81 lines
1.5 KiB
Text
81 lines
1.5 KiB
Text
<a :href="href" :class="char" webc:root="override">
|
|
<div class="image">
|
|
<slot name="image"></slot>
|
|
</div>
|
|
<div class="text">
|
|
<slot name="title"></slot>
|
|
<slot></slot>
|
|
</div>
|
|
</a>
|
|
|
|
<style webc:scoped="character-card">
|
|
:host {
|
|
display: grid;
|
|
align-content: start;
|
|
|
|
font-size: 0.875em;
|
|
color: inherit;
|
|
text-decoration: none;
|
|
|
|
background-color: var(--clr-box-background);
|
|
|
|
border: var(--border-thin) solid var(--clr-box-border);
|
|
border-radius: 1em;
|
|
|
|
overflow: hidden;
|
|
}
|
|
|
|
:host:hover img {
|
|
scale: 1.1;
|
|
}
|
|
|
|
:host .image {
|
|
overflow: hidden;
|
|
aspect-ratio: 3/2;
|
|
}
|
|
|
|
:host img {
|
|
width: 100%;
|
|
height: 100%;
|
|
object-fit: cover;
|
|
scale: 1;
|
|
transition: scale 0.2s ease-in-out;
|
|
}
|
|
|
|
:host .text {
|
|
--card-spacing: 1.5rem;
|
|
padding-block: var(--card-spacing);
|
|
padding-inline: var(--card-spacing);
|
|
}
|
|
|
|
:host :where(h2, h3, h4, h5, h6) {
|
|
position: relative;
|
|
font-size: 1.375rem;
|
|
margin-block: 0 0.5em;
|
|
padding-block: 0 0.5em;
|
|
}
|
|
|
|
:host :where(h2, h3, h4, h5, h6)::after {
|
|
content: '';
|
|
position: absolute;
|
|
display: block;
|
|
left: 0;
|
|
bottom: 0;
|
|
height: 0.125em;
|
|
width: 2em;
|
|
border-radius: 1em;
|
|
background: linear-gradient(
|
|
to right,
|
|
oklch(from var(--clr-heading-underline) calc(l + 0.1) c h),
|
|
oklch(from var(--clr-heading-underline) calc(l - 0.2) c h)
|
|
);
|
|
}
|
|
|
|
:host p {
|
|
margin-block: 0;
|
|
}
|
|
|
|
:host p ~ p {
|
|
margin-block: 1em 0;
|
|
}
|
|
</style>
|