Site design → Style: fonts, corners, text size, shadows, page width
A new Style card in Site design (a `style` global) chooses the heading and body fonts from 15 bundled ones, corners (sharp/soft/round), text size, shadow strength and page width, with a live sample. The choices become --site-* CSS variables that the @theme radius, shadow, container and font tokens scale, so blocks keep using rounded-xl, shadow-sm, max-w-6xl and follow the setting. Buttons and chips use rounded-button; the defaults are the site's current look. Fonts are @fontsource-variable packages (replacing the static DM Sans and Playfair ones): still served by the site, and a browser downloads only the fonts a page uses. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Hy2vMnHJYP7QGsiH21zHxW
This commit is contained in:
parent
c35f9a60cc
commit
91f6705899
29 changed files with 628 additions and 110 deletions
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>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue