feat: add reference image component

This commit is contained in:
Sebin Nyshkim 2025-04-04 18:52:25 +02:00
parent f7a73793d8
commit fa04d4ea19

View file

@ -0,0 +1,46 @@
<figure class="ref-image">
<eleventy-image
class="image"
:class="(dropshadow ? 'dropshadow' : '')"
:src="src"
:alt="`${alt} by ${artist}`"
:width="width"
sizes="1000px"
></eleventy-image>
<figcaption class="caption">
<template webc:nokeep @text="alt"></template>
&copy;
<a :href="href" target="_blank" @text="artist"></a>
</figcaption>
</figure>
<style>
.ref-image {
max-width: var(--refimage-max-width);
margin-block: 0;
margin-inline: auto;
& img {
display: block;
width: 100%;
height: 100%;
max-height: 35rem;
object-fit: contain;
}
& .image,
& .caption {
flex: 0 0 auto;
}
& .dropshadow {
filter: drop-shadow(0.5em 0.25em 0.375em oklch(0 0 0 / 0.5));
}
& .caption {
text-align: center;
margin-block: 1rem 0;
margin-inline: 0;
}
}
</style>