Four static landing-page options with Vite build, cal booking, and links to sibling sites. Co-authored-by: Cursor <cursoragent@cursor.com>
18 lines
578 B
JavaScript
18 lines
578 B
JavaScript
const sections = document.querySelectorAll('section[id]');
|
|
const links = document.querySelectorAll('.toc nav a');
|
|
|
|
const observer = new IntersectionObserver(
|
|
(entries) => {
|
|
entries.forEach((entry) => {
|
|
if (!entry.isIntersecting) return;
|
|
links.forEach((a) => {
|
|
a.style.fontWeight = a.getAttribute('href') === `#${entry.target.id}` ? '600' : '';
|
|
a.style.color = a.getAttribute('href') === `#${entry.target.id}` ? 'var(--accent)' : '';
|
|
});
|
|
});
|
|
},
|
|
{ rootMargin: '-30% 0px -60% 0px' }
|
|
);
|
|
|
|
sections.forEach((s) => observer.observe(s));
|