aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-10-15 07:07:40 -0700
committerAdam Soltys <[email protected]>2026-10-15 07:07:40 -0700
commitb540d3fab2579da40e0bcdb59581f83b0b742947 (patch)
tree25a5b22849765f73f721fbc77be85e9989d67279 /src
parent63fc25dbdfef08ed599e5e639f070ccf72077492 (diff)
downloadcoinosv3-b540d3fab2579da40e0bcdb59581f83b0b742947.tar.gz
coinosv3-b540d3fab2579da40e0bcdb59581f83b0b742947.zip
Feed wheel: after a reversal the next two notches are plain, then a spin winds up again. The 700 ms spell without wind-up after a turn back (63fc25d) also covered a spin begun inside it, so correcting the direction and spinning on felt slow for most of a second (Adam, 2026-10-16: "it slows down for a while when I don't want it to"; "overall the scrolling still isn't as fast"). The calm is now a count: the reversal's next two notches don't wind the speed up — a couple of correcting notches still travel a couple of notches — and from the third the wind-up is back, so a spin after a reversal goes as far as one from rest. tools/feed-wheel-reverse-test.js (a reversal plus four quick notches goes well past five plain ones, and about as far as five from rest).
Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01J1Kon8bxJoHRpJdSzshCkp
Diffstat (limited to 'src')
-rw-r--r--src/app.js20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/app.js b/src/app.js
index 5575cc5..dae7b17 100644
--- a/src/app.js
+++ b/src/app.js
@@ -6654,13 +6654,15 @@ if (INTENT_URI) {
};
// ---- the wheel
// A turn back against the coast catches the page at once and is a plain
- // notch from rest — no flight the other way, since for a moment after a
- // reversal (CALM) notches don't wind the speed up, so a couple of
- // correcting notches travel a couple of notches. (A spell of quarter-size
- // "hunting" notches ramping back up was tried here and felt like a
- // stutter and a slow patch — Adam, 2026-10-16.)
- const CALM = 700; // ms after a reversal without wind-up
- let calmUntil = 0; // (lastDir/lastMoveAt: the tick's, above)
+ // notch from rest — no flight the other way, since the next couple of
+ // notches after a reversal (CALM) don't wind the speed up, so a couple of
+ // correcting notches travel a couple of notches; a spin that keeps going
+ // winds up again from the third. (A spell of quarter-size "hunting"
+ // notches ramping back up was tried here and felt like a stutter and a
+ // slow patch; a 700 ms spell without wind-up after a reversal was tried
+ // too and a spin begun inside it felt slow — Adam, 2026-10-16.)
+ const CALM = 2; // notches after a reversal without wind-up
+ let calmLeft = 0; // (lastDir/lastMoveAt: the tick's, above)
let smoothUntil = 0; // a trackpad's events were just seen: hands off
window.addEventListener('wheel', (e) => {
if (e.ctrlKey || e.shiftKey || e.defaultPrevented) return;
@@ -6680,7 +6682,7 @@ if (INTENT_URI) {
// to the OLD elapsed time made the first reverse step jump. Give the
// notch a small response now, then coast the rest of its travel.
stop();
- calmUntil = now + CALM;
+ calmLeft = CALM;
const first = dir * Math.min(16, Math.abs(px * 3 / TAU) * 16);
window.scrollBy({ top: first, behavior: 'instant' });
lastDir = dir; lastMoveAt = now;
@@ -6690,7 +6692,7 @@ if (INTENT_URI) {
// goes, the more each turn adds (up to 2.5x), so keeping the wheel
// turning winds the speed up instead of settling at a stroll. From
// rest a notch is the same push as ever.
- const gain = now < calmUntil ? 1 : 1 + Math.min(1.5, Math.abs(v) / 4);
+ const gain = calmLeft-- > 0 ? 1 : 1 + Math.min(1.5, Math.abs(v) / 4);
coast(v + (px * 3 * gain) / TAU, TAU);
}
}, { passive: false });