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-03-16 16:25:45 +00:00
|
|
|
ta_servant?: string
|
|
|
|
turns?: string
|
2023-01-20 23:43:00 +00:00
|
|
|
}
|
|
|
|
|
2023-03-16 16:25:45 +00:00
|
|
|
const { turns, ta_servant, 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-07-13 18:15:57 +00:00
|
|
|
const icon: string = `background-image: url('/assets/ta_icons/${image}.webp')`
|
2023-03-16 16:25:45 +00:00
|
|
|
const servant: string = `/assets/ta_icons/ta_servants/${ta_servant}.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>
|
2023-03-16 16:25:45 +00:00
|
|
|
<div class="icon" style={icon}>
|
2023-03-15 16:03:50 +00:00
|
|
|
<span>
|
|
|
|
<h2>{title}</h2>
|
|
|
|
</span>
|
2023-03-09 10:44:18 +00:00
|
|
|
</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-16 16:25:45 +00:00
|
|
|
<div class="expand-on-hover">
|
|
|
|
<img src={servant} alt="" />
|
|
|
|
<h2>{turns}</h2>
|
|
|
|
</div>
|
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;
|
2023-07-08 12:38:36 +00:00
|
|
|
border-radius: 1.25rem;
|
|
|
|
padding-bottom: 1.5rem;
|
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
|
|
|
}
|
2023-03-16 16:25:45 +00:00
|
|
|
article > .icon {
|
2023-07-08 12:38:36 +00:00
|
|
|
border-radius: 1.25rem;
|
|
|
|
--size-value: 7rem;
|
|
|
|
width: var(--size-value);
|
|
|
|
height: var(--size-value);
|
|
|
|
margin: 0.5rem;
|
2023-07-13 18:15:57 +00:00
|
|
|
background-size: var(--size-value);
|
|
|
|
background-position: center center;
|
2023-03-09 10:44:18 +00:00
|
|
|
}
|
2023-01-20 23:43:00 +00:00
|
|
|
|
2023-03-16 16:25:45 +00:00
|
|
|
article:hover .icon span {
|
2023-03-15 16:03:50 +00:00
|
|
|
display: flex;
|
2023-07-08 12:38:36 +00:00
|
|
|
position: absolute;
|
2023-03-15 16:03:50 +00:00
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
|
|
|
text-align: center;
|
2023-03-05 20:58:01 +00:00
|
|
|
background-color: var(--c-darkgray);
|
2023-07-08 12:38:36 +00:00
|
|
|
height: calc(var(--size-value) + 0.1rem);
|
|
|
|
width: calc(var(--size-value) + 0.1rem);
|
2023-01-20 23:43:00 +00:00
|
|
|
opacity: 90%;
|
2023-07-08 12:38:36 +00:00
|
|
|
border-radius: 1.25rem;
|
2023-03-09 10:44:18 +00:00
|
|
|
}
|
2023-01-20 23:43:00 +00:00
|
|
|
|
2023-03-15 16:03:50 +00:00
|
|
|
article:hover span h2 {
|
|
|
|
margin: 0;
|
|
|
|
display: inline-flex;
|
|
|
|
font-weight: bold;
|
|
|
|
color: white;
|
|
|
|
font-size: 18px;
|
|
|
|
line-height: 150%;
|
2023-07-08 12:38:36 +00:00
|
|
|
padding: 0.5rem;
|
2023-03-15 16:03:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
article span h2 {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
|
2023-03-16 16:25:45 +00:00
|
|
|
article .icon span {
|
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
|
|
|
|
2023-03-16 16:25:45 +00:00
|
|
|
.icon {
|
2023-03-14 17:55:58 +00:00
|
|
|
display: flex;
|
|
|
|
justify-content: center;
|
|
|
|
align-items: center;
|
|
|
|
}
|
|
|
|
|
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-16 16:25:45 +00:00
|
|
|
|
|
|
|
.expand-on-hover {
|
|
|
|
display: flex;
|
|
|
|
flex-direction: row;
|
|
|
|
flex-wrap: wrap;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: space-evenly;
|
|
|
|
background-color: var(--c-duskgray);
|
|
|
|
z-index: 99;
|
|
|
|
transform: scaleY(0);
|
|
|
|
transform-origin: top;
|
|
|
|
position: absolute;
|
2023-07-08 12:38:36 +00:00
|
|
|
top: 90%;
|
2023-03-16 16:25:45 +00:00
|
|
|
left: 0px;
|
|
|
|
right: 0px;
|
|
|
|
color: white;
|
2023-07-08 12:38:36 +00:00
|
|
|
border-radius: 0px 0px 1.25rem 1.25rem;
|
2023-03-16 16:25:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.expand-on-hover img {
|
|
|
|
width: 3rem;
|
|
|
|
height: 3rem;
|
2023-07-08 12:38:36 +00:00
|
|
|
margin-top: 0.5rem;
|
|
|
|
margin-bottom: 0.5rem;
|
|
|
|
border-radius: 0.5rem;
|
2023-03-16 16:25:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.expand-on-hover h2 {
|
|
|
|
margin: 0.5rem;
|
|
|
|
}
|
|
|
|
|
|
|
|
article:hover .expand-on-hover {
|
|
|
|
transform: scaleY(1);
|
|
|
|
transition: transform 200ms ease-in-out;
|
|
|
|
background-color: var(--c-duskgray);
|
|
|
|
}
|
2023-03-09 10:44:18 +00:00
|
|
|
</style>
|