This commit is contained in:
Jakub Dorfman 2026-05-18 17:18:09 +02:00
commit b4fbf3e411
59 changed files with 4735 additions and 0 deletions

View file

@ -0,0 +1,36 @@
<script lang="ts">
import type { ContentBlock } from '$lib/types';
import TextBlock from './TextBlock.svelte';
import ImageBlock from './ImageBlock.svelte';
import ImageTextBlock from './ImageTextBlock.svelte';
import TimelineBlock from './TimelineBlock.svelte';
import TestimonialsBlock from './TestimonialsBlock.svelte';
import ServicesBlock from './ServicesBlock.svelte';
import CtaBlock from './CtaBlock.svelte';
import SpacerBlock from './SpacerBlock.svelte';
import HorizontalCardsBlock from './HorizontalCardsBlock.svelte';
let { blocks = [] } = $props<{ blocks: ContentBlock[] }>();
</script>
{#each blocks as block (block.id)}
{#if block.type === 'text'}
<TextBlock data={block.data} />
{:else if block.type === 'image'}
<ImageBlock data={block.data} />
{:else if block.type === 'image_text'}
<ImageTextBlock data={block.data} />
{:else if block.type === 'timeline'}
<TimelineBlock data={block.data} />
{:else if block.type === 'testimonials'}
<TestimonialsBlock data={block.data} />
{:else if block.type === 'services'}
<ServicesBlock data={block.data} />
{:else if block.type === 'cta'}
<CtaBlock data={block.data} />
{:else if block.type === 'spacer'}
<SpacerBlock data={block.data} />
{:else if block.type === 'horizontal_cards'}
<HorizontalCardsBlock data={block.data} />
{/if}
{/each}

View file

@ -0,0 +1,15 @@
<script lang="ts">
let { data } = $props<{
data: { heading?: string; subtext?: string; buttonLabel?: string; buttonUrl?: string };
}>();
</script>
<section class="px-6 py-16 md:py-20">
<div class="mx-auto max-w-5xl rounded-[2.5rem] bg-sage px-8 py-14 text-center text-white shadow-lg md:px-16">
<h2 class="text-4xl text-white md:text-5xl">{data.heading || 'Ready to feel restored?'}</h2>
<p class="mx-auto mt-5 max-w-2xl text-lg leading-8 text-white/85">{data.subtext || 'Book a massage session designed around your body, pace, and needs.'}</p>
{#if data.buttonLabel}
<a class="btn mt-8 rounded-full border-0 bg-white px-8 text-sage-dark hover:bg-warm" href={data.buttonUrl || '/book'}>{data.buttonLabel}</a>
{/if}
</div>
</section>

View file

@ -0,0 +1,27 @@
<script lang="ts">
type Card = { title: string; description: string; url?: string; link?: string };
let { data } = $props<{ data: { items?: Card[] } }>();
let items = $derived(data.items?.length ? data.items : [
{ title: 'Mindful touch', description: 'Create calm content cards for studio highlights.' }
]);
</script>
<section class="mx-auto max-w-6xl px-6 py-16">
<div class="mb-8">
<p class="mb-2 text-sm font-semibold uppercase tracking-[0.25em] text-sage-dark">Explore</p>
<h2 class="text-4xl md:text-5xl">Studio highlights</h2>
</div>
<div class="flex gap-5 overflow-x-auto pb-4 md:grid md:grid-cols-3 md:overflow-visible">
{#each items as item}
<a class="min-w-[18rem] overflow-hidden rounded-[2rem] bg-white/75 shadow-sm ring-1 ring-charcoal/5 transition hover:-translate-y-1 hover:shadow-md md:min-w-0" href={item.link || '#'}>
{#if item.url}
<img class="aspect-[4/3] w-full object-cover" src={item.url} alt="" />
{/if}
<div class="p-6">
<h3 class="text-2xl">{item.title}</h3>
<p class="mt-3 leading-7 text-charcoal/70">{item.description}</p>
</div>
</a>
{/each}
</div>
</section>

View file

@ -0,0 +1,16 @@
<script lang="ts">
let { data } = $props<{ data: { url?: string; alt?: string; caption?: string } }>();
</script>
<section class="mx-auto max-w-5xl px-6 py-10">
<figure class="overflow-hidden rounded-[2rem] bg-white/70 shadow-sm ring-1 ring-charcoal/5">
{#if data.url}
<img class="aspect-[16/10] w-full object-cover" src={data.url} alt={data.alt || ''} />
{:else}
<div class="grid aspect-[16/10] place-items-center bg-sage/10 text-sage-dark">Image coming soon</div>
{/if}
{#if data.caption}
<figcaption class="px-6 py-4 text-center text-sm text-charcoal/60">{data.caption}</figcaption>
{/if}
</figure>
</section>

View file

@ -0,0 +1,20 @@
<script lang="ts">
let { data } = $props<{
data: { url?: string; alt?: string; content?: string; imagePosition?: 'left' | 'right' };
}>();
</script>
<section class="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">
{#if data.url}
<img class="aspect-[4/5] w-full object-cover" src={data.url} alt={data.alt || ''} />
{:else}
<div class="grid aspect-[4/5] place-items-center text-sage-dark">Upload an image</div>
{/if}
</div>
<div class="prose-wellness text-lg text-charcoal/80">
{@html data.content || '<h2>A gentler rhythm</h2><p>Pair meaningful copy with a calming studio image.</p>'}
</div>
</div>
</section>

View file

@ -0,0 +1,26 @@
<script lang="ts">
type Service = { title: string; description: string; duration: string; price: string };
let { data } = $props<{ data: { items?: Service[] } }>();
let items = $derived(data.items?.length ? data.items : [
{ title: 'Restorative Massage', description: 'A personalized session to ease tension and support deep rest.', duration: '60 min', price: '£70' }
]);
</script>
<section class="mx-auto max-w-6xl px-6 py-16 md:py-20">
<div class="mb-10 text-center">
<p class="mb-2 text-sm font-semibold uppercase tracking-[0.25em] text-sage-dark">Treatments</p>
<h2 class="text-4xl md:text-5xl">Services</h2>
</div>
<div class="grid gap-6 md:grid-cols-2">
{#each items as item}
<article class="group rounded-[2rem] bg-white/75 p-7 shadow-sm ring-1 ring-charcoal/5 transition hover:-translate-y-1 hover:shadow-md">
<div class="flex items-start justify-between gap-4">
<h3 class="text-2xl">{item.title}</h3>
<span class="rounded-full bg-sage/10 px-4 py-2 text-sm font-semibold text-sage-dark">{item.duration}</span>
</div>
<p class="mt-4 leading-7 text-charcoal/70">{item.description}</p>
<p class="mt-6 text-xl font-bold text-terracotta">{item.price}</p>
</article>
{/each}
</div>
</section>

View file

@ -0,0 +1,6 @@
<script lang="ts">
let { data } = $props<{ data: { size?: 'sm' | 'md' | 'lg' } }>();
let height = $derived(data.size === 'lg' ? 'h-24 md:h-36' : data.size === 'sm' ? 'h-8 md:h-12' : 'h-14 md:h-20');
</script>
<div class={height} aria-hidden="true"></div>

View file

@ -0,0 +1,54 @@
<script lang="ts">
import { onMount } from 'svelte';
type Testimonial = { name: string; text: string; rating: number };
let { data } = $props<{ data: { items?: Testimonial[] } }>();
let items = $derived(data.items?.length ? data.items : [
{ name: 'Client', text: 'A calming, thoughtful massage experience.', rating: 5 }
]);
let index = $state(0);
let paused = $state(false);
let interval: ReturnType<typeof setInterval> | undefined;
function next() {
index = (index + 1) % items.length;
}
function prev() {
index = (index - 1 + items.length) % items.length;
}
onMount(() => {
interval = setInterval(() => {
if (!paused && items.length > 1) next();
}, 4000);
return () => interval && clearInterval(interval);
});
</script>
<section class="bg-white/45 py-16 md:py-20" onmouseenter={() => (paused = true)} onmouseleave={() => (paused = false)} role="region" aria-label="Testimonials carousel">
<div class="mx-auto max-w-5xl px-6">
<div class="mb-10 flex flex-col justify-between gap-4 md:flex-row md:items-end">
<div>
<p class="mb-2 text-sm font-semibold uppercase tracking-[0.25em] text-sage-dark">Kind words</p>
<h2 class="text-4xl md:text-5xl">Client experiences</h2>
</div>
<div class="flex gap-3">
<button class="btn btn-circle bg-white text-charcoal hover:bg-sage hover:text-white" onclick={prev} aria-label="Previous testimonial">‹</button>
<button class="btn btn-circle bg-white text-charcoal hover:bg-sage hover:text-white" onclick={next} aria-label="Next testimonial">›</button>
</div>
</div>
<div class="carousel w-full overflow-hidden rounded-[2rem] bg-warm shadow-sm ring-1 ring-charcoal/5">
{#each items as item, i}
<div class="carousel-item w-full transition-transform duration-500" style={`transform: translateX(-${index * 100}%);`}>
<article class="w-full p-8 md:p-12">
<div class="mb-5 text-xl text-terracotta" aria-label={`${item.rating} stars`}>{'★'.repeat(Math.max(1, Math.min(5, item.rating || 5)))}</div>
<p class="text-2xl leading-relaxed text-charcoal/80 md:text-3xl">“{item.text}”</p>
<p class="mt-6 font-semibold text-sage-dark">— {item.name}</p>
</article>
</div>
{/each}
</div>
</div>
</section>

View file

@ -0,0 +1,9 @@
<script lang="ts">
let { data } = $props<{ data: { content?: string } }>();
</script>
<section class="mx-auto max-w-3xl px-6 py-12 md:py-16">
<div class="prose-wellness text-lg text-charcoal/85">
{@html data.content || '<h2>Welcome</h2><p>Add warm, inviting copy in the CMS.</p>'}
</div>
</section>

View file

@ -0,0 +1,26 @@
<script lang="ts">
type TimelineItem = { year: string; title: string; description: string };
let { data } = $props<{ data: { items?: TimelineItem[] } }>();
let items = $derived(data.items?.length ? data.items : [
{ year: 'Now', title: 'Your story here', description: 'Add milestones, training, or the journey behind the practice.' }
]);
</script>
<section class="mx-auto max-w-5xl px-6 py-16">
<div class="mb-12 text-center">
<p class="mb-2 text-sm font-semibold uppercase tracking-[0.25em] text-sage-dark">Journey</p>
<h2 class="text-4xl md:text-5xl">A practice shaped over time</h2>
</div>
<div class="relative md:before:absolute md:before:left-1/2 md:before:top-0 md:before:h-full md:before:w-px md:before:bg-sage/30">
{#each items as item, index}
<div class="relative mb-8 grid gap-4 md:grid-cols-2 md:gap-12">
<div class="hidden md:block" class:md:order-2={index % 2 === 0}></div>
<article class="rounded-3xl bg-white/75 p-6 shadow-sm ring-1 ring-charcoal/5" class:md:text-right={index % 2 === 0}>
<span class="text-sm font-bold uppercase tracking-[0.2em] text-terracotta">{item.year}</span>
<h3 class="mt-2 text-2xl">{item.title}</h3>
<p class="mt-3 leading-7 text-charcoal/70">{item.description}</p>
</article>
</div>
{/each}
</div>
</section>