MCPcopy Create free account
hub / github.com/OpenSIST/OpenSIST.github.io / go

Function go

src/Components/Home/home.jsx:129–140  ·  view source on GitHub ↗
(dir)

Source from the content-addressed store, hash-verified

127 // One gesture = one page change. The lock absorbs trackpad inertia
128 // (which fires a burst of +/- deltas) so the page can't flip-flop.
129 const go = (dir) => {
130 if (lock) return;
131 setPageIndex((cur) => {
132 const next = Math.min(Math.max(cur + (dir > 0 ? 1 : -1), 0), PAGE_COUNT - 1);
133 if (cur === next) return cur;
134 lock = true;
135 setTimeout(() => {
136 lock = false;
137 }, 1000);
138 return next;
139 });
140 };
141 // when the active screen's own content overflows, let it scroll natively
142 // until it hits the edge — only then do we snap to the next/prev screen
143 const canScrollWithin = (dir) => {

Callers 2

onWheelFunction · 0.85
onTouchMoveFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected