firq-dev-website/src/components/cards/technologyCard.astro

89 lines
1.8 KiB
Text
Raw Normal View History

---
import { Image } from 'astro:assets'
2024-07-19 22:52:15 +02:00
import type { GlobImage } from '../../types/generic'
import { plsLoadImage } from '../../utils/tools'
export interface Props {
2023-03-09 11:44:18 +01:00
title: string
link: string
imageFile: string
}
const { imageFile, link, title } = Astro.props
const imagePath = `/src/assets/technologies/${imageFile}`
2024-01-05 01:12:19 +01:00
const images_logos = import.meta.glob<GlobImage>(
'/src/assets/technologies/*.{png,webp}'
)
2024-01-05 01:12:19 +01:00
const loadedImage = plsLoadImage(images_logos, imagePath)
---
2023-03-09 11:44:18 +01:00
<a href={link} target="_blank" rel="noopener noreferrer" aria-label={title}>
2023-03-09 11:44:18 +01:00
<article>
2024-10-22 21:34:18 +02:00
<Image src={loadedImage} alt="" loading={'eager'} width={150} height={150} quality={100}/>
<div>
<h2>{title}</h2>
2023-03-09 11:44:18 +01:00
</div>
</article>
2024-10-22 21:15:24 +02:00
<span class="visually-hidden">{title}</span>
</a>
<style>
2024-10-29 22:17:38 +01:00
* {
transition: all var(--a-time-default) var(--a-animation-1);
}
a {
text-decoration: none;
}
2024-10-24 18:52:33 +02:00
2023-03-09 11:44:18 +01:00
article {
display: flex;
2024-10-24 18:52:33 +02:00
position: relative;
align-items: center;
2024-10-24 18:52:33 +02:00
justify-content: center;
text-align: center;
2024-10-24 18:52:33 +02:00
background-color: var(--c-primary-background);
border: 2px solid var(--c-primary-background);
border-radius: 1.25rem;
padding: 6px;
height: auto;
width: auto;
2024-10-24 18:52:33 +02:00
}
article img {
2023-07-08 15:02:07 +02:00
border-radius: 1.25rem;
2024-10-24 18:52:33 +02:00
width: 80px;
height: auto;
2023-03-09 11:44:18 +01:00
}
2024-10-24 18:52:33 +02:00
article div {
display: none;
2023-03-09 11:44:18 +01:00
}
2024-10-24 18:52:33 +02:00
article:hover {
border-color: var(--c-accent-1);
2023-03-09 11:44:18 +01:00
}
article:hover div {
display: flex;
2024-10-24 18:52:33 +02:00
position: absolute;
margin: unset;
align-items: center;
justify-content: center;
text-align: center;
2024-10-24 18:52:33 +02:00
background-color: var(--c-primary-background);
border-radius: 1.25rem;
width: 80px;
height: 80px;
opacity: 90%;
z-index: 100;
}
2023-03-09 11:44:18 +01:00
article:hover h2 {
display: inline-flex;
2024-10-24 18:52:33 +02:00
font-size: 16px;
font-weight: 500;
color: var(--c-primary-text);
}
2023-03-09 11:44:18 +01:00
</style>