| 669 | let touchX = 0; |
| 670 | let touchY = 0; |
| 671 | const snapTarget = (from: number, y: number, velocity: number) => { |
| 672 | if (Math.abs(velocity) > flickSpeed) { |
| 673 | return velocity < 0 ? current.full : current.card; |
| 674 | } |
| 675 | const threshold = (current.full - current.card) * snapRatio; |
| 676 | if (from <= current.card) { |
| 677 | return y - current.card > threshold ? current.full : current.card; |
| 678 | } |
| 679 | return current.full - y > threshold ? current.card : current.full; |
| 680 | }; |
| 681 | const onTouchStart = (event: TouchEvent) => { |
| 682 | dragging = true; |
| 683 | refreshMoving(); |