1
0
Fork 0

Import photos as assets and properly compress late_afternoon.webp

This commit is contained in:
Moritz Ruth 2025-03-05 23:56:10 +01:00
parent 5131f31a1e
commit 8a06e5c18a
Signed by: moritzruth
GPG key ID: C9BBAB79405EE56D
7 changed files with 13 additions and 9 deletions

View file

@ -3,7 +3,7 @@
"private": true, "private": true,
"type": "module", "type": "module",
"scripts": { "scripts": {
"dev": "vite --host", "dev": "vite",
"build": "vite-ssg build", "build": "vite-ssg build",
"start": "vite preview" "start": "vite preview"
}, },

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 MiB

View file

Before

Width:  |  Height:  |  Size: 216 KiB

After

Width:  |  Height:  |  Size: 216 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 398 KiB

View file

Before

Width:  |  Height:  |  Size: 373 KiB

After

Width:  |  Height:  |  Size: 373 KiB

View file

@ -1,28 +1,32 @@
import lateAfternoonUrl from "./assets/photography/late_afternoon.webp"
import martyrdomUrl from "./assets/photography/martyrdom.webp"
import heatUrl from "./assets/photography/heat.webp"
interface Photo { interface Photo {
file: string
title: string title: string
altText: string altText: string
date: string date: string
description: string description: string
url: string
} }
export const photos: Photo[] = [ export const photos: Photo[] = [
{ {
file: "Late_afternoon.webp",
title: "Late afternoon", title: "Late afternoon",
altText: "A red house in London", altText: "A red house in London",
date: "2019", date: "2019",
description: "65 Curzon Street, Mayfair, London" description: "65 Curzon Street, Mayfair, London",
url: lateAfternoonUrl
}, },
{ {
file: "Martyrdom.webp", url: martyrdomUrl,
title: "Martyrdom", title: "Martyrdom",
altText: "A church on a vineyard", altText: "A church on a vineyard",
date: "2019", date: "2019",
description: "The Sankt-Laurentius church by the Mosel river in Bremm (Germany)." description: "The Sankt-Laurentius church by the Mosel river in Bremm (Germany)."
}, },
{ {
file: "Heat.webp", url: heatUrl,
title: "Heat", title: "Heat",
altText: "An orange passageway with windows on all walls", altText: "An orange passageway with windows on all walls",
date: "2022", date: "2022",

View file

@ -3,12 +3,12 @@
<div class="flex flex-col space-y-30 lg:space-y-20"> <div class="flex flex-col space-y-30 lg:space-y-20">
<div <div
v-for="photo in photos" v-for="photo in photos"
:key="photo.file" :key="photo.url"
class="flex -lg:space-y-10 lg:space-x-10 -lg:flex-col -lg:items-center" class="flex -lg:space-y-10 lg:space-x-10 -lg:flex-col -lg:items-center"
> >
<a class="lg:max-w-150 block w-full" :href="`/photography/${photo.file}`"> <a class="lg:max-w-150 block w-full" :href="photo.url">
<SuspendingImage <SuspendingImage
:src="`/photography/${photo.file}`" :src="photo.url"
:alt="photo.altText" :alt="photo.altText"
class="w-full max-h-80vh block object-contain" class="w-full max-h-80vh block object-contain"
/> />