diff --git a/frontend/src/b/Shorts.tsx b/frontend/src/b/Shorts.tsx index b19a855..f040b65 100644 --- a/frontend/src/b/Shorts.tsx +++ b/frontend/src/b/Shorts.tsx @@ -46,6 +46,8 @@ function command(frame: HTMLIFrameElement | null | undefined, func: Func, args: } const PLAYING = 1 +// 마우스로 이만큼 끌면 다음·이전 영상으로 넘긴다 +const SWIPE_PX = 30 /** 화면에 보이는 동안만 true */ function useVisible(threshold = 0.5) { @@ -247,11 +249,11 @@ function ShortsViewer({ items, start, onClose, onAt }: { items: ShortItem[]; sta setDragging(false) if (!d || !box) return if (!d.moved) return togglePause() - // 한 화면의 15% 넘게 끌면 다음·이전 영상으로, 아니면 제자리로 + // 30px 만 끌어도 다음·이전 영상으로, 그보다 덜 끌면 제자리로 const h = box.clientHeight const dy = e.clientY - d.y const base = Math.round(d.top / h) - const target = Math.min(items.length - 1, Math.max(0, base + (dy < -h * 0.15 ? 1 : dy > h * 0.15 ? -1 : 0))) + const target = Math.min(items.length - 1, Math.max(0, base + (dy < -SWIPE_PX ? 1 : dy > SWIPE_PX ? -1 : 0))) box.scrollTo({ top: target * h, behavior: 'smooth' }) }