Compare commits
2 commits
c35f9a60cc
...
f1ef0162d7
| Author | SHA1 | Date | |
|---|---|---|---|
| f1ef0162d7 | |||
| 91f6705899 |
29 changed files with 628 additions and 110 deletions
|
|
@ -34,7 +34,7 @@ app-admin/ # SvelteKit admin app (serves admin.<domain>)
|
|||
│ │ ├── orders/ # Order list + booking-email status/resend
|
||||
│ │ ├── customers/ # Customer personal data (GDPR): search, export, correct, erase, retention settings
|
||||
│ │ ├── emails/ # Block-based booking email editor (live preview, test send)
|
||||
│ │ ├── globals/ # Header/footer/colors editor (menu label: Site design)
|
||||
│ │ ├── globals/ # Header/footer/colors/style editor (menu label: Site design)
|
||||
│ │ ├── backup/ # Export/import UI (calls api/export, api/import)
|
||||
│ │ ├── preview/ # Draft preview via sessionStorage (same-origin)
|
||||
│ │ └── api/ # upload, export, import, slots (Shop block times in /preview) endpoints
|
||||
|
|
@ -141,7 +141,9 @@ To add an email block type: add to `EmailBlockType` in `packages/shared/src/type
|
|||
- **Shop / payments**: all basket, slot-hold, Stripe and order logic lives in the PocketBase hooks (JSVM: synchronous, each handler `require()`s the lib; see the header comment). The public app must stay unprivileged — no superuser login, no Stripe secret key; its routes only proxy to `/api/shop/*` and manage the `basket_id` cookie (`app-public/src/lib/server/shop.ts`). Booking emails are rendered and sent by the public app from data the webhook hook returns (`OrderEmailData`, `sendOrderEmailsFromData`); keep `orderEmailData()` in the hook and `loadOrderEmailData()` in `packages/shared/src/server/email` returning the same shape. Local testing uses `stripe-mock` (`STRIPE_API_BASE`, local compose only).
|
||||
|
||||
### Styling
|
||||
- **Public site**: Custom theme via `@theme` in `app.css` — colors: `warm`, `charcoal`, `sage`, `sage-dark`, `terracotta`. Fonts: `DM Sans` (body), `Playfair Display` (headings).
|
||||
- **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`.
|
||||
- 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 `<style>` in `<head>` (SSR, no flash): the admin gets only DaisyUI primary (= site Primary) and secondary (= site Accent) with auto-contrast text; `/preview` and the public site get all site colour variables. Never use `text-primary`/`text-secondary` for text — a light brand colour is unreadable as text; mark state with a tint/bar instead. Conventions:
|
||||
- Section card: `rounded-box bg-base-100 p-5 shadow` with an `h2.text-2xl.font-bold` title (see Site design / globals).
|
||||
- Form field: `<label class="fieldset"><span class="fieldset-legend">Label</span><input class="input w-full" /></label>`; hints in `<span class="label">`.
|
||||
|
|
|
|||
|
|
@ -217,7 +217,7 @@ What the software does; the studio (the controller) is responsible for the priva
|
|||
- **Checkout:** a short privacy notice with the link, and a hint under the notes field asking customers not to write health details (special-category data). There is deliberately no "I consent" box: booking data is processed to perform the contract, not on consent. Both texts are editable in the Checkout block.
|
||||
- **Customers (admin):** look a customer up by name, email, phone or notes (orders and unpaid checkouts, matched by email case-insensitively); *Export data (JSON)* for access/portability requests; correct name/email/phone or remove notes on every record; *Erase* anonymises their orders (amounts, services and dates stay for the accounts) and their codes (the codes keep working), and deletes unpaid checkouts. Stripe and the email provider keep their own copies — handle those in their dashboards.
|
||||
- **Retention:** daily at 03:15 UTC and on PocketBase start (`pocketbase/pb_hooks/privacy.pb.js`): unpaid checkouts are deleted after *N* days (default 30); orders are anonymised after *M* months (default 0 = never — set it once the accountant has said how long records must be kept). Orders with a booking still ahead are skipped; codes are anonymised with the same age once they have expired or are used up. Settings live in the `privacy` global.
|
||||
- **No third parties on page load:** fonts are bundled (`@fontsource/*`), not loaded from Google, and Stripe.js loads only when the customer presses Pay (`@stripe/stripe-js/pure`). The only cookies are the basket cookie and the admin login, so no cookie banner is needed — keep it that way, or add one before adding analytics.
|
||||
- **No third parties on page load:** fonts are bundled (`@fontsource-variable/*`; *Site design → Style* picks from them), not loaded from Google, and Stripe.js loads only when the customer presses Pay (`@stripe/stripe-js/pure`). The only cookies are the basket cookie and the admin login, so no cookie banner is needed — keep it that way, or add one before adding analytics.
|
||||
- All customer-data reads and writes go through `/api/privacy/*` (signed-in admin only; `orders`/`baskets` are superuser-only collections).
|
||||
|
||||
## Public routes (public app)
|
||||
|
|
|
|||
159
app-admin/package-lock.json
generated
159
app-admin/package-lock.json
generated
|
|
@ -26,8 +26,21 @@
|
|||
"uuid": "^14.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@fontsource/dm-sans": "^5.3.0",
|
||||
"@fontsource/playfair-display": "^5.3.0",
|
||||
"@fontsource-variable/cormorant-garamond": "^5.3.0",
|
||||
"@fontsource-variable/dm-sans": "^5.3.0",
|
||||
"@fontsource-variable/eb-garamond": "^5.3.0",
|
||||
"@fontsource-variable/fraunces": "^5.3.0",
|
||||
"@fontsource-variable/inter": "^5.3.0",
|
||||
"@fontsource-variable/josefin-sans": "^5.3.0",
|
||||
"@fontsource-variable/libre-baskerville": "^5.3.0",
|
||||
"@fontsource-variable/lora": "^5.3.0",
|
||||
"@fontsource-variable/manrope": "^5.3.0",
|
||||
"@fontsource-variable/montserrat": "^5.3.0",
|
||||
"@fontsource-variable/nunito": "^5.3.0",
|
||||
"@fontsource-variable/outfit": "^5.3.0",
|
||||
"@fontsource-variable/playfair-display": "^5.3.0",
|
||||
"@fontsource-variable/raleway": "^5.3.0",
|
||||
"@fontsource-variable/work-sans": "^5.3.0",
|
||||
"@sveltejs/kit": "^2.57.0",
|
||||
"@sveltejs/vite-plugin-svelte": "^7.0.0",
|
||||
"@types/node": "^25.8.0",
|
||||
|
|
@ -120,20 +133,150 @@
|
|||
"license": "MIT",
|
||||
"peer": true
|
||||
},
|
||||
"node_modules/@fontsource/dm-sans": {
|
||||
"node_modules/@fontsource-variable/cormorant-garamond": {
|
||||
"version": "5.3.0",
|
||||
"resolved": "https://registry.npmjs.org/@fontsource/dm-sans/-/dm-sans-5.3.0.tgz",
|
||||
"integrity": "sha512-lYJtMXXO28q1z+yz+z8XKd0s4hXaa9QdkETzkyD760sidCv5heI86weYA0sx0Nc4pAMAQTUuyf4gO44cYKKS9g==",
|
||||
"resolved": "https://registry.npmjs.org/@fontsource-variable/cormorant-garamond/-/cormorant-garamond-5.3.0.tgz",
|
||||
"integrity": "sha512-rgZJ/5w3hi60swAPnrOXpZf5wEH6NTrvm4H8D9Y4b1QIFUqlX14eM3QTMU/eAznjfh0eXpO1QUqsFhiy58aoMg==",
|
||||
"dev": true,
|
||||
"license": "OFL-1.1",
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ayuhito"
|
||||
}
|
||||
},
|
||||
"node_modules/@fontsource/playfair-display": {
|
||||
"node_modules/@fontsource-variable/dm-sans": {
|
||||
"version": "5.3.0",
|
||||
"resolved": "https://registry.npmjs.org/@fontsource/playfair-display/-/playfair-display-5.3.0.tgz",
|
||||
"integrity": "sha512-uJSABalvdWc10fEPppQjQocamT21LEyRfzzWfRfqbkPz+sRv+kKpYDKyluBUskvJREkJTos9epj1WjQROGu99Q==",
|
||||
"resolved": "https://registry.npmjs.org/@fontsource-variable/dm-sans/-/dm-sans-5.3.0.tgz",
|
||||
"integrity": "sha512-BpUG5bqePiDFMBM4ZtLSlPdAIOM990uB1dlXzIf4aw21yQR7BmykedLXXXMqGWsR18aMLOsbWccwJNh3ztTQaA==",
|
||||
"dev": true,
|
||||
"license": "OFL-1.1",
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ayuhito"
|
||||
}
|
||||
},
|
||||
"node_modules/@fontsource-variable/eb-garamond": {
|
||||
"version": "5.3.0",
|
||||
"resolved": "https://registry.npmjs.org/@fontsource-variable/eb-garamond/-/eb-garamond-5.3.0.tgz",
|
||||
"integrity": "sha512-656OJsA9Vv24yhqRZFEzXnzS2AYgKdEILLgHJYLzzXndgcWFKfSXFqzbRI5/6Yk1Yt7UfWrUeppE5nRQPQMwlQ==",
|
||||
"dev": true,
|
||||
"license": "OFL-1.1",
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ayuhito"
|
||||
}
|
||||
},
|
||||
"node_modules/@fontsource-variable/fraunces": {
|
||||
"version": "5.3.0",
|
||||
"resolved": "https://registry.npmjs.org/@fontsource-variable/fraunces/-/fraunces-5.3.0.tgz",
|
||||
"integrity": "sha512-9BYGySn4AHEJdgp9Z28tQ3X+laJMEOITXkQarZXeloWQZDq5oOvXJ3kDA8c7MGIfpogIaZfjrQBqmda8POOCKA==",
|
||||
"dev": true,
|
||||
"license": "OFL-1.1",
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ayuhito"
|
||||
}
|
||||
},
|
||||
"node_modules/@fontsource-variable/inter": {
|
||||
"version": "5.3.0",
|
||||
"resolved": "https://registry.npmjs.org/@fontsource-variable/inter/-/inter-5.3.0.tgz",
|
||||
"integrity": "sha512-OupL48va4JNofb97w6NYeF9S7W/kHNKM0Er8Dem5nqi4jeOLrVJDoE8tZEpnMJmtkvNbB1EIPPwHcdkF6b1oUA==",
|
||||
"dev": true,
|
||||
"license": "OFL-1.1",
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ayuhito"
|
||||
}
|
||||
},
|
||||
"node_modules/@fontsource-variable/josefin-sans": {
|
||||
"version": "5.3.0",
|
||||
"resolved": "https://registry.npmjs.org/@fontsource-variable/josefin-sans/-/josefin-sans-5.3.0.tgz",
|
||||
"integrity": "sha512-duVgkuzE/co4iuIfJ7jM2qX0ED3b6qdY+SlSjNMs6zfhz7EE7kJxV0qF65hQCv1kN0A20j4FwsGAYJvfpU+iSg==",
|
||||
"dev": true,
|
||||
"license": "OFL-1.1",
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ayuhito"
|
||||
}
|
||||
},
|
||||
"node_modules/@fontsource-variable/libre-baskerville": {
|
||||
"version": "5.3.0",
|
||||
"resolved": "https://registry.npmjs.org/@fontsource-variable/libre-baskerville/-/libre-baskerville-5.3.0.tgz",
|
||||
"integrity": "sha512-lIjXwDhcdr0OxSdzlAU4G7Tnny1LhgAiPFdp3/PjwRMqYt2JLU6pQiLwz/M5lRBs/kRtHwxknPUqRt37AnqPFg==",
|
||||
"dev": true,
|
||||
"license": "OFL-1.1",
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ayuhito"
|
||||
}
|
||||
},
|
||||
"node_modules/@fontsource-variable/lora": {
|
||||
"version": "5.3.0",
|
||||
"resolved": "https://registry.npmjs.org/@fontsource-variable/lora/-/lora-5.3.0.tgz",
|
||||
"integrity": "sha512-2ph8KiZ8Bn141hWuC3ErtpJ+Ui8p2MJQn8TJNRSRmLmnCIOCtHfiBM9R7WLRPeUG/q6hXyHOxWQ8DvRSX+ixvQ==",
|
||||
"dev": true,
|
||||
"license": "OFL-1.1",
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ayuhito"
|
||||
}
|
||||
},
|
||||
"node_modules/@fontsource-variable/manrope": {
|
||||
"version": "5.3.0",
|
||||
"resolved": "https://registry.npmjs.org/@fontsource-variable/manrope/-/manrope-5.3.0.tgz",
|
||||
"integrity": "sha512-6D5dgokHsWDDMtmXHznKa0hK229NN+1a4BLPmUCLqcO1Pw5EEhWY5RFt0AcXnVRAljFFPfRtLkJePQj6LSsV6g==",
|
||||
"dev": true,
|
||||
"license": "OFL-1.1",
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ayuhito"
|
||||
}
|
||||
},
|
||||
"node_modules/@fontsource-variable/montserrat": {
|
||||
"version": "5.3.0",
|
||||
"resolved": "https://registry.npmjs.org/@fontsource-variable/montserrat/-/montserrat-5.3.0.tgz",
|
||||
"integrity": "sha512-7PaZoxaxrWLAyrhO46v65An9LhUhfkTExWLhfbywYZCnZEgg/W1rEHnlNmZKjNZ3nJTVYyicqxlJt10z/26yTA==",
|
||||
"dev": true,
|
||||
"license": "OFL-1.1",
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ayuhito"
|
||||
}
|
||||
},
|
||||
"node_modules/@fontsource-variable/nunito": {
|
||||
"version": "5.3.0",
|
||||
"resolved": "https://registry.npmjs.org/@fontsource-variable/nunito/-/nunito-5.3.0.tgz",
|
||||
"integrity": "sha512-tw0ch7evIDSwoeUy+0XzocYHfbRWLeCRPJy22KgbrLjDLAbNw/fErBiil10Ssrs3Sjr55zaZrr36a975j8cBkQ==",
|
||||
"dev": true,
|
||||
"license": "OFL-1.1",
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ayuhito"
|
||||
}
|
||||
},
|
||||
"node_modules/@fontsource-variable/outfit": {
|
||||
"version": "5.3.0",
|
||||
"resolved": "https://registry.npmjs.org/@fontsource-variable/outfit/-/outfit-5.3.0.tgz",
|
||||
"integrity": "sha512-fPb5XnYK0k7SbR++HEmm4+ZqDszmLKQ+sPRUr8oQ/KNC0vy6r6hazJFe8iYozv4cqlHbvJ/JECkJWrfDodUMVQ==",
|
||||
"dev": true,
|
||||
"license": "OFL-1.1",
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ayuhito"
|
||||
}
|
||||
},
|
||||
"node_modules/@fontsource-variable/playfair-display": {
|
||||
"version": "5.3.0",
|
||||
"resolved": "https://registry.npmjs.org/@fontsource-variable/playfair-display/-/playfair-display-5.3.0.tgz",
|
||||
"integrity": "sha512-IHdzTvE8eGIXHteZql7KXoqdc3Gfm+Zs1u4XlSC3MeplkwviT3sx/P6gI0tLwg/xIYLF4ZJYveZ5V+bl9cnDwA==",
|
||||
"dev": true,
|
||||
"license": "OFL-1.1",
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ayuhito"
|
||||
}
|
||||
},
|
||||
"node_modules/@fontsource-variable/raleway": {
|
||||
"version": "5.3.0",
|
||||
"resolved": "https://registry.npmjs.org/@fontsource-variable/raleway/-/raleway-5.3.0.tgz",
|
||||
"integrity": "sha512-aSV2k+V6Zz+od0dHpBOzkVxEzmgEdiXcxDfant39jLOx+T89dielQRrZylukwK3Fp+FY255gPqz67ruOfs1rqA==",
|
||||
"dev": true,
|
||||
"license": "OFL-1.1",
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ayuhito"
|
||||
}
|
||||
},
|
||||
"node_modules/@fontsource-variable/work-sans": {
|
||||
"version": "5.3.0",
|
||||
"resolved": "https://registry.npmjs.org/@fontsource-variable/work-sans/-/work-sans-5.3.0.tgz",
|
||||
"integrity": "sha512-le8h/OIIuhm5Z7TdvuMw0yKg2gaCZUiMec8zaumsVVjzeJRBPEF0bQI/MkaZDHCVzZDvZoP/O2LiGOSfDLSbaw==",
|
||||
"dev": true,
|
||||
"license": "OFL-1.1",
|
||||
"funding": {
|
||||
|
|
|
|||
|
|
@ -10,8 +10,21 @@
|
|||
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@fontsource/dm-sans": "^5.3.0",
|
||||
"@fontsource/playfair-display": "^5.3.0",
|
||||
"@fontsource-variable/cormorant-garamond": "^5.3.0",
|
||||
"@fontsource-variable/dm-sans": "^5.3.0",
|
||||
"@fontsource-variable/eb-garamond": "^5.3.0",
|
||||
"@fontsource-variable/fraunces": "^5.3.0",
|
||||
"@fontsource-variable/inter": "^5.3.0",
|
||||
"@fontsource-variable/josefin-sans": "^5.3.0",
|
||||
"@fontsource-variable/libre-baskerville": "^5.3.0",
|
||||
"@fontsource-variable/lora": "^5.3.0",
|
||||
"@fontsource-variable/manrope": "^5.3.0",
|
||||
"@fontsource-variable/montserrat": "^5.3.0",
|
||||
"@fontsource-variable/nunito": "^5.3.0",
|
||||
"@fontsource-variable/outfit": "^5.3.0",
|
||||
"@fontsource-variable/playfair-display": "^5.3.0",
|
||||
"@fontsource-variable/raleway": "^5.3.0",
|
||||
"@fontsource-variable/work-sans": "^5.3.0",
|
||||
"@sveltejs/kit": "^2.57.0",
|
||||
"@sveltejs/vite-plugin-svelte": "^7.0.0",
|
||||
"@types/node": "^25.8.0",
|
||||
|
|
|
|||
|
|
@ -13,9 +13,28 @@
|
|||
white-space: normal;
|
||||
}
|
||||
|
||||
/* Site design → Style sets the --site-* variables (siteStyleVars in
|
||||
$shared/theme) on the public site and the admin preview; without them
|
||||
(the admin's own pages) every token below is its usual value. Corners,
|
||||
shadows and widths are scaled here, so blocks just use rounded-xl,
|
||||
shadow-sm, max-w-6xl… Buttons and chips use rounded-button (a pill when
|
||||
Round); dots and avatars stay rounded-full. */
|
||||
@theme {
|
||||
--font-sans: 'DM Sans', ui-sans-serif, system-ui, sans-serif;
|
||||
--font-serif: 'Playfair Display', Georgia, serif;
|
||||
--font-sans: var(--site-font-body, 'DM Sans Variable', ui-sans-serif, system-ui, sans-serif);
|
||||
--font-serif: var(--site-font-heading, 'Playfair Display Variable', Georgia, serif);
|
||||
--radius-lg: calc(0.5rem * var(--site-corners, 1));
|
||||
--radius-xl: calc(0.75rem * var(--site-corners, 1));
|
||||
--radius-2xl: calc(1rem * var(--site-corners, 1));
|
||||
--radius-card: calc(1.25rem * var(--site-corners, 1));
|
||||
--radius-panel: calc(2rem * var(--site-corners, 1));
|
||||
--radius-button: var(--site-button-radius, 9999px);
|
||||
--shadow-sm: 0 1px 3px 0 rgb(0 0 0 / calc(0.1 * var(--site-shadow, 1))), 0 1px 2px -1px rgb(0 0 0 / calc(0.1 * var(--site-shadow, 1)));
|
||||
--shadow-md: 0 4px 6px -1px rgb(0 0 0 / calc(0.1 * var(--site-shadow, 1))), 0 2px 4px -2px rgb(0 0 0 / calc(0.1 * var(--site-shadow, 1)));
|
||||
--shadow-lg: 0 10px 15px -3px rgb(0 0 0 / calc(0.1 * var(--site-shadow, 1))), 0 4px 6px -4px rgb(0 0 0 / calc(0.1 * var(--site-shadow, 1)));
|
||||
--shadow-xl: 0 20px 25px -5px rgb(0 0 0 / calc(0.1 * var(--site-shadow, 1))), 0 8px 10px -6px rgb(0 0 0 / calc(0.1 * var(--site-shadow, 1)));
|
||||
--container-3xl: calc(48rem * var(--site-width, 1));
|
||||
--container-6xl: calc(72rem * var(--site-width, 1));
|
||||
--container-7xl: calc(80rem * var(--site-width, 1));
|
||||
--color-warm: var(--color-bg, #faf8f5);
|
||||
--color-charcoal: var(--color-heading, #2c2c2c);
|
||||
--color-sage: var(--color-primary, #8a9a7b);
|
||||
|
|
@ -54,7 +73,9 @@
|
|||
--fg-body: var(--color-text, #2c2c2c);
|
||||
background: var(--color-bg, #faf8f5);
|
||||
color: var(--fg-body);
|
||||
font-family: 'DM Sans', ui-sans-serif, system-ui, sans-serif;
|
||||
font-family: var(--font-sans);
|
||||
/* Site design → Style → Text size; rem-sized spacing grows with it. */
|
||||
font-size: var(--site-text-size, 100%);
|
||||
}
|
||||
|
||||
/* ── Foreground colour utilities (set per-block via BackgroundWrapper) ── */
|
||||
|
|
@ -84,7 +105,7 @@ h1,
|
|||
h2,
|
||||
h3,
|
||||
h4 {
|
||||
font-family: 'Playfair Display', Georgia, serif;
|
||||
font-family: var(--font-serif);
|
||||
color: var(--fg-heading, #2c2c2c);
|
||||
}
|
||||
|
||||
|
|
@ -124,7 +145,7 @@ h4 {
|
|||
margin: 0.75rem 0;
|
||||
padding-left: 1.25rem;
|
||||
border-left: 3px solid var(--color-primary, #8a9a7b);
|
||||
font-family: 'Playfair Display', Georgia, serif;
|
||||
font-family: var(--font-serif);
|
||||
font-size: 1.35rem;
|
||||
font-style: italic;
|
||||
}
|
||||
|
|
|
|||
19
app-admin/src/lib/fonts.ts
Normal file
19
app-admin/src/lib/fonts.ts
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
// The fonts Site design → Style offers (SITE_FONTS in $shared/theme), bundled
|
||||
// and served by this app, not loaded from Google: a Google Fonts request sends
|
||||
// every visitor's IP address to Google (GDPR). Each import only declares the
|
||||
// font; a browser downloads the files of the fonts a page actually uses.
|
||||
import '@fontsource-variable/playfair-display';
|
||||
import '@fontsource-variable/cormorant-garamond';
|
||||
import '@fontsource-variable/eb-garamond';
|
||||
import '@fontsource-variable/libre-baskerville';
|
||||
import '@fontsource-variable/lora';
|
||||
import '@fontsource-variable/fraunces';
|
||||
import '@fontsource-variable/dm-sans';
|
||||
import '@fontsource-variable/inter';
|
||||
import '@fontsource-variable/manrope';
|
||||
import '@fontsource-variable/montserrat';
|
||||
import '@fontsource-variable/nunito';
|
||||
import '@fontsource-variable/outfit';
|
||||
import '@fontsource-variable/raleway';
|
||||
import '@fontsource-variable/work-sans';
|
||||
import '@fontsource-variable/josefin-sans';
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
import { env } from '$env/dynamic/private';
|
||||
import { defaultColors } from '$lib/types';
|
||||
import { defaultColors, defaultStyle } from '$lib/types';
|
||||
import { shopCurrency } from '$shared/calendar';
|
||||
import type { LayoutServerLoad } from './$types';
|
||||
|
||||
|
|
@ -13,13 +13,16 @@ async function getGlobal(pb: App.Locals['pb'], key: string, fallback: unknown) {
|
|||
}
|
||||
|
||||
export const load: LayoutServerLoad = async ({ locals }) => {
|
||||
const [colors, header] = await Promise.all([
|
||||
const [colors, header, style] = await Promise.all([
|
||||
getGlobal(locals.pb, 'colors', defaultColors),
|
||||
getGlobal(locals.pb, 'header', {}) as Promise<{ logo?: { url?: string } }>
|
||||
getGlobal(locals.pb, 'header', {}) as Promise<{ logo?: { url?: string } }>,
|
||||
// Only /preview uses it: the admin's own pages keep their look.
|
||||
getGlobal(locals.pb, 'style', defaultStyle)
|
||||
]);
|
||||
return {
|
||||
user: locals.user,
|
||||
colors,
|
||||
style,
|
||||
// The site's logo is the admin's tab icon too (same as the public site).
|
||||
logoUrl: header?.logo?.url || '',
|
||||
// Admin dates/times are entered and shown in the site's timezone, and
|
||||
|
|
|
|||
|
|
@ -1,13 +1,6 @@
|
|||
<script lang="ts">
|
||||
import '../app.css';
|
||||
// Fonts are bundled and served by this app, not loaded from Google: a
|
||||
// Google Fonts request sends every visitor's IP address to Google (GDPR).
|
||||
import '@fontsource/dm-sans/400.css';
|
||||
import '@fontsource/dm-sans/500.css';
|
||||
import '@fontsource/dm-sans/600.css';
|
||||
import '@fontsource/dm-sans/700.css';
|
||||
import '@fontsource/playfair-display/600.css';
|
||||
import '@fontsource/playfair-display/700.css';
|
||||
import '$lib/fonts';
|
||||
import favicon from '$lib/assets/favicon.svg';
|
||||
import { afterNavigate } from '$app/navigation';
|
||||
import { page } from '$app/state';
|
||||
|
|
|
|||
|
|
@ -2,10 +2,10 @@ import { fail, redirect } from '@sveltejs/kit';
|
|||
import { ClientResponseError } from 'pocketbase';
|
||||
import { PRIVACY_PAGE_SLUG, privacyTemplateHtml } from '$lib/admin/privacyTemplate';
|
||||
import { attempt } from '$lib/server/actions';
|
||||
import { defaultColors, defaultFooter, defaultHeader } from '$lib/types';
|
||||
import { defaultColors, defaultFooter, defaultHeader, defaultStyle } from '$lib/types';
|
||||
import type { Actions, PageServerLoad } from './$types';
|
||||
|
||||
const SECTIONS = ['header', 'footer', 'colors'] as const;
|
||||
const SECTIONS = ['header', 'footer', 'colors', 'style'] as const;
|
||||
|
||||
async function getGlobal(pb: App.Locals['pb'], key: string, fallback: unknown) {
|
||||
try {
|
||||
|
|
@ -21,10 +21,11 @@ async function getGlobal(pb: App.Locals['pb'], key: string, fallback: unknown) {
|
|||
}
|
||||
|
||||
export const load: PageServerLoad = async ({ locals }) => {
|
||||
const [header, footer, colors] = await Promise.all([
|
||||
const [header, footer, colors, style] = await Promise.all([
|
||||
getGlobal(locals.pb, 'header', defaultHeader),
|
||||
getGlobal(locals.pb, 'footer', defaultFooter),
|
||||
getGlobal(locals.pb, 'colors', defaultColors)
|
||||
getGlobal(locals.pb, 'colors', defaultColors),
|
||||
getGlobal(locals.pb, 'style', defaultStyle)
|
||||
]);
|
||||
|
||||
// All pages for the page selectors, with what the basket setting warns
|
||||
|
|
@ -35,7 +36,7 @@ export const load: PageServerLoad = async ({ locals }) => {
|
|||
return { id: page.id, slug: page.slug, title: page.title, published: !!page.published, hasCheckout: types.has('checkout') };
|
||||
});
|
||||
|
||||
return { header, footer, colors, pages };
|
||||
return { header, footer, colors, style, pages };
|
||||
};
|
||||
|
||||
export const actions: Actions = {
|
||||
|
|
|
|||
|
|
@ -3,14 +3,19 @@
|
|||
import { enhance } from '$app/forms';
|
||||
import { fly, slide } from 'svelte/transition';
|
||||
import ImagePicker from '$lib/admin/editors/ImagePicker.svelte';
|
||||
import SegmentedControl from '$lib/admin/editors/SegmentedControl.svelte';
|
||||
import { PRIVACY_PAGE_SLUG } from '$lib/admin/privacyTemplate';
|
||||
import { shopLinks } from '$lib/types';
|
||||
import { defaultStyle, shopLinks } from '$lib/types';
|
||||
import { SITE_FONTS, readableTextOn, siteStyleVars } from '$shared/theme';
|
||||
import type { SubmitFunction } from '@sveltejs/kit';
|
||||
|
||||
let { data, form } = $props();
|
||||
let header = $state(structuredClone(data.header.data));
|
||||
let footer = $state(structuredClone(data.footer.data));
|
||||
let colors = $state(structuredClone(data.colors.data));
|
||||
let style = $state({ ...defaultStyle, ...data.style.data });
|
||||
// The sample below the style settings: the variables the public site gets, as an inline style.
|
||||
let styleSample = $derived(Object.entries(siteStyleVars(style)).map(([name, value]) => `${name}:${value}`).join(';'));
|
||||
let saving = $state('');
|
||||
// Older records may predate the CTA button and the basket page; the inputs below need values.
|
||||
header.ctaButton ??= { label: '', href: '' };
|
||||
|
|
@ -116,7 +121,7 @@
|
|||
|
||||
<div class="mb-6">
|
||||
<h1 class="text-3xl font-bold">Site design</h1>
|
||||
<p class="text-base-content/60">The header, footer and colors shared by every page of the site.</p>
|
||||
<p class="text-base-content/60">The header, footer, colors and style shared by every page of the site.</p>
|
||||
</div>
|
||||
|
||||
<div class="grid gap-6 xl:grid-cols-3">
|
||||
|
|
@ -218,4 +223,53 @@
|
|||
{/each}
|
||||
{@render saveButton('colors', 'Save colors')}
|
||||
</form>
|
||||
|
||||
<form class="flex flex-col rounded-box bg-base-100 p-5 shadow" method="POST" action="?/save" use:enhance={submit}>
|
||||
<input type="hidden" name="id" value={data.style.id} />
|
||||
<input type="hidden" name="section" value="style" />
|
||||
<input type="hidden" name="data" value={JSON.stringify(style)} />
|
||||
<h2 class="mb-4 text-2xl font-bold">Style</h2>
|
||||
<p class="mb-2 text-sm text-base-content/60">Fonts and shapes for the public site. The fonts come with the site, so visitors' browsers don't contact Google for them.</p>
|
||||
{#snippet fontSelect(label: string, key: 'headingFont' | 'bodyFont')}
|
||||
<label class="fieldset py-1">
|
||||
<span class="fieldset-legend pb-0">{label}</span>
|
||||
<select class="select w-full" bind:value={style[key]}>
|
||||
<optgroup label="Serif">
|
||||
{#each SITE_FONTS.filter((font) => font.serif) as font (font.id)}
|
||||
<option value={font.id} style="font-family: '{font.family}'">{font.label}</option>
|
||||
{/each}
|
||||
</optgroup>
|
||||
<optgroup label="Sans-serif">
|
||||
{#each SITE_FONTS.filter((font) => !font.serif) as font (font.id)}
|
||||
<option value={font.id} style="font-family: '{font.family}'">{font.label}</option>
|
||||
{/each}
|
||||
</optgroup>
|
||||
</select>
|
||||
</label>
|
||||
{/snippet}
|
||||
{@render fontSelect('Headings', 'headingFont')}
|
||||
{@render fontSelect('Body text', 'bodyFont')}
|
||||
<div class="mt-3 space-y-2">
|
||||
<SegmentedControl label="Corners" options={['sharp', 'soft', 'round']} value={style.corners} onChange={(v) => (style.corners = v as typeof style.corners)} />
|
||||
<SegmentedControl label="Text size" options={['small', 'normal', 'large']} value={style.textSize} onChange={(v) => (style.textSize = v as typeof style.textSize)} />
|
||||
<SegmentedControl label="Shadows" options={['none', 'soft', 'strong']} value={style.shadows} onChange={(v) => (style.shadows = v as typeof style.shadows)} />
|
||||
<SegmentedControl label="Page width" options={['narrow', 'normal', 'wide']} value={style.width} onChange={(v) => (style.width = v as typeof style.width)} />
|
||||
</div>
|
||||
<p class="mt-1 text-sm text-base-content/60">Page width is how wide text and sections may get on a big screen; phones are unaffected.</p>
|
||||
|
||||
<!-- How the choices look. Inline styles, because the radius and shadow tokens in app.css
|
||||
are worked out once for the whole page and can't follow variables set on this box. -->
|
||||
<div
|
||||
class="mt-4 border border-base-300 p-4"
|
||||
style="{styleSample}; background: {colors.background}; color: {colors.text}; font-family: var(--site-font-body); font-size: var(--site-text-size); border-radius: calc(1rem * var(--site-corners))"
|
||||
aria-label="Style sample"
|
||||
>
|
||||
<p class="text-2xl font-semibold" style="font-family: var(--site-font-heading); color: {colors.heading}">A calm space for you</p>
|
||||
<div class="mt-3 bg-white p-3" style="border-radius: calc(1rem * var(--site-corners)); box-shadow: 0 1px 3px 0 rgb(0 0 0 / calc(0.1 * var(--site-shadow))), 0 1px 2px -1px rgb(0 0 0 / calc(0.1 * var(--site-shadow)))">
|
||||
<p>Body text looks like this. Sessions last an hour.</p>
|
||||
<span class="mt-3 inline-block px-5 py-2 text-sm font-medium" style="border-radius: var(--site-button-radius); background: {colors.primary}; color: {readableTextOn(colors.primary)}">Book</span>
|
||||
</div>
|
||||
</div>
|
||||
{@render saveButton('style', 'Save style')}
|
||||
</form>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -22,8 +22,8 @@
|
|||
|
||||
<svelte:head>
|
||||
<title>Preview</title>
|
||||
<!-- Full site colours so the draft looks like the public site. -->
|
||||
{@html rootStyleTag(siteThemeVars(data.colors))}
|
||||
<!-- Full site colours and style so the draft looks like the public site. -->
|
||||
{@html rootStyleTag(siteThemeVars(data.colors, data.style))}
|
||||
</svelte:head>
|
||||
|
||||
{#if blocks.length}
|
||||
|
|
|
|||
159
app-public/package-lock.json
generated
159
app-public/package-lock.json
generated
|
|
@ -17,8 +17,21 @@
|
|||
"tailwindcss": "^4.3.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@fontsource/dm-sans": "^5.3.0",
|
||||
"@fontsource/playfair-display": "^5.3.0",
|
||||
"@fontsource-variable/cormorant-garamond": "^5.3.0",
|
||||
"@fontsource-variable/dm-sans": "^5.3.0",
|
||||
"@fontsource-variable/eb-garamond": "^5.3.0",
|
||||
"@fontsource-variable/fraunces": "^5.3.0",
|
||||
"@fontsource-variable/inter": "^5.3.0",
|
||||
"@fontsource-variable/josefin-sans": "^5.3.0",
|
||||
"@fontsource-variable/libre-baskerville": "^5.3.0",
|
||||
"@fontsource-variable/lora": "^5.3.0",
|
||||
"@fontsource-variable/manrope": "^5.3.0",
|
||||
"@fontsource-variable/montserrat": "^5.3.0",
|
||||
"@fontsource-variable/nunito": "^5.3.0",
|
||||
"@fontsource-variable/outfit": "^5.3.0",
|
||||
"@fontsource-variable/playfair-display": "^5.3.0",
|
||||
"@fontsource-variable/raleway": "^5.3.0",
|
||||
"@fontsource-variable/work-sans": "^5.3.0",
|
||||
"@sveltejs/kit": "^2.57.0",
|
||||
"@sveltejs/vite-plugin-svelte": "^7.0.0",
|
||||
"@types/node": "^25.8.0",
|
||||
|
|
@ -29,20 +42,150 @@
|
|||
"vite": "^8.0.7"
|
||||
}
|
||||
},
|
||||
"node_modules/@fontsource/dm-sans": {
|
||||
"node_modules/@fontsource-variable/cormorant-garamond": {
|
||||
"version": "5.3.0",
|
||||
"resolved": "https://registry.npmjs.org/@fontsource/dm-sans/-/dm-sans-5.3.0.tgz",
|
||||
"integrity": "sha512-lYJtMXXO28q1z+yz+z8XKd0s4hXaa9QdkETzkyD760sidCv5heI86weYA0sx0Nc4pAMAQTUuyf4gO44cYKKS9g==",
|
||||
"resolved": "https://registry.npmjs.org/@fontsource-variable/cormorant-garamond/-/cormorant-garamond-5.3.0.tgz",
|
||||
"integrity": "sha512-rgZJ/5w3hi60swAPnrOXpZf5wEH6NTrvm4H8D9Y4b1QIFUqlX14eM3QTMU/eAznjfh0eXpO1QUqsFhiy58aoMg==",
|
||||
"dev": true,
|
||||
"license": "OFL-1.1",
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ayuhito"
|
||||
}
|
||||
},
|
||||
"node_modules/@fontsource/playfair-display": {
|
||||
"node_modules/@fontsource-variable/dm-sans": {
|
||||
"version": "5.3.0",
|
||||
"resolved": "https://registry.npmjs.org/@fontsource/playfair-display/-/playfair-display-5.3.0.tgz",
|
||||
"integrity": "sha512-uJSABalvdWc10fEPppQjQocamT21LEyRfzzWfRfqbkPz+sRv+kKpYDKyluBUskvJREkJTos9epj1WjQROGu99Q==",
|
||||
"resolved": "https://registry.npmjs.org/@fontsource-variable/dm-sans/-/dm-sans-5.3.0.tgz",
|
||||
"integrity": "sha512-BpUG5bqePiDFMBM4ZtLSlPdAIOM990uB1dlXzIf4aw21yQR7BmykedLXXXMqGWsR18aMLOsbWccwJNh3ztTQaA==",
|
||||
"dev": true,
|
||||
"license": "OFL-1.1",
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ayuhito"
|
||||
}
|
||||
},
|
||||
"node_modules/@fontsource-variable/eb-garamond": {
|
||||
"version": "5.3.0",
|
||||
"resolved": "https://registry.npmjs.org/@fontsource-variable/eb-garamond/-/eb-garamond-5.3.0.tgz",
|
||||
"integrity": "sha512-656OJsA9Vv24yhqRZFEzXnzS2AYgKdEILLgHJYLzzXndgcWFKfSXFqzbRI5/6Yk1Yt7UfWrUeppE5nRQPQMwlQ==",
|
||||
"dev": true,
|
||||
"license": "OFL-1.1",
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ayuhito"
|
||||
}
|
||||
},
|
||||
"node_modules/@fontsource-variable/fraunces": {
|
||||
"version": "5.3.0",
|
||||
"resolved": "https://registry.npmjs.org/@fontsource-variable/fraunces/-/fraunces-5.3.0.tgz",
|
||||
"integrity": "sha512-9BYGySn4AHEJdgp9Z28tQ3X+laJMEOITXkQarZXeloWQZDq5oOvXJ3kDA8c7MGIfpogIaZfjrQBqmda8POOCKA==",
|
||||
"dev": true,
|
||||
"license": "OFL-1.1",
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ayuhito"
|
||||
}
|
||||
},
|
||||
"node_modules/@fontsource-variable/inter": {
|
||||
"version": "5.3.0",
|
||||
"resolved": "https://registry.npmjs.org/@fontsource-variable/inter/-/inter-5.3.0.tgz",
|
||||
"integrity": "sha512-OupL48va4JNofb97w6NYeF9S7W/kHNKM0Er8Dem5nqi4jeOLrVJDoE8tZEpnMJmtkvNbB1EIPPwHcdkF6b1oUA==",
|
||||
"dev": true,
|
||||
"license": "OFL-1.1",
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ayuhito"
|
||||
}
|
||||
},
|
||||
"node_modules/@fontsource-variable/josefin-sans": {
|
||||
"version": "5.3.0",
|
||||
"resolved": "https://registry.npmjs.org/@fontsource-variable/josefin-sans/-/josefin-sans-5.3.0.tgz",
|
||||
"integrity": "sha512-duVgkuzE/co4iuIfJ7jM2qX0ED3b6qdY+SlSjNMs6zfhz7EE7kJxV0qF65hQCv1kN0A20j4FwsGAYJvfpU+iSg==",
|
||||
"dev": true,
|
||||
"license": "OFL-1.1",
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ayuhito"
|
||||
}
|
||||
},
|
||||
"node_modules/@fontsource-variable/libre-baskerville": {
|
||||
"version": "5.3.0",
|
||||
"resolved": "https://registry.npmjs.org/@fontsource-variable/libre-baskerville/-/libre-baskerville-5.3.0.tgz",
|
||||
"integrity": "sha512-lIjXwDhcdr0OxSdzlAU4G7Tnny1LhgAiPFdp3/PjwRMqYt2JLU6pQiLwz/M5lRBs/kRtHwxknPUqRt37AnqPFg==",
|
||||
"dev": true,
|
||||
"license": "OFL-1.1",
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ayuhito"
|
||||
}
|
||||
},
|
||||
"node_modules/@fontsource-variable/lora": {
|
||||
"version": "5.3.0",
|
||||
"resolved": "https://registry.npmjs.org/@fontsource-variable/lora/-/lora-5.3.0.tgz",
|
||||
"integrity": "sha512-2ph8KiZ8Bn141hWuC3ErtpJ+Ui8p2MJQn8TJNRSRmLmnCIOCtHfiBM9R7WLRPeUG/q6hXyHOxWQ8DvRSX+ixvQ==",
|
||||
"dev": true,
|
||||
"license": "OFL-1.1",
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ayuhito"
|
||||
}
|
||||
},
|
||||
"node_modules/@fontsource-variable/manrope": {
|
||||
"version": "5.3.0",
|
||||
"resolved": "https://registry.npmjs.org/@fontsource-variable/manrope/-/manrope-5.3.0.tgz",
|
||||
"integrity": "sha512-6D5dgokHsWDDMtmXHznKa0hK229NN+1a4BLPmUCLqcO1Pw5EEhWY5RFt0AcXnVRAljFFPfRtLkJePQj6LSsV6g==",
|
||||
"dev": true,
|
||||
"license": "OFL-1.1",
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ayuhito"
|
||||
}
|
||||
},
|
||||
"node_modules/@fontsource-variable/montserrat": {
|
||||
"version": "5.3.0",
|
||||
"resolved": "https://registry.npmjs.org/@fontsource-variable/montserrat/-/montserrat-5.3.0.tgz",
|
||||
"integrity": "sha512-7PaZoxaxrWLAyrhO46v65An9LhUhfkTExWLhfbywYZCnZEgg/W1rEHnlNmZKjNZ3nJTVYyicqxlJt10z/26yTA==",
|
||||
"dev": true,
|
||||
"license": "OFL-1.1",
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ayuhito"
|
||||
}
|
||||
},
|
||||
"node_modules/@fontsource-variable/nunito": {
|
||||
"version": "5.3.0",
|
||||
"resolved": "https://registry.npmjs.org/@fontsource-variable/nunito/-/nunito-5.3.0.tgz",
|
||||
"integrity": "sha512-tw0ch7evIDSwoeUy+0XzocYHfbRWLeCRPJy22KgbrLjDLAbNw/fErBiil10Ssrs3Sjr55zaZrr36a975j8cBkQ==",
|
||||
"dev": true,
|
||||
"license": "OFL-1.1",
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ayuhito"
|
||||
}
|
||||
},
|
||||
"node_modules/@fontsource-variable/outfit": {
|
||||
"version": "5.3.0",
|
||||
"resolved": "https://registry.npmjs.org/@fontsource-variable/outfit/-/outfit-5.3.0.tgz",
|
||||
"integrity": "sha512-fPb5XnYK0k7SbR++HEmm4+ZqDszmLKQ+sPRUr8oQ/KNC0vy6r6hazJFe8iYozv4cqlHbvJ/JECkJWrfDodUMVQ==",
|
||||
"dev": true,
|
||||
"license": "OFL-1.1",
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ayuhito"
|
||||
}
|
||||
},
|
||||
"node_modules/@fontsource-variable/playfair-display": {
|
||||
"version": "5.3.0",
|
||||
"resolved": "https://registry.npmjs.org/@fontsource-variable/playfair-display/-/playfair-display-5.3.0.tgz",
|
||||
"integrity": "sha512-IHdzTvE8eGIXHteZql7KXoqdc3Gfm+Zs1u4XlSC3MeplkwviT3sx/P6gI0tLwg/xIYLF4ZJYveZ5V+bl9cnDwA==",
|
||||
"dev": true,
|
||||
"license": "OFL-1.1",
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ayuhito"
|
||||
}
|
||||
},
|
||||
"node_modules/@fontsource-variable/raleway": {
|
||||
"version": "5.3.0",
|
||||
"resolved": "https://registry.npmjs.org/@fontsource-variable/raleway/-/raleway-5.3.0.tgz",
|
||||
"integrity": "sha512-aSV2k+V6Zz+od0dHpBOzkVxEzmgEdiXcxDfant39jLOx+T89dielQRrZylukwK3Fp+FY255gPqz67ruOfs1rqA==",
|
||||
"dev": true,
|
||||
"license": "OFL-1.1",
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ayuhito"
|
||||
}
|
||||
},
|
||||
"node_modules/@fontsource-variable/work-sans": {
|
||||
"version": "5.3.0",
|
||||
"resolved": "https://registry.npmjs.org/@fontsource-variable/work-sans/-/work-sans-5.3.0.tgz",
|
||||
"integrity": "sha512-le8h/OIIuhm5Z7TdvuMw0yKg2gaCZUiMec8zaumsVVjzeJRBPEF0bQI/MkaZDHCVzZDvZoP/O2LiGOSfDLSbaw==",
|
||||
"dev": true,
|
||||
"license": "OFL-1.1",
|
||||
"funding": {
|
||||
|
|
|
|||
|
|
@ -10,8 +10,21 @@
|
|||
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@fontsource/dm-sans": "^5.3.0",
|
||||
"@fontsource/playfair-display": "^5.3.0",
|
||||
"@fontsource-variable/cormorant-garamond": "^5.3.0",
|
||||
"@fontsource-variable/dm-sans": "^5.3.0",
|
||||
"@fontsource-variable/eb-garamond": "^5.3.0",
|
||||
"@fontsource-variable/fraunces": "^5.3.0",
|
||||
"@fontsource-variable/inter": "^5.3.0",
|
||||
"@fontsource-variable/josefin-sans": "^5.3.0",
|
||||
"@fontsource-variable/libre-baskerville": "^5.3.0",
|
||||
"@fontsource-variable/lora": "^5.3.0",
|
||||
"@fontsource-variable/manrope": "^5.3.0",
|
||||
"@fontsource-variable/montserrat": "^5.3.0",
|
||||
"@fontsource-variable/nunito": "^5.3.0",
|
||||
"@fontsource-variable/outfit": "^5.3.0",
|
||||
"@fontsource-variable/playfair-display": "^5.3.0",
|
||||
"@fontsource-variable/raleway": "^5.3.0",
|
||||
"@fontsource-variable/work-sans": "^5.3.0",
|
||||
"@sveltejs/kit": "^2.57.0",
|
||||
"@sveltejs/vite-plugin-svelte": "^7.0.0",
|
||||
"@types/node": "^25.8.0",
|
||||
|
|
|
|||
|
|
@ -3,9 +3,28 @@
|
|||
themes: light --default;
|
||||
}
|
||||
|
||||
/* Site design → Style sets the --site-* variables (siteStyleVars in
|
||||
$shared/theme) on the public site and the admin preview; without them
|
||||
(the admin's own pages) every token below is its usual value. Corners,
|
||||
shadows and widths are scaled here, so blocks just use rounded-xl,
|
||||
shadow-sm, max-w-6xl… Buttons and chips use rounded-button (a pill when
|
||||
Round); dots and avatars stay rounded-full. */
|
||||
@theme {
|
||||
--font-sans: 'DM Sans', ui-sans-serif, system-ui, sans-serif;
|
||||
--font-serif: 'Playfair Display', Georgia, serif;
|
||||
--font-sans: var(--site-font-body, 'DM Sans Variable', ui-sans-serif, system-ui, sans-serif);
|
||||
--font-serif: var(--site-font-heading, 'Playfair Display Variable', Georgia, serif);
|
||||
--radius-lg: calc(0.5rem * var(--site-corners, 1));
|
||||
--radius-xl: calc(0.75rem * var(--site-corners, 1));
|
||||
--radius-2xl: calc(1rem * var(--site-corners, 1));
|
||||
--radius-card: calc(1.25rem * var(--site-corners, 1));
|
||||
--radius-panel: calc(2rem * var(--site-corners, 1));
|
||||
--radius-button: var(--site-button-radius, 9999px);
|
||||
--shadow-sm: 0 1px 3px 0 rgb(0 0 0 / calc(0.1 * var(--site-shadow, 1))), 0 1px 2px -1px rgb(0 0 0 / calc(0.1 * var(--site-shadow, 1)));
|
||||
--shadow-md: 0 4px 6px -1px rgb(0 0 0 / calc(0.1 * var(--site-shadow, 1))), 0 2px 4px -2px rgb(0 0 0 / calc(0.1 * var(--site-shadow, 1)));
|
||||
--shadow-lg: 0 10px 15px -3px rgb(0 0 0 / calc(0.1 * var(--site-shadow, 1))), 0 4px 6px -4px rgb(0 0 0 / calc(0.1 * var(--site-shadow, 1)));
|
||||
--shadow-xl: 0 20px 25px -5px rgb(0 0 0 / calc(0.1 * var(--site-shadow, 1))), 0 8px 10px -6px rgb(0 0 0 / calc(0.1 * var(--site-shadow, 1)));
|
||||
--container-3xl: calc(48rem * var(--site-width, 1));
|
||||
--container-6xl: calc(72rem * var(--site-width, 1));
|
||||
--container-7xl: calc(80rem * var(--site-width, 1));
|
||||
--color-warm: var(--color-bg, #faf8f5);
|
||||
--color-charcoal: var(--color-heading, #2c2c2c);
|
||||
--color-sage: var(--color-primary, #8a9a7b);
|
||||
|
|
@ -44,7 +63,9 @@
|
|||
--fg-body: var(--color-text, #2c2c2c);
|
||||
background: var(--color-bg, #faf8f5);
|
||||
color: var(--fg-body);
|
||||
font-family: 'DM Sans', ui-sans-serif, system-ui, sans-serif;
|
||||
font-family: var(--font-sans);
|
||||
/* Site design → Style → Text size; rem-sized spacing grows with it. */
|
||||
font-size: var(--site-text-size, 100%);
|
||||
}
|
||||
|
||||
/* ── Foreground colour utilities (set per-block via BackgroundWrapper) ── */
|
||||
|
|
@ -74,7 +95,7 @@ h1,
|
|||
h2,
|
||||
h3,
|
||||
h4 {
|
||||
font-family: 'Playfair Display', Georgia, serif;
|
||||
font-family: var(--font-serif);
|
||||
color: var(--fg-heading, #2c2c2c);
|
||||
}
|
||||
|
||||
|
|
@ -114,7 +135,7 @@ h4 {
|
|||
margin: 0.75rem 0;
|
||||
padding-left: 1.25rem;
|
||||
border-left: 3px solid var(--color-primary, #8a9a7b);
|
||||
font-family: 'Playfair Display', Georgia, serif;
|
||||
font-family: var(--font-serif);
|
||||
font-size: 1.35rem;
|
||||
font-style: italic;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@
|
|||
<div class="flex shrink-0 items-center gap-2 md:gap-3">
|
||||
{#if hasItems}
|
||||
<a
|
||||
class="relative flex items-center gap-2 rounded-full border border-charcoal/10 px-3 py-2 text-sm font-semibold text-charcoal/80 transition hover:border-sage hover:text-sage-dark md:px-4"
|
||||
class="relative flex items-center gap-2 rounded-button border border-charcoal/10 px-3 py-2 text-sm font-semibold text-charcoal/80 transition hover:border-sage hover:text-sage-dark md:px-4"
|
||||
href={links.basket}
|
||||
aria-label="View your basket ({basket.count})"
|
||||
>
|
||||
|
|
@ -74,10 +74,10 @@
|
|||
</a>
|
||||
{/if}
|
||||
{#if header.ctaButton?.label}
|
||||
<a class="cta btn hidden rounded-full border-0 px-6 hover:opacity-90 md:inline-flex" href={links.booking}>{header.ctaButton.label}</a>
|
||||
<a class="cta btn hidden rounded-button border-0 px-6 hover:opacity-90 md:inline-flex" href={links.booking}>{header.ctaButton.label}</a>
|
||||
{/if}
|
||||
<button
|
||||
class="grid h-10 w-10 place-items-center rounded-full text-charcoal/80 transition hover:bg-charcoal/5 md:hidden"
|
||||
class="grid h-10 w-10 place-items-center rounded-button text-charcoal/80 transition hover:bg-charcoal/5 md:hidden"
|
||||
type="button"
|
||||
aria-label="Open menu"
|
||||
aria-haspopup="dialog"
|
||||
|
|
@ -98,7 +98,7 @@
|
|||
<div class="flex h-full flex-col">
|
||||
<div class="flex items-center justify-between border-b border-charcoal/10 px-6 py-4">
|
||||
<span class="font-serif text-xl font-bold text-charcoal">Menu</span>
|
||||
<button class="grid h-10 w-10 place-items-center rounded-full text-charcoal/80 transition hover:bg-charcoal/5" type="button" aria-label="Close menu" onclick={closeMenu}>
|
||||
<button class="grid h-10 w-10 place-items-center rounded-button text-charcoal/80 transition hover:bg-charcoal/5" type="button" aria-label="Close menu" onclick={closeMenu}>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="1.8" aria-hidden="true">
|
||||
<path stroke-linecap="round" d="M6 6l12 12M18 6L6 18" />
|
||||
</svg>
|
||||
|
|
@ -129,7 +129,7 @@
|
|||
|
||||
{#if header.ctaButton?.label}
|
||||
<div class="border-t border-charcoal/10 p-6">
|
||||
<a class="cta btn btn-block rounded-full border-0 hover:opacity-90" href={links.booking}>{header.ctaButton.label}</a>
|
||||
<a class="cta btn btn-block rounded-button border-0 hover:opacity-90" href={links.booking}>{header.ctaButton.label}</a>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
|
|
|
|||
19
app-public/src/lib/fonts.ts
Normal file
19
app-public/src/lib/fonts.ts
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
// The fonts Site design → Style offers (SITE_FONTS in $shared/theme), bundled
|
||||
// and served by this app, not loaded from Google: a Google Fonts request sends
|
||||
// every visitor's IP address to Google (GDPR). Each import only declares the
|
||||
// font; a browser downloads the files of the fonts a page actually uses.
|
||||
import '@fontsource-variable/playfair-display';
|
||||
import '@fontsource-variable/cormorant-garamond';
|
||||
import '@fontsource-variable/eb-garamond';
|
||||
import '@fontsource-variable/libre-baskerville';
|
||||
import '@fontsource-variable/lora';
|
||||
import '@fontsource-variable/fraunces';
|
||||
import '@fontsource-variable/dm-sans';
|
||||
import '@fontsource-variable/inter';
|
||||
import '@fontsource-variable/manrope';
|
||||
import '@fontsource-variable/montserrat';
|
||||
import '@fontsource-variable/nunito';
|
||||
import '@fontsource-variable/outfit';
|
||||
import '@fontsource-variable/raleway';
|
||||
import '@fontsource-variable/work-sans';
|
||||
import '@fontsource-variable/josefin-sans';
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
import { defaultColors, defaultFooter, defaultHeader } from '$lib/types';
|
||||
import { defaultColors, defaultFooter, defaultHeader, defaultStyle } from '$lib/types';
|
||||
import type { ItemRecord } from '$lib/types';
|
||||
import { BASKET_COOKIE, getBasket } from '$lib/server/shop';
|
||||
import { loadShopData } from '$shared/server/shop';
|
||||
|
|
@ -21,10 +21,11 @@ export const load: LayoutServerLoad = async ({ locals, cookies, url }) => {
|
|||
// Shop blocks fetch bookable times themselves (GET /api/slots).
|
||||
void url.pathname;
|
||||
|
||||
const [header, footer, colors] = await Promise.all([
|
||||
const [header, footer, colors, style] = await Promise.all([
|
||||
getGlobal(locals.pb, 'header', defaultHeader),
|
||||
getGlobal(locals.pb, 'footer', defaultFooter),
|
||||
getGlobal(locals.pb, 'colors', defaultColors)
|
||||
getGlobal(locals.pb, 'colors', defaultColors),
|
||||
getGlobal(locals.pb, 'style', defaultStyle)
|
||||
]);
|
||||
|
||||
if (!header.homePage) header.homePage = defaultHeader.homePage;
|
||||
|
|
@ -47,5 +48,5 @@ export const load: LayoutServerLoad = async ({ locals, cookies, url }) => {
|
|||
// Prices are shown in the currency Stripe charges in.
|
||||
const currency = shopCurrency(env.STRIPE_CURRENCY);
|
||||
|
||||
return { header, footer, colors, user: locals.user, basket, items, timezone, currency };
|
||||
return { header, footer, colors, style, user: locals.user, basket, items, timezone, currency };
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,13 +1,6 @@
|
|||
<script lang="ts">
|
||||
import '../app.css';
|
||||
// Fonts are bundled and served by this app, not loaded from Google: a
|
||||
// Google Fonts request sends every visitor's IP address to Google (GDPR).
|
||||
import '@fontsource/dm-sans/400.css';
|
||||
import '@fontsource/dm-sans/500.css';
|
||||
import '@fontsource/dm-sans/600.css';
|
||||
import '@fontsource/dm-sans/700.css';
|
||||
import '@fontsource/playfair-display/600.css';
|
||||
import '@fontsource/playfair-display/700.css';
|
||||
import '$lib/fonts';
|
||||
import favicon from '$lib/assets/favicon.svg';
|
||||
import Header from '$lib/components/Header.svelte';
|
||||
import Footer from '$lib/components/Footer.svelte';
|
||||
|
|
@ -35,9 +28,9 @@
|
|||
<!-- Home-screen icon on phones; iOS ignores SVG, so only for an uploaded logo. -->
|
||||
{#if icon !== favicon}<link rel="apple-touch-icon" href={icon} />{/if}
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<!-- Site colours, rendered server-side (previously applied in onMount, which
|
||||
<!-- Site colours and style, rendered server-side (previously applied in onMount, which
|
||||
flashed the defaults on every page load). Values are sanitised. -->
|
||||
{@html rootStyleTag(siteThemeVars(data.colors))}
|
||||
{@html rootStyleTag(siteThemeVars(data.colors, data.style))}
|
||||
</svelte:head>
|
||||
|
||||
<Header header={data.header} />
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
Your booking is confirmed. A receipt was sent to <strong>{data.order.email}</strong>.
|
||||
</p>
|
||||
|
||||
<div class="mt-8 rounded-box border border-charcoal/10 bg-white/60 p-6 text-left">
|
||||
<div class="mt-8 rounded-2xl border border-charcoal/10 bg-white/60 p-6 text-left">
|
||||
<h2 class="font-serif text-xl">Your order</h2>
|
||||
<ul class="mt-4 space-y-3">
|
||||
{#each data.order.lines ?? [] as line}
|
||||
|
|
@ -50,7 +50,7 @@
|
|||
|
||||
{#if data.order.passes?.length}
|
||||
<!-- Bundles bought: their codes (also in the confirmation email). -->
|
||||
<div class="mt-6 rounded-box border border-sage/40 bg-sage/10 p-6 text-left">
|
||||
<div class="mt-6 rounded-2xl border border-sage/40 bg-sage/10 p-6 text-left">
|
||||
<h2 class="font-serif text-xl">Your {data.order.passes.length === 1 ? 'code' : 'codes'}</h2>
|
||||
<p class="mt-1 text-sm text-charcoal/70">Enter a code in the basket when you book — the sessions it includes are then already paid for.</p>
|
||||
{#each data.order.passes as pass (pass.id)}
|
||||
|
|
@ -70,7 +70,7 @@
|
|||
</div>
|
||||
{/if}
|
||||
|
||||
<a class="btn mt-8 rounded-full border-0 px-8 text-primary-content" style="background-color: var(--color-primary, #8a9a7b);" href={links.booking}>Book another</a>
|
||||
<a class="btn mt-8 rounded-button border-0 px-8 text-primary-content" style="background-color: var(--color-primary, #8a9a7b);" href={links.booking}>Book another</a>
|
||||
{:else if data.state === 'processing'}
|
||||
<h1 class="font-serif text-4xl">Processing your payment…</h1>
|
||||
<p class="mt-3 text-charcoal/70">
|
||||
|
|
@ -82,10 +82,10 @@
|
|||
{:else if data.state === 'canceled' || data.state === 'failed'}
|
||||
<h1 class="font-serif text-4xl">Payment not completed</h1>
|
||||
<p class="mt-3 text-charcoal/70">Your payment didn't go through — no money was captured. Please try again.</p>
|
||||
<a class="btn mt-8 rounded-full border-0 px-8 text-primary-content" style="background-color: var(--color-primary, #8a9a7b);" href={links.basket}>Back to your basket</a>
|
||||
<a class="btn mt-8 rounded-button border-0 px-8 text-primary-content" style="background-color: var(--color-primary, #8a9a7b);" href={links.basket}>Back to your basket</a>
|
||||
{:else}
|
||||
<h1 class="font-serif text-4xl">Nothing to see here</h1>
|
||||
<p class="mt-3 text-charcoal/70">This link is missing a payment reference.</p>
|
||||
<a class="btn mt-8 rounded-full border-0 px-8 text-primary-content" style="background-color: var(--color-primary, #8a9a7b);" href={links.booking}>Back to the shop</a>
|
||||
<a class="btn mt-8 rounded-button border-0 px-8 text-primary-content" style="background-color: var(--color-primary, #8a9a7b);" href={links.booking}>Back to the shop</a>
|
||||
{/if}
|
||||
</section>
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
<div class="flex {alignmentClasses[data.alignment] || 'justify-center'}">
|
||||
<a
|
||||
href={data.href || '#'}
|
||||
class="btn {variantClasses[data.variant] || 'btn-primary'} {sizeClasses[data.size] || ''}"
|
||||
class="btn rounded-button {variantClasses[data.variant] || 'btn-primary'} {sizeClasses[data.size] || ''}"
|
||||
style={data.color ? `background-color: ${data.color}; border-color: ${data.color};` : ''}
|
||||
>
|
||||
{data.label || 'Button'}
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
<div class="mt-6 grid gap-6 grid-cols-[repeat(auto-fit,minmax(200px,1fr))]">
|
||||
{#each data.items || [] as card, i (i)}
|
||||
<!-- Cards are white whatever the block's colours, so they use the site's own text colour. -->
|
||||
<div class="relative overflow-hidden rounded-[1.25rem] bg-white text-[color-mix(in_srgb,var(--color-text,#2c2c2c)_85%,transparent)] shadow-[0_1px_6px_rgba(0,0,0,0.08)] transition-shadow {card.href ? 'hover:shadow-lg' : ''}">
|
||||
<div class="relative overflow-hidden rounded-card bg-white text-[color-mix(in_srgb,var(--color-text,#2c2c2c)_85%,transparent)] shadow-sm transition-shadow {card.href ? 'hover:shadow-lg' : ''}">
|
||||
{#if !numbered && card.imageUrl}
|
||||
<img class="block aspect-[4/3] w-full object-cover" src={card.imageUrl} alt={card.imageAlt || ''} />
|
||||
{/if}
|
||||
|
|
|
|||
|
|
@ -358,7 +358,7 @@
|
|||
{#if shopAbove}
|
||||
<p class="mt-2 text-sm text-fg-body/70">Pick a service or product above.</p>
|
||||
{:else}
|
||||
<a class="mt-6 inline-flex rounded-full bg-sage px-6 py-2.5 text-sm font-medium text-primary-content transition hover:bg-sage-dark" href={bookingHref}>Book a session</a>
|
||||
<a class="mt-6 inline-flex rounded-button bg-sage px-6 py-2.5 text-sm font-medium text-primary-content transition hover:bg-sage-dark" href={bookingHref}>Book a session</a>
|
||||
{/if}
|
||||
</div>
|
||||
{:else}
|
||||
|
|
@ -380,7 +380,7 @@
|
|||
{#if ending && payState !== 'confirming'}
|
||||
<button
|
||||
type="button"
|
||||
class="rounded-full border border-charcoal/20 bg-white px-4 py-1.5 font-medium transition hover:bg-charcoal/5 disabled:opacity-60"
|
||||
class="rounded-button border border-charcoal/20 bg-white px-4 py-1.5 font-medium transition hover:bg-charcoal/5 disabled:opacity-60"
|
||||
disabled={renewing}
|
||||
onclick={renewHolds}
|
||||
>
|
||||
|
|
@ -460,7 +460,7 @@
|
|||
<div class="flex items-center gap-2">
|
||||
<button
|
||||
type="button"
|
||||
class="flex h-8 w-8 items-center justify-center rounded-full border border-charcoal/15 text-lg leading-none disabled:opacity-40"
|
||||
class="flex h-8 w-8 items-center justify-center rounded-button border border-charcoal/15 text-lg leading-none disabled:opacity-40"
|
||||
disabled={pending || line.quantity <= 1}
|
||||
aria-label="Decrease quantity"
|
||||
onclick={() => changeQuantity(line.id, line.quantity, -1)}
|
||||
|
|
@ -470,7 +470,7 @@
|
|||
<span class="w-6 text-center">{line.quantity}</span>
|
||||
<button
|
||||
type="button"
|
||||
class="flex h-8 w-8 items-center justify-center rounded-full border border-charcoal/15 text-lg leading-none disabled:opacity-40"
|
||||
class="flex h-8 w-8 items-center justify-center rounded-button border border-charcoal/15 text-lg leading-none disabled:opacity-40"
|
||||
disabled={pending}
|
||||
aria-label="Increase quantity"
|
||||
onclick={() => changeQuantity(line.id, line.quantity, 1)}
|
||||
|
|
@ -486,7 +486,7 @@
|
|||
|
||||
<button
|
||||
type="button"
|
||||
class="flex h-8 w-8 shrink-0 items-center justify-center rounded-full text-charcoal/50 transition-colors hover:bg-terracotta/10 hover:text-terracotta disabled:opacity-40"
|
||||
class="flex h-8 w-8 shrink-0 items-center justify-center rounded-button text-charcoal/50 transition-colors hover:bg-terracotta/10 hover:text-terracotta disabled:opacity-40"
|
||||
disabled={pending}
|
||||
aria-label="Remove {line.itemName ?? 'item'}"
|
||||
onclick={() => removeLine(line.id)}
|
||||
|
|
@ -542,7 +542,7 @@
|
|||
class="w-36 rounded-xl border border-charcoal/15 bg-white px-3 py-2 font-mono tracking-wider uppercase focus:ring-2 focus:ring-sage/50 focus:outline-none"
|
||||
bind:value={codeInput}
|
||||
/>
|
||||
<button type="submit" class="rounded-full border border-charcoal/20 px-4 py-2 text-sm font-medium transition hover:bg-charcoal/5 disabled:opacity-50" disabled={codeBusy || !codeInput.trim()}>
|
||||
<button type="submit" class="rounded-button border border-charcoal/20 px-4 py-2 text-sm font-medium transition hover:bg-charcoal/5 disabled:opacity-50" disabled={codeBusy || !codeInput.trim()}>
|
||||
{codeBusy ? 'Checking…' : 'Apply'}
|
||||
</button>
|
||||
</form>
|
||||
|
|
@ -617,7 +617,7 @@
|
|||
{#if payState === 'idle' || payState === 'creating'}
|
||||
<button
|
||||
type="submit"
|
||||
class="btn w-full rounded-full border-0 text-primary-content"
|
||||
class="btn w-full rounded-button border-0 text-primary-content"
|
||||
style="background-color: var(--color-primary, #8a9a7b);"
|
||||
disabled={payState === 'creating'}
|
||||
>
|
||||
|
|
@ -652,7 +652,7 @@
|
|||
{#if payState === 'ready' || payState === 'confirming'}
|
||||
<button
|
||||
type="button"
|
||||
class="btn mt-4 w-full rounded-full border-0 text-primary-content"
|
||||
class="btn mt-4 w-full rounded-button border-0 text-primary-content"
|
||||
style="background-color: var(--color-primary, #8a9a7b);"
|
||||
disabled={payState === 'confirming'}
|
||||
onclick={confirmPayment}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
<section class="relative flex min-h-[80vh] items-center justify-center overflow-hidden px-6 py-20 md:min-h-[90vh]">
|
||||
<div class="relative z-10 mx-auto max-w-4xl text-center">
|
||||
<h1 class="animate-fade-in text-5xl leading-tight text-fg-heading md:text-7xl lg:text-8xl" style="font-family: 'Playfair Display', Georgia, serif;">
|
||||
<h1 class="animate-fade-in text-5xl leading-tight text-fg-heading md:text-7xl lg:text-8xl">
|
||||
{data.heading || 'Holistic and Experiential Learning about Happiness'}
|
||||
</h1>
|
||||
{#if data.subheading}
|
||||
|
|
@ -24,7 +24,7 @@
|
|||
{/if}
|
||||
{#if data.buttonLabel}
|
||||
<div class="animate-fade-in mt-10" style="animation-delay: 0.3s;">
|
||||
<a class="btn rounded-full border-0 bg-sage px-10 py-3 text-lg text-primary-content shadow-lg transition hover:bg-sage-dark hover:shadow-xl" href={data.buttonUrl || shopLinks(page.data.header).booking}>
|
||||
<a class="btn rounded-button border-0 bg-sage px-10 py-3 text-lg text-primary-content shadow-lg transition hover:bg-sage-dark hover:shadow-xl" href={data.buttonUrl || shopLinks(page.data.header).booking}>
|
||||
{data.buttonLabel}
|
||||
</a>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
<section use:scrollReveal class="reveal mx-auto max-w-6xl px-6 py-14 md:py-20">
|
||||
<div class="grid items-center gap-10 md:grid-cols-2">
|
||||
<div class:md:order-2={data.imagePosition === 'right'} class="overflow-hidden rounded-[2rem] bg-sage/10 shadow-sm">
|
||||
<div class:md:order-2={data.imagePosition === 'right'} class="overflow-hidden rounded-panel bg-sage/10 shadow-sm">
|
||||
{#if data.url}
|
||||
<img class="aspect-[4/5] w-full object-cover" src={data.url} alt={data.alt || ''} />
|
||||
{:else}
|
||||
|
|
|
|||
|
|
@ -353,11 +353,11 @@
|
|||
{#if duration}
|
||||
<span class="text-xs text-charcoal/60">{formatDuration(duration.minutes)}</span>
|
||||
{:else if !isService && item.stock != null && item.stock > 0 && item.stock <= 5}
|
||||
<span class="rounded-full bg-terracotta/15 px-2.5 py-0.5 text-xs font-medium text-terracotta">
|
||||
<span class="rounded-button bg-terracotta/15 px-2.5 py-0.5 text-xs font-medium text-terracotta">
|
||||
Only {item.stock} left
|
||||
</span>
|
||||
{:else if soldOut}
|
||||
<span class="rounded-full bg-terracotta/15 px-2.5 py-0.5 text-xs font-medium text-terracotta">
|
||||
<span class="rounded-button bg-terracotta/15 px-2.5 py-0.5 text-xs font-medium text-terracotta">
|
||||
Sold out
|
||||
</span>
|
||||
{/if}
|
||||
|
|
@ -386,7 +386,7 @@
|
|||
{#if isService}
|
||||
<button
|
||||
type="button"
|
||||
class="inline-flex items-center justify-center gap-2 rounded-full px-6 py-2.5 text-sm font-medium transition {ui?.pickerOpen
|
||||
class="inline-flex items-center justify-center gap-2 rounded-button px-6 py-2.5 text-sm font-medium transition {ui?.pickerOpen
|
||||
? 'border border-charcoal/15 text-charcoal hover:bg-charcoal/5'
|
||||
: bookable
|
||||
? 'bg-sage text-primary-content hover:bg-sage-dark'
|
||||
|
|
@ -400,7 +400,7 @@
|
|||
{:else}
|
||||
<button
|
||||
type="button"
|
||||
class="inline-flex items-center justify-center gap-2 rounded-full bg-sage px-6 py-2.5 text-sm font-medium text-primary-content transition hover:bg-sage-dark disabled:cursor-not-allowed disabled:bg-charcoal/10 disabled:text-charcoal/50"
|
||||
class="inline-flex items-center justify-center gap-2 rounded-button bg-sage px-6 py-2.5 text-sm font-medium text-primary-content transition hover:bg-sage-dark disabled:cursor-not-allowed disabled:bg-charcoal/10 disabled:text-charcoal/50"
|
||||
disabled={soldOut || ui?.adding}
|
||||
onclick={() => addItem(item.id)}
|
||||
>
|
||||
|
|
@ -457,7 +457,7 @@
|
|||
<div class="mb-3 flex items-center justify-between gap-2">
|
||||
<button
|
||||
type="button"
|
||||
class="flex h-8 w-8 items-center justify-center rounded-full border border-charcoal/15 text-lg leading-none text-charcoal transition hover:bg-charcoal/5 disabled:cursor-default disabled:opacity-30"
|
||||
class="flex h-8 w-8 items-center justify-center rounded-button border border-charcoal/15 text-lg leading-none text-charcoal transition hover:bg-charcoal/5 disabled:cursor-default disabled:opacity-30"
|
||||
aria-label="Previous month"
|
||||
disabled={ui.monthOffset <= 0}
|
||||
onclick={() => ui.monthOffset--}
|
||||
|
|
@ -470,7 +470,7 @@
|
|||
</p>
|
||||
<button
|
||||
type="button"
|
||||
class="flex h-8 w-8 items-center justify-center rounded-full border border-charcoal/15 text-lg leading-none text-charcoal transition hover:bg-charcoal/5 disabled:cursor-default disabled:opacity-30"
|
||||
class="flex h-8 w-8 items-center justify-center rounded-button border border-charcoal/15 text-lg leading-none text-charcoal transition hover:bg-charcoal/5 disabled:cursor-default disabled:opacity-30"
|
||||
aria-label="Next month"
|
||||
disabled={ui.monthOffset >= MAX_MONTH_OFFSET}
|
||||
onclick={() => ui.monthOffset++}
|
||||
|
|
@ -489,7 +489,7 @@
|
|||
<span>The next available date for {formatDuration(duration.minutes)} is <strong>{longDate(zonedDateKey(ui.next, timezone))}</strong>.</span>
|
||||
<button
|
||||
type="button"
|
||||
class="rounded-full bg-sage px-4 py-1.5 font-medium text-primary-content transition hover:bg-sage-dark"
|
||||
class="rounded-button bg-sage px-4 py-1.5 font-medium text-primary-content transition hover:bg-sage-dark"
|
||||
onclick={() => showDay(item.id, ui.next!)}
|
||||
>
|
||||
Go to next available date →
|
||||
|
|
@ -516,7 +516,7 @@
|
|||
disabled={!selectable}
|
||||
aria-pressed={selected}
|
||||
onclick={() => (ui.selectedDayKey = day.dateKey)}
|
||||
class="aspect-square rounded-full text-sm transition {selected
|
||||
class="aspect-square rounded-button text-sm transition {selected
|
||||
? 'bg-sage font-semibold text-primary-content'
|
||||
: selectable
|
||||
? 'cursor-pointer bg-sage/15 font-medium text-charcoal hover:bg-sage/35'
|
||||
|
|
@ -545,12 +545,12 @@
|
|||
{@const label = `${formatTime(entry.start)}–${formatTime(entry.end)}`}
|
||||
{#if isGroup && entry.line}
|
||||
<!-- Places in a group session already in the basket: − / + -->
|
||||
<div class="inline-flex items-center gap-2 rounded-full bg-sage/15 py-1 pr-1 pl-3.5 text-sm text-sage-dark">
|
||||
<div class="inline-flex items-center gap-2 rounded-button bg-sage/15 py-1 pr-1 pl-3.5 text-sm text-sage-dark">
|
||||
<span>{label} · {placesLeft(free)}</span>
|
||||
<span class="inline-flex items-center gap-1 rounded-full bg-white px-1 py-0.5">
|
||||
<span class="inline-flex items-center gap-1 rounded-button bg-white px-1 py-0.5">
|
||||
<button
|
||||
type="button"
|
||||
class="flex h-6 w-6 items-center justify-center rounded-full leading-none text-charcoal transition hover:bg-charcoal/10 disabled:opacity-40"
|
||||
class="flex h-6 w-6 items-center justify-center rounded-button leading-none text-charcoal transition hover:bg-charcoal/10 disabled:opacity-40"
|
||||
aria-label="One place fewer"
|
||||
disabled={ui.adding}
|
||||
onclick={() => changeSeats(item.id, entry, -1)}
|
||||
|
|
@ -563,7 +563,7 @@
|
|||
</span>
|
||||
<button
|
||||
type="button"
|
||||
class="flex h-6 w-6 items-center justify-center rounded-full leading-none text-charcoal transition hover:bg-charcoal/10 disabled:opacity-40"
|
||||
class="flex h-6 w-6 items-center justify-center rounded-button leading-none text-charcoal transition hover:bg-charcoal/10 disabled:opacity-40"
|
||||
aria-label="One place more"
|
||||
disabled={ui.adding || free <= 0}
|
||||
onclick={() => changeSeats(item.id, entry, 1)}
|
||||
|
|
@ -577,7 +577,7 @@
|
|||
type="button"
|
||||
disabled={!!entry.line || !entry.time || ui.adding}
|
||||
onclick={() => entry.time && addTime(item, duration.minutes, entry.time)}
|
||||
class="inline-flex items-center gap-1.5 rounded-full border px-3.5 py-1.5 text-sm transition {entry.line
|
||||
class="inline-flex items-center gap-1.5 rounded-button border px-3.5 py-1.5 text-sm transition {entry.line
|
||||
? 'cursor-not-allowed border-transparent bg-sage/15 text-sage-dark'
|
||||
: 'border-charcoal/15 bg-white text-charcoal hover:border-sage hover:bg-sage/10'} disabled:opacity-60 {ui.adding &&
|
||||
!entry.line
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@
|
|||
<button
|
||||
type="button"
|
||||
onclick={prev}
|
||||
class="w-10 h-10 rounded-full flex items-center justify-center transition-colors hover:bg-[rgba(255,236,224,1)] hover:text-[#93384a] bg-[rgba(255,219,197,0.8)]"
|
||||
class="w-10 h-10 rounded-button flex items-center justify-center transition-colors hover:bg-[rgba(255,236,224,1)] hover:text-[#93384a] bg-[rgba(255,219,197,0.8)]"
|
||||
aria-label="Previous slide"
|
||||
>
|
||||
<svg viewBox="0 0 7.3 13" class="w-2 h-3" fill="none" stroke="currentColor" stroke-width="1.5">
|
||||
|
|
@ -75,7 +75,7 @@
|
|||
<button
|
||||
type="button"
|
||||
onclick={next}
|
||||
class="w-10 h-10 rounded-full flex items-center justify-center transition-colors hover:bg-[rgba(255,236,224,1)] hover:text-[#93384a] bg-[rgba(255,219,197,0.8)]"
|
||||
class="w-10 h-10 rounded-button flex items-center justify-center transition-colors hover:bg-[rgba(255,236,224,1)] hover:text-[#93384a] bg-[rgba(255,219,197,0.8)]"
|
||||
aria-label="Next slide"
|
||||
>
|
||||
<svg viewBox="0 0 7.3 13" class="w-2 h-3" fill="none" stroke="currentColor" stroke-width="1.5">
|
||||
|
|
|
|||
|
|
@ -65,13 +65,13 @@
|
|||
</div>
|
||||
|
||||
{#if visibleEvents.length === 0}
|
||||
<div class="mx-auto max-w-2xl rounded-[2rem] border border-sage/20 bg-white/70 p-8 text-center shadow-sm">
|
||||
<div class="mx-auto max-w-2xl rounded-panel border border-sage/20 bg-white/70 p-8 text-center shadow-sm">
|
||||
<p class="text-charcoal/70">No upcoming events are available for the selected categories.</p>
|
||||
</div>
|
||||
{:else}
|
||||
<div class="isolate grid gap-8 lg:grid-cols-2">
|
||||
{#each months as month}
|
||||
<div class="relative z-0 overflow-visible rounded-[2rem] border border-sage/15 bg-white/80 p-3 shadow-sm sm:p-5 backdrop-blur hover:z-[9000] focus-within:z-[9000]">
|
||||
<div class="relative z-0 overflow-visible rounded-panel border border-sage/15 bg-white/80 p-3 shadow-sm sm:p-5 backdrop-blur hover:z-[9000] focus-within:z-[9000]">
|
||||
<h3 class="font-display mb-5 text-center text-3xl text-charcoal">{month.label}</h3>
|
||||
<div class="mb-2 grid grid-cols-7 gap-1 text-center text-xs font-semibold uppercase tracking-wide text-charcoal/45">
|
||||
{#each weekdays as weekday}<div>{weekday}</div>{/each}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { defaultColors, type ColorsGlobal } from './types';
|
||||
import { defaultColors, defaultStyle, type ColorsGlobal, type StyleGlobal } from './types';
|
||||
|
||||
// Site colours (Site design → Colors) as CSS variables, rendered server-side
|
||||
// into a <style> tag so pages don't flash the default colours on load.
|
||||
|
|
@ -56,9 +56,68 @@ export function brandThemeVars(colors: Partial<ColorsGlobal> | null | undefined)
|
|||
};
|
||||
}
|
||||
|
||||
/** Every site colour variable — public site and the admin preview. */
|
||||
export function siteThemeVars(colors: Partial<ColorsGlobal> | null | undefined): Record<string, string> {
|
||||
// Fonts to pick from in Site design → Style. Each is bundled by both apps
|
||||
// (src/lib/fonts.ts, @fontsource-variable packages) and a browser downloads
|
||||
// only the ones a page uses. Adding one: install the package in both apps,
|
||||
// import it in both fonts.ts files, add it here.
|
||||
export const SITE_FONTS = [
|
||||
{ id: 'playfair-display', label: 'Playfair Display', family: 'Playfair Display Variable', serif: true },
|
||||
{ id: 'cormorant-garamond', label: 'Cormorant Garamond', family: 'Cormorant Garamond Variable', serif: true },
|
||||
{ id: 'eb-garamond', label: 'EB Garamond', family: 'EB Garamond Variable', serif: true },
|
||||
{ id: 'libre-baskerville', label: 'Libre Baskerville', family: 'Libre Baskerville Variable', serif: true },
|
||||
{ id: 'lora', label: 'Lora', family: 'Lora Variable', serif: true },
|
||||
{ id: 'fraunces', label: 'Fraunces', family: 'Fraunces Variable', serif: true },
|
||||
{ id: 'dm-sans', label: 'DM Sans', family: 'DM Sans Variable', serif: false },
|
||||
{ id: 'inter', label: 'Inter', family: 'Inter Variable', serif: false },
|
||||
{ id: 'manrope', label: 'Manrope', family: 'Manrope Variable', serif: false },
|
||||
{ id: 'montserrat', label: 'Montserrat', family: 'Montserrat Variable', serif: false },
|
||||
{ id: 'nunito', label: 'Nunito', family: 'Nunito Variable', serif: false },
|
||||
{ id: 'outfit', label: 'Outfit', family: 'Outfit Variable', serif: false },
|
||||
{ id: 'raleway', label: 'Raleway', family: 'Raleway Variable', serif: false },
|
||||
{ id: 'work-sans', label: 'Work Sans', family: 'Work Sans Variable', serif: false },
|
||||
{ id: 'josefin-sans', label: 'Josefin Sans', family: 'Josefin Sans Variable', serif: false }
|
||||
] as const;
|
||||
|
||||
/** CSS font-family for a SITE_FONTS id (unknown ids get `fallbackId`'s font). */
|
||||
export function fontStack(id: unknown, fallbackId: string): string {
|
||||
const font = SITE_FONTS.find((f) => f.id === id) ?? SITE_FONTS.find((f) => f.id === fallbackId)!;
|
||||
return `'${font.family}', ${font.serif ? 'Georgia, serif' : 'ui-sans-serif, system-ui, sans-serif'}`;
|
||||
}
|
||||
|
||||
// What each Style choice sets. The variables are read by the @theme in both
|
||||
// apps' app.css (radius, shadow, container and font tokens), so every
|
||||
// rounded-xl, shadow-sm, max-w-6xl… on the public site follows them.
|
||||
const CORNERS = {
|
||||
sharp: { scale: '0', button: '0' },
|
||||
soft: { scale: '0.4', button: '0.375rem' },
|
||||
round: { scale: '1', button: '9999px' }
|
||||
};
|
||||
const TEXT_SIZES = { small: '93.75%', normal: '100%', large: '112.5%' };
|
||||
const SHADOWS = { none: '0', soft: '1', strong: '2.2' };
|
||||
const WIDTHS = { narrow: '0.85', normal: '1', wide: '1.2' };
|
||||
|
||||
function pick<T>(table: Record<string, T>, key: unknown, fallback: string): T {
|
||||
return table[String(key)] ?? table[fallback];
|
||||
}
|
||||
|
||||
/** Site design → Style as CSS variables — public site and the admin preview. */
|
||||
export function siteStyleVars(style: Partial<StyleGlobal> | null | undefined): Record<string, string> {
|
||||
const corners = pick(CORNERS, style?.corners, defaultStyle.corners);
|
||||
return {
|
||||
'--site-font-heading': fontStack(style?.headingFont, defaultStyle.headingFont),
|
||||
'--site-font-body': fontStack(style?.bodyFont, defaultStyle.bodyFont),
|
||||
'--site-corners': corners.scale,
|
||||
'--site-button-radius': corners.button,
|
||||
'--site-text-size': pick(TEXT_SIZES, style?.textSize, defaultStyle.textSize),
|
||||
'--site-shadow': pick(SHADOWS, style?.shadows, defaultStyle.shadows),
|
||||
'--site-width': pick(WIDTHS, style?.width, defaultStyle.width)
|
||||
};
|
||||
}
|
||||
|
||||
/** Every site colour and style variable — public site and the admin preview. */
|
||||
export function siteThemeVars(colors: Partial<ColorsGlobal> | null | undefined, style?: Partial<StyleGlobal> | null): Record<string, string> {
|
||||
return {
|
||||
...siteStyleVars(style),
|
||||
'--color-bg': safeColor(colors?.background, defaultColors.background),
|
||||
'--color-heading': safeColor(colors?.heading, defaultColors.heading),
|
||||
'--color-subheading': safeColor(colors?.subheading, defaultColors.subheading),
|
||||
|
|
|
|||
|
|
@ -360,3 +360,23 @@ export const defaultColors: ColorsGlobal = {
|
|||
primary: '#8a9a7b',
|
||||
accent: '#c9825f'
|
||||
};
|
||||
|
||||
/** Site design → Style. Fonts are ids from SITE_FONTS in theme.ts. */
|
||||
export type StyleGlobal = {
|
||||
headingFont: string;
|
||||
bodyFont: string;
|
||||
corners: 'sharp' | 'soft' | 'round';
|
||||
textSize: 'small' | 'normal' | 'large';
|
||||
shadows: 'none' | 'soft' | 'strong';
|
||||
width: 'narrow' | 'normal' | 'wide';
|
||||
};
|
||||
|
||||
// The site's look before these settings existed.
|
||||
export const defaultStyle: StyleGlobal = {
|
||||
headingFont: 'playfair-display',
|
||||
bodyFont: 'dm-sans',
|
||||
corners: 'round',
|
||||
textSize: 'normal',
|
||||
shadows: 'soft',
|
||||
width: 'normal'
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue