gallery/grid-n-view.html

185 lines
4.8 KiB
HTML
Raw Normal View History

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Grid n' View</title>
<link rel="stylesheet" href="css/grid-n-view.css" />
<script src="grid-n-view.js"></script>
<style>
/* fade-in body... */
body {
animation: fadeInAnimation ease 2s;
animation-iteration-count: 1;
animation-fill-mode: forwards;
}
@keyframes fadeInAnimation {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}
</style>
<script>
var SCROLL_TIMEOUT = 100
// save/restore scroll position...
// XXX might also be nice to restory current image and selection...
window.addEventListener('beforeunload', function(){
window.scrollX > 0 ?
(sessionStorage.windowScrollX = window.scrollX)
: (delete sessionStorage.windowScrollX)
sessionStorage.windowScrollY = window.scrollY })
var restoreScroll = function(){
setTimeout(function(){
sessionStorage.windowScrollY
&& window.scroll(
(sessionStorage.windowScrollX ?? 0)*1,
sessionStorage.windowScrollY*1) }, SCROLL_TIMEOUT ?? 100) }
</script>
</head>
<body onload="setup(); restoreScroll()">
<h3>ToDo</h3>
<pre>
- Save current gallery (zip)
- <s>Views: Gallery / Details / Lightbox</s>
- Details: populate fields
- toolbar -- floating over gallery
- lightbox (current)
- info (current)
- select / deselect (current / all)
- delete / clear deleted (current / all)
- crop
- load
- toolbar -- floating over image (gallery/lightbox/details/...)
- lightbox
- info
- select / deselect
- delete
- Lightbox: hover indicators:
- start/end (a-la ImageGrid.Viewer??)
- next/prev
- <s>count</s>
- <s>selection</s>
- <s>Gallery: Adaptable image justification in grid</s>
- <s>Gallery: Spacial navigation (up/down/left/right)</s>
- <b>auto focus image iff the gallery is visible</b>
- handle focus / tabindex (???)
- <s>option: .loop_images</s>
- <s>Up/Down: might be a good idea to select an image based on
longest border instead of closest center (current)...</s>
- Gallery: PageUp/PageDown, home/end + allow page navigation
- <b>Gallery: focus visible...</b>
- <s>Gallery/Lightbox: Selection of images (space / ctrl-a / ctrl-d / ctrl-i)</s>
- <s>Lightbox: show selection marker</s>
- <b>Gallery: constructor...</b>
Gallery([options])
Gallery(urls[, options])
Gallery(dom[, options])
Gallery(dom, urls[, options])
- <b>Gallery: view crop</b>
- open/change/close
- crop stack (a-la ImageGrid.Viewer)
- actions:
- "from selection"
- <s>Gallery: drag-n-drop</s>
- <s>drop files/images</s> -- add loading indicator
- <s>drag to sort</s>
- <b>drag marked</b>
- styling...
- <s>Gallery: remove image</s>
- <s>basic delete</s>
- <s>delete marked</s>
- <s>mark images for deletion + delete marked</s>
- UI/toolbar
- <s>Gallery: serialize / deserialize</s>
- <s>Lightbox: navigation (keyboard / mouse)</s>
- <s>Lightbox: fullscreen mode</s>
- Gallery: element (???)
- <s>Would be nice to retain the scroll position on refresh...</s>
- ...
</pre>
<pre>
Controls:
Left / Reight - Previos / next image
Up / Down - Image above / below
Space - Mark image (also shift-click)
Ctrl-A - Mark all images
Ctrl-D - Unmark all images
Ctrl-I - Reverse image marks
Enter - Toggle lightbox
Esc - Close image info or lightbox
Delete - Toggle image / marked for deletion (toggle)
Shift-Delete - Delete marked image(s) or current if none are marked
NOTE: if the grid behaves in an odd way on resize tweak PATCH_MARGIN value,
though this sould not be necessary.
(optimal range &gt;1 and &lt;3)
</pre>
<hr>
<div class="gallery">
<!-- gallery: content -->
<div class="images">
<img src="images/500px/1.JPG" caption="Caption text">
<img src="images/500px/2.JPG">
<img src="images/500px/3.JPG" class="marked">
<img src="images/500px/DSC08102.jpg">
<img src="images/500px/4.JPG">
<img src="images/500px/5.JPG">
<img src="images/500px/DSC08102.jpg" class="marked">
<img src="images/500px/6.JPG">
<img src="images/500px/DSC08102.jpg">
<img src="images/500px/2.JPG" class="marked">
<img src="images/500px/5.JPG">
</div>
<!-- lightbox -->
<div class="lightbox">
<!-- XXX not sure about draggable=.. here... -->
<img draggable="false">
<div class="buttons">
<div class="button prev"></div>
<div class="button next"></div>
<div class="button info"></div>
<div class="button fullscreen"></div>
<div class="button close"></div>
</div>
</div>
<!-- details -->
<div class="details">
<!-- XXX not sure about draggable=.. here... -->
<img draggable="false">
<div class="caption">
CAPTION
</div>
<div class="tags">
TAGS
</div>
<div class="metadata">
METADATA
</div>
<div class="buttons">
<div class="button prev"></div>
<div class="button next"></div>
<div class="button close"></div>
</div>
</div>
</div>
</body>
</html>
<!-- vim:set ts=4 sw=4 : -->