From 7c9a55224a52f8a2e6a373c5a2b3a11f62dd9ce1 Mon Sep 17 00:00:00 2001 From: Mischa Date: Sun, 21 Jun 2026 20:40:15 +0200 Subject: [PATCH] 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 Claude-Session: https://claude.ai/code/session_01Vgmzx8VTTTmCskSpQtsLTr --- themes/intotheeast/css/style.css | 2 ++ themes/intotheeast/templates/trip.html.twig | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/themes/intotheeast/css/style.css b/themes/intotheeast/css/style.css index 790db93..6d2311a 100644 --- a/themes/intotheeast/css/style.css +++ b/themes/intotheeast/css/style.css @@ -1,5 +1,7 @@ *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; } +html { scroll-behavior: smooth; } + body { font-family: var(--font-ui); font-size: var(--text-base); diff --git a/themes/intotheeast/templates/trip.html.twig b/themes/intotheeast/templates/trip.html.twig index 4ad1404..3d2f169 100644 --- a/themes/intotheeast/templates/trip.html.twig +++ b/themes/intotheeast/templates/trip.html.twig @@ -346,7 +346,7 @@ tripMap.on('load', function () { el.addEventListener('click', function () { var card = document.getElementById('entry-' + entry.slug); if (!card) return; - card.scrollIntoView({ behavior: 'smooth', block: 'start' }); + window.location.hash = 'entry-' + entry.slug; setTimeout(function () { card.classList.add('is-highlighted'); setTimeout(function () { card.classList.remove('is-highlighted'); }, 700);