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

141 lines
2.6 KiB
Text
Raw Normal View History

2023-01-15 17:53:19 +01:00
---
export interface Props {
2023-03-09 11:44:18 +01:00
name: string
level: string
skills: string
np: string
image_servant: string
image_bond: string
ml: string
bond10: string
2023-01-15 17:53:19 +01:00
}
2023-03-09 11:44:18 +01:00
const { bond10, ml, image_bond, image_servant, np, skills, level, name } =
Astro.props
2023-01-15 17:53:19 +01:00
const servant_img: string = `/assets/servant/${image_servant}.webp`
const bondce_img: string = `/assets/ce/bond-ce/${image_bond}.webp`
2023-03-09 11:44:18 +01:00
let bondce_css: string = 'bond-ce'
2023-01-15 17:53:19 +01:00
2023-03-09 11:44:18 +01:00
if (bond10 === 'false') {
bondce_css += ' unobtained'
2023-01-15 17:53:19 +01:00
}
---
<article>
2023-03-09 11:44:18 +01:00
<img src={servant_img} alt={name} />
<h2 class="subtext">
Level {level}<br />
{skills}<br />
NP {np}
</h2>
<div class="expand-on-hover">
<img class={bondce_css} src={bondce_img} alt="" />
<h2 class="subtext">Mana Loading: {ml === 'Not Unlocked' && <br />}{ml}</h2>
</div>
2023-01-15 17:53:19 +01:00
</article>
<style>
2023-03-09 11:44:18 +01:00
.heading {
display: flex;
height: 4rem;
width: 100%;
align-items: center;
justify-content: center;
2023-07-07 18:32:14 +02:00
font-size: 24px;
2023-03-09 11:44:18 +01:00
color: white;
max-width: 200px;
padding-bottom: 0.3rem;
font-weight: bold;
}
.servants-container {
row-gap: 1em;
column-gap: 1em;
justify-content: center;
align-self: center;
}
article:hover {
transform: scale(var(--hover-scale));
}
article {
display: flex;
flex-wrap: wrap;
flex-direction: column;
background-color: var(--c-darkergray);
border-color: var(--c-darkgray);
2023-07-07 18:37:58 +02:00
padding: 0em 0.75em 0.5rem 0.75em;
2023-03-09 11:44:18 +01:00
width: 40%;
height: auto;
justify-content: center;
align-items: center;
text-align: center;
transition: transform var(--speed) var(--ease);
2023-07-07 18:32:14 +02:00
border-radius: 1.25rem;
2023-03-09 11:44:18 +01:00
}
article > img {
2023-07-07 18:32:14 +02:00
width: 7.5rem;
height: 7.5rem;
border-radius: 2.5rem;
margin-top: 0.75rem;
2023-03-09 11:44:18 +01:00
}
.subtext {
color: white;
font-size: 16px;
font-weight: 600;
margin: 5;
line-height: 20px;
}
.expand-on-hover {
background-color: var(--c-duskgray);
2023-03-09 11:44:18 +01:00
z-index: 99;
transform: scaleY(0);
transform-origin: top;
position: absolute;
2023-07-07 18:37:58 +02:00
top: 92.5%;
2023-03-09 11:44:18 +01:00
left: 0px;
right: 0px;
2023-07-07 18:32:14 +02:00
border-radius: 0px 0px 1.25rem 1.25rem;
2023-03-09 11:44:18 +01:00
}
article:hover .expand-on-hover {
transform: scaleY(1);
transition: transform 200ms ease-in-out;
background-color: var(--c-duskgray);
}
.bond-ce {
padding-top: 0.75rem;
height: 3rem;
}
.unobtained {
filter: grayscale(1);
}
2023-03-16 19:30:03 +01:00
@media (min-width: 512px) {
article {
2023-07-07 18:37:58 +02:00
padding: 10px;
2023-03-16 19:30:03 +01:00
width: auto;
height: auto;
}
article > img {
width: 200px;
height: 200px;
}
.bond-ce {
2023-07-07 18:32:14 +02:00
height: 3.5rem;
2023-03-16 19:30:03 +01:00
}
2023-07-07 18:37:58 +02:00
.expand-on-hover {
top: 95%;
}
2023-03-16 19:30:03 +01:00
}
2023-03-09 11:44:18 +01:00
</style>