aboutsummaryrefslogtreecommitdiffstats
path: root/src/app.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-09-03 23:12:15 -0700
committerAdam Soltys <[email protected]>2026-09-03 23:12:15 -0700
commit72edbadc375df36bdb910090935ce71baa5f7a9e (patch)
treedbdb8d67abd466aee5ff73f14693857cdb149b2c /src/app.js
parent4f0e444616b6ef1898f4029a38a0489d760d0e6d (diff)
downloadcoinosv3-72edbadc375df36bdb910090935ce71baa5f7a9e.tar.gz
coinosv3-72edbadc375df36bdb910090935ce71baa5f7a9e.zip
Critical fix: the commit-threshold change I just shipped threw on every drag release. My new travel-fraction variable was also named 'moved', colliding with the drag-started flag of the same name in the enclosing scope — a temporal-dead-zone ReferenceError that threw up() before it could commit or even snap back, so a release did nothing. Renamed to 'travelled'. (This is what made 4f0e444's drags dead.)
Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01MrkLsNScXe9b6BviUSdmMr
Diffstat (limited to 'src/app.js')
-rw-r--r--src/app.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/app.js b/src/app.js
index 725cf4c..fa2f966 100644
--- a/src/app.js
+++ b/src/app.js
@@ -3506,10 +3506,10 @@ function balanceCard() {
const pitch = kids[1] ? (kids[1].offsetLeft - kids[0].offsetLeft) : el.clientWidth || 1;
const fromCenter = kids[fromIdx].offsetLeft + kids[fromIdx].offsetWidth / 2;
const nowCenter = el.scrollLeft + el.clientWidth / 2;
- const moved = (nowCenter - fromCenter) / pitch; // + = toward higher index
+ const travelled = (nowCenter - fromCenter) / pitch; // + = toward higher index
let dir = 0;
if (Math.abs(vel) > 0.12) dir = vel < 0 ? 1 : -1; // quick flick
- else if (Math.abs(moved) > 0.15) dir = moved > 0 ? 1 : -1; // pulled ~a sixth of a card
+ else if (Math.abs(travelled) > 0.15) dir = travelled > 0 ? 1 : -1; // pulled ~a sixth of a card
const best = Math.max(0, Math.min(kids.length - 1, fromIdx + dir));
const k = kids[best];
if (k) el.scrollTo({ left: k.offsetLeft + k.offsetWidth / 2 - el.clientWidth / 2, behavior: 'smooth' });