69 lines
3 KiB
TypeScript
69 lines
3 KiB
TypeScript
import { v4 as uuid } from 'uuid';
|
|
import type { BlockType, ContentBlock } from '$lib/types';
|
|
|
|
export const blockLabels: Record<BlockType, string> = {
|
|
text: 'Text',
|
|
image_text: 'Image + Text',
|
|
timeline: 'Timeline',
|
|
hero: 'Hero',
|
|
button: 'Button',
|
|
spacer: 'Spacer',
|
|
testimonials: 'Testimonials',
|
|
upcoming_calendar: 'Upcoming Calendar'
|
|
};
|
|
|
|
export const blockTypes = Object.keys(blockLabels) as BlockType[];
|
|
|
|
export function createBlock(type: BlockType): ContentBlock {
|
|
const base = { id: uuid(), type, data: {} as Record<string, any> };
|
|
switch (type) {
|
|
case 'text':
|
|
base.data = { content: '<h2>New text block</h2><p>Add your copy here.</p>' };
|
|
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: [{ title: 'Milestone', description: 'Describe this moment.' }] };
|
|
break;
|
|
case 'hero':
|
|
base.data = {
|
|
heading: 'Holistic and Experiential Learning about Happiness',
|
|
subheading: 'Individual sessions, workshops and events in Oslo',
|
|
buttonLabel: 'BOOK NOW',
|
|
buttonUrl: '/book'
|
|
};
|
|
break;
|
|
case 'button':
|
|
base.data = {
|
|
label: 'Learn More',
|
|
href: '/',
|
|
variant: 'primary',
|
|
size: 'md',
|
|
alignment: 'center'
|
|
};
|
|
break;
|
|
case 'spacer':
|
|
base.data = { height: 64 };
|
|
break;
|
|
case 'testimonials':
|
|
base.data = {
|
|
title: 'What They Say About Me',
|
|
items: [
|
|
{ text: 'Recently I started to experience incredible whole-body orgasms. And now I know how it works. My awareness around sexuality changed for good and I feel like a boss of my own life. What a joy to have this freedom of choice.', title: 'Anne' },
|
|
{ text: 'I never thought it was possible to sense so much pleasure in my body without intense stimulations I got used to. After the series of sessions, I could feel something like a trance state by receiving only a gentle touch. That was a totally new experience for me.', title: 'Espen' },
|
|
{ text: "Eva's sexual healing methods should be accessible to everyone. I am amazed by the depth and integrity of the message she conveys through her work. I was meeting Eva for healing my body and, as a result, I reconnected with my heart and soul too.", title: 'Marie' },
|
|
{ text: "It is hard to surprise me with any sexual activity since I had many exciting experiments in my life. But I always suspected that there might be something more I have not yet felt and tried. Thanks to Eva I realised how much power I've got. Under her guidance, I have learnt to maximise my orgasmic potential and consciously play with arousal. By the way, my wife is also happy that I became enthusiastic about new sexual practices.", title: 'Jan' }
|
|
]
|
|
};
|
|
break;
|
|
case 'upcoming_calendar':
|
|
base.data = {
|
|
title: 'Upcoming Events',
|
|
categories: []
|
|
};
|
|
break;
|
|
}
|
|
base.data._background = { type: 'none', color: '', attachment: 'scroll', overlay: false, overlayOpacity: 40 };
|
|
return base;
|
|
}
|