Skip to content

Commit 3116003

Browse files
committed
add mobile
1 parent f7beaa8 commit 3116003

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

pages/stories/[slug].js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,7 @@ function ProgressRope({ scrollYProgress, color }) {
295295

296296
const handlePointerUp = useCallback(() => {
297297
if (snapped.current && tugMaxY.current > TUG_THRESHOLD) {
298+
new Audio("/sounds/switch.mp3").play().catch(() => {});
298299
const font = RANDOM_FONTS[Math.floor(Math.random() * RANDOM_FONTS.length)];
299300
const bg = RANDOM_COLORS[Math.floor(Math.random() * RANDOM_COLORS.length)];
300301
let chaosStyle = document.getElementById("rope-chaos");
@@ -334,6 +335,7 @@ function ProgressRope({ scrollYProgress, color }) {
334335
height: "100vh",
335336
zIndex: 9999,
336337
pointerEvents: dragging ? "auto" : "none",
338+
touchAction: dragging ? "none" : "auto",
337339
}}
338340
onPointerMove={handlePointerMove}
339341
onPointerUp={handlePointerUp}
@@ -344,7 +346,7 @@ function ProgressRope({ scrollYProgress, color }) {
344346
stroke="transparent"
345347
strokeWidth="24"
346348
fill="none"
347-
style={{ pointerEvents: "auto", cursor: "grab" }}
349+
style={{ pointerEvents: "auto", cursor: "grab", touchAction: "none" }}
348350
onPointerDown={handlePointerDown}
349351
/>
350352
{segments.map((seg, i) => (

0 commit comments

Comments
 (0)