295 lines
5.1 KiB
SCSS
295 lines
5.1 KiB
SCSS
$breakpoint: 900px;
|
|
|
|
:root {
|
|
--color-text: #fff;
|
|
--color-ink: #202124;
|
|
--color-accent: #a63446;
|
|
--color-accent-strong: #7c2130;
|
|
--color-background: #eee;
|
|
--color-focus: #ffd166;
|
|
--border-width: 5px;
|
|
--space-xs: 0.375rem;
|
|
--space-s: 0.75rem;
|
|
--space-m: 1.5rem;
|
|
}
|
|
|
|
*,
|
|
*::before,
|
|
*::after {
|
|
box-sizing: border-box;
|
|
}
|
|
|
|
html {
|
|
min-height: 100%;
|
|
background: var(--color-background);
|
|
color: var(--color-ink);
|
|
font-family:
|
|
system-ui,
|
|
-apple-system,
|
|
BlinkMacSystemFont,
|
|
'Segoe UI',
|
|
sans-serif;
|
|
}
|
|
|
|
body {
|
|
block-size: 100dvh;
|
|
margin: 0;
|
|
display: grid;
|
|
grid-template-columns: auto minmax(0, 1fr);
|
|
overflow: hidden;
|
|
}
|
|
|
|
img {
|
|
display: block;
|
|
max-inline-size: 100%;
|
|
block-size: auto;
|
|
}
|
|
|
|
:focus {
|
|
outline: none;
|
|
}
|
|
|
|
:focus-visible {
|
|
outline: 3px solid var(--color-focus);
|
|
outline-offset: 4px;
|
|
}
|
|
|
|
.site-header {
|
|
display: grid;
|
|
place-items: center;
|
|
position: relative;
|
|
min-inline-size: 5rem;
|
|
max-block-size: 100dvh;
|
|
overflow: hidden;
|
|
background: var(--color-accent);
|
|
color: var(--color-text);
|
|
padding: var(--space-m) var(--space-s);
|
|
}
|
|
|
|
.site-header h1 {
|
|
margin: 0;
|
|
font-size: clamp(1.5rem, 4vmin, 3rem);
|
|
font-weight: 300;
|
|
line-height: 1;
|
|
writing-mode: vertical-rl;
|
|
transform: rotate(180deg);
|
|
white-space: nowrap;
|
|
}
|
|
|
|
.gallery {
|
|
min-width: 0;
|
|
min-height: 100dvh;
|
|
display: grid;
|
|
grid-template-columns: minmax(5rem, 10vmin) minmax(0, 1fr) minmax(
|
|
7rem,
|
|
14vmin
|
|
);
|
|
position: relative;
|
|
overflow: hidden;
|
|
}
|
|
|
|
.rail {
|
|
min-height: 0;
|
|
max-height: 100dvh;
|
|
overflow-y: auto;
|
|
overscroll-behavior: contain;
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
gap: var(--space-s);
|
|
padding: var(--space-m) var(--space-s);
|
|
scrollbar-color: var(--color-accent) transparent;
|
|
}
|
|
|
|
.thumbnail {
|
|
display: block;
|
|
flex: 0 0 auto;
|
|
border: var(--border-width) solid var(--color-text);
|
|
background: var(--color-text);
|
|
color: inherit;
|
|
box-shadow: 0 0 0 1px rgb(32 33 36 / 16%);
|
|
}
|
|
|
|
.thumbnail:hover,
|
|
.thumbnail.is-selected {
|
|
border-color: var(--color-accent);
|
|
}
|
|
|
|
.thumbnail:focus-visible {
|
|
outline: 3px solid var(--color-focus);
|
|
outline-offset: 3px;
|
|
box-shadow:
|
|
0 0 0 6px var(--color-accent-strong),
|
|
0 0 0 1px rgb(32 33 36 / 16%);
|
|
}
|
|
|
|
.thumbnail--portrait {
|
|
inline-size: 8vmin;
|
|
}
|
|
|
|
.thumbnail--landscape {
|
|
inline-size: 12vmin;
|
|
}
|
|
|
|
.thumbnail picture,
|
|
.thumbnail img {
|
|
inline-size: 100%;
|
|
}
|
|
|
|
.frame {
|
|
min-width: 0;
|
|
min-height: 0;
|
|
display: grid;
|
|
padding: var(--space-m);
|
|
}
|
|
|
|
.frame-content {
|
|
min-width: 0;
|
|
min-height: 0;
|
|
position: relative;
|
|
overflow: hidden;
|
|
}
|
|
|
|
.frame-content.is-loading::after {
|
|
content: '';
|
|
position: absolute;
|
|
inset: 0;
|
|
margin: auto;
|
|
inline-size: 3rem;
|
|
block-size: 3rem;
|
|
border: 4px solid rgb(32 33 36 / 20%);
|
|
border-block-start-color: var(--color-accent);
|
|
border-radius: 50%;
|
|
animation: spin 0.8s linear infinite;
|
|
}
|
|
|
|
@keyframes spin {
|
|
to {
|
|
transform: rotate(360deg);
|
|
}
|
|
}
|
|
|
|
@media (prefers-reduced-motion: reduce) {
|
|
.frame-content.is-loading::after {
|
|
animation: none;
|
|
}
|
|
}
|
|
|
|
// Holds the next photo's <picture> off-screen so the browser fetches it before
|
|
// the slideshow advances. Kept renderable (not display: none) so loading runs.
|
|
.frame-preload {
|
|
position: absolute;
|
|
inline-size: 0;
|
|
block-size: 0;
|
|
overflow: hidden;
|
|
pointer-events: none;
|
|
}
|
|
|
|
.frame-figure,
|
|
.frame-figure picture {
|
|
display: contents;
|
|
}
|
|
|
|
.frame-figure img {
|
|
position: absolute;
|
|
inset: 0;
|
|
margin: auto;
|
|
inline-size: auto;
|
|
block-size: auto;
|
|
max-inline-size: 100%;
|
|
max-block-size: 100%;
|
|
border: var(--border-width) solid var(--color-text);
|
|
background: var(--color-text);
|
|
box-shadow: 0 0 0 1px rgb(32 33 36 / 16%);
|
|
}
|
|
|
|
.slideshow-toggle {
|
|
display: none;
|
|
position: absolute;
|
|
inset-block-start: var(--space-s);
|
|
justify-self: center;
|
|
border: 0;
|
|
border-radius: 4px;
|
|
padding: 0.45rem 0.75rem;
|
|
background: var(--color-accent-strong);
|
|
color: var(--color-text);
|
|
font: inherit;
|
|
font-size: 0.875rem;
|
|
line-height: 1;
|
|
cursor: pointer;
|
|
}
|
|
|
|
.js .slideshow-toggle {
|
|
display: block;
|
|
}
|
|
|
|
.slideshow-toggle:hover {
|
|
background: #5f1724;
|
|
}
|
|
|
|
@media (width < $breakpoint) {
|
|
body {
|
|
grid-template-columns: 1fr;
|
|
grid-template-rows: auto minmax(0, 1fr);
|
|
}
|
|
|
|
.site-header {
|
|
display: flex;
|
|
flex-direction: row-reverse;
|
|
align-items: center;
|
|
justify-content: space-around;
|
|
padding: var(--space-s);
|
|
}
|
|
|
|
.slideshow-toggle {
|
|
position: static;
|
|
}
|
|
|
|
.site-header h1 {
|
|
writing-mode: horizontal-tb;
|
|
transform: none;
|
|
font-size: clamp(1.5rem, 7vw, 2rem);
|
|
}
|
|
|
|
.gallery {
|
|
min-height: 0;
|
|
grid-template-columns: minmax(0, 1fr);
|
|
grid-template-rows: auto minmax(0, 1fr) auto;
|
|
}
|
|
|
|
.rail {
|
|
max-height: none;
|
|
min-width: 0;
|
|
overflow: auto hidden;
|
|
flex-direction: row;
|
|
justify-content: flex-start;
|
|
padding: var(--space-xs) var(--space-s);
|
|
}
|
|
|
|
.rail--portraits {
|
|
grid-row: 1;
|
|
}
|
|
|
|
.rail--landscapes {
|
|
grid-row: 3;
|
|
}
|
|
|
|
.thumbnail {
|
|
inline-size: auto;
|
|
}
|
|
|
|
.thumbnail--portrait img {
|
|
block-size: 12vmin;
|
|
inline-size: auto;
|
|
}
|
|
|
|
.thumbnail--landscape img {
|
|
block-size: 8vmin;
|
|
inline-size: auto;
|
|
}
|
|
|
|
.frame {
|
|
grid-row: 2;
|
|
padding: var(--space-s);
|
|
}
|
|
}
|