your personal website on atproto - mirror blento.app
at main 46 lines 1.1 kB view raw
1import { COLUMNS } from '$lib'; 2import type { CardDefinition } from '../types'; 3import EditingSectionCard from './EditingSectionCard.svelte'; 4import SectionCard from './SectionCard.svelte'; 5import SectionCardSettings from './SectionCardSettings.svelte'; 6 7export const SectionCardDefinition = { 8 type: 'section', 9 contentComponent: SectionCard, 10 editingContentComponent: EditingSectionCard, 11 createNew: (card) => { 12 card.cardType = 'section'; 13 card.cardData = { 14 text: 'hello world', 15 verticalAlign: 'bottom', 16 textSize: 1 17 }; 18 19 card.h = 1; 20 card.mobileH = 2; 21 22 card.w = COLUMNS; 23 card.mobileW = COLUMNS; 24 }, 25 26 defaultColor: 'transparent', 27 maxH: 1, 28 canResize: false, 29 settingsComponent: SectionCardSettings 30} as CardDefinition & { type: 'section' }; 31 32 33 34export const textAlignClasses: Record<string, string> = { 35 left: '', 36 center: 'text-center justify-center', 37 right: 'text-end justify-end' 38}; 39 40export const verticalAlignClasses: Record<string, string> = { 41 top: 'items-stretch', 42 center: 'items-center-safe', 43 bottom: 'items-end-safe' 44}; 45 46export const textSizeClasses = ['text-lg', 'text-2xl', 'text-4xl', 'text-6xl'];