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

79 lines
1.4 KiB
Text

---
export interface Props {
site: string
link: string
image: string
}
const { image, link, site } = Astro.props
const icon: string = `background-image: url('/assets/social/${image}.webp')`
---
<a href={link} target="_blank" rel="noopener noreferrer" aria-label={site}>
<article class="contact do-hover">
<div style={icon}>
<span>
<h2>{site}</h2>
</span>
</div>
</article>
</a>
<style>
a {
text-decoration: none;
}
article:hover span {
padding: 0.5rem 0.5rem;
display: flex;
align-items: center;
justify-content: center;
text-align: center;
background-color: var(--c-darkgray);
height: 85%;
width: 100%;
opacity: 90%;
}
article:hover h2 {
margin: 0;
display: inline-flex;
font-weight: bold;
color: white;
font-size: 18px;
}
article h2 {
display: none;
}
article span {
display: none;
}
article div {
background-size: contain;
width: 100px;
height: 100px;
display: flex;
align-items: center;
justify-content: center;
}
article {
display: flex;
align-items: center;
justify-content: center;
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;
}
a:hover {
transform: scale(var(--hover-scale));
}
</style>