INNER CODE UNIT · JavaScript
scrollable
jatinkrmalik/LLMFeeder · web/main.js:212
const scrollable = rect.height - viewport;
const progress =
scrollable > 40
? Math.min(1, Math.max(0, -rect.top / scrollable))
: Math.min(1, Math.max(0, (viewport - rect.top) / (viewport + rect.height)));
markSteps(progress);
markTrash(progress);
if (!supportsScrollTimeline) {
setFallbackTokens(progress);
track.setAttribute("data-stage", String(Math.min(4, markSteps(progress))));
}
ticking = false;
};
const onScroll = () => {
if (ticking || !visible) return;
ticking = true;