16 lines
479 B
JavaScript
16 lines
479 B
JavaScript
// ── Scroll hint: appears after idling at the top of the page ──
|
|
(function () {
|
|
const hint = document.getElementById('scrollHint');
|
|
if (!hint) return;
|
|
|
|
const timer = setTimeout(() => {
|
|
if (window.scrollY <= 24) hint.classList.add('visible');
|
|
}, 3000);
|
|
|
|
// Any scroll dismisses it for the rest of the visit
|
|
window.addEventListener('scroll', () => {
|
|
clearTimeout(timer);
|
|
hint.classList.remove('visible');
|
|
}, { passive: true, once: true });
|
|
})();
|