add cc base design template
Deploy site / build-and-deploy (push) Canceled after 0s

This commit is contained in:
2026-10-18 02:15:50 -04:00
parent a870f025f0
commit 5f1eaaf0a7
36 changed files with 1092 additions and 286 deletions
+30
View File
@@ -0,0 +1,30 @@
---
import { Image } from 'astro:assets';
const found = import.meta.glob<{ default: ImageMetadata }>('../assets/photos/*.{jpg,jpeg,png,webp,avif}', { eager: true });
const photos = Object.entries(found)
.sort(([a], [b]) => a.localeCompare(b))
.slice(0, 3)
.map(([path, mod]) => ({
src: mod.default,
caption: (path.split('/').pop() ?? '').replace(/\.[^.]+$/, '').replace(/[-_]+/g, ' ').toUpperCase(),
}));
const slots = [0, 1, 2].map((i) => photos[i] ?? null);
---
<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>
</figure>
<div class="side">
{
[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>
))
}
</div>
</div>