Finalise vibes

This commit is contained in:
Aria 2025-04-25 05:22:35 +10:00
parent eedba4c364
commit 5613e2f2f9
Signed by untrusted user who does not match committer: aria
GPG key ID: 60C69216C5EA747B
34 changed files with 6 additions and 6 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 113 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 361 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 249 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 86 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 104 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 133 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 297 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 101 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 116 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 150 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 157 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 88 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 702 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 174 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 123 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 529 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 184 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 146 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 503 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 262 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

View file

@ -27,6 +27,7 @@ import "../../styles/aria.css";
const { album } = Astro.props; const { album } = Astro.props;
const images = await getAlbumImages(album.id); const images = await getAlbumImages(album.id);
const sorted = images.sort((a, b) => a.src.localeCompare(b.src));
--- ---
<BaseLayout> <BaseLayout>
<div class="text-center my-16 mb-32"> <div class="text-center my-16 mb-32">
@ -41,14 +42,15 @@ const images = await getAlbumImages(album.id);
class="mx-auto container my-8 sm:columns-2 md:columns-3 lg:columns-4 xl:columns-5" class="mx-auto container my-8 sm:columns-2 md:columns-3 lg:columns-4 xl:columns-5"
> >
{ {
images.map((image) => ( sorted.map((image) => (
<Picture <Picture
src={image} src={image}
alt={`Image from ${album.data.title} album`} alt={`Image from ${album.data.title} album`}
formats={["avif", "webp", "jpeg"]} formats={["avif", "webp", "jpeg"]}
quality={90} quality={95}
class="rounded-sm mb-4 border border-transparent hover:border-gray-300 transition-all duration-300 ease-in-out hover:shadow-lg" class="rounded-sm mb-4 border border-transparent hover:border-gray-300 transition-all duration-300 ease-in-out hover:shadow-lg"
loading="lazy" loading="lazy"
decoding="async"
/> />
)) ))
} }

View file

@ -1,7 +1,7 @@
export async function getAlbumImages(albumId: string) { export async function getAlbumImages(albumId: string) {
// 1. List all album files from collections path // 1. List all album files from collections path
let images = import.meta.glob<{ default: ImageMetadata }>( let images = import.meta.glob<{ default: ImageMetadata }>(
"/src/content/albums/**/*.{jpeg,jpg,webp,avif,png,jxl}" "/src/content/albums/**/*.{jpeg,jpg,webp,avif,png,jxl,heic}"
); );
// 2. Filter images by albumId // 2. Filter images by albumId
@ -13,8 +13,6 @@ export async function getAlbumImages(albumId: string) {
const resolvedImages = await Promise.all( const resolvedImages = await Promise.all(
Object.values(images).map((image) => image().then((mod) => mod.default)) Object.values(images).map((image) => image().then((mod) => mod.default))
); );
// 4. Shuffle images in random order
resolvedImages.sort(() => Math.random() - 0.5);
return resolvedImages; return resolvedImages;
} }