tailwind rebuild
This commit is contained in:
@@ -10,19 +10,27 @@ const photos = Object.entries(found)
|
||||
caption: (path.split('/').pop() ?? '').replace(/\.[^.]+$/, '').replace(/[-_]+/g, ' ').toUpperCase(),
|
||||
}));
|
||||
const slots = [0, 1, 2].map((i) => photos[i] ?? null);
|
||||
|
||||
const corner = "before:absolute before:size-[22px] before:border-accent before:content-[''] after:absolute after:size-[22px] after:border-accent after:content-['']";
|
||||
const shot = (photo: boolean) => [
|
||||
'relative m-0 overflow-hidden border border-line bg-panel',
|
||||
!photo && `${corner} before:top-2.5 before:left-2.5 before:border-t-2 before:border-l-2 after:right-2.5 after:bottom-2.5 after:border-r-2 after:border-b-2`,
|
||||
];
|
||||
const caption = 'absolute inset-x-0 bottom-0 px-5 pt-[18px] pb-3 font-mono text-[12px]';
|
||||
const captionPhoto = 'bg-[linear-gradient(transparent,rgba(5,8,7,0.85))] text-fg';
|
||||
---
|
||||
|
||||
<div class="captures">
|
||||
<figure class:list={['shot big', slots[0] ? 'photo' : 'empty']}>
|
||||
{slots[0] ? <Image src={slots[0].src} alt={slots[0].caption} widths={[640, 1000, 1400]} sizes="(max-width: 900px) 100vw, 700px" /> : null}
|
||||
<figcaption>{slots[0] ? slots[0].caption : '[PHOTO 1 · FEATURED]'}</figcaption>
|
||||
<div class="flex flex-wrap gap-3">
|
||||
<figure class:list={[shot(!!slots[0]), 'h-[372px] min-w-0 flex-[2_1_360px] max-sm:h-[260px]']}>
|
||||
{slots[0] ? <Image class="absolute inset-0 size-full object-cover" src={slots[0].src} alt={slots[0].caption} widths={[640, 1000, 1400]} sizes="(max-width: 900px) 100vw, 700px" /> : null}
|
||||
<figcaption class:list={[caption, slots[0] ? captionPhoto : 'text-muted']}>{slots[0] ? slots[0].caption : '[PHOTO 1 · FEATURED]'}</figcaption>
|
||||
</figure>
|
||||
<div class="side">
|
||||
<div class="flex min-w-0 flex-[1_1_220px] flex-col gap-3">
|
||||
{
|
||||
[1, 2].map((i) => (
|
||||
<figure class:list={['shot', slots[i] ? 'photo' : 'empty']}>
|
||||
{slots[i] ? <Image src={slots[i]!.src} alt={slots[i]!.caption} widths={[400, 700]} sizes="(max-width: 900px) 100vw, 350px" /> : null}
|
||||
<figcaption>{slots[i] ? slots[i]!.caption : `[PHOTO ${i + 1}]`}</figcaption>
|
||||
<figure class:list={[shot(!!slots[i]), 'h-[180px]']}>
|
||||
{slots[i] ? <Image class="absolute inset-0 size-full object-cover" src={slots[i]!.src} alt={slots[i]!.caption} widths={[400, 700]} sizes="(max-width: 900px) 100vw, 350px" /> : null}
|
||||
<figcaption class:list={[caption, slots[i] ? captionPhoto : 'text-muted']}>{slots[i] ? slots[i]!.caption : `[PHOTO ${i + 1}]`}</figcaption>
|
||||
</figure>
|
||||
))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user