2023-01-20 23:43:00 +00:00
|
|
|
---
|
|
|
|
export interface Props {
|
2023-03-10 19:10:54 +00:00
|
|
|
date: string
|
2023-03-09 10:44:18 +00:00
|
|
|
title: string
|
|
|
|
link: string
|
|
|
|
image: string
|
2023-03-11 18:59:51 +00:00
|
|
|
user?: string
|
2023-01-20 23:43:00 +00:00
|
|
|
}
|
|
|
|
|
2023-03-11 18:59:51 +00:00
|
|
|
const { user, date, image, link, title } = Astro.props
|
2023-01-20 23:43:00 +00:00
|
|
|
|
2023-03-10 19:10:54 +00:00
|
|
|
const options_date: Intl.DateTimeFormatOptions = {
|
|
|
|
year: 'numeric',
|
|
|
|
month: '2-digit',
|
|
|
|
day: '2-digit',
|
|
|
|
}
|
|
|
|
|
|
|
|
const formatted_date = new Date(date).toLocaleDateString('de-DE', options_date)
|
2023-03-06 18:12:59 +00:00
|
|
|
const icon: string = `background: url('/ta_icons/${image}.webp')`
|
2023-03-11 18:59:51 +00:00
|
|
|
|
|
|
|
let hasuser = ''
|
|
|
|
if (user !== undefined) {
|
|
|
|
hasuser = 'hasuser'
|
|
|
|
}
|
2023-01-20 23:43:00 +00:00
|
|
|
---
|
2023-03-09 10:44:18 +00:00
|
|
|
|
2023-01-27 10:16:01 +00:00
|
|
|
<a href={link} target="_blank" rel="noopener noreferrer" aria-label={title}>
|
2023-03-09 10:44:18 +00:00
|
|
|
<article>
|
|
|
|
<div style={icon}>
|
|
|
|
<h2>{title}</h2>
|
|
|
|
</div>
|
2023-03-10 19:10:54 +00:00
|
|
|
<p>
|
2023-03-11 18:59:51 +00:00
|
|
|
<span class={hasuser}>
|
|
|
|
By {user}<br /> •
|
|
|
|
</span>
|
2023-03-10 19:10:54 +00:00
|
|
|
{formatted_date}
|
|
|
|
</p>
|
2023-03-09 10:44:18 +00:00
|
|
|
</article>
|
2023-01-20 23:43:00 +00:00
|
|
|
</a>
|
|
|
|
|
|
|
|
<style>
|
2023-03-11 18:59:51 +00:00
|
|
|
span {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
.hasuser {
|
|
|
|
display: flex;
|
|
|
|
}
|
2023-03-10 19:10:54 +00:00
|
|
|
a {
|
|
|
|
text-decoration: none;
|
|
|
|
}
|
2023-03-09 10:44:18 +00:00
|
|
|
article {
|
2023-03-05 20:58:01 +00:00
|
|
|
background-color: var(--c-darkergray);
|
|
|
|
border-color: var(--c-darkgray);
|
2023-01-20 23:43:00 +00:00
|
|
|
padding: 10px;
|
|
|
|
text-align: center;
|
|
|
|
transition: transform var(--speed) var(--ease);
|
|
|
|
height: auto;
|
|
|
|
width: auto;
|
|
|
|
line-height: 128px;
|
2023-03-09 10:44:18 +00:00
|
|
|
}
|
|
|
|
article:hover {
|
2023-01-20 23:43:00 +00:00
|
|
|
transform: scale(var(--hover-scale));
|
2023-03-09 10:44:18 +00:00
|
|
|
}
|
|
|
|
article > div {
|
2023-01-20 23:43:00 +00:00
|
|
|
width: 128px;
|
|
|
|
height: 128px;
|
|
|
|
object-fit: cover;
|
|
|
|
object-position: 0% 0%;
|
2023-03-09 10:44:18 +00:00
|
|
|
}
|
2023-01-20 23:43:00 +00:00
|
|
|
|
2023-03-09 10:44:18 +00:00
|
|
|
article:hover h2 {
|
2023-01-20 23:43:00 +00:00
|
|
|
color: white;
|
2023-03-05 20:58:01 +00:00
|
|
|
background-color: var(--c-darkgray);
|
2023-01-20 23:43:00 +00:00
|
|
|
font-size: 18px;
|
|
|
|
display: inline-block;
|
|
|
|
vertical-align: bottom;
|
|
|
|
line-height: normal;
|
|
|
|
width: 90%;
|
|
|
|
border-radius: 5px;
|
|
|
|
opacity: 90%;
|
2023-03-09 10:44:18 +00:00
|
|
|
}
|
2023-01-20 23:43:00 +00:00
|
|
|
|
2023-03-09 10:44:18 +00:00
|
|
|
article h2 {
|
2023-01-20 23:43:00 +00:00
|
|
|
display: none;
|
2023-03-09 10:44:18 +00:00
|
|
|
}
|
2023-03-10 19:10:54 +00:00
|
|
|
|
|
|
|
p {
|
|
|
|
display: flex;
|
|
|
|
text-align: center;
|
|
|
|
justify-content: center;
|
2023-03-11 18:59:51 +00:00
|
|
|
align-items: center;
|
2023-03-10 19:10:54 +00:00
|
|
|
line-height: 100%;
|
|
|
|
text-decoration: none;
|
|
|
|
color: white;
|
|
|
|
font-size: 1rem;
|
|
|
|
font-weight: bold;
|
|
|
|
padding-top: 0.5rem;
|
|
|
|
margin: 0.5rem 0px;
|
2023-03-11 18:59:51 +00:00
|
|
|
flex-wrap: wrap;
|
|
|
|
flex-direction: column;
|
2023-03-10 19:10:54 +00:00
|
|
|
}
|
2023-03-09 10:44:18 +00:00
|
|
|
</style>
|