fix(scroll): use hash navigation for marker clicks

Browser handles scroll natively via window.location.hash, respecting
scroll-margin-top. Updates URL for shareability and screen reader
compatibility. Added html { scroll-behavior: smooth } for smooth
hash navigation globally.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Vgmzx8VTTTmCskSpQtsLTr
This commit is contained in:
2026-06-21 20:40:15 +02:00
parent 85ba3747b1
commit 7c9a55224a
2 changed files with 3 additions and 1 deletions
+2
View File
@@ -1,5 +1,7 @@
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; } *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { body {
font-family: var(--font-ui); font-family: var(--font-ui);
font-size: var(--text-base); font-size: var(--text-base);
+1 -1
View File
@@ -346,7 +346,7 @@ tripMap.on('load', function () {
el.addEventListener('click', function () { el.addEventListener('click', function () {
var card = document.getElementById('entry-' + entry.slug); var card = document.getElementById('entry-' + entry.slug);
if (!card) return; if (!card) return;
card.scrollIntoView({ behavior: 'smooth', block: 'start' }); window.location.hash = 'entry-' + entry.slug;
setTimeout(function () { setTimeout(function () {
card.classList.add('is-highlighted'); card.classList.add('is-highlighted');
setTimeout(function () { card.classList.remove('is-highlighted'); }, 700); setTimeout(function () { card.classList.remove('is-highlighted'); }, 700);