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);