Added useSlider hook and mouse interaction test.

This commit is contained in:
Jay
2025-07-22 07:46:18 -04:00
parent 936c513a73
commit d224f335e9
13 changed files with 308 additions and 17 deletions
+20
View File
@@ -0,0 +1,20 @@
export function handleScroll(
prevLength: number,
scrollDelta: number,
handleIncrement: () => void,
handleDecrement: () => void,
) {
const newLength = prevLength + scrollDelta;
if (Math.abs(newLength) > 50) {
if (newLength > 0) {
handleIncrement();
} else if (newLength < 0) {
handleDecrement();
}
return 0;
}
return newLength;
}