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:
@@ -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);
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|||||||
Reference in New Issue
Block a user