feat: remove header_link, adjust hero scroll to next, fix some html errors
All checks were successful
Build / build (push) Successful in 4m12s
Build / deploy-stage (push) Successful in 2m38s
Build / switch-stage (push) Successful in 2m3s

This commit is contained in:
2025-04-23 08:45:12 +02:00
parent e9f086fc22
commit 9f6cfb145e
6 changed files with 50 additions and 22 deletions

View File

@@ -0,0 +1,32 @@
document.addEventListener('DOMContentLoaded', () => {
document
.querySelectorAll('.hero-down-link')
.forEach(link => link.addEventListener('click', scrollToNext));
});
function scrollToNext(e) {
e.preventDefault();
const refEl = e.currentTarget;
const isMobile = window.matchMedia('(max-width: 768px)').matches;
if (isMobile) {
const target = document.getElementById('hero-text');
if (!target) {
console.warn('scrollToNext: no element with id="hero-text"');
return;
}
target.scrollIntoView({ behavior: 'smooth', block: 'start' });
} else {
const frames = Array.from(document.querySelectorAll('.frame'));
const nextFrame = frames.find(frame =>
refEl.compareDocumentPosition(frame) & Node.DOCUMENT_POSITION_FOLLOWING
);
if (!nextFrame) {
console.warn('scrollToNext: no .frame found after this link');
return;
}
nextFrame.scrollIntoView({ behavior: 'smooth', block: 'start' });
}
}