Improved TA section, added date sorting
This commit is contained in:
parent
4e85915ebe
commit
eb523961c1
4 changed files with 61 additions and 17 deletions
src
|
@ -1,12 +1,20 @@
|
|||
---
|
||||
export interface Props {
|
||||
date: string
|
||||
title: string
|
||||
link: string
|
||||
image: string
|
||||
}
|
||||
|
||||
const { image, link, title } = Astro.props
|
||||
const { date, image, link, title } = Astro.props
|
||||
|
||||
const options_date: Intl.DateTimeFormatOptions = {
|
||||
year: 'numeric',
|
||||
month: '2-digit',
|
||||
day: '2-digit',
|
||||
}
|
||||
|
||||
const formatted_date = new Date(date).toLocaleDateString('de-DE', options_date)
|
||||
const icon: string = `background: url('/ta_icons/${image}.webp')`
|
||||
---
|
||||
|
||||
|
@ -15,10 +23,16 @@ const icon: string = `background: url('/ta_icons/${image}.webp')`
|
|||
<div style={icon}>
|
||||
<h2>{title}</h2>
|
||||
</div>
|
||||
<p>
|
||||
{formatted_date}
|
||||
</p>
|
||||
</article>
|
||||
</a>
|
||||
|
||||
<style>
|
||||
a {
|
||||
text-decoration: none;
|
||||
}
|
||||
article {
|
||||
background-color: var(--c-darkergray);
|
||||
border-color: var(--c-darkgray);
|
||||
|
@ -54,4 +68,17 @@ const icon: string = `background: url('/ta_icons/${image}.webp')`
|
|||
article h2 {
|
||||
display: none;
|
||||
}
|
||||
|
||||
p {
|
||||
display: flex;
|
||||
text-align: center;
|
||||
justify-content: center;
|
||||
line-height: 100%;
|
||||
text-decoration: none;
|
||||
color: white;
|
||||
font-size: 1rem;
|
||||
font-weight: bold;
|
||||
padding-top: 0.5rem;
|
||||
margin: 0.5rem 0px;
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -36,7 +36,7 @@ if (abovetext === undefined) {
|
|||
color: white;
|
||||
margin: 0.5rem 0px 0.5rem 0.5em;
|
||||
padding: 0.25rem 0.75rem;
|
||||
width: max-content;
|
||||
max-width: max-content;
|
||||
background-color: var(--c-darkgray);
|
||||
}
|
||||
h2 {
|
||||
|
|
|
@ -19,6 +19,8 @@ const important_data = tadata.filter(function (el) {
|
|||
].includes(el.title)
|
||||
})
|
||||
|
||||
tadata.sort((a, b) => Date.parse(b.date) - Date.parse(a.date))
|
||||
|
||||
const description = 'A collection of TAs previously completed be Firq.'
|
||||
---
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue