From 93af773b4a86a1bd0323c23b5a07b805febe5759 Mon Sep 17 00:00:00 2001 From: Arc-blroth <45273859+Arc-blroth@users.noreply.github.com> Date: Tue, 18 Jun 2024 20:59:39 -0700 Subject: [PATCH 1/4] fix archive ordering + add summer to archive --- data/archive.ts | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/data/archive.ts b/data/archive.ts index 5b7fb72..102132b 100644 --- a/data/archive.ts +++ b/data/archive.ts @@ -8,6 +8,8 @@ export interface SeriesArchive { export interface QuarterArchive { name: string; + season: "w" | "s" | "u" | "f"; + year: number; series: SeriesArchive[]; } @@ -19,7 +21,7 @@ for (const event of eventData) { if (!event.type) continue; const idComponents = event.id.split("-"); - if (idComponents.length >= 2 && /^[fws]\d\d$/.test(idComponents[0])) { + if (idComponents.length >= 2 && /^[wsuf]\d\d$/.test(idComponents[0])) { if (!quarters.has(idComponents[0])) { quarters.set(idComponents[0], new Map()); } @@ -36,22 +38,32 @@ for (const event of eventData) { } } +const SEASONS = { "w": 0, "s": 1, "u": 2, "f": 3 }; + const archive: QuarterArchive[] = [...quarters.entries()].map(([quarterId, quarterMap]) => { + const seasonChar = quarterId.charAt(0); let season; - switch (quarterId.charAt(0)) { + switch (seasonChar) { case "f": season = "Fall"; break; case "w": season = "Winter"; break; case "s": season = "Spring"; break; case "u": season = "Summer"; break; default: throw `invalid season char '${quarterId.charAt(0)}' (this should never happen)` } + const year = parseInt(quarterId.length === 3 ? `20${quarterId.slice(1)}` : quarterId); return { - name: `${season} ${quarterId.length === 3 ? `20${quarterId.slice(1)}` : quarterId}`, + name: `${season} ${year}`, + season: seasonChar, + year: year, series: [...quarterMap.entries()].map(([seriesId, events]) => ({ name: seriesId, description: eventTypes.find(x => x.name === seriesId)!.description, events, })) } -}) +}).sort((a, b) => { + if (a.year == b.year) return SEASONS[a.season] - SEASONS[b.season]; + return a.year - b.year; +}).reverse(); + export default archive; From 24b66edca2a69aaaac8dc1c632868c8d43288e2b Mon Sep 17 00:00:00 2001 From: Arc-blroth <45273859+Arc-blroth@users.noreply.github.com> Date: Tue, 18 Jun 2024 21:03:11 -0700 Subject: [PATCH 2/4] future-proofing (tm) --- data/archive.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/archive.ts b/data/archive.ts index 102132b..64c8f7a 100644 --- a/data/archive.ts +++ b/data/archive.ts @@ -50,7 +50,7 @@ const archive: QuarterArchive[] = [...quarters.entries()].map(([quarterId, quart case "u": season = "Summer"; break; default: throw `invalid season char '${quarterId.charAt(0)}' (this should never happen)` } - const year = parseInt(quarterId.length === 3 ? `20${quarterId.slice(1)}` : quarterId); + const year = parseInt(quarterId.length === 3 ? `20${quarterId.slice(1)}` : quarterId.slice(1)); return { name: `${season} ${year}`, season: seasonChar, From be19cc2b8e1314cd7b6d4e13af906636f87abfb9 Mon Sep 17 00:00:00 2001 From: Arc-blroth <45273859+Arc-blroth@users.noreply.github.com> Date: Wed, 26 Jun 2024 18:15:46 -0700 Subject: [PATCH 3/4] reverse archive sort comparator --- data/archive.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/data/archive.ts b/data/archive.ts index 64c8f7a..bb94f81 100644 --- a/data/archive.ts +++ b/data/archive.ts @@ -62,8 +62,8 @@ const archive: QuarterArchive[] = [...quarters.entries()].map(([quarterId, quart })) } }).sort((a, b) => { - if (a.year == b.year) return SEASONS[a.season] - SEASONS[b.season]; - return a.year - b.year; -}).reverse(); + if (b.year == a.year) return SEASONS[b.season] - SEASONS[a.season]; + return b.year - a.year; +}); export default archive; From ff53bc7392aab9177dd07f6a46b20907e1088581 Mon Sep 17 00:00:00 2001 From: Arc-blroth <45273859+Arc-blroth@users.noreply.github.com> Date: Mon, 26 Aug 2024 11:29:11 +0800 Subject: [PATCH 4/4] fix archive layout weirdness --- styles/Archive.module.scss | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/styles/Archive.module.scss b/styles/Archive.module.scss index 753b7d7..b71f46d 100644 --- a/styles/Archive.module.scss +++ b/styles/Archive.module.scss @@ -7,18 +7,21 @@ } .series { - padding: 0.5rem; + display: grid; + grid-template-columns: repeat(auto-fill, 20rem); + gap: 2rem; + padding: 1.5rem; } .event { - display: inline-flex; /* keep the inline nature of buttons */ + display: flex; align-items: flex-start; /* this is default */ background-color: var(--cyber-black); - margin: 1rem; border: var(--cyber-gold) 2px solid; border-radius: 2rem; width: 20rem; height: 17rem; + font-family: inherit; /* ??? override user-agent stylesheet for button */ text-align: left; &:hover {