removed not used blocks

This commit is contained in:
Jakub Dorfman 2026-05-20 13:57:07 +02:00
parent fe5d77443d
commit 1b3ef17800
17 changed files with 3 additions and 615 deletions

View file

@ -50,7 +50,7 @@ All components use Svelte 5 runes syntax — **never** `export let`, `$:`, or `o
Pages are composed of `ContentBlock[]`. Each block has `{ id, type, data }`. Block types are defined in `$lib/types.ts`:
`text | image | image_text | timeline | testimonials | services | cta | spacer | horizontal_cards`
- **Public renderers**: `$lib/blocks/<Type>Block.svelte` — one per type, receives `data` prop
- **Public renderers**: `$lib/blocks/<Type>Block.svelte` — one per type, receives `data` prop. Currently active: `TextBlock`, `ImageTextBlock`, `TimelineBlock`, `HeroBlock`.
- **Admin editors**: `$lib/admin/editors/BlockEditor.svelte` — switches editor UI by type
- **Defaults**: `$lib/admin/blockDefaults.ts` — `createBlock(type)` generates a new block with sensible defaults
- **Block list**: `$lib/admin/BlockList.svelte` — draggable reorder, select, delete

View file

@ -3,21 +3,9 @@ import type { BlockType, ContentBlock } from '$lib/types';
export const blockLabels: Record<BlockType, string> = {
text: 'Text',
image: 'Image',
image_text: 'Image + Text',
timeline: 'Timeline',
testimonials: 'Testimonials',
services: 'Services',
cta: 'Call to Action',
spacer: 'Spacer',
horizontal_cards: 'Horizontal Cards',
hero: 'Hero',
columns: 'Columns',
pricing_table: 'Pricing Table',
newsletter: 'Newsletter',
articles_list: 'Articles List',
profile_card: 'Profile Card',
features_list: 'Features List'
hero: 'Hero'
};
export const blockTypes = Object.keys(blockLabels) as BlockType[];
@ -28,30 +16,12 @@ export function createBlock(type: BlockType): ContentBlock {
case 'text':
base.data = { content: '<h2>New text block</h2><p>Add your copy here.</p>' };
break;
case 'image':
base.data = { url: '', alt: '', caption: '' };
break;
case 'image_text':
base.data = { url: '', alt: '', content: '<h2>Image and text</h2><p>Add content here.</p>', imagePosition: 'left' };
break;
case 'timeline':
base.data = { items: [{ year: '2026', title: 'Milestone', description: 'Describe this moment.' }] };
break;
case 'testimonials':
base.data = { items: [{ name: 'Client name', text: 'A beautiful experience.', rating: 5 }] };
break;
case 'services':
base.data = { items: [{ title: 'Massage session', description: 'Describe the service.', duration: '60 min', price: '£70' }] };
break;
case 'cta':
base.data = { heading: 'Ready to book?', subtext: 'Start your next moment of calm.', buttonLabel: 'Book Now', buttonUrl: '/book' };
break;
case 'spacer':
base.data = { size: 'md' };
break;
case 'horizontal_cards':
base.data = { items: [{ title: 'Card title', description: 'Card description', url: '', link: '' }] };
break;
case 'hero':
base.data = {
heading: 'Holistic and Experiential Learning about Happiness',
@ -61,76 +31,6 @@ export function createBlock(type: BlockType): ContentBlock {
backgroundImage: ''
};
break;
case 'columns':
base.data = {
heading: 'Elements of Holistic Sexology',
items: [
{ title: 'Coaching and Mind Work', content: '<p>Explore beliefs, thoughts and emotions associated with your sexuality.</p>', icon: '🧠' },
{ title: 'Somatic Practices', content: '<p>Use sound, breathing, movement, touch to increase sensitivity.</p>', icon: '🧘' },
{ title: 'Harmonizing the Energy System', content: '<p>Techniques of Shiatsu based on Chinese medicine to resolve blockages.</p>', icon: '⚡' }
]
};
break;
case 'pricing_table':
base.data = {
heading: 'Prices',
items: [
{ duration: '60 min', price: '2000 NOK' },
{ duration: '90 min', price: '2500 NOK' },
{ duration: '120 min', price: '3000 NOK' },
{ duration: '150 min', price: '3500 NOK' },
{ duration: '180 min', price: '4000 NOK' }
]
};
break;
case 'newsletter':
base.data = {
heading: 'Want to stay connected?',
subtext: 'Sign up to receive my free videos and articles that allow you to know more about the secrets of sexual bliss.',
buttonLabel: 'Yes, please!',
placeholder: 'Your email address'
};
break;
case 'articles_list':
base.data = {
heading: 'My Favourite Articles',
items: [
{ title: 'As a "real" man you need to be hard! Sexual performance anxiety in men', url: '/article1' },
{ title: 'Listen to your body! What numbness is communicating to you?', url: '/article2' },
{ title: 'Reclaim your pleasure and joy! Consent and clear empowered communication are the basis', url: '/article3' }
]
};
break;
case 'profile_card':
base.data = {
name: 'Alegría',
tagline: 'Holistic Sensual Massage Therapist',
image: '',
description: '<p>Let yourself be pampered like Caesar by Cleopatra.</p>',
education: ['Professional training in holistic sensual massage Core Touch I and II'],
contact: '+47 40158395',
profileUrl: ''
};
break;
case 'features_list':
base.data = {
heading: 'In my sessions, I teach...',
categories: [
{
title: 'For men',
items: ['Overcome sexual anxiety', 'Last as long as you want', 'Treat erectile dysfunction without drugs']
},
{
title: 'For women',
items: ['Increase sensitivity in the whole body', 'Unlock every possible kind of orgasm', 'Release fear, shame and trauma']
},
{
title: 'For couples',
items: ['Feel more connected while lovemaking', 'Master the art of Tantric sex', 'Deepen your relationship']
}
]
};
break;
}
base.data._background = { type: 'none', color: '', imageUrl: '', attachment: 'scroll', overlay: false, overlayOpacity: 40 };
return base;

View file

@ -41,19 +41,10 @@
{#if block.type === 'text'}
<RichTextEditor value={block.data.content} onChange={(content) => updateData({ content })} />
{:else if block.type === 'image'}
<ImageUploader url={block.data.url} alt={block.data.alt} onChange={(image) => updateData(image)} />
<label class="form-control mt-3"><span class="label-text">Caption</span><input class="input input-bordered" value={block.data.caption || ''} oninput={(e) => updateData({ caption: e.currentTarget.value })} /></label>
{:else if block.type === 'image_text'}
<ImageUploader url={block.data.url} alt={block.data.alt} onChange={(image) => updateData(image)} />
<label class="form-control mt-3"><span class="label-text">Image position</span><select class="select select-bordered" value={block.data.imagePosition || 'left'} onchange={(e) => updateData({ imagePosition: e.currentTarget.value })}><option value="left">Left</option><option value="right">Right</option></select></label>
<div class="mt-3"><RichTextEditor value={block.data.content} onChange={(content) => updateData({ content })} /></div>
{:else if block.type === 'spacer'}
<label class="form-control"><span class="label-text">Size</span><select class="select select-bordered" value={block.data.size || 'md'} onchange={(e) => updateData({ size: e.currentTarget.value })}><option value="sm">Small</option><option value="md">Medium</option><option value="lg">Large</option></select></label>
{:else if block.type === 'cta'}
{#each ['heading', 'subtext', 'buttonLabel', 'buttonUrl'] as field}
<label class="form-control"><span class="label-text capitalize">{field}</span><input class="input input-bordered" value={block.data[field] || ''} oninput={(e) => updateData({ [field]: e.currentTarget.value })} /></label>
{/each}
{:else if block.type === 'timeline'}
{#each block.data.items || [] as item, i}
<div class="rounded-box mb-3 border border-base-300 p-3">
@ -64,118 +55,10 @@
</div>
{/each}
<button class="btn" type="button" onclick={() => addArrayItem('items', { year: '', title: '', description: '' })}>Add item</button>
{:else if block.type === 'testimonials'}
{#each block.data.items || [] as item, i}
<div class="rounded-box mb-3 border border-base-300 p-3">
<input class="input input-bordered mb-2 w-full" placeholder="Name" value={item.name} oninput={(e) => updateArray('items', i, { name: e.currentTarget.value })} />
<textarea class="textarea textarea-bordered mb-2 w-full" placeholder="Text" value={item.text} oninput={(e) => updateArray('items', i, { text: e.currentTarget.value })}></textarea>
<input class="input input-bordered w-full" type="number" min="1" max="5" value={item.rating} oninput={(e) => updateArray('items', i, { rating: Number(e.currentTarget.value) })} />
<button class="btn btn-error btn-sm mt-2" type="button" onclick={() => removeArrayItem('items', i)}>Remove</button>
</div>
{/each}
<button class="btn" type="button" onclick={() => addArrayItem('items', { name: '', text: '', rating: 5 })}>Add testimonial</button>
{:else if block.type === 'services'}
{#each block.data.items || [] as item, i}
<div class="rounded-box mb-3 border border-base-300 p-3">
{#each ['title', 'description', 'duration', 'price'] as field}
<input class="input input-bordered mb-2 w-full" placeholder={field} value={item[field]} oninput={(e) => updateArray('items', i, { [field]: e.currentTarget.value })} />
{/each}
<button class="btn btn-error btn-sm" type="button" onclick={() => removeArrayItem('items', i)}>Remove</button>
</div>
{/each}
<button class="btn" type="button" onclick={() => addArrayItem('items', { title: '', description: '', duration: '', price: '' })}>Add service</button>
{:else if block.type === 'horizontal_cards'}
{#each block.data.items || [] as item, i}
<div class="rounded-box mb-3 border border-base-300 p-3">
{#each ['title', 'description', 'url', 'link'] as field}
<input class="input input-bordered mb-2 w-full" placeholder={field} value={item[field]} oninput={(e) => updateArray('items', i, { [field]: e.currentTarget.value })} />
{/each}
<button class="btn btn-error btn-sm" type="button" onclick={() => removeArrayItem('items', i)}>Remove</button>
</div>
{/each}
<button class="btn" type="button" onclick={() => addArrayItem('items', { title: '', description: '', url: '', link: '' })}>Add card</button>
{:else if block.type === 'hero'}
{#each ['heading', 'subheading', 'buttonLabel', 'buttonUrl', 'backgroundImage'] as field}
<label class="form-control"><span class="label-text capitalize">{field.replace(/([A-Z])/g, ' $1')}</span><input class="input input-bordered" value={block.data[field] || ''} oninput={(e) => updateData({ [field]: e.currentTarget.value })} /></label>
{/each}
{:else if block.type === 'columns'}
{#each ['heading'] as field}
<label class="form-control"><span class="label-text capitalize">{field}</span><input class="input input-bordered" value={block.data[field] || ''} oninput={(e) => updateData({ [field]: e.currentTarget.value })} /></label>
{/each}
<h3 class="mt-4 font-bold">Columns</h3>
{#each block.data.items || [] as item, i}
<div class="rounded-box mb-3 border border-base-300 p-3">
<input class="input input-bordered mb-2 w-full" placeholder="Title" value={item.title} oninput={(e) => updateArray('items', i, { title: e.currentTarget.value })} />
<input class="input input-bordered mb-2 w-full" placeholder="Icon (emoji)" value={item.icon || ''} oninput={(e) => updateArray('items', i, { icon: e.currentTarget.value })} />
<textarea class="textarea textarea-bordered w-full" placeholder="HTML Content" value={item.content} oninput={(e) => updateArray('items', i, { content: e.currentTarget.value })}></textarea>
<button class="btn btn-error btn-sm mt-2" type="button" onclick={() => removeArrayItem('items', i)}>Remove</button>
</div>
{/each}
<button class="btn" type="button" onclick={() => addArrayItem('items', { title: '', icon: '', content: '' })}>Add column</button>
{:else if block.type === 'pricing_table'}
{#each ['heading'] as field}
<label class="form-control"><span class="label-text capitalize">{field}</span><input class="input input-bordered" value={block.data[field] || ''} oninput={(e) => updateData({ [field]: e.currentTarget.value })} /></label>
{/each}
<h3 class="mt-4 font-bold">Price rows</h3>
{#each block.data.items || [] as item, i}
<div class="rounded-box mb-3 border border-base-300 p-3">
<input class="input input-bordered mb-2 w-full" placeholder="Duration" value={item.duration} oninput={(e) => updateArray('items', i, { duration: e.currentTarget.value })} />
<input class="input input-bordered w-full" placeholder="Price" value={item.price} oninput={(e) => updateArray('items', i, { price: e.currentTarget.value })} />
<button class="btn btn-error btn-sm mt-2" type="button" onclick={() => removeArrayItem('items', i)}>Remove</button>
</div>
{/each}
<button class="btn" type="button" onclick={() => addArrayItem('items', { duration: '', price: '' })}>Add row</button>
{:else if block.type === 'newsletter'}
{#each ['heading', 'subtext', 'buttonLabel', 'placeholder'] as field}
<label class="form-control"><span class="label-text capitalize">{field}</span><input class="input input-bordered" value={block.data[field] || ''} oninput={(e) => updateData({ [field]: e.currentTarget.value })} /></label>
{/each}
{:else if block.type === 'articles_list'}
{#each ['heading'] as field}
<label class="form-control"><span class="label-text capitalize">{field}</span><input class="input input-bordered" value={block.data[field] || ''} oninput={(e) => updateData({ [field]: e.currentTarget.value })} /></label>
{/each}
<h3 class="mt-4 font-bold">Articles</h3>
{#each block.data.items || [] as item, i}
<div class="rounded-box mb-3 border border-base-300 p-3">
<input class="input input-bordered mb-2 w-full" placeholder="Title" value={item.title} oninput={(e) => updateArray('items', i, { title: e.currentTarget.value })} />
<input class="input input-bordered w-full" placeholder="URL" value={item.url} oninput={(e) => updateArray('items', i, { url: e.currentTarget.value })} />
<button class="btn btn-error btn-sm mt-2" type="button" onclick={() => removeArrayItem('items', i)}>Remove</button>
</div>
{/each}
<button class="btn" type="button" onclick={() => addArrayItem('items', { title: '', url: '' })}>Add article</button>
{:else if block.type === 'profile_card'}
{#each ['name', 'tagline', 'image', 'contact', 'profileUrl'] as field}
<label class="form-control"><span class="label-text capitalize">{field.replace(/([A-Z])/g, ' $1')}</span><input class="input input-bordered" value={block.data[field] || ''} oninput={(e) => updateData({ [field]: e.currentTarget.value })} /></label>
{/each}
<label class="form-control"><span class="label-text">Description (HTML)</span><textarea class="textarea textarea-bordered w-full" value={block.data.description || ''} oninput={(e) => updateData({ description: e.currentTarget.value })}></textarea></label>
<h3 class="mt-4 font-bold">Education</h3>
{#each block.data.education || [] as edu, i}
<div class="flex gap-2 mb-2">
<input class="input input-bordered flex-1" value={edu} oninput={(e) => {
const arr = [...(block.data.education || [])];
arr[i] = e.currentTarget.value;
updateData({ education: arr });
}} />
<button class="btn btn-error btn-sm" type="button" onclick={() => {
const arr = (block.data.education || []).filter((_: unknown, idx: number) => idx !== i);
updateData({ education: arr });
}}>×</button>
</div>
{/each}
<button class="btn btn-sm" type="button" onclick={() => updateData({ education: [...(block.data.education || []), ''] })}>Add education</button>
{:else if block.type === 'features_list'}
{#each ['heading'] as field}
<label class="form-control"><span class="label-text capitalize">{field}</span><input class="input input-bordered" value={block.data[field] || ''} oninput={(e) => updateData({ [field]: e.currentTarget.value })} /></label>
{/each}
<h3 class="mt-4 font-bold">Categories</h3>
{#each block.data.categories || [] as cat, ci}
<div class="rounded-box mb-3 border border-base-300 p-3">
<input class="input input-bordered mb-2 w-full" placeholder="Category title" value={cat.title} oninput={(e) => updateArray('categories', ci, { title: e.currentTarget.value })} />
<p class="text-xs text-base-content/60 mb-1">Items (one per line)</p>
<textarea class="textarea textarea-bordered w-full" rows="4" value={(cat.items || []).join('\n')} oninput={(e) => updateArray('categories', ci, { items: e.currentTarget.value.split('\n').filter((s) => s.trim()) })}></textarea>
<button class="btn btn-error btn-sm" type="button" onclick={() => removeArrayItem('categories', ci)}>Remove</button>
</div>
{/each}
<button class="btn" type="button" onclick={() => addArrayItem('categories', { title: '', items: [] })}>Add category</button>
{/if}
<hr class="my-6" />

View file

@ -1,25 +0,0 @@
<script lang="ts">
import { scrollReveal } from '$lib/scrollReveal';
type Article = { title: string; url: string };
let { data } = $props<{
data: { heading?: string; items?: Article[] };
}>();
let items = $derived(data.items?.length ? data.items : []);
</script>
<section class="mx-auto max-w-4xl px-6 py-16 md:py-20">
{#if data.heading}
<h2 use:scrollReveal class="reveal mb-10 text-center text-4xl md:text-5xl">{data.heading}</h2>
{/if}
<div use:scrollReveal class="reveal space-y-4">
{#each items as item}
<a class="group block rounded-[1.5rem] bg-white/70 p-6 shadow-sm ring-1 ring-charcoal/5 transition hover:-translate-y-0.5 hover:shadow-md" href={item.url} target="_blank" rel="noreferrer">
<div class="flex items-center justify-between gap-4">
<span class="text-lg leading-relaxed text-fg-body/80 transition group-hover:text-sage-dark">{item.title}</span>
<span class="shrink-0 text-xl text-sage/50 transition group-hover:text-sage-dark">→</span>
</div>
</a>
{/each}
</div>
</section>

View file

@ -2,21 +2,9 @@
import type { ContentBlock, BlockBackground, BlockForeground } from '$lib/types';
import BackgroundWrapper from './BackgroundWrapper.svelte';
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';
import HeroBlock from './HeroBlock.svelte';
import ColumnsBlock from './ColumnsBlock.svelte';
import PricingTableBlock from './PricingTableBlock.svelte';
import NewsletterBlock from './NewsletterBlock.svelte';
import ArticlesListBlock from './ArticlesListBlock.svelte';
import ProfileCardBlock from './ProfileCardBlock.svelte';
import FeaturesListBlock from './FeaturesListBlock.svelte';
let { blocks = [] } = $props<{ blocks: ContentBlock[] }>();
@ -33,36 +21,12 @@
<BackgroundWrapper background={getBg(block)} foreground={getFg(block)}>
{#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} />
{:else if block.type === 'hero'}
<HeroBlock data={block.data} />
{:else if block.type === 'columns'}
<ColumnsBlock data={block.data} />
{:else if block.type === 'pricing_table'}
<PricingTableBlock data={block.data} />
{:else if block.type === 'newsletter'}
<NewsletterBlock data={block.data} />
{:else if block.type === 'articles_list'}
<ArticlesListBlock data={block.data} />
{:else if block.type === 'profile_card'}
<ProfileCardBlock data={block.data} />
{:else if block.type === 'features_list'}
<FeaturesListBlock data={block.data} />
{/if}
</BackgroundWrapper>
{/each}

View file

@ -1,26 +0,0 @@
<script lang="ts">
import { scrollReveal } from '$lib/scrollReveal';
type Column = { title: string; content: string; icon?: string };
let { data } = $props<{
data: { heading?: string; items?: Column[] };
}>();
let items = $derived(data.items?.length ? data.items : []);
</script>
<section class="mx-auto max-w-6xl px-6 py-16 md:py-20">
{#if data.heading}
<h2 use:scrollReveal class="reveal mb-14 text-center text-4xl md:text-5xl">{data.heading}</h2>
{/if}
<div class="grid gap-8 md:grid-cols-3">
{#each items as item, i}
<article use:scrollReveal={i * 0.1} class="reveal rounded-[2rem] bg-white/70 p-8 shadow-sm ring-1 ring-charcoal/5">
{#if item.icon}
<span class="mb-4 block text-4xl">{item.icon}</span>
{/if}
<h3 class="mb-4 text-2xl">{item.title}</h3>
<div class="prose-wellness text-fg-body/70">{@html item.content}</div>
</article>
{/each}
</div>
</section>

View file

@ -1,17 +0,0 @@
<script lang="ts">
import { scrollReveal } from '$lib/scrollReveal';
let { data } = $props<{
data: { heading?: string; subtext?: string; buttonLabel?: string; buttonUrl?: string };
}>();
</script>
<section use:scrollReveal class="reveal 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

@ -1,30 +0,0 @@
<script lang="ts">
import { scrollReveal } from '$lib/scrollReveal';
type Category = { title: string; items: string[] };
let { data } = $props<{
data: { heading?: string; categories?: Category[] };
}>();
let categories = $derived(data.categories?.length ? data.categories : []);
</script>
<section class="mx-auto max-w-6xl px-6 py-16 md:py-20">
{#if data.heading}
<h2 use:scrollReveal class="reveal mb-12 text-center text-4xl md:text-5xl">{data.heading}</h2>
{/if}
<div class="grid gap-8 md:grid-cols-3">
{#each categories as cat, i}
<article use:scrollReveal={i * 0.1} class="reveal rounded-[2rem] bg-white/70 p-8 shadow-sm ring-1 ring-charcoal/5">
<h3 class="mb-6 text-center text-2xl">{cat.title}</h3>
<ul class="space-y-4">
{#each cat.items as item}
<li class="flex items-start gap-3 text-fg-body/75">
<span class="mt-1 grid h-6 w-6 shrink-0 place-items-center rounded-full bg-sage/15 text-sm text-sage-dark">✓</span>
<span class="leading-relaxed">{item}</span>
</li>
{/each}
</ul>
</article>
{/each}
</div>
</section>

View file

@ -1,29 +0,0 @@
<script lang="ts">
import { scrollReveal } from '$lib/scrollReveal';
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" use:scrollReveal>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, i}
<a use:scrollReveal={i * 0.1} class="reveal 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-fg-body/70">{item.description}</p>
</div>
</a>
{/each}
</div>
</section>

View file

@ -1,18 +0,0 @@
<script lang="ts">
import { scrollReveal } from '$lib/scrollReveal';
let { data } = $props<{ data: { url?: string; alt?: string; caption?: string } }>();
</script>
<section use:scrollReveal class="reveal 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-fg-body/60">{data.caption}</figcaption>
{/if}
</figure>
</section>

View file

@ -1,23 +0,0 @@
<script lang="ts">
import { scrollReveal } from '$lib/scrollReveal';
let { data } = $props<{
data: {
heading?: string;
subtext?: string;
buttonLabel?: string;
placeholder?: string;
};
}>();
</script>
<section class="bg-sage/10 px-6 py-16 md:py-20">
<div use:scrollReveal class="reveal mx-auto max-w-2xl text-center">
<h2 class="text-3xl md:text-4xl">{data.heading || 'Want to stay connected?'}</h2>
<p class="mx-auto mt-5 max-w-xl leading-relaxed text-fg-body/70">{data.subtext || 'Sign up to receive updates.'}</p>
<form class="mx-auto mt-8 flex max-w-md gap-3" onsubmit={(e) => e.preventDefault()}>
<input class="input input-bordered flex-1 rounded-full bg-white px-6" type="email" placeholder={data.placeholder || 'Your email address'} required />
<button class="btn rounded-full border-0 bg-sage px-8 text-white hover:bg-sage-dark" type="submit">{data.buttonLabel || 'Subscribe'}</button>
</form>
</div>
</section>

View file

@ -1,33 +0,0 @@
<script lang="ts">
import { scrollReveal } from '$lib/scrollReveal';
type PriceRow = { duration: string; price: string };
let { data } = $props<{
data: { heading?: string; items?: PriceRow[] };
}>();
let items = $derived(data.items?.length ? data.items : []);
</script>
<section class="mx-auto max-w-3xl px-6 py-16 md:py-20">
{#if data.heading}
<h2 use:scrollReveal class="reveal mb-10 text-center text-4xl md:text-5xl">{data.heading}</h2>
{/if}
<div use:scrollReveal class="reveal overflow-hidden rounded-[2rem] bg-white/75 shadow-sm ring-1 ring-charcoal/5">
<table class="w-full text-left">
<thead>
<tr class="border-b border-charcoal/10 bg-sage/5">
<th class="px-8 py-5 text-lg font-semibold text-fg-heading">Duration</th>
<th class="px-8 py-5 text-lg font-semibold text-fg-heading">Price</th>
</tr>
</thead>
<tbody>
{#each items as item}
<tr class="border-b border-charcoal/5 transition hover:bg-warm/50">
<td class="px-8 py-4 text-fg-body/80">{item.duration}</td>
<td class="px-8 py-4 font-semibold text-terracotta">{item.price}</td>
</tr>
{/each}
</tbody>
</table>
</div>
</section>

View file

@ -1,57 +0,0 @@
<script lang="ts">
import { scrollReveal } from '$lib/scrollReveal';
let { data } = $props<{
data: {
name?: string;
tagline?: string;
image?: string;
description?: string;
education?: string[];
contact?: string;
profileUrl?: string;
};
}>();
</script>
<section class="mx-auto max-w-4xl px-6 py-16 md:py-20">
<div use:scrollReveal class="reveal grid items-start gap-10 md:grid-cols-[1fr_2fr]">
<div class="overflow-hidden rounded-[2rem] bg-sage/10 shadow-sm">
{#if data.image}
<img class="aspect-[3/4] w-full object-cover" src={data.image} alt={data.name || ''} />
{:else}
<div class="grid aspect-[3/4] place-items-center text-sage-dark">Photo</div>
{/if}
</div>
<div>
{#if data.name}
<h2 class="text-4xl md:text-5xl">{data.name}</h2>
{/if}
{#if data.tagline}
<p class="mt-2 text-lg font-medium text-sage-dark">{data.tagline}</p>
{/if}
{#if data.description}
<div class="prose-wellness mt-6 text-lg text-fg-body/80">{@html data.description}</div>
{/if}
{#if data.education?.length}
<div class="mt-8">
<h3 class="mb-3 text-xl font-semibold">Education</h3>
<ul class="space-y-2">
{#each data.education as edu}
<li class="flex items-start gap-3 text-fg-body/70">
<span class="mt-1.5 h-2 w-2 shrink-0 rounded-full bg-sage"></span>
{edu}
</li>
{/each}
</ul>
</div>
{/if}
{#if data.contact}
<p class="mt-6 text-fg-body/70">Contact: <a class="font-semibold text-sage-dark hover:text-terracotta" href={`tel:${data.contact}`}>{data.contact}</a></p>
{/if}
{#if data.profileUrl}
<a class="btn mt-6 rounded-full border-0 bg-sage text-white hover:bg-sage-dark" href={data.profileUrl} target="_blank" rel="noreferrer">View full profile</a>
{/if}
</div>
</div>
</section>

View file

@ -1,28 +0,0 @@
<script lang="ts">
import { scrollReveal } from '$lib/scrollReveal';
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" use:scrollReveal>Services</h2>
</div>
<div class="grid gap-6 md:grid-cols-2">
{#each items as item, i}
<article use:scrollReveal={i * 0.1} class="reveal 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-fg-body/70">{item.description}</p>
<p class="mt-6 text-xl font-bold text-terracotta">{item.price}</p>
</article>
{/each}
</div>
</section>

View file

@ -1,6 +0,0 @@
<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

@ -1,55 +0,0 @@
<script lang="ts">
import { scrollReveal } from '$lib/scrollReveal';
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 use:scrollReveal class="reveal 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-fg-body/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

@ -1,20 +1,8 @@
export type BlockType =
| 'text'
| 'image'
| 'image_text'
| 'timeline'
| 'testimonials'
| 'services'
| 'cta'
| 'spacer'
| 'horizontal_cards'
| 'hero'
| 'columns'
| 'pricing_table'
| 'newsletter'
| 'articles_list'
| 'profile_card'
| 'features_list';
| 'hero';
export type BlockBackground = {
type: 'none' | 'color' | 'image';