90 lines
1.7 KiB
Text
90 lines
1.7 KiB
Text
---
|
|
import type { ImageMetadata } from 'astro'
|
|
import { Image } from 'astro:assets'
|
|
|
|
export interface Props {
|
|
site: string
|
|
link: string
|
|
imageFile: string
|
|
}
|
|
|
|
const { imageFile, link, site } = Astro.props
|
|
const imagePath = `/src/assets/social/${imageFile}`
|
|
const images_logos = import.meta.glob<{ default: ImageMetadata }>(
|
|
'/src/assets/social/*.webp'
|
|
)
|
|
---
|
|
|
|
<a href={link} target="_blank" rel="noopener noreferrer" aria-label={site}>
|
|
<article class="contact do-hover">
|
|
<Image src={images_logos[imagePath]()} alt="" />
|
|
<div>
|
|
<h2>{site}</h2>
|
|
</div>
|
|
</article>
|
|
</a>
|
|
|
|
<style>
|
|
a {
|
|
text-decoration: none;
|
|
}
|
|
|
|
article {
|
|
--size-value: 6.25rem;
|
|
border-radius: 1.25rem;
|
|
display: flex;
|
|
justify-content: center;
|
|
align-items: 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;
|
|
position: relative;
|
|
}
|
|
|
|
article img {
|
|
border-radius: 1.25rem;
|
|
width: var(--size-value);
|
|
height: var(--size-value);
|
|
}
|
|
|
|
article:hover div {
|
|
border-radius: 1.25rem;
|
|
padding: 0 0.5rem;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
text-align: center;
|
|
background-color: var(--c-darkgray);
|
|
height: calc(var(--size-value));
|
|
width: calc(var(--size-value) - 1rem);
|
|
opacity: 90%;
|
|
z-index: 100;
|
|
position: absolute;
|
|
}
|
|
|
|
article:hover h2 {
|
|
margin: 0;
|
|
display: inline-flex;
|
|
font-weight: bold;
|
|
color: white;
|
|
font-size: 18px;
|
|
}
|
|
|
|
article h2 {
|
|
position: absolute;
|
|
display: none;
|
|
}
|
|
|
|
article div {
|
|
display: none;
|
|
}
|
|
|
|
a:hover {
|
|
transform: scale(var(--hover-scale));
|
|
}
|
|
</style>
|