|
3 | 3 | import type { EventData } from "$lib"; |
4 | 4 | import Day from "$lib/Day.svelte"; |
5 | 5 | import { onMount } from "svelte"; |
6 | | - import type { CalendarThemes, CustomTheme } from "./utils"; |
| 6 | + import { DARK_THEME, LIGHT_THEME, type CalendarThemes, type CustomTheme } from "./utils"; |
7 | 7 |
|
8 | 8 | export let events: EventData[]; |
9 | 9 | export let theme: CalendarThemes; |
|
18 | 18 |
|
19 | 19 | function chooseStyle() { |
20 | 20 | let tempStyle = ""; |
21 | | - const LIGHT_THEME: CustomTheme = { |
22 | | - "backgroundColor": "#ededed", |
23 | | - "headerColor": "#b3b3b3", |
24 | | - "dayTextColor": "#f5f5f5", |
25 | | - "dayOfWeekSize": "2rem", |
26 | | - "selectedDayTextColor": "#ffffff", |
27 | | - "headerHeight": "80px", |
28 | | - "headerBoxShadow": "0px 8px 18px -18px rgb(0, 0, 0)", |
29 | | - "daySeparatorLineWidth": "1px", |
30 | | - "daySeparatorLineStyle": "solid", |
31 | | - "daySeparatorLineColor": "#9e9e9e", |
32 | | - "eventBorderRadius": "3px", |
33 | | - "eventTitleColor": "#6a81a4", |
34 | | - "eventTitleFontSize": "clamp(0.9rem, 0.6951rem + 0.6829vw, 1.25rem)", |
35 | | - "tagFontSize": "0.6rem", |
36 | | - "timeTextColor": "#545454", |
37 | | - "timeTextFontSize": "clamp(0.8rem, 0rem + 1.4vw, 1rem)", |
38 | | - "eventBackgroundColor": "#adadad", |
39 | | - "resourceFontSize": "1rem", |
40 | | - "resourceTextColor": "#ffffff" |
41 | | - } |
42 | | - const DARK_THEME: CustomTheme = { |
43 | | - backgroundColor: "#303030", |
44 | | - headerColor: "#212121", |
45 | | - dayTextColor: "#ffffff", |
46 | | - dayOfWeekSize: "2rem", |
47 | | - selectedDayTextColor: "#8AB4F4", |
48 | | - headerHeight: "80px", |
49 | | - headerBoxShadow: "0px 8px 18px -18px rgb(0, 0, 0)", |
50 | | - daySeparatorLineWidth: "1px", |
51 | | - daySeparatorLineStyle: "dashed", |
52 | | - daySeparatorLineColor: "#202020", |
53 | | - eventBackgroundColor: "#424242", |
54 | | - eventBorderRadius: "3px", |
55 | | - eventTitleColor: "#8AB4F4", |
56 | | - eventTitleFontSize: "clamp(0.9rem, 0.6951rem + 0.6829vw, 1.25rem)", |
57 | | - resourceTextColor: "#ffffff", |
58 | | - resourceFontSize: "1rem", |
59 | | - tagFontSize: "0.6rem", |
60 | | - timeTextColor: "#fdfdfd", |
61 | | - timeTextFontSize: "clamp(0.8rem, 0rem + 1.4vw, 1rem)" |
62 | | - } |
63 | 21 | if (theme === "CUSTOM") { |
64 | 22 | for (let i=0;i<Object.keys(customTheme).length;i++) { |
65 | 23 | tempStyle += `--${Object.keys(customTheme)[i]}:${customTheme[Object.keys(customTheme)[i]]};`; |
|
0 commit comments