Finalise vibes
BIN
src/content/albums/aria-board/3-kusanagi.png
Normal file
After Width: | Height: | Size: 2.7 MiB |
BIN
src/content/albums/aria-board/9999-1.png
Normal file
After Width: | Height: | Size: 113 KiB |
BIN
src/content/albums/aria-board/9999-10.png
Normal file
After Width: | Height: | Size: 361 KiB |
BIN
src/content/albums/aria-board/9999-11.jpg
Normal file
After Width: | Height: | Size: 249 KiB |
BIN
src/content/albums/aria-board/9999-12.png
Normal file
After Width: | Height: | Size: 86 KiB |
BIN
src/content/albums/aria-board/9999-13.png
Normal file
After Width: | Height: | Size: 14 KiB |
BIN
src/content/albums/aria-board/9999-14.webp
Normal file
After Width: | Height: | Size: 3.8 MiB |
BIN
src/content/albums/aria-board/9999-15.jpg
Normal file
After Width: | Height: | Size: 104 KiB |
BIN
src/content/albums/aria-board/9999-16.jpg
Normal file
After Width: | Height: | Size: 133 KiB |
BIN
src/content/albums/aria-board/9999-17.jpg
Normal file
After Width: | Height: | Size: 2.3 MiB |
BIN
src/content/albums/aria-board/9999-18.jpg
Normal file
After Width: | Height: | Size: 2.1 MiB |
BIN
src/content/albums/aria-board/9999-19.jpg
Normal file
After Width: | Height: | Size: 6.6 MiB |
BIN
src/content/albums/aria-board/9999-2.png
Normal file
After Width: | Height: | Size: 297 KiB |
BIN
src/content/albums/aria-board/9999-20.png
Normal file
After Width: | Height: | Size: 101 KiB |
BIN
src/content/albums/aria-board/9999-21.png
Normal file
After Width: | Height: | Size: 116 KiB |
BIN
src/content/albums/aria-board/9999-22.png
Normal file
After Width: | Height: | Size: 150 KiB |
BIN
src/content/albums/aria-board/9999-23.jpg
Normal file
After Width: | Height: | Size: 157 KiB |
BIN
src/content/albums/aria-board/9999-24.png
Normal file
After Width: | Height: | Size: 42 KiB |
BIN
src/content/albums/aria-board/9999-25.png
Normal file
After Width: | Height: | Size: 88 KiB |
BIN
src/content/albums/aria-board/9999-26.png
Normal file
After Width: | Height: | Size: 2.4 MiB |
BIN
src/content/albums/aria-board/9999-27.jpg
Normal file
After Width: | Height: | Size: 702 KiB |
BIN
src/content/albums/aria-board/9999-28.jpg
Normal file
After Width: | Height: | Size: 174 KiB |
BIN
src/content/albums/aria-board/9999-29.jpg
Normal file
After Width: | Height: | Size: 123 KiB |
BIN
src/content/albums/aria-board/9999-3.png
Normal file
After Width: | Height: | Size: 15 KiB |
BIN
src/content/albums/aria-board/9999-30.webp
Normal file
After Width: | Height: | Size: 529 KiB |
BIN
src/content/albums/aria-board/9999-31.jpg
Normal file
After Width: | Height: | Size: 1.1 MiB |
BIN
src/content/albums/aria-board/9999-4.webp
Normal file
After Width: | Height: | Size: 184 KiB |
BIN
src/content/albums/aria-board/9999-5.png
Normal file
After Width: | Height: | Size: 42 KiB |
BIN
src/content/albums/aria-board/9999-6.png
Normal file
After Width: | Height: | Size: 146 KiB |
BIN
src/content/albums/aria-board/9999-7.png
Normal file
After Width: | Height: | Size: 503 KiB |
BIN
src/content/albums/aria-board/9999-8.png
Normal file
After Width: | Height: | Size: 262 KiB |
BIN
src/content/albums/aria-board/9999-9.png
Normal file
After Width: | Height: | Size: 6.2 KiB |
|
@ -27,6 +27,7 @@ import "../../styles/aria.css";
|
|||
|
||||
const { album } = Astro.props;
|
||||
const images = await getAlbumImages(album.id);
|
||||
const sorted = images.sort((a, b) => a.src.localeCompare(b.src));
|
||||
---
|
||||
<BaseLayout>
|
||||
<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"
|
||||
>
|
||||
{
|
||||
images.map((image) => (
|
||||
sorted.map((image) => (
|
||||
<Picture
|
||||
src={image}
|
||||
alt={`Image from ${album.data.title} album`}
|
||||
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"
|
||||
loading="lazy"
|
||||
decoding="async"
|
||||
/>
|
||||
))
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
export async function getAlbumImages(albumId: string) {
|
||||
// 1. List all album files from collections path
|
||||
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
|
||||
|
@ -14,7 +14,5 @@ export async function getAlbumImages(albumId: string) {
|
|||
Object.values(images).map((image) => image().then((mod) => mod.default))
|
||||
);
|
||||
|
||||
// 4. Shuffle images in random order
|
||||
resolvedImages.sort(() => Math.random() - 0.5);
|
||||
return resolvedImages;
|
||||
}
|