firq-dev-website/src/components/links/linkCard.astro

50 lines
1,001 B
Text
Raw Normal View History

2024-10-26 22:41:24 +02:00
---
import type { ImageMetadata } from 'astro'
export interface Props {
text: string
icon: ImageMetadata
link: string
}
const { text, icon, link } = Astro.props
const icon_src_url = `url("${icon.src}")`
---
<a href={link} target="_blank" rel="noopener noreferrer">
<div class="icon"></div>
<span class="visually-hidden">{text}</span>
</a>
<style define:vars={{ icon_src_url }}>
2024-10-29 22:17:38 +01:00
* {
transition: all var(--a-time-default) var(--a-animation-1);
}
2024-10-26 22:41:24 +02:00
a {
display: flex;
align-items: center;
justify-content: center;
2024-10-26 22:51:03 +02:00
width: 2.25em;
height: 2.25em;
2024-10-26 22:41:24 +02:00
background-color: var(--c-primary-background);
border-radius: .35rem;
border: 2px solid var(--c-primary-text);
}
a:hover {
border-color: var(--c-accent-1);
& .icon {
background: var(--c-accent-1);
}
}
.icon {
mask: var(--icon_src_url) no-repeat center;
mask-size: contain;
background-color: var(--c-primary-text);
2024-10-26 22:51:03 +02:00
height: 1.5em;
width: 1.5em;
2024-10-26 22:41:24 +02:00
}
</style>