your personal website on atproto - mirror
blento.app
1import type { CardDefinition } from '../types';
2import CountdownCard from './CountdownCard.svelte';
3import CountdownCardSettings from './CountdownCardSettings.svelte';
4
5export type CountdownCardData = {
6 targetDate?: string;
7};
8
9export const CountdownCardDefinition = {
10 type: 'countdown',
11 contentComponent: CountdownCard,
12 settingsComponent: CountdownCardSettings,
13
14 createNew: (card) => {
15 card.w = 4;
16 card.h = 2;
17 card.mobileW = 8;
18 card.mobileH = 3;
19 card.cardData = {} as CountdownCardData;
20 },
21
22 allowSetColor: true,
23 name: 'Countdown',
24 minW: 4,
25 canHaveLabel: true,
26 groups: ['Utilities'],
27 keywords: ['timer', 'event', 'date', 'countdown'],
28 icon: `<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" class="size-4"><path stroke-linecap="round" stroke-linejoin="round" d="M12 6v6h4.5m4.5 0a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z M19.5 4.5l-1.5 1.5M4.5 4.5l1.5 1.5M12 2.25V3.75M9 2.25h6" /></svg>`
29} as CardDefinition & { type: 'countdown' };