Component for PCBs, many visual tweaks, finished dechorionator content, added many many photos, started work on mars rover software lead, timeline to luxon and automatic date-based ordering
This commit is contained in:
@@ -1,7 +1,11 @@
|
||||
---
|
||||
import type { timelineEntry } from "@interfaces/timeline.ts";
|
||||
|
||||
const timeline: timelineEntry[] = Astro.props.timeline || [];
|
||||
interface Props {
|
||||
timeline: timelineEntry[];
|
||||
}
|
||||
|
||||
const { timeline = [] } = Astro.props;
|
||||
---
|
||||
|
||||
<custom-timeline>
|
||||
@@ -11,21 +15,25 @@ const timeline: timelineEntry[] = Astro.props.timeline || [];
|
||||
data-timeline
|
||||
>
|
||||
{
|
||||
timeline.map((entry, index) => (
|
||||
<div
|
||||
class="border-caperren-green min-w-s max-w-s rounded-lg border bg-black px-2 pt-1 pb-2"
|
||||
data-timeline-node-index={index}
|
||||
>
|
||||
<h3 class="text-lg font-bold">{entry.event}</h3>
|
||||
<h4 class="leading-none font-semibold">{entry.eventDetail}</h4>
|
||||
<time class="mt-1 mb-2 text-sm leading-none italic">
|
||||
{entry.date}
|
||||
</time>
|
||||
{entry.description && (
|
||||
<p class="text-sm font-normal">{entry.description}</p>
|
||||
)}
|
||||
</div>
|
||||
))
|
||||
timeline
|
||||
.sort((a: timelineEntry, b: timelineEntry) =>
|
||||
a.date.diff(b.date).toMillis(),
|
||||
)
|
||||
.map((entry, index) => (
|
||||
<div
|
||||
class="border-caperren-green min-w-s max-w-s rounded-lg border bg-black px-2 pt-1 pb-2"
|
||||
data-timeline-node-index={index}
|
||||
>
|
||||
<h3 class="text-lg font-bold">{entry.event}</h3>
|
||||
<h4 class="leading-none font-semibold">{entry.eventDetail}</h4>
|
||||
<time class="mt-1 mb-2 text-sm leading-none italic">
|
||||
{entry.date.toFormat("LLLL kkkk")}
|
||||
</time>
|
||||
{entry.description && (
|
||||
<p class="text-sm font-normal">{entry.description}</p>
|
||||
)}
|
||||
</div>
|
||||
))
|
||||
}
|
||||
</div>
|
||||
<div
|
||||
|
||||
Reference in New Issue
Block a user