Skip to content

Commit

Permalink
Make highlights card background changeable
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-panhead committed Apr 18, 2024
1 parent cfc02f6 commit 835c607
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 7 deletions.
25 changes: 22 additions & 3 deletions src/components/HighlightCard.astro
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,20 @@
interface Props {
title: string,
date: string
primacy?: 0|1|2 // primary|secondary|tertiary
}
const { title, date } = Astro.props;
const { title, date, primacy = 0 } = Astro.props;
---

<div class="highlights_card">
<div class:list={
[
"highlights_card",
{"highlights_card--primary": primacy === 0},
{"highlights_card--secondary": primacy === 1},
{"highlights_card--tertiary": primacy === 2}
]
}>
<div class="highlights_card-header">
<span class="highlights_card-title">
<slot name="icon" />
Expand Down Expand Up @@ -35,10 +43,21 @@ const { title, date } = Astro.props;
}

.highlights_card:hover {
background-color: white;
border: 1px solid black;
}

.highlights_card--primary:hover {
background-color: var(--primary);
}

.highlights_card--secondary:hover {
background-color: var(--secondary);
}

.highlights_card--tertiary:hover {
background-color: var(--tertiary);
}

.highlights_card-header {
display: flex;
flex-direction: column;
Expand Down
8 changes: 4 additions & 4 deletions src/components/HighlightsSection.astro
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import HighlightCard from "./HighlightCard.astro"
<div class="highlights">
<h2>Here's some highlights of my experience:</h2>
<div class="highlights-container">
<HighlightCard title="Berlinguette Group" date="Jan 2024 - Now">
<HighlightCard title="Berlinguette Group" date="Jan 2024 - Now" primacy={2}>
<svg
class="text-tertiary"
slot="icon"
Expand All @@ -30,7 +30,7 @@ import HighlightCard from "./HighlightCard.astro"
using technologies like React, Python, Docker, Arduino, and MQTT.
</HighlightCard>
<hr>
<HighlightCard title="UBC BIOMOD Club" date="May 2023 - Now">
<HighlightCard title="UBC BIOMOD Club" date="May 2023 - Now" primacy={1}>
<svg
class="text-secondary"
slot="icon"
Expand All @@ -57,9 +57,9 @@ import HighlightCard from "./HighlightCard.astro"
submission, where we placed 5th internationally!
</HighlightCard>
<hr>
<HighlightCard title="UBC ARC" date="May 2023 - Dec 2023">
<HighlightCard title="UBC ARC" date="May 2023 - Dec 2023" primacy={0}>
<svg
class="text-primary"
class="text-primary"
slot="icon"
aria-hidden="true"
xmlns="http://www.w3.org/2000/svg"
Expand Down

0 comments on commit 835c607

Please sign in to comment.