Public site: smoother scrolling #24

Merged
reudy merged 1 commit from smoother-scrolling into main 2026-10-27 09:37:31 +01:00
Member

The site sometimes felt choppy while scrolling. I measured it by scrolling the test home page in Playwright (Firefox and Chromium), counting frames that took more than 25 ms.

Cause (Firefox, 1440 px, typical of 3 runs): ~80 of ~580 frames late as it was. With the blur off: ~50. With the fade-in animations off: ~18. With both off: ~3. Fixed hero backgrounds made no difference. At phone width scrolling was already smooth.

Changes

  • Header and upcoming-calendar cards: nearly solid background (bg-warm/95, bg-white/90), no backdrop-blur.
  • Fade-in animations are quicker: blocks 0.7s → 0.4s and slide 30 → 16 px; hero 0.8s → 0.5s with shorter delays.
  • Animations are off:
    • with prefers-reduced-motion (smooth scrolling for anchor links too);
    • on weak devices: ≤ 2 cores or ≤ 2 GB memory straight away; otherwise scrollReveal.ts times the first 120 frames while scrolling and switches them off if more than 1 in 10 run late. This sets plain-motion on <html>, remembered in sessionStorage for the rest of the visit.
  • AGENTS.md: no backdrop-blur on public pages, keep animations short, and what plain-motion is.

Tested (Playwright, test stack, home page then /about):

  • At 412 px the animations stay on and scrolling is smooth (0–5 late frames of ~240).
  • At 1440 px the check switched the animations off in 3 of 4 runs. The next page then scrolled smoothly (3–9 late of ~235). In the 4th run, Firefox stayed just under the limit on the first page.
  • The quicker animations alone already cut Firefox's first-page late frames from ~80 to ~15.
  • Reduced motion: .reveal shows at once (opacity 1, no transition).
  • 2 cores: animations are off from the start, with no page errors.
  • The header still reads cleanly over photos.
  • Type check: public 0 errors / 3 warnings and admin 0 errors / 16 warnings (both as before).

Not tested: real phones or a real GPU. The test browsers render without a graphics card, so the absolute numbers are worse than on real devices. The test box has only 2 cores, so I faked 8 cores to test the frame check.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Hy2vMnHJYP7QGsiH21zHxW

The site sometimes felt choppy while scrolling. I measured it by scrolling the test home page in Playwright (Firefox and Chromium), counting frames that took more than 25 ms. **Cause** (Firefox, 1440 px, typical of 3 runs): ~80 of ~580 frames late as it was. With the blur off: ~50. With the fade-in animations off: ~18. With both off: ~3. Fixed hero backgrounds made no difference. At phone width scrolling was already smooth. **Changes** - Header and upcoming-calendar cards: nearly solid background (`bg-warm/95`, `bg-white/90`), no `backdrop-blur`. - Fade-in animations are quicker: blocks 0.7s → 0.4s and slide 30 → 16 px; hero 0.8s → 0.5s with shorter delays. - Animations are off: - with `prefers-reduced-motion` (smooth scrolling for anchor links too); - on weak devices: ≤ 2 cores or ≤ 2 GB memory straight away; otherwise `scrollReveal.ts` times the first 120 frames while scrolling and switches them off if more than 1 in 10 run late. This sets `plain-motion` on `<html>`, remembered in sessionStorage for the rest of the visit. - AGENTS.md: no `backdrop-blur` on public pages, keep animations short, and what `plain-motion` is. **Tested** (Playwright, test stack, home page then /about): - At 412 px the animations stay on and scrolling is smooth (0–5 late frames of ~240). - At 1440 px the check switched the animations off in 3 of 4 runs. The next page then scrolled smoothly (3–9 late of ~235). In the 4th run, Firefox stayed just under the limit on the first page. - The quicker animations alone already cut Firefox's first-page late frames from ~80 to ~15. - Reduced motion: `.reveal` shows at once (opacity 1, no transition). - 2 cores: animations are off from the start, with no page errors. - The header still reads cleanly over photos. - Type check: public 0 errors / 3 warnings and admin 0 errors / 16 warnings (both as before). **Not tested:** real phones or a real GPU. The test browsers render without a graphics card, so the absolute numbers are worse than on real devices. The test box has only 2 cores, so I faked 8 cores to test the frame check. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01Hy2vMnHJYP7QGsiH21zHxW
agent added 1 commit 2026-10-27 09:36:05 +01:00
Scrolling the home page dropped frames on a desktop-sized window. Measured
in Firefox and Chromium, the cost came from blocks fading in while scrolling
and from the blurred (frosted) header and calendar cards, which are redrawn
on every frame.

- Header and upcoming-calendar cards: nearly solid background, no blur.
- Fade-in animations are shorter (0.4s / 0.5s, a smaller slide).
- They are off for people whose device asks for reduced motion, and on
  devices that can't keep up: very few cores / little memory straight
  away, otherwise when more than 1 in 10 of the first scrolled frames run
  late (scrollReveal.ts adds `plain-motion` to <html>, remembered for
  the visit).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hy2vMnHJYP7QGsiH21zHxW
reudy merged commit 312dc5ed3c into main 2026-10-27 09:37:31 +01:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: reudy-net/domaino#24
No description provided.