116 lines
2.4 KiB
Text
116 lines
2.4 KiB
Text
---
|
|
export interface Props {
|
|
url: string
|
|
slug: string
|
|
title: string
|
|
pubdate: Date
|
|
description: string
|
|
author: string
|
|
}
|
|
|
|
const options_date: Intl.DateTimeFormatOptions = {
|
|
year: 'numeric',
|
|
month: 'long',
|
|
day: '2-digit',
|
|
}
|
|
const { author, description, pubdate, url, title, slug } = Astro.props
|
|
const date = new Date(pubdate).toLocaleDateString('en-GB', options_date)
|
|
---
|
|
|
|
<a href={`${url}/${slug}`} rel="noopener noreferrer">
|
|
<div class="circle"></div>
|
|
<article>
|
|
<h2>{title}</h2>
|
|
<h3>{date} • Written by {author}</h3>
|
|
<p>{description}</p>
|
|
</article>
|
|
</a>
|
|
|
|
<style>
|
|
* {
|
|
transition: all var(--a-time-default) var(--a-animation-1);
|
|
}
|
|
.circle {
|
|
display: none;
|
|
}
|
|
|
|
a {
|
|
align-items: center;
|
|
justify-content: center;
|
|
display: flex;
|
|
text-decoration: none;
|
|
height: fit-content;
|
|
margin: 0px 0.5rem;
|
|
width: 100%;
|
|
}
|
|
p {
|
|
color: var(--c-primary-text);
|
|
text-align: left;
|
|
font-size: 1.1em;
|
|
margin: 0.5em;
|
|
}
|
|
article > h2 {
|
|
margin: 0.3rem 0.5rem;
|
|
color: var(--c-accent-1);
|
|
font-size: 1.5rem;
|
|
line-height: normal;
|
|
text-decoration: none;
|
|
}
|
|
article > h3 {
|
|
margin: 0.2em 0.5rem;
|
|
color: var(--c-primary-text);
|
|
font-size: 1rem;
|
|
line-height: normal;
|
|
text-decoration: none;
|
|
}
|
|
article {
|
|
display: flex;
|
|
flex: 1;
|
|
flex-wrap: wrap;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
align-content: center;
|
|
justify-content: center;
|
|
background-color: var(--c-primary-background);
|
|
padding: 10px;
|
|
text-align: center;
|
|
min-height: 100%;
|
|
border: 2px solid var(--c-primary-background);
|
|
border-radius: 1.25rem;
|
|
}
|
|
|
|
a:hover article {
|
|
border-color: var(--c-accent-1);
|
|
}
|
|
|
|
@media (min-width: 900px) {
|
|
.circle {
|
|
margin: 1rem 0.5rem 1rem 0.5rem;
|
|
position: relative;
|
|
display: flex;
|
|
visibility: visible;
|
|
height: 1rem;
|
|
width: 1rem;
|
|
background-color: var(--c-accent-1);
|
|
border-style: solid;
|
|
border-width: 0.25rem;
|
|
border-color: var(--c-secondary-background);
|
|
border-radius: 40%;
|
|
transition: all var(--a-time-short) var(--a-animation-1);
|
|
}
|
|
|
|
a:hover > .circle {
|
|
height: 1.25rem;
|
|
width: 1.25rem;
|
|
translate: -0.125rem;
|
|
margin-right: 4px;
|
|
}
|
|
|
|
article {
|
|
border: 2px solid var(--c-primary-background);
|
|
align-items: flex-start;
|
|
align-content: flex-start;
|
|
margin-left: 0.5rem;
|
|
}
|
|
}
|
|
</style>
|