homepage/src/components/Card.astro

57 lines
846 B
Text

---
const { id, name, link } = Astro.props;
---
<a href={link}>
<div class="card">
<div class="image-wrapper">
<img src={`/img/logo/${id}.svg`} alt={`${name} logo`}" />
</div>
<div class="text">
<h1>{name}</h1>
<p><slot /></p>
</div>
</div>
</a>
<style>
.card {
display: flex;
align-items: center;
padding: 10px;
margin: 10px 0;
border: 2px #ff66ff solid;
color: white;
border-radius: 25px;
transition: 0.1s ease-out;
position: relative;
top: 0;
background-color: #00000000;
}
.card:hover {
top: -4px;
background-color: #ff80ff;
border: none;
color: black;
}
.card:hover img {
filter: invert(100%) brightness(0%);
}
.text {
margin-left: 20px;
}
.image-wrapper {
height: 100px;
width: 100px;
text-align: center;
}
img {
height: 100%;
width: auto;
}
</style>