From 6bf66bb291daa4cb924185231e67ecaccf250337 Mon Sep 17 00:00:00 2001 From: Johannes Hofmann Date: Fri, 30 Oct 2026 09:02:20 +0100 Subject: examples: modernize gipfelweb — responsive, dark/light, one page per panorama MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - markers positioned in percent of the slide (identify reads the dimensions), so the panorama scales with the viewport; a CSS-only 'Full resolution' checkbox switches to natural size with horizontal scrolling - peaks and photos now share one page; chip-style checkboxes toggle Peaks / Photos / Labels / Full resolution (pure CSS sibling selectors, no JavaScript) - interaction for all input types: hover (mouse), :focus-within (keyboard, markers are anchors), :target (touch, tap to open a popup); popups get below/left/right classes from the generator so they never leave the image - labels show distance (the data always had it): NAME · 2849 m · 12.3 km - new gallery index.html (thumbnail grid), dark/light via prefers-color-scheme, system font stack, lazy thumbnails, aria labels, viewport meta; stylesheet is a single external style.css - backlink updated to flpsed.org/gipfel.html - gipfel2html: LC_ALL=C (awk decimal separator), no pipe-subshell marker loops (counter must survive), exact cross-reference matching The old two-page (images/hills) split is gone; the hills view is the Peaks toggle now. --- examples/style.css | 203 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 203 insertions(+) create mode 100644 examples/style.css (limited to 'examples/style.css') diff --git a/examples/style.css b/examples/style.css new file mode 100644 index 0000000..3c43fb3 --- /dev/null +++ b/examples/style.css @@ -0,0 +1,203 @@ +/* gipfelweb stylesheet — modern, CSS-only interaction (no JavaScript). + Theme follows the system preference; markers are positioned in + percent of the panorama so the image can scale freely. */ + +:root { + --bg: #101014; + --panel: #1a1a21; + --text: #e8e8ee; + --muted: #9a9aa6; + --accent: #7aa2f7; + --chip: #24242e; + --chip-hover: #32323e; + --label-bg: rgba(16, 16, 20, 0.85); + --dot-peak: #ffd54a; + --dot-photo: #7ee787; + --shadow: 0 4px 16px rgba(0, 0, 0, 0.45); +} +@media (prefers-color-scheme: light) { + :root { + --bg: #f2f3f7; + --panel: #ffffff; + --text: #1d1d24; + --muted: #61616c; + --accent: #2b5fb8; + --chip: #e2e3ea; + --chip-hover: #d2d3dd; + --label-bg: rgba(255, 255, 255, 0.92); + --dot-peak: #d97706; + --dot-photo: #15803d; + --shadow: 0 4px 16px rgba(0, 0, 0, 0.18); + } +} + +* { box-sizing: border-box; } + +body { + margin: 0; + background: var(--bg); + color: var(--text); + font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; + line-height: 1.5; +} + +header { + padding: 1rem 1.25rem 0.5rem; +} +header h1 { + margin: 0 0 0.5rem; + font-size: 1.35rem; + font-weight: 650; +} +header a { color: var(--accent); text-decoration: none; } +header a:hover { text-decoration: underline; } + +/* ---- control chips (checkbox hack; inputs are visually hidden) ---- */ +main { padding: 0 1.25rem 1.25rem; } + +.tgl { position: absolute; opacity: 0; pointer-events: none; } +.chip { + display: inline-block; + margin: 0 0.4rem 0.6rem 0; + padding: 0.3rem 0.8rem; + border-radius: 999px; + background: var(--chip); + color: var(--text); + font-size: 0.85rem; + cursor: pointer; + user-select: none; + transition: background 0.12s; +} +.chip:hover { background: var(--chip-hover); } +.tgl:checked + .chip { background: var(--accent); color: #fff; } +.tgl:focus-visible + .chip { outline: 2px solid var(--accent); outline-offset: 2px; } + +/* ---- panorama ---- */ +.pano-wrap { + background: var(--panel); + border-radius: 10px; + box-shadow: var(--shadow); + overflow: hidden; +} +.pano { + position: relative; + width: 100%; +} +.pano img.slide { + display: block; + width: 100%; + height: auto; +} +/* full resolution: natural width, horizontal scroll */ +#t-full:checked ~ .pano-wrap { overflow-x: auto; } +#t-full:checked ~ .pano-wrap .pano { width: max-content; } +#t-full:checked ~ .pano-wrap img.slide { width: auto; max-width: none; } + +ul.markers { position: absolute; inset: 0; margin: 0; padding: 0; list-style: none; } + +.mk { position: absolute; left: var(--x); top: var(--y); } +.mk > a { + display: block; + position: static; + outline: none; +} +.dot { + display: block; + width: 10px; + height: 10px; + margin: -5px 0 0 -5px; + border-radius: 50%; + background: var(--dot-peak); + box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.55); + opacity: 0.45; + transition: opacity 0.12s; +} +.mk.photo .dot { background: var(--dot-photo); } +.pano:hover .dot { opacity: 0.9; } +.mk:hover .dot, .mk:focus-within .dot, .mk:target .dot { opacity: 1; } + +/* popups: hidden until hover / keyboard focus / tap (:target) */ +.pop { + position: absolute; + bottom: 14px; + left: 50%; + transform: translateX(-50%); + visibility: hidden; + opacity: 0; + transition: opacity 0.12s; + white-space: nowrap; + background: var(--label-bg); + color: var(--text); + border-radius: 8px; + padding: 0.25rem 0.6rem; + font-size: 0.82rem; + backdrop-filter: blur(4px); + box-shadow: var(--shadow); + z-index: 5; +} +/* generator adds .below/.left/.right so popups never leave the image */ +.mk.below .pop { bottom: auto; top: 14px; } +.mk.left .pop { left: 0; transform: none; } +.mk.right .pop { left: auto; right: 0; transform: none; } + +.mk:hover .pop, .mk:focus-within .pop, .mk:target .pop { + visibility: visible; + opacity: 1; +} +.pop .dist { color: var(--muted); } +.pop.thumb { + padding: 0; + background: none; + border: 2px solid var(--label-bg); +} +.pop.thumb img { display: block; border-radius: 6px; max-width: 400px; } +.pop.thumb .cap { + position: absolute; + left: 0; right: 0; bottom: 0; + margin: 0; + padding: 0.2rem 0.5rem; + font-size: 0.75rem; + background: var(--label-bg); + border-radius: 0 0 4px 4px; +} + +/* view toggles */ +#t-peaks:not(:checked) ~ .pano-wrap .peak { display: none; } +#t-photos:not(:checked) ~ .pano-wrap .photo { display: none; } +#t-labels:checked ~ .pano-wrap .pop.label { visibility: visible; opacity: 1; } + +/* ---- cross links & footer ---- */ +.related { margin-top: 1.25rem; } +.related h2 { font-size: 0.95rem; color: var(--muted); font-weight: 550; } +.related a { display: inline-block; margin: 0 0.5rem 0.5rem 0; } +.related img { + display: block; + border-radius: 6px; + max-width: 300px; + height: auto; + box-shadow: var(--shadow); +} +footer { + padding: 0.5rem 1.25rem 2rem; + color: var(--muted); + font-size: 0.8rem; +} +footer a { color: var(--accent); text-decoration: none; } + +/* ---- gallery index ---- */ +.gallery { + display: grid; + grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); + gap: 1rem; +} +.gallery a { + display: block; + background: var(--panel); + border-radius: 10px; + overflow: hidden; + box-shadow: var(--shadow); + text-decoration: none; + color: var(--text); +} +.gallery img { display: block; width: 100%; height: auto; } +.gallery .t { display: block; padding: 0.5rem 0.75rem; font-size: 0.9rem; } -- cgit v1.2.3