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

107 lines
1.9 KiB
Text
Raw Normal View History

---
2023-12-25 19:05:07 +01:00
import { Image } from 'astro:assets'
2024-07-19 22:52:15 +02:00
import mlb_ce from '../../assets/ce/mlb.webp'
import type { GlobImage } from '../../types/generic'
import { plsLoadImage } from '../../utils/tools'
export interface Props {
2023-03-09 11:44:18 +01:00
name: string
imageFile: string
2024-01-05 01:14:28 +01:00
mlb: boolean
}
const { mlb, imageFile, name } = Astro.props
const imagePath = `/src/assets/ce/${imageFile}`
2024-01-05 01:12:19 +01:00
const images_ces = import.meta.glob<GlobImage>('/src/assets/ce/*.png')
const loadedCEImage = plsLoadImage(images_ces, imagePath)
2024-01-05 01:12:19 +01:00
const mlb_image = mlb ? 'mlbalign' : 'hidemlb'
---
<article>
2023-03-09 11:44:18 +01:00
<div>
<Image src={loadedCEImage} alt={name} class="ce-crop" />
2023-03-09 11:44:18 +01:00
</div>
<div class={mlb_image}>
2023-12-25 19:05:07 +01:00
<Image src={mlb_ce} alt="Max-limit broken" class="mlb" />
2023-03-09 11:44:18 +01:00
</div>
</article>
<style>
2023-03-09 11:44:18 +01:00
.hidemlb {
display: none;
height: 1em;
}
2023-03-09 11:44:18 +01:00
article {
2023-07-07 18:32:14 +02:00
border-radius: 1.25rem;
border: 2px var(--c-darkgray) solid;
2023-03-09 11:44:18 +01:00
background-color: var(--c-darkergray);
width: 35%;
height: auto;
justify-content: center;
text-align: center;
margin: 0px;
display: grid;
grid-template-columns: 100%;
2023-07-07 18:32:14 +02:00
grid-template-rows: auto 3em;
2023-03-09 11:44:18 +01:00
gap: 0px 0px;
grid-auto-flow: row;
grid-template-areas:
'.'
'.';
}
2023-03-09 11:44:18 +01:00
article:hover {
border: 2px var(--c-darkpurple) solid;
2023-03-09 11:44:18 +01:00
}
2023-03-09 11:44:18 +01:00
article div {
margin: auto;
2023-03-09 11:44:18 +01:00
}
2023-03-09 11:44:18 +01:00
img {
2023-07-07 18:32:14 +02:00
border-radius: 1.5rem;
margin-top: 1rem;
2023-03-09 11:44:18 +01:00
display: flex;
margin-left: auto;
margin-right: auto;
}
2023-03-09 11:44:18 +01:00
.ce-crop {
2024-10-21 22:23:25 +02:00
width: min(85%, 85px);
height: auto;
2023-03-09 11:44:18 +01:00
}
2023-03-09 11:44:18 +01:00
.mlb {
2024-10-21 22:23:25 +02:00
width: min(85%, 85px);
2023-12-25 19:05:07 +01:00
height: auto;
2023-03-09 11:44:18 +01:00
margin-left: auto;
margin-right: auto;
margin-top: 0px;
2023-03-09 11:44:18 +01:00
}
.mlbalign {
display: flex;
justify-items: center;
align-items: center;
}
@media (min-width: 512px) {
.ce-crop {
width: 100px;
height: 100px;
}
2023-03-09 11:44:18 +01:00
article {
width: 128px;
}
2023-01-23 19:00:16 +01:00
.mlbalign {
width: 85px;
}
2023-07-07 18:40:56 +02:00
.mlb {
width: 85px;
2023-07-07 18:40:56 +02:00
}
2023-03-09 11:44:18 +01:00
}
</style>