diff --git a/package-lock.json b/package-lock.json index 8126efd..05ce574 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,6 +17,7 @@ "@types/react": "^19.2.2", "@types/react-dom": "^19.2.3", "astro": "^5.16.0", + "canvas-confetti": "^1.9.2", "dayjs": "^1.11.19", "isomorphic-dompurify": "^2.30.0", "marked": "^16.4.1", @@ -26,7 +27,8 @@ "typescript": "^5.9.3" }, "devDependencies": { - "@biomejs/biome": "^2.2.6" + "@biomejs/biome": "^2.2.6", + "@types/canvas-confetti": "^1.6.1" } }, "node_modules/@ampproject/remapping": { @@ -3096,6 +3098,13 @@ "@babel/types": "^7.28.2" } }, + "node_modules/@types/canvas-confetti": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@types/canvas-confetti/-/canvas-confetti-1.9.0.tgz", + "integrity": "sha512-aBGj/dULrimR1XDZLtG9JwxX1b4HPRF6CX9Yfwh3NvstZEm1ZL7RBnel4keCPSqs1ANRu1u2Aoz9R+VmtjYuTg==", + "dev": true, + "license": "MIT" + }, "node_modules/@types/debug": { "version": "4.1.12", "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.12.tgz", @@ -3950,6 +3959,16 @@ ], "license": "CC-BY-4.0" }, + "node_modules/canvas-confetti": { + "version": "1.9.4", + "resolved": "https://registry.npmjs.org/canvas-confetti/-/canvas-confetti-1.9.4.tgz", + "integrity": "sha512-yxQbJkAVrFXWNbTUjPqjF7G+g6pDotOUHGbkZq2NELZUMDpiJ85rIEazVb8GTaAptNW2miJAXbs1BtioA251Pw==", + "license": "ISC", + "funding": { + "type": "donate", + "url": "https://www.paypal.me/kirilvatev" + } + }, "node_modules/ccount": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/ccount/-/ccount-2.0.1.tgz", diff --git a/package.json b/package.json index a391a3e..734b7d1 100644 --- a/package.json +++ b/package.json @@ -24,12 +24,14 @@ "dayjs": "^1.11.19", "isomorphic-dompurify": "^2.30.0", "marked": "^16.4.1", + "canvas-confetti": "^1.9.2", "react": "^19.2.0", "react-dom": "^19.2.0", "tailwindcss": "^4.1.17", "typescript": "^5.9.3" }, "devDependencies": { - "@biomejs/biome": "^2.2.6" + "@biomejs/biome": "^2.2.6", + "@types/canvas-confetti": "^1.9.0" } } diff --git a/src/components/DueDate.astro b/src/components/DueDate.astro index 62639c0..d2910a9 100644 --- a/src/components/DueDate.astro +++ b/src/components/DueDate.astro @@ -1,8 +1,8 @@ --- import { - localizeTime, - formatTime, calculateAbsoluteDate, + formatTime, + localizeTime, } from "../utils/dateUtils"; interface Props { diff --git a/src/components/EnhancedMarkdownContent.astro b/src/components/EnhancedMarkdownContent.astro index dceb1d3..3174dae 100644 --- a/src/components/EnhancedMarkdownContent.astro +++ b/src/components/EnhancedMarkdownContent.astro @@ -1,6 +1,6 @@ --- -import Default from "@astrojs/starlight/components/MarkdownContent.astro"; import { Aside } from "@astrojs/starlight/components"; +import Default from "@astrojs/starlight/components/MarkdownContent.astro"; const { data } = Astro.locals.starlightRoute.entry; --- diff --git a/src/components/Schedule.astro b/src/components/Schedule.astro index 5a4725d..b50c078 100644 --- a/src/components/Schedule.astro +++ b/src/components/Schedule.astro @@ -1,11 +1,12 @@ --- import { getCollection } from "astro:content"; -import { marked } from "marked"; -import DOMPurify from "isomorphic-dompurify"; -import dayjs, { type Dayjs } from "dayjs"; -import { formatTime, calculateAbsoluteDate } from "../utils/dateUtils"; import { Badge } from "@astrojs/starlight/components"; +import dayjs, { type Dayjs } from "dayjs"; +import DOMPurify from "isomorphic-dompurify"; +import { marked } from "marked"; import { transformContentData } from "../utils/contentUtils"; +import { calculateAbsoluteDate, formatTime } from "../utils/dateUtils"; + interface Reading { link: string; @@ -103,31 +104,20 @@ const events = [...exams, ...homeworks, ...lectures].sort( (a, b) => a.date.valueOf() - b.date.valueOf(), ); -// events is already sorted, so just check if the last event is in the past -// class concludes on the Friday of finals week -const concluded = calculateAbsoluteDate({ - week: 16, - day: "Friday", - time: "17:00:00", -}).isBefore(dayjs()); --- -{ - !concluded && ( -