2023-01-20 23:43:00 +00:00
|
|
|
---
|
2023-12-25 17:39:44 +00:00
|
|
|
import type { ImageMetadata } from 'astro'
|
|
|
|
import { Image } from 'astro:assets'
|
|
|
|
|
2023-01-20 23:43:00 +00:00
|
|
|
export interface Props {
|
2023-03-09 10:44:18 +00:00
|
|
|
site: string
|
|
|
|
link: string
|
2023-12-25 17:39:44 +00:00
|
|
|
imageFile: string
|
2023-01-20 23:43:00 +00:00
|
|
|
}
|
|
|
|
|
2023-12-25 17:39:44 +00:00
|
|
|
const { imageFile, link, site } = Astro.props
|
2024-01-01 16:53:19 +00:00
|
|
|
const logoAltText = `${site} Logo`
|
2023-12-25 17:39:44 +00:00
|
|
|
const imagePath = `/src/assets/social/${imageFile}`
|
|
|
|
const images_logos = import.meta.glob<{ default: ImageMetadata }>(
|
2023-12-25 22:49:11 +00:00
|
|
|
'/src/assets/social/*.{png,webp}'
|
2023-12-25 17:39:44 +00:00
|
|
|
)
|
2023-01-20 23:43:00 +00:00
|
|
|
---
|
|
|
|
|
2024-01-01 16:53:19 +00:00
|
|
|
<a href={link} target="_blank" rel="noopener noreferrer" aria-label=`${site} - new window`>
|
2023-03-09 10:44:18 +00:00
|
|
|
<article class="contact do-hover">
|
2024-01-01 16:53:19 +00:00
|
|
|
<Image src={images_logos[imagePath]()} alt={logoAltText} />
|
2023-12-25 17:39:44 +00:00
|
|
|
<div>
|
|
|
|
<h2>{site}</h2>
|
2023-03-10 20:01:12 +00:00
|
|
|
</div>
|
2023-03-09 10:44:18 +00:00
|
|
|
</article>
|
2024-01-01 16:53:19 +00:00
|
|
|
<span class="visually-hidden">{logoAltText}</span>
|
2023-01-20 23:43:00 +00:00
|
|
|
</a>
|
|
|
|
|
|
|
|
<style>
|
2023-03-15 16:03:50 +00:00
|
|
|
a {
|
|
|
|
text-decoration: none;
|
|
|
|
}
|
|
|
|
|
2023-12-25 17:39:44 +00:00
|
|
|
article {
|
|
|
|
--size-value: 6.25rem;
|
2023-07-08 13:02:07 +00:00
|
|
|
border-radius: 1.25rem;
|
|
|
|
display: flex;
|
|
|
|
justify-content: center;
|
2023-12-25 17:39:44 +00:00
|
|
|
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;
|
2023-07-08 13:02:07 +00:00
|
|
|
width: var(--size-value);
|
|
|
|
height: var(--size-value);
|
|
|
|
}
|
|
|
|
|
2023-12-25 17:39:44 +00:00
|
|
|
article:hover div {
|
2023-07-08 13:02:07 +00:00
|
|
|
border-radius: 1.25rem;
|
|
|
|
padding: 0 0.5rem;
|
2023-03-15 16:03:50 +00:00
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
|
|
|
text-align: center;
|
|
|
|
background-color: var(--c-darkgray);
|
2023-12-25 17:39:44 +00:00
|
|
|
height: calc(var(--size-value));
|
|
|
|
width: calc(var(--size-value) - 1rem);
|
2023-03-15 16:03:50 +00:00
|
|
|
opacity: 90%;
|
2023-12-25 17:39:44 +00:00
|
|
|
z-index: 100;
|
|
|
|
position: absolute;
|
2023-03-15 16:03:50 +00:00
|
|
|
}
|
|
|
|
|
2023-03-10 20:01:12 +00:00
|
|
|
article:hover h2 {
|
2023-03-15 16:03:50 +00:00
|
|
|
margin: 0;
|
|
|
|
display: inline-flex;
|
|
|
|
font-weight: bold;
|
2023-03-09 10:44:18 +00:00
|
|
|
color: white;
|
|
|
|
font-size: 18px;
|
2023-03-10 20:01:12 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
article h2 {
|
2023-12-25 17:39:44 +00:00
|
|
|
position: absolute;
|
2023-03-10 20:01:12 +00:00
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
|
2023-12-25 17:39:44 +00:00
|
|
|
article div {
|
2023-03-15 16:03:50 +00:00
|
|
|
display: none;
|
|
|
|
}
|
2023-12-25 17:39:44 +00:00
|
|
|
|
2023-03-09 10:44:18 +00:00
|
|
|
a:hover {
|
|
|
|
transform: scale(var(--hover-scale));
|
|
|
|
}
|
|
|
|
</style>
|