source: Klonkt/src/assets/js/smooth-scroll.js@ b5bae24

main
Last change on this file since b5bae24 was b5bae24, checked in by Robin Genis <roboburr@…>, 3 months ago

reconcile: commit uncommitted live /srv state (playback fix + prefetch, SF favicon, smooth scroll, scripts)

The live working tree /srv/prutfolio was ahead of the bare repo with direct
server edits that had never been committed back. The deploy hook does
checkout -f main, so the next deploy would have reverted the 3 modified
tracked files to f33db01 and lost this work:

  • audio-player.js: robust playback — retry+backoff on network hiccups (no longer skipping immediately) + next-track prefetch (downloads the next track while the current one plays -> ended->next swaps instantly, covering the autoplay lapse). Fix for the sometimes-next-doesn't-play bug.
  • server.js: favicon mark p -> SF (SoundFabrics rebrand). shell.ejs: audio-player.js cache buster ?v=5 -> ?v=6 + favicon ?v=sf.
  • Plus previously untracked project files committed: lenis.min.js + smooth-scroll.js (not yet wired), scripts/ (v9 import/migration), deploy/ docs (DEPLOY.md/backup.sh/nginx/verify.ps1), .well-known/assetlinks.json. audio-player.js.bak.20260614 deliberately NOT committed.

Co-Authored-By: Claude <noreply@…>

  • Property mode set to 100644
File size: 644 bytes
Line 
1/* PrutFolio — Lenis smooth wheel scroll init (desktop only) */
2(function () {
3 if (typeof Lenis === "undefined") return;
4 // Skip op touch/mobile — native momentum is beter dan JS lib
5 var isMobile = window.matchMedia("(pointer: coarse)").matches || window.innerWidth < 1024;
6 if (isMobile) return;
7 var lenis = new Lenis({
8 duration: 1.0,
9 easing: function (t) { return Math.min(1, 1.001 - Math.pow(2, -10 * t)); },
10 smoothWheel: true,
11 wheelMultiplier: 1.0,
12 touchMultiplier: 2.0,
13 });
14 function raf(time) { lenis.raf(time); requestAnimationFrame(raf); }
15 requestAnimationFrame(raf);
16 window.lenis = lenis;
17})();
Note: See TracBrowser for help on using the repository browser.