Restructure and extra stuff

This commit is contained in:
Firq 2024-10-26 22:41:24 +02:00
parent b0fc3a05c5
commit a77312c17c
Signed by: Firq
GPG key ID: 3ACC61C8CEC83C20
36 changed files with 250 additions and 68 deletions
src/components/links

View file

@ -0,0 +1,47 @@
---
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 }}>
a {
display: flex;
align-items: center;
justify-content: center;
width: 36px;
height: 36px;
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);
height: 65%;
width: 65%;
}
</style>