diff --git a/.vscode/settings.json b/.vscode/settings.json index 4fc4d43..204668b 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -4,6 +4,7 @@ "editor.quickSuggestions": { "strings": true }, + "css.customData": [".vscode/tailwind.json"], "cSpell.words": [ "correctanswer", "creationdate", diff --git a/.vscode/tailwind.json b/.vscode/tailwind.json new file mode 100644 index 0000000..d634f37 --- /dev/null +++ b/.vscode/tailwind.json @@ -0,0 +1,95 @@ +{ + "version": 1.2, + "atDirectives": [ + { + "name": "@theme", + "description": "Use the `@theme` directive to define your project's custom design tokens, like fonts, colors, and breakpoints.", + "references": [ + { + "name": "Tailwind Documentation", + "url": "https://tailwindcss.com/docs/functions-and-directives#theme-directive" + } + ] + }, + { + "name": "@source", + "description": "Use the `@source` directive to explicitly specify source files that aren't picked up by Tailwind's automatic content detection.", + "references": [ + { + "name": "Tailwind Documentation", + "url": "https://tailwindcss.com/docs/functions-and-directives#source-directive" + } + ] + }, + { + "name": "@utility", + "description": "Use the `@utility` directive to add custom utilities to your project that work with variants like `hover`, `focus` and `lg`.", + "references": [ + { + "name": "Tailwind Documentation", + "url": "https://tailwindcss.com/docs/functions-and-directives#utility-directive" + } + ] + }, + { + "name": "@variant", + "description": "Use the `@variant` directive to apply a Tailwind variant to styles in your CSS.", + "references": [ + { + "name": "Tailwind Documentation", + "url": "https://tailwindcss.com/docs/functions-and-directives#variant-directive" + } + ] + }, + { + "name": "@custom-variant", + "description": "Use the `@custom-variant` directive to add a custom variant in your project.", + "references": [ + { + "name": "Tailwind Documentation", + "url": "https://tailwindcss.com/docs/functions-and-directives#custom-variant-directive" + } + ] + }, + { + "name": "@apply", + "description": "Use the `@apply` directive to inline any existing utility classes into your own custom CSS.", + "references": [ + { + "name": "Tailwind Documentation", + "url": "https://tailwindcss.com/docs/functions-and-directives#apply-directive" + } + ] + }, + { + "name": "@reference", + "description": "If you want to use `@apply` or `@variant` in the ` +
{@render children()}
diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index 330c0df..91e914c 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -120,12 +120,6 @@ justify-content: center; } - h1 { - text-align: center; - margin: 0; - font-size: 60px; - } - h2 { text-align: center; margin: 0; diff --git a/src/routes/IdleScreen/+page.svelte b/src/routes/IdleScreen/+page.svelte index 4a9da74..9090bc0 100644 --- a/src/routes/IdleScreen/+page.svelte +++ b/src/routes/IdleScreen/+page.svelte @@ -2,32 +2,35 @@ import { Modal, Content, Trigger } from "sv-popup"; import Time from "./components/time/DisplayCollsOfTime.svelte"; - import TimeTable from "./timeTable.svelte"; - import EditTimetableDiv from "./EditTimetable.svelte"; + import TimeTable from "./components/timetable/DisplayRowsOfTimetable.svelte"; + import EditTimetableDiv from "./components/timetable/EditTimetable.svelte"; + import { colseModal } from "./logic/TimeAndTableData.svelte.js"; export let ShowSeconds = $state({ v: true }); -
+
- + {#if ShowSeconds.v}Disable Seconds{:else}Enable Seconds{/if} + - +
-
-
diff --git a/src/routes/IdleScreen/EditTimetable.svelte b/src/routes/IdleScreen/EditTimetable.svelte deleted file mode 100644 index 186b69d..0000000 --- a/src/routes/IdleScreen/EditTimetable.svelte +++ /dev/null @@ -1,348 +0,0 @@ - - -
-
-
-
- - {#each table.Times as time} - { - newTable(table); - }} - bind:value={time} - /> - {/each} -
-
- Monday - {#each table.Monday as time} - { - newTable(table); - }} - bind:value={time} - /> - {/each} -
-
- Tuesday - {#each table.Tuesday as time} - { - newTable(table); - }} - bind:value={time} - /> - {/each} -
-
- Wednesday - {#each table.Wednesday as time} - { - newTable(table); - }} - bind:value={time} - /> - {/each} -
-
- Thursday - {#each table.Thursday as time} - { - newTable(table); - }} - bind:value={time} - /> - {/each} -
-
- Friday - {#each table.Friday as time} - { - newTable(table); - }} - bind:value={time} - /> - {/each} -
-
- -
-
- -{#if TabOpen !== false} -
-
-
-

Paste CSV here:

-

- -
-
- - -
-
-
-{/if} - - diff --git a/src/routes/IdleScreen/components/time/DisplayCollsOfTime.svelte b/src/routes/IdleScreen/components/time/DisplayCollsOfTime.svelte index 047c2b5..69afb40 100644 --- a/src/routes/IdleScreen/components/time/DisplayCollsOfTime.svelte +++ b/src/routes/IdleScreen/components/time/DisplayCollsOfTime.svelte @@ -7,32 +7,34 @@ onMount(() => { ShowSeconds = localStorage.getItem("ShowSeconds") || "true" == "true" ? true : false; - setInterval(() => { ampm = new Date().getHours() >= 12 ? "PM" : "AM"; }, 1000); }); -
- - -

:

- - +
+
+ + +

:

+ + - {#if ShowSeconds} - - - {/if} + {#if ShowSeconds} +

.

-

{ampm}

-
-
-

- {new Date().toLocaleString("en-US", { weekday: "short" })} - {new Date().getDate()}, - {new Date().toLocaleString("en-US", { month: "short" })} - {new Date().getFullYear()} -

+ + + {/if} +

{ampm}

+
+
+

+ {new Date().toLocaleString("en-US", { weekday: "short" })} + {new Date().getDate()}, + {new Date().toLocaleString("en-US", { month: "short" })} + {new Date().getFullYear()} +

+
diff --git a/src/routes/IdleScreen/components/time/digit.svelte b/src/routes/IdleScreen/components/time/digit.svelte index fd91b91..98c8dc2 100644 --- a/src/routes/IdleScreen/components/time/digit.svelte +++ b/src/routes/IdleScreen/components/time/digit.svelte @@ -3,7 +3,9 @@ {#if props.size == "small"} -

{props.digit}

+

+ {props.digit} +

{:else if props.size == "large"} -

{props.digit}

-{/if} +

{props.digit}

+{/if} \ No newline at end of file diff --git a/src/routes/IdleScreen/components/time/row.svelte b/src/routes/IdleScreen/components/time/row.svelte index bc81e23..fa94570 100644 --- a/src/routes/IdleScreen/components/time/row.svelte +++ b/src/routes/IdleScreen/components/time/row.svelte @@ -19,7 +19,7 @@
{#each Array(digits) as _, i} diff --git a/src/routes/IdleScreen/components/timetable/DisplayRowsOfTimetable.svelte b/src/routes/IdleScreen/components/timetable/DisplayRowsOfTimetable.svelte new file mode 100644 index 0000000..2230b1b --- /dev/null +++ b/src/routes/IdleScreen/components/timetable/DisplayRowsOfTimetable.svelte @@ -0,0 +1,37 @@ + + +
+ {#each timetableData.v as row, RowIndex} + {#each row as time, timeIndex} + {#if RowIndex == 0 && timeIndex == 0} + + {:else if RowIndex == 0} + {time} + {:else if RowIndex == new Date().getDay() && timeIndex == 0} + {legend[RowIndex]} + {:else if RowIndex == new Date().getDay()} + {time} + {:else if timeIndex == 0} + {legend[RowIndex]} + {:else} + {time} + {/if} + {/each} + {/each} +
diff --git a/src/routes/IdleScreen/components/timetable/EditTimetable.svelte b/src/routes/IdleScreen/components/timetable/EditTimetable.svelte new file mode 100644 index 0000000..2ca0e2f --- /dev/null +++ b/src/routes/IdleScreen/components/timetable/EditTimetable.svelte @@ -0,0 +1,58 @@ + + +
+
+ {#each data as row, RowIndex} +
+ {#each row as _, timeIndex} + {#if RowIndex == 0 && timeIndex == 0} + + {:else if timeIndex == 0} + + {:else if RowIndex == 0} + + {:else} + + {/if} + {/each} +
+ {/each} +
+ +
+ +
+
diff --git a/src/routes/IdleScreen/logic/TimeAndTableData.svelte.js b/src/routes/IdleScreen/logic/TimeAndTableData.svelte.js index e69de29..d480d89 100644 --- a/src/routes/IdleScreen/logic/TimeAndTableData.svelte.js +++ b/src/routes/IdleScreen/logic/TimeAndTableData.svelte.js @@ -0,0 +1,20 @@ +export let timetableData = $state({ + v: [ + [ + "07:50 - 08:50", + "08:50 - 09:40", + "09:40 - 10:30 ", + "10:30 - 11:00", + "11:00 - 12:00", + "12:00 - 01:00", + "01:00 - 02:00", + ], + ["English", "Sanskrit", "Math", "Lunch", "Hindi", "Social Science", "Science"], + ["English", "Art & Craft", "Math", "Lunch", "Hindi", "Social Science", "Science"], + ["English", "GK", "Math", "Lunch", "Hindi", "Social Science", "Science"], + ["English", "Sanskrit", "Math", "Lunch", "Hindi", "Social Science", "Science"], + ["English", "Computers", "Math", "Lunch", "Hindi", "Social Science", "Science"], + ], +}); + +export let colseModal = $state({ v: false }); diff --git a/src/routes/IdleScreen/timeTable.svelte b/src/routes/IdleScreen/timeTable.svelte deleted file mode 100644 index 67374c8..0000000 --- a/src/routes/IdleScreen/timeTable.svelte +++ /dev/null @@ -1,198 +0,0 @@ - - -
-
-
- - {#each table.Times as time} - {time} - {/each} -
-
- {#if new Date().getDay() == 1} - Monday - {:else} - Monday - {/if} - {#each table.Monday as time} - {#if new Date().getDay() == 1} - {time} - {:else} - {time} - {/if} - {/each} -
-
- {#if new Date().getDay() == 2} - Tuesday - {:else} - Tuesday - {/if} - {#each table.Tuesday as time} - {#if new Date().getDay() == 2} - {time} - {:else} - {time} - {/if} - {/each} -
-
- {#if new Date().getDay() == 3} - Wednesday - {:else} - Wednesday - {/if} - {#each table.Wednesday as time} - {#if new Date().getDay() == 3} - {time} - {:else} - {time} - {/if} - {/each} -
-
- {#if new Date().getDay() == 4} - Thursday - {:else} - Thursday - {/if} - {#each table.Thursday as time} - {#if new Date().getDay() == 4} - {time} - {:else} - {time} - {/if} - {/each} -
-
- {#if new Date().getDay() == 5} - Friday - {:else} - Friday - {/if} - {#each table.Friday as time} - {#if new Date().getDay() == 5} - {time} - {:else} - {time} - {/if} - {/each} -
-
-
- - diff --git a/src/routes/app.css b/src/routes/app.css new file mode 100644 index 0000000..47fa6dc --- /dev/null +++ b/src/routes/app.css @@ -0,0 +1,17 @@ +@import "https://www.nerdfonts.com/assets/css/webfont.css"; +@import url("https://fonts.googleapis.com/css2?family=Comfortaa:wght@300..700&family=JetBrains+Mono:wght@200&family=Sour+Gummy:wght@300&display=swap"); +@import "tailwindcss"; + +:root { + @apply bg-gray-950 p-5 text-white; +} + + + +.btn { + @apply cursor-pointer rounded border-2 border-white bg-gray-600 px-4 py-2 font-bold text-white transition-all hover:scale-105 hover:-rotate-5 hover:bg-gray-500 hover:shadow-lg; + + &.green { + @apply bg-green-600 hover:bg-green-500; + } +} \ No newline at end of file