mirror of
				https://github.com/flynx/ImageGrid.git
				synced 2025-10-31 19:30:07 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			317 lines
		
	
	
		
			5.2 KiB
		
	
	
	
		
			HTML
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			317 lines
		
	
	
		
			5.2 KiB
		
	
	
	
		
			HTML
		
	
	
		
			Executable File
		
	
	
	
	
| <html>
 | |
| <head>
 | |
| <title>ImageGrid.Viewer</title>
 | |
| 
 | |
| 
 | |
| <style>
 | |
| 
 | |
| /* 
 | |
| * XXX move the CSS to a separate file...
 | |
| * XXX split-off styling/coloring from layout...
 | |
| */
 | |
| 
 | |
| .viewer {
 | |
| 	position: relative;
 | |
| 	width: 800px;
 | |
| 	height: 600px;
 | |
| 	overflow: hidden;
 | |
| 
 | |
| 	border: solid blue 1px;
 | |
| }
 | |
| 
 | |
| 
 | |
| .ribbon-set {
 | |
| 	position: absolute;
 | |
| 	display: block;
 | |
| 
 | |
| 	/* NOTE: this needs for scaling/zooming to behave correctly and not 
 | |
| 			shift the element, when its dimensions change... 
 | |
| 			...this is because .ribbon-set will both be used for scaling 
 | |
| 			and aligning... */
 | |
| 	transform-origin: top left;
 | |
| 	-ms-transform-origin: top left;
 | |
| 	-webkit-transform-origin: top left; /* Safari and Chrome */
 | |
| }
 | |
| .ribbon-set:empty:after {
 | |
| 	display: block;
 | |
| 	top: 0px;
 | |
| 	left: 0px;
 | |
| 	width: 100%;
 | |
| 	height: 100%;
 | |
| 	content: "Empty";
 | |
| 	text-align: center;
 | |
| }
 | |
| 
 | |
| 
 | |
| .ribbon {
 | |
| 	position: relative;
 | |
| 	display: block;
 | |
| 	height: auto;
 | |
| 	min-width: 0px;
 | |
| 	overflow: visible;
 | |
| 	white-space: nowrap;
 | |
| 	font-size: 0;
 | |
| 
 | |
| 	margin-top: 20px;
 | |
| 	margin-bottom: 20px;
 | |
| }
 | |
| .ribbon:empty {
 | |
| 	display: none;
 | |
| }
 | |
| .ribbon:first-child {
 | |
| 	margin-top: 0px;
 | |
| }
 | |
| .ribbon:last-child {
 | |
| 	margin-bottom: 0px;
 | |
| }
 | |
| 
 | |
| .image {
 | |
| 	position: relative;
 | |
| 	display: inline-block;
 | |
| 	vertical-align: middle;
 | |
| 	text-align;left;
 | |
| 	width: 300px;
 | |
| 	height: 300px;
 | |
| 	font-size: 12pt;
 | |
| 	overflow: hidden;
 | |
| 
 | |
| 	box-sizing: border-box;
 | |
| 	color: white;
 | |
| 
 | |
| 	background: no-repeat 50% black;
 | |
| 	background-size: contain;
 | |
| 	/* XXX do we need this? */
 | |
| 	border: solid black 5px;
 | |
| }
 | |
| .current.image {
 | |
| 	background: no-repeat 50% black;
 | |
| 	background-size: contain;
 | |
| 
 | |
| 	/* XXX remove this... */
 | |
| 	border: solid red 5px;
 | |
| }
 | |
| 
 | |
| /* dot mark... */
 | |
| .marked.image:after {
 | |
| 	display: block;
 | |
| 	position: absolute;
 | |
| 	content: "";
 | |
| 	font-size: 0pt;
 | |
| 	border: none;
 | |
| 
 | |
| 	width: 15px;
 | |
| 	height: 15px;
 | |
| 
 | |
| 	bottom: 5px;
 | |
| 	right: 5px;
 | |
| 
 | |
| 	border-radius: 50%;
 | |
| 	background: blue;
 | |
| }
 | |
| 
 | |
| /* corner mark... (a-la bookmarks in PortableMag) */
 | |
| /*
 | |
| .marked.image:after {
 | |
| 	display: block;
 | |
| 	position: absolute;
 | |
| 	content: "";
 | |
| 	font-size: 0pt;
 | |
| 	border: none;
 | |
| 
 | |
| 	width: 30px;
 | |
| 	height: 30px;
 | |
| 
 | |
| 	top: -15px;
 | |
| 	right: -15px;
 | |
| 
 | |
| 	background: blue;
 | |
| 
 | |
| 	-webkit-transform: rotate(45deg);
 | |
| 	-moz-transform: rotate(45deg);
 | |
| 	-o-transform: rotate(45deg);
 | |
| 	-ms-transform: rotate(45deg);
 | |
| 	transform: rotate(45deg);
 | |
| }
 | |
| */
 | |
| 
 | |
| 
 | |
| .marked-only.viewer:after {
 | |
| 	display: block;
 | |
| 	position: absolute;
 | |
| 	content: "Showing marked images only";
 | |
| 	font-size: 14pt;
 | |
| 	border: none;
 | |
| 	color: blue;
 | |
| 	width: auto;
 | |
| 	height: auto;
 | |
| 
 | |
| 	top: 10px;
 | |
| 	right: 10px;
 | |
| 
 | |
| }
 | |
