diff --git a/css/grid-n-view.css b/css/grid-n-view.css new file mode 100644 index 0000000..10bce25 --- /dev/null +++ b/css/grid-n-view.css @@ -0,0 +1,133 @@ +/********************************************************************** +* +* +* +**********************************************************************/ + + +/********************************************************* Config ****/ + +:root { + /* dimensions */ + --gallery-scrollbar-width: 0.5em; + + --lightbox-frame-size: 5vmin; + --lightbox-image-margin-top: 0.75; + --lightbox-button-size: 4em; + + /* theme */ + --gallery-text-color: black; + --gallery-secondary-color: silver; + --gallery-background-color: white; + + --lightbox-background-color: white; +} + + + +/****************************************************** Scrolling ****/ + +::-webkit-scrollbar { + width: var(--gallery-scrollbar-width); +} +::-webkit-scrollbar-track { + background-color: transparent; + border-radius: 100px; +} +::-webkit-scrollbar-thumb { + background-color: var(--gallery-secondary-color); + border-radius: 100px; +} +body { + overflow-y: scroll; +} + + +/******************************************************** Gallery ****/ + +/* XXX need to account for scrollbar popping in and out */ +.gallery { + position: relative; + display: flex; + justify-content: flex-start; + align-content: flex-start; + flex-flow: row wrap; + + margin-left: var(--gallery-scrollbar-width); + margin-right: 0; +} +.gallery img { + height: 300px; + width: auto; + image-rendering: crisp-edges; + box-sizing: border-box; +} +.gallery>img { + cursor: hand; +} +.gallery img.current { + border: solid 2px red; +} + + +/******************************************************* Lightbox ****/ + +.gallery .lightbox { + display: none; + position: fixed; + width: 100%; + height: 100%; + top: 0px; + left: 0px; + + text-align: center; + + background: var(--lightbox-background-color); +} +.gallery .lightbox.show-caption:after { + content: attr(caption); + position: absolute; + bottom: 0.5em; + left: 0.5em; +} +.gallery .lightbox.clickable { + cursor: hand; +} +/* XXX add metadata display... */ +.gallery .lightbox img { + object-fit: contain; + width: calc( + 100vw + - var(--lightbox-frame-size) * 2); + height: calc( + 100vh + - var(--lightbox-frame-size) * 2); + margin-top: calc( + var(--lightbox-frame-size) + * var(--lightbox-image-margin-top)); +} +/* controls: next/prev... */ +.lightbox .button { + cursor: hand; + font-size: var(--lightbox-button-size); + padding: 0 0.25em; + filter: saturate(0); + opacity: 0.1; +} +.lightbox .button:hover { + opacity: 1; + filter: saturate(1); +} +/* controls: close... */ +.gallery .lightbox .button.close { + position: absolute; + top: 0px; + right: 0px; +} +.gallery .lightbox .button.close:after { + content: "×"; + color: red; +} + + +/*********************************************************************/ diff --git a/grid-n-view.html b/grid-n-view.html index 4c53aad..5f9db71 100644 --- a/grid-n-view.html +++ b/grid-n-view.html @@ -1,571 +1,18 @@ + - + + +Grid n' View + + + + + +