astro-ghostcms/.pnpm-store/v3/files/06/fb79db8288f2cc5bef411e7b12f...

34 lines
694 B
Plaintext

---
interface Props {
color?: string | undefined;
}
import colors from '../config/colors.json';
if (Astro.props.color === undefined) {
Astro.props.color =
colors[Math.floor(Math.random() * colors.length)];
}
const { color } = Astro.props;
---
<style define:vars={{ color: color }}>
div.brutal-card {
background-color: var(--color);
border-radius: 0.5rem;
border: 3px solid black;
filter: drop-shadow(7px 7px 0 rgb(0 0 0 / 1));
transition: all;
padding: 1rem;
transition-duration: 0.5s;
animation: ease-in-out;
}
div.brutal-card:hover {
filter: drop-shadow(5px 5px 0 rgb(0 0 0 / 1));
}
</style>
<div class='brutal-card'>
<slot />
</div>