firq-dev-website/src/components/favouriteCard.astro

96 lines
1.6 KiB
Text
Raw Normal View History

---
export interface Props {
2023-03-09 11:44:18 +01:00
name: string
origin: string
image: string
link: string
}
const { link, image, origin, name } = Astro.props
2023-03-09 11:44:18 +01:00
const img: string = `/favourites/${image}.webp`
---
<a href={link} target="_blank" rel="noopener noreferrer">
<article>
<div class="heading">{name}</div>
<img src={img} alt={name} />
<h2 class="subtext">
{origin}
</h2>
</article>
</a>
<style>
a {
text-decoration: none;
}
2023-03-09 11:44:18 +01:00
.heading {
display: flex;
height: 4rem;
font-size: 22px;
color: white;
max-width: 200px;
padding-bottom: 0.3rem;
font-weight: bold;
margin: 0px;
justify-content: center;
align-items: center;
}
2023-03-09 11:44:18 +01:00
.servants-container {
row-gap: 1em;
column-gap: 1em;
justify-content: center;
align-self: center;
align-content: center;
}
2023-03-09 11:44:18 +01:00
article:hover {
transform: scale(var(--hover-scale));
}
2023-03-09 11:44:18 +01:00
article {
display: flex;
flex-wrap: wrap;
flex-direction: column;
background-color: var(--c-darkergray);
border-color: var(--c-darkgray);
padding: 0em 0.75em;
width: 40%;
height: auto;
justify-content: center;
align-items: center;
text-align: center;
transition: transform var(--speed) var(--ease);
}
2023-03-09 11:44:18 +01:00
article > img {
padding: 0.25em;
width: 120px;
height: auto;
}
2023-03-09 11:44:18 +01:00
@media (min-width: 512px) {
article {
padding: 10px 10px;
width: auto;
height: auto;
}
2023-03-09 11:44:18 +01:00
article > img {
padding: 1.5em;
width: 200px;
height: auto;
}
2023-03-09 11:44:18 +01:00
}
.subtext {
color: white;
font-size: 16px;
font-weight: 600;
margin: 5;
line-height: 20px;
}
</style>