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

56 lines
1.1 KiB
Text
Raw Normal View History

---
export interface Props {
title: string;
link: string;
image: string;
}
const { image, link, title } = Astro.props;
const icon: string = `background: url('/ta_icons/${image}.webp')`
---
2023-01-27 10:16:01 +00:00
<a href={link} target="_blank" rel="noopener noreferrer" aria-label={title}>
<article>
<div style={icon}>
<h2>{title}</h2>
</div>
</article>
</a>
<style>
article {
2023-03-05 20:58:01 +00:00
background-color: var(--c-darkergray);
border-color: var(--c-darkgray);
padding: 10px;
text-align: center;
transition: transform var(--speed) var(--ease);
height: auto;
width: auto;
line-height: 128px;
}
article:hover {
transform: scale(var(--hover-scale));
}
article > div {
width: 128px;
height: 128px;
object-fit: cover;
object-position: 0% 0%;
}
article:hover h2 {
color: white;
2023-03-05 20:58:01 +00:00
background-color: var(--c-darkgray);
font-size: 18px;
display: inline-block;
vertical-align: bottom;
line-height: normal;
width: 90%;
border-radius: 5px;
opacity: 90%;
}
article h2 {
display: none;
}
</style>