Added background and foreground settings to blocks, and scroll in animations
This commit is contained in:
parent
b4fbf3e411
commit
94c1e0b679
24 changed files with 826 additions and 44 deletions
25
app/src/lib/blocks/ArticlesListBlock.svelte
Normal file
25
app/src/lib/blocks/ArticlesListBlock.svelte
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
<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>
|
||||
51
app/src/lib/blocks/BackgroundWrapper.svelte
Normal file
51
app/src/lib/blocks/BackgroundWrapper.svelte
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
<script lang="ts">
|
||||
import type { BlockBackground, BlockForeground } from '$lib/types';
|
||||
|
||||
let {
|
||||
background = { type: 'none', color: '', imageUrl: '', attachment: 'scroll', overlay: false, overlayOpacity: 40 } satisfies BlockBackground,
|
||||
foreground = {} as BlockForeground,
|
||||
children
|
||||
} = $props<{
|
||||
background?: BlockBackground;
|
||||
foreground?: BlockForeground;
|
||||
children?: import('svelte').Snippet;
|
||||
}>();
|
||||
|
||||
function bgStyle() {
|
||||
const parts: string[] = [];
|
||||
if (background.type === 'color' && background.color) {
|
||||
parts.push(`background-color: ${background.color};`);
|
||||
}
|
||||
if (background.type === 'image' && background.imageUrl) {
|
||||
parts.push(`background-image: url(${background.imageUrl});`);
|
||||
parts.push(`background-size: cover;`);
|
||||
parts.push(`background-position: center;`);
|
||||
parts.push(`background-repeat: no-repeat;`);
|
||||
parts.push(`background-attachment: ${background.attachment};`);
|
||||
}
|
||||
return parts.join(' ');
|
||||
}
|
||||
|
||||
function fgStyle() {
|
||||
const parts: string[] = [];
|
||||
if (foreground.headingColor) {
|
||||
parts.push(`--fg-heading: ${foreground.headingColor};`);
|
||||
}
|
||||
if (foreground.bodyColor) {
|
||||
parts.push(`--fg-body: ${foreground.bodyColor};`);
|
||||
}
|
||||
return parts.join(' ');
|
||||
}
|
||||
</script>
|
||||
|
||||
<div style={bgStyle() + ' ' + fgStyle()} class="relative">
|
||||
{#if background.type === 'image' && background.overlay && background.imageUrl}
|
||||
<div
|
||||
class="pointer-events-none absolute inset-0"
|
||||
style={`background-color: rgba(0,0,0,${background.overlayOpacity / 100});`}
|
||||
></div>
|
||||
{/if}
|
||||
<div class="relative z-10">
|
||||
{@render children()}
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
<script lang="ts">
|
||||
import type { ContentBlock } from '$lib/types';
|
||||
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';
|
||||
|
|
@ -9,28 +10,59 @@
|
|||
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[] }>();
|
||||
|
||||
function getBg(block: ContentBlock): BlockBackground {
|
||||
return (block.data._background as BlockBackground) || { type: 'none', color: '', imageUrl: '', attachment: 'scroll', overlay: false, overlayOpacity: 40 };
|
||||
}
|
||||
|
||||
function getFg(block: ContentBlock): BlockForeground {
|
||||
return (block.data._foreground as BlockForeground) || {};
|
||||
}
|
||||
</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}
|
||||
<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}
|
||||
|
|
|
|||
26
app/src/lib/blocks/ColumnsBlock.svelte
Normal file
26
app/src/lib/blocks/ColumnsBlock.svelte
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
<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>
|
||||
|
|
@ -1,10 +1,12 @@
|
|||
<script lang="ts">
|
||||
import { scrollReveal } from '$lib/scrollReveal';
|
||||
|
||||
let { data } = $props<{
|
||||
data: { heading?: string; subtext?: string; buttonLabel?: string; buttonUrl?: string };
|
||||
}>();
|
||||
</script>
|
||||
|
||||
<section class="px-6 py-16 md:py-20">
|
||||
<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>
|
||||
|
|
|
|||
30
app/src/lib/blocks/FeaturesListBlock.svelte
Normal file
30
app/src/lib/blocks/FeaturesListBlock.svelte
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
<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>
|
||||
35
app/src/lib/blocks/HeroBlock.svelte
Normal file
35
app/src/lib/blocks/HeroBlock.svelte
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
<script lang="ts">
|
||||
let { data } = $props<{
|
||||
data: {
|
||||
heading?: string;
|
||||
subheading?: string;
|
||||
buttonLabel?: string;
|
||||
buttonUrl?: string;
|
||||
backgroundImage?: string;
|
||||
};
|
||||
}>();
|
||||
</script>
|
||||
|
||||
<section class="relative flex min-h-[80vh] items-center justify-center overflow-hidden px-6 py-20 md:min-h-[90vh]">
|
||||
{#if data.backgroundImage}
|
||||
<img class="absolute inset-0 h-full w-full object-cover" src={data.backgroundImage} alt="" />
|
||||
<div class="absolute inset-0 bg-charcoal/50"></div>
|
||||
{/if}
|
||||
<div class="relative z-10 mx-auto max-w-4xl text-center">
|
||||
<h1 class="animate-fade-in text-5xl leading-tight md:text-7xl lg:text-8xl" style="font-family: 'Playfair Display', Georgia, serif;">
|
||||
{data.heading || 'Holistic and Experiential Learning about Happiness'}
|
||||
</h1>
|
||||
{#if data.subheading}
|
||||
<p class="animate-fade-in mx-auto mt-6 max-w-2xl text-lg leading-relaxed text-fg-body/70 md:text-xl" style="animation-delay: 0.15s;">
|
||||
{data.subheading}
|
||||
</p>
|
||||
{/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-white shadow-lg transition hover:bg-sage-dark hover:shadow-xl" href={data.buttonUrl || '/book'}>
|
||||
{data.buttonLabel}
|
||||
</a>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
</section>
|
||||
|
|
@ -1,4 +1,6 @@
|
|||
<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 : [
|
||||
|
|
@ -9,17 +11,17 @@
|
|||
<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>
|
||||
<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}
|
||||
<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 || '#'}>
|
||||
{#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-charcoal/70">{item.description}</p>
|
||||
<p class="mt-3 leading-7 text-fg-body/70">{item.description}</p>
|
||||
</div>
|
||||
</a>
|
||||
{/each}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,10 @@
|
|||
<script lang="ts">
|
||||
import { scrollReveal } from '$lib/scrollReveal';
|
||||
|
||||
let { data } = $props<{ data: { url?: string; alt?: string; caption?: string } }>();
|
||||
</script>
|
||||
|
||||
<section class="mx-auto max-w-5xl px-6 py-10">
|
||||
<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 || ''} />
|
||||
|
|
@ -10,7 +12,7 @@
|
|||
<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>
|
||||
<figcaption class="px-6 py-4 text-center text-sm text-fg-body/60">{data.caption}</figcaption>
|
||||
{/if}
|
||||
</figure>
|
||||
</section>
|
||||
|
|
|
|||
|
|
@ -1,10 +1,12 @@
|
|||
<script lang="ts">
|
||||
import { scrollReveal } from '$lib/scrollReveal';
|
||||
|
||||
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">
|
||||
<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">
|
||||
{#if data.url}
|
||||
|
|
@ -13,7 +15,7 @@
|
|||
<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">
|
||||
<div class="prose-wellness text-lg text-fg-body/80">
|
||||
{@html data.content || '<h2>A gentler rhythm</h2><p>Pair meaningful copy with a calming studio image.</p>'}
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
23
app/src/lib/blocks/NewsletterBlock.svelte
Normal file
23
app/src/lib/blocks/NewsletterBlock.svelte
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
<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>
|
||||
33
app/src/lib/blocks/PricingTableBlock.svelte
Normal file
33
app/src/lib/blocks/PricingTableBlock.svelte
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
<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>
|
||||
57
app/src/lib/blocks/ProfileCardBlock.svelte
Normal file
57
app/src/lib/blocks/ProfileCardBlock.svelte
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
<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>
|
||||
|
|
@ -1,4 +1,6 @@
|
|||
<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 : [
|
||||
|
|
@ -9,16 +11,16 @@
|
|||
<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>
|
||||
<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}
|
||||
<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">
|
||||
{#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-charcoal/70">{item.description}</p>
|
||||
<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}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
<script lang="ts">
|
||||
import { scrollReveal } from '$lib/scrollReveal';
|
||||
import { onMount } from 'svelte';
|
||||
|
||||
type Testimonial = { name: string; text: string; rating: number };
|
||||
|
|
@ -26,7 +27,7 @@
|
|||
});
|
||||
</script>
|
||||
|
||||
<section class="bg-white/45 py-16 md:py-20" onmouseenter={() => (paused = true)} onmouseleave={() => (paused = false)} role="region" aria-label="Testimonials carousel">
|
||||
<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>
|
||||
|
|
@ -44,7 +45,7 @@
|
|||
<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="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>
|
||||
|
|
|
|||
|
|
@ -1,9 +1,11 @@
|
|||
<script lang="ts">
|
||||
import { scrollReveal } from '$lib/scrollReveal';
|
||||
|
||||
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">
|
||||
<section use:scrollReveal class="reveal mx-auto max-w-3xl px-6 py-12 md:py-16">
|
||||
<div class="prose-wellness text-lg text-fg-body/85">
|
||||
{@html data.content || '<h2>Welcome</h2><p>Add warm, inviting copy in the CMS.</p>'}
|
||||
</div>
|
||||
</section>
|
||||
|
|
|
|||
|
|
@ -1,4 +1,6 @@
|
|||
<script lang="ts">
|
||||
import { scrollReveal } from '$lib/scrollReveal';
|
||||
|
||||
type TimelineItem = { year: string; title: string; description: string };
|
||||
let { data } = $props<{ data: { items?: TimelineItem[] } }>();
|
||||
let items = $derived(data.items?.length ? data.items : [
|
||||
|
|
@ -9,16 +11,16 @@
|
|||
<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>
|
||||
<h2 class="text-4xl md:text-5xl" use:scrollReveal>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 use:scrollReveal class="reveal 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>
|
||||
<p class="mt-3 leading-7 text-fg-body/70">{item.description}</p>
|
||||
</article>
|
||||
</div>
|
||||
{/each}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue