From 8b40305b221dc336a422a4ff8a45e10e66442f3f Mon Sep 17 00:00:00 2001 From: Valentijn Date: Fri, 15 May 2026 18:35:47 +0200 Subject: [PATCH] fixed a LOT of repetition --- src/components/Box.astro | 61 ++++++++++ src/components/Contact/ContactForm.astro | 113 +++++++++--------- src/components/Contact/ContactImage.astro | 14 +++ src/components/Contact/Page.astro | 49 ++++---- src/components/Experience/ExperienceBox.astro | 78 +++--------- src/components/Experience/Page.astro | 49 ++------ src/components/Hero/Page.astro | 55 ++------- src/components/Projects/Page.astro | 49 ++------ src/components/Projects/ProjectBox.astro | 74 +++--------- src/components/Section.astro | 74 ++++++++++++ src/components/Studies/Page.astro | 54 ++------- src/components/Studies/StudyBox.astro | 36 +++--- src/components/TitleCard.astro | 52 ++------ src/data/site.ts | 42 +++++-- src/utils/getCurrentStudy.ts | 23 ---- 15 files changed, 356 insertions(+), 467 deletions(-) create mode 100644 src/components/Box.astro create mode 100644 src/components/Contact/ContactImage.astro create mode 100644 src/components/Section.astro delete mode 100644 src/utils/getCurrentStudy.ts diff --git a/src/components/Box.astro b/src/components/Box.astro new file mode 100644 index 0000000..fae0b11 --- /dev/null +++ b/src/components/Box.astro @@ -0,0 +1,61 @@ +--- +interface Props { + accent?: string; + isTitle?: boolean +} + +const { accent, isTitle } = Astro.props as Props; + +let opachity = 0.05; +if (isTitle) { + opachity = 0.2; +} +--- + +
+ {accent &&
} +
+ +
+
+ + \ No newline at end of file diff --git a/src/components/Contact/ContactForm.astro b/src/components/Contact/ContactForm.astro index 471c39b..f557856 100644 --- a/src/components/Contact/ContactForm.astro +++ b/src/components/Contact/ContactForm.astro @@ -1,78 +1,76 @@ --- const { title, description } = Astro.props; +import Box from "../Box.astro"; --- -
-
-
- - - - -
-
-
+ +
+ + + + +
+
\ No newline at end of file diff --git a/src/components/Contact/ContactImage.astro b/src/components/Contact/ContactImage.astro new file mode 100644 index 0000000..e208975 --- /dev/null +++ b/src/components/Contact/ContactImage.astro @@ -0,0 +1,14 @@ +--- +import Box from "../Box.astro"; +--- + + +
+
+ \ No newline at end of file diff --git a/src/components/Contact/Page.astro b/src/components/Contact/Page.astro index 0c3701a..ba57aa7 100644 --- a/src/components/Contact/Page.astro +++ b/src/components/Contact/Page.astro @@ -1,48 +1,43 @@ --- import TitleCard from '../TitleCard.astro'; import ContactForm from './ContactForm.astro'; +import ContactImage from './ContactImage.astro'; +import Section from '../Section.astro'; --- -
-
+
- -
-
+
+ +
+ +
+
+ \ No newline at end of file diff --git a/src/components/Experience/ExperienceBox.astro b/src/components/Experience/ExperienceBox.astro index ed20c2e..c45a86f 100644 --- a/src/components/Experience/ExperienceBox.astro +++ b/src/components/Experience/ExperienceBox.astro @@ -1,69 +1,35 @@ --- const { experience } = Astro.props; - +import Box from "../Box.astro"; const color: string = experience.color --- -
-
+ +
+
+

{experience.name}

+

{experience.role}

-
-
-
-

{experience.name}

-

{experience.role}

+

+ {experience.description} +

+
-

- {experience.description} -

-
- -
-

- {experience.start.toLocaleDateString('en-US', { year: 'numeric', month: 'short' })} - - - {experience.end - ? experience.end.toLocaleDateString('en-US', { year: 'numeric', month: 'short' }) - : 'Nu'} -

-
+
+

+ {experience.start.toLocaleDateString('en-US', { year: 'numeric', month: 'short' })} + - + {experience.end + ? experience.end.toLocaleDateString('en-US', { year: 'numeric', month: 'short' }) + : 'Nu'} +

-
+ \ No newline at end of file diff --git a/src/components/Studies/Page.astro b/src/components/Studies/Page.astro index 617e5ed..a113c9b 100644 --- a/src/components/Studies/Page.astro +++ b/src/components/Studies/Page.astro @@ -2,45 +2,22 @@ import { siteData } from '../../data/site'; import StudyBox from './StudyBox.astro'; import TitleCard from '../TitleCard.astro'; +import Section from '../Section.astro'; const studies = [...siteData.studies]; const sortedStudies = studies.sort((a, b) => b.start.getTime() - a.start.getTime()); --- -
-
-
- - {sortedStudies.map((study) => ( - - ))} -
-
-
+
+
+ + {sortedStudies.map((study) => ( + + ))} +
+
\ No newline at end of file diff --git a/src/components/Studies/StudyBox.astro b/src/components/Studies/StudyBox.astro index e27341a..cf1285f 100644 --- a/src/components/Studies/StudyBox.astro +++ b/src/components/Studies/StudyBox.astro @@ -1,33 +1,29 @@ --- const { study } = Astro.props; - +import Box from "../Box.astro"; const color: string = study.color --- -
- + +
+
+

{study.study}

+

{study.school} · {study.level}

+
-
-
-
-

{study.study}

-

{study.school} · {study.level}

-
- -
-

- {study.start.toLocaleDateString('en-US', { year: 'numeric', month: 'short' })} - - - {study.end - ? study.end.toLocaleDateString('en-US', { year: 'numeric', month: 'short' }) - : 'Nu'} -

-
+
+

+ {study.start.toLocaleDateString('en-US', { year: 'numeric', month: 'short' })} + - + {study.end + ? study.end.toLocaleDateString('en-US', { year: 'numeric', month: 'short' }) + : 'Nu'} +

-
+