aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
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 });