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

116 lines
1.8 KiB
Text
Raw Normal View History

---
export interface Props {
2023-03-09 11:44:18 +01:00
name: string
link: string
mlb: string
}
2023-03-09 11:44:18 +01:00
const { mlb, link, name } = Astro.props
const ce_img: string = `/assets/ce/${link}.webp`
const mlb_ce: string = `/assets/ce/mlb.webp`
2023-03-09 11:44:18 +01:00
let mlb_image: string = 'mlbalign'
2023-03-09 11:44:18 +01:00
if (mlb === 'false') {
mlb_image = 'hidemlb'
}
---
<article>
2023-03-09 11:44:18 +01:00
<div>
<img class="ce-crop" src={ce_img} alt={name} />
</div>
<div class={mlb_image}>
<img class="mlb" src={mlb_ce} alt="Max-limit broken" />
</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;
2023-03-09 11:44:18 +01:00
background-color: var(--c-darkergray);
padding: 20px;
padding-top: 5px;
width: 35%;
height: auto;
justify-content: center;
text-align: center;
transition: transform var(--speed) var(--ease);
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 {
transform: scale(var(--hover-scale));
}
2023-03-09 11:44:18 +01:00
article div {
margin: 0.5em auto;
}
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
.heading-center {
display: flex;
height: 4rem;
width: 100%;
align-items: center;
justify-content: center;
font-size: 1.25em;
color: white;
font-weight: bold;
}
.ce-crop {
width: 6em;
height: 6em;
}
2023-03-09 11:44:18 +01:00
.mlb {
2023-07-07 18:40:56 +02:00
width: 5.5rem;
2023-03-09 11:44:18 +01:00
margin-left: auto;
margin-right: auto;
}
.mlbalign {
display: flex;
justify-items: center;
align-items: center;
}
@media (min-width: 512px) {
.ce-crop {
2023-03-09 11:44:18 +01:00
width: 7.5em;
height: 7.5em;
}
2023-03-09 11:44:18 +01:00
article {
width: 10em;
}
2023-01-23 19:00:16 +01:00
.mlbalign {
2023-03-09 11:44:18 +01:00
width: 7.5em;
}
2023-07-07 18:40:56 +02:00
.mlb {
width: 7rem;
}
2023-03-09 11:44:18 +01:00
}
</style>