From 688788a80db1555db45b26bec830893af24ffc0a Mon Sep 17 00:00:00 2001 From: patrick Date: Sat, 11 Apr 2026 07:43:55 -0400 Subject: [PATCH] feat: improve education timeline component - add spacing between timeline items - connect timeline line between nodes by extending the line - add isLast prop to hide line extension on final item - auto-detect future start dates and display "Starting X" instead of "X - present" - reorder awards section before core courses section on mobile --- src/components/svelte/EducationItem.svelte | 29 ++++++++++++++++------ src/components/svelte/Timeline.svelte | 2 +- src/pages/index.astro | 4 +-- 3 files changed, 24 insertions(+), 11 deletions(-) diff --git a/src/components/svelte/EducationItem.svelte b/src/components/svelte/EducationItem.svelte index fd924bd..7ccfa3f 100644 --- a/src/components/svelte/EducationItem.svelte +++ b/src/components/svelte/EducationItem.svelte @@ -29,9 +29,10 @@ interface Props { entry: EducationEntry + isLast?: boolean } - let { entry }: Props = $props() + let { entry, isLast = false }: Props = $props() const dateDisplay = $derived(() => { const start = entry.startMonth ? `${entry.startMonth} ${entry.startYear}` : `${entry.startYear}` @@ -40,6 +41,18 @@ const end = entry.endMonth ? `${entry.endMonth} ${entry.endYear}` : `${entry.endYear}` return `${start} - ${end}` } + + // Check if start date is in the future + const now = new Date() + const currentYear = now.getFullYear() + const isFutureYear = entry.startYear > currentYear + const isFutureMonth = entry.startYear === currentYear && entry.startMonth && + new Date(`${entry.startMonth} 1, ${entry.startYear}`).getTime() > now.getTime() + + if (isFutureYear || isFutureMonth) { + return `Starting ${start}` + } + if (entry.expected) { return `${start} - Present (Expected)` } @@ -47,9 +60,9 @@ }) -
+
-
+
@@ -85,10 +98,10 @@
-
- +
+ {#if entry.courses && entry.courses.length > 0} -
+

Core Courses

{#each entry.courses as course} @@ -101,9 +114,9 @@
{/if} - + {#if entry.awards && entry.awards.length > 0} -
+

Awards & Scholarships

    {#each entry.awards as award} diff --git a/src/components/svelte/Timeline.svelte b/src/components/svelte/Timeline.svelte index 75cea72..4866d85 100644 --- a/src/components/svelte/Timeline.svelte +++ b/src/components/svelte/Timeline.svelte @@ -8,6 +8,6 @@ let { children }: Props = $props() -
    +
    {@render children()}
    diff --git a/src/pages/index.astro b/src/pages/index.astro index cfa3cfc..4956338 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -172,8 +172,8 @@ const turnstileSitekey = import.meta.env.PUBLIC_TURNSTILE_SITEKEY
    - {education.map(entry => ( - + {education.map((entry, i) => ( + ))}