button and spacer block
visual changes
This commit is contained in:
parent
1b3ef17800
commit
5a0ffe20df
11 changed files with 190 additions and 22 deletions
|
|
@ -5,6 +5,8 @@
|
|||
import ImageTextBlock from './ImageTextBlock.svelte';
|
||||
import TimelineBlock from './TimelineBlock.svelte';
|
||||
import HeroBlock from './HeroBlock.svelte';
|
||||
import ButtonBlock from './ButtonBlock.svelte';
|
||||
import SpacerBlock from './SpacerBlock.svelte';
|
||||
|
||||
let { blocks = [] } = $props<{ blocks: ContentBlock[] }>();
|
||||
|
||||
|
|
@ -27,6 +29,10 @@
|
|||
<TimelineBlock data={block.data} />
|
||||
{:else if block.type === 'hero'}
|
||||
<HeroBlock data={block.data} />
|
||||
{:else if block.type === 'button'}
|
||||
<ButtonBlock data={block.data} />
|
||||
{:else if block.type === 'spacer'}
|
||||
<SpacerBlock data={block.data} />
|
||||
{/if}
|
||||
</BackgroundWrapper>
|
||||
{/each}
|
||||
|
|
|
|||
26
app/src/lib/blocks/ButtonBlock.svelte
Normal file
26
app/src/lib/blocks/ButtonBlock.svelte
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
<script lang="ts">
|
||||
let { data } = $props<{ data: Record<string, any> }>();
|
||||
|
||||
const alignmentClasses: Record<string, string> = {
|
||||
left: 'justify-start',
|
||||
center: 'justify-center',
|
||||
right: 'justify-end'
|
||||
};
|
||||
|
||||
const sizeClasses: Record<string, string> = {
|
||||
xs: 'btn-xs',
|
||||
sm: 'btn-sm',
|
||||
md: '',
|
||||
lg: 'btn-lg'
|
||||
};
|
||||
</script>
|
||||
|
||||
<div class="flex {alignmentClasses[data.alignment] || 'justify-center'}">
|
||||
<a
|
||||
href={data.href || '#'}
|
||||
class="btn btn-{data.variant || 'primary'} {sizeClasses[data.size] || ''}"
|
||||
style={data.color ? `background-color: ${data.color}; border-color: ${data.color};` : ''}
|
||||
>
|
||||
{data.label || 'Button'}
|
||||
</a>
|
||||
</div>
|
||||
|
|
@ -5,16 +5,11 @@
|
|||
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'}
|
||||
|
|
|
|||
7
app/src/lib/blocks/SpacerBlock.svelte
Normal file
7
app/src/lib/blocks/SpacerBlock.svelte
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
<script lang="ts">
|
||||
let { data } = $props<{ data: Record<string, any> }>();
|
||||
|
||||
const height = $derived(data.height ?? 64);
|
||||
</script>
|
||||
|
||||
<div style="height: {height}px;" class="w-full"></div>
|
||||
Loading…
Add table
Add a link
Reference in a new issue