| .marked-only .image:not(.marked) {
 | |
| 	display: none;
 | |
| }
 | |
| .marked-only .marked.image:after {
 | |
| 	display: none;
 | |
| }
 | |
| 
 | |
| 
 | |
| .up-indicator,
 | |
| .down-indicator,
 | |
| .start-indicator,
 | |
| .end-indicator {
 | |
| 	display: block;
 | |
| 	position: absolute;
 | |
| 	content: "";
 | |
| 	top: 0px;
 | |
| 	left: 50%;
 | |
| 	height: 50px;
 | |
| 	width: 100px;
 | |
| 	margin-left: -50px;
 | |
| 
 | |
| 	overflow: hidden;
 | |
| 
 | |
| 	cursor: hand;
 | |
| }
 | |
| .up-indicator:after,
 | |
| .down-indicator:after {
 | |
| 	display: inline-block;
 | |
| 	position: absolute;
 | |
| 	content: "";
 | |
| 	width: 50px;
 | |
| 	height: 50px;
 | |
| 
 | |
| 	bottom: -25px;
 | |
| 	left: 25px;
 | |
| 
 | |
| 	background: yellow;
 | |
| 
 | |
| 	-webkit-transform: rotate(45deg);
 | |
| 	-moz-transform: rotate(45deg);
 | |
| 	-o-transform: rotate(45deg);
 | |
| 	-ms-transform: rotate(45deg);
 | |
| 	transform: rotate(45deg);
 | |
| }
 | |
| .down-indicator {
 | |
| 	top: auto;
 | |
| 	bottom: 0px;
 | |
| }
 | |
| .down-indicator:after {
 | |
| 	top: -25px;
 | |
| 	bottom: auto;
 | |
| }
 | |
| .start-indicator,
 | |
| .end-indicator {
 | |
| 	left: 0px;
 | |
| 	width: 10px;
 | |
| 	height: 100%;
 | |
| 	margin: 0px;
 | |
| 
 | |
| 	background: yellow;
 | |
| }
 | |
| .end-indicator {
 | |
| 	left: auto;
 | |
| 	right: 0px;
 | |
| }
 | |
| /* default state */
 | |
| .up-indicator,
 | |
| .down-indicator,
 | |
| .start-indicator,
 | |
| .end-indicator {
 | |
| 	display: none;
 | |
| }
 | |
| 
 | |
| 
 | |
| </style>
 | |
| 
 | |
| 
 | |
| 
 | |
| <script src="jquery.js"></script>
 | |
| 
 | |
| <script src="lib/jli.js"></script>
 | |
| <script src="lib/keyboard.js"></script>
 | |
| 
 | |
| <script src="base.js"></script>
 | |
| <script src="data.js"></script>
 | |
| <script src="ui.js"></script>
 | |
| <script src="keybindings3.js"></script>
 | |
| 
 | |
| <script>
 | |
| 
 | |
| // setup...
 | |
| $(function(){
 | |
| 
 | |
| 	//setElementOrigin($('.ribbon-set'), 'top', 'left')
 | |
| 
 | |
| 	loadData(DATA)
 | |
| 
 | |
| 	// NOTE: this is global so as to not to add any extra complexity to 
 | |
| 	//		the internal workings...
 | |
| 	$('.viewer')
 | |
| 		.click(clickHandler)
 | |
| 
 | |
| 	$(document)
 | |
| 		.keydown(makeKeyboardHandler(
 | |
| 			KEYBOARD_CONFIG,
 | |
| 			function(k){console.log(k)}))
 | |
| 
 | |
| 	setupDataBindings()
 | |
| 
 | |
| 	// XXX stub...
 | |
| 	centerView(focusImage($('.image').first()), 'css')
 | |
| 	updateImages()
 | |
| 
 | |
| })
 | |
| 
 | |
| 
 | |
| </script>
 | |
| 
 | |
| </head>
 | |
| <body>
 | |
| 
 | |
| <!-- This is the basic viewer structure...
 | |
| 
 | |
| Unpopulated
 | |
| NOTE: there can be only .ribbon-set element.
 | |
| 
 | |
| <div class="viewer">
 | |
| 	<div class="ribbon-set"></div>
 | |
| </div>
 | |
| 
 | |
| 
 | |
| Populated
 | |
| 
 | |
| <div class="viewer">
 | |
| 	<div class="ribbon-set">
 | |
| 		<div class="ribbon">
 | |
| 			<div class="image"></div>
 | |
| 			<div class="image"></div>
 | |
| 		</div>
 | |
| 		<div class="ribbon">
 | |
| 			<div class="image"></div>
 | |
| 			<div class="current image"></div>
 | |
| 			<div class="image"></div>
 | |
| 			<div class="image"></div>
 | |
| 		</div>
 | |
| 	</div>
 | |
| </div>
 | |
| -->
 | |
| 
 | |
| <div class="viewer">
 | |
| 
 | |
| 	<div class="ribbon-set"></div>
 | |
| 
 | |
| 
 | |
| 	<!-- XXX should these be here??? -->
 | |
| 	<div class="up-indicator"></div>
 | |
| 	<div class="down-indicator"></div>
 | |
| 	<div class="start-indicator"></div>
 | |
| 	<div class="end-indicator"></div>
 | |
| </div>
 | |
| 
 | |
| 
 | |
| <!-- vim:set ts=4 sw=4 spell : -->
 | |
| </body>
 | |
| </html>
 |