diff options
| author | user <user@clank> | 2026-08-30 16:54:38 +0200 |
|---|---|---|
| committer | user <user@clank> | 2026-08-30 16:54:38 +0200 |
| commit | a1fd6a4e124c0b4e16c31ad6ef7ac5b6f617966d (patch) | |
| tree | 02b549282778480439ce431a89d0926819729f23 | |
| parent | web: the panes cast shows the drop bands, not just the swap (diff) | |
| download | slosh-a1fd6a4e124c0b4e16c31ad6ef7ac5b6f617966d.tar.gz slosh-a1fd6a4e124c0b4e16c31ad6ef7ac5b6f617966d.tar.xz slosh-a1fd6a4e124c0b4e16c31ad6ef7ac5b6f617966d.zip | |
web: one knob to hurry every cast on the page
window.SLOSHCAST_SPEED, multiplied into each mount's own data-speed:
the front page sets 1.25 and every recording plays a quarter faster
than authored, the scripts under demos/ untouched -- their pacing is
theirs, and how much of it a visitor's attention span gets is the
page's call. The clock keeps counting cast-time, so the timestamps
mean the same thing at any speed.
| -rw-r--r-- | web/index.html | 6 | ||||
| -rw-r--r-- | web/recordings/player.js | 10 |
2 files changed, 15 insertions, 1 deletions
diff --git a/web/index.html b/web/index.html index d34255a..7fec3f9 100644 --- a/web/index.html +++ b/web/index.html @@ -297,6 +297,12 @@ Server = https://slosh.foo/arch/$arch </section> </main> +<script> +// One knob: every cast on this page plays this much faster than authored. +// The scripts under web/recordings/demos/ keep their own pacing; this is +// the front page deciding its visitors' time is short. +window.SLOSHCAST_SPEED = 1.25; +</script> <script src="recordings/player.js"></script> <script> // The scripts on the page: the copy buttons, the install preselect and the diff --git a/web/recordings/player.js b/web/recordings/player.js index 11cdbc3..2480eb5 100644 --- a/web/recordings/player.js +++ b/web/recordings/player.js @@ -169,7 +169,15 @@ function scIsCanvasCp(cp) { // ── the player ──────────────────────────────────────────────────────────────── function mountSloshcast(el, data, opts = {}) { - const speed = opts.speed || 1; + // Per-mount speed (data-speed) times the page's one global knob: set + // window.SLOSHCAST_SPEED before this script loads and every cast on the + // page plays that much faster, the recordings untouched. The clock still + // counts cast-time, so 0:04 / 0:26 means the same thing at any speed. + const speed = + (opts.speed || 1) * + (typeof window !== "undefined" && window.SLOSHCAST_SPEED > 0 + ? window.SLOSHCAST_SPEED + : 1); const PAD = 8; // .sc-screen padding, px const BASE_FONT = 14; const esc = (s) => |
