From a6f9e6c6e3831705f5038cb28a2878a971e92693 Mon Sep 17 00:00:00 2001 From: agent Date: Tue, 27 Oct 2026 08:36:03 +0000 Subject: [PATCH] Public site: smoother scrolling 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 , remembered for the visit). Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01Hy2vMnHJYP7QGsiH21zHxW --- AGENTS.md | 1 + app-admin/src/app.css | 35 ++++++-- app-public/src/app.css | 35 ++++++-- app-public/src/lib/components/Header.svelte | 2 +- packages/shared/src/blocks/HeroBlock.svelte | 4 +- .../src/blocks/UpcomingCalendarBlock.svelte | 2 +- packages/shared/src/scrollReveal.ts | 79 +++++++++++++++++++ 7 files changed, 144 insertions(+), 14 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index c5b8cf0..9b8dd04 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -143,6 +143,7 @@ To add an email block type: add to `EmailBlockType` in `packages/shared/src/type ### Styling - **Public site**: Custom theme via `@theme` in `app.css` — colors: `warm`, `charcoal`, `sage`, `sage-dark`, `terracotta`. Fonts: `font-sans` (body), `font-serif` (headings), chosen in Site design → Style (default DM Sans / Playfair Display). - **Site design → Style** (`style` global: fonts, corners, text size, shadows, page width) becomes `--site-*` variables (`siteStyleVars` in `$shared/theme`) that the `@theme` tokens in both `app.css` files scale. So in public-site markup use the tokens — `rounded-xl`/`rounded-2xl`/`rounded-card`/`rounded-panel`, `shadow-sm`…`shadow-xl`, `max-w-3xl`/`6xl`/`7xl` — never `rounded-[2rem]` or an arbitrary `shadow-[…]`, which ignore the settings. Buttons, chips and icon buttons are `rounded-button` (a pill when Round, square when Sharp); only dots, avatars and badges stay `rounded-full`. + - Keep scrolling smooth: no `backdrop-blur` on public pages (it is redrawn on every scrolled frame; use a nearly solid background), and keep animations short. The `.reveal` / `.animate-fade-in` animations are switched off for people who ask for reduced motion and, by `scrollReveal.ts`, on devices that stutter (`plain-motion` on ``, rules in both `app.css` files). - Fonts are bundled `@fontsource-variable/*` packages, imported in each app's `src/lib/fonts.ts` and listed in `SITE_FONTS`; a new one goes in all three places. - **Admin area**: DaisyUI **5** (no `form-control` / `label-text` / `*-bordered` — those are v4). Colours come from Site design via `$shared/theme`, rendered as a `