fix(scroll): use block:start so scroll-margin-top is respected
block:center ignores scroll-margin-top. block:start positions the entry's top edge at the margin offset, clearing the sticky header. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vgmzx8VTTTmCskSpQtsLTr
This commit is contained in:
@@ -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: 'center' });
|
card.scrollIntoView({ behavior: 'smooth', block: 'start' });
|
||||||
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