38 lines
784 B
Plaintext
38 lines
784 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 }}>
|
|
span.brutal-pill {
|
|
filter: drop-shadow(3px 3px 0 rgb(0 0 0 / 1));
|
|
user-select: none;
|
|
background-color: white;
|
|
border-radius: 9999px;
|
|
border: 2px solid black;
|
|
padding: 0.25rem 0.75rem;
|
|
transition: all;
|
|
transition-duration: 0.5s;
|
|
animation: ease-in-out;
|
|
font-size: small;
|
|
}
|
|
|
|
span.brutal-pill:hover {
|
|
filter: drop-shadow(5px 5px 0 rgb(0 0 0 / 1));
|
|
background-color: var(--color);
|
|
}
|
|
</style>
|
|
|
|
<span class='brutal-pill'>
|
|
<slot />
|
|
</span>
|