INNER CODE UNIT · JavaScript
canAdvance
jatinkrmalik/LLMFeeder · web/main.js:108
const canAdvance = () => {
if (advancing || consumed) return false;
if (window.matchMedia("(pointer: coarse)").matches) return false;
if (window.innerWidth < 700 || window.innerHeight < 620) return false;
const hero = heroSection.getBoundingClientRect();
// Still essentially looking at the hero.
return hero.bottom > window.innerHeight * 0.6;
};
window.addEventListener(
"wheel",
(event) => {
if (event.deltaY <= 4 || event.ctrlKey) return;
if (!canAdvance()) return;
event.preventDefault();
advancing = true;
consumed = true;
sceneTrack.scrollIntoView({ behavior: "smooth", block: "start" });