Load low-res thumbnails

This commit is contained in:
Mikkel Svartveit 2023-10-18 18:28:09 -07:00
parent 0bbf92455f
commit 1b81a7bcf4
3 changed files with 7 additions and 4 deletions

View file

@ -3,16 +3,19 @@ import { Image } from "astro:assets";
interface Props {
photo: any;
width?: number;
height?: number;
class?: string;
}
const { photo, class: className } = Astro.props;
const { photo, width, height, class: className } = Astro.props;
---
<Image
src={photo}
alt=""
height={1000}
{width}
{height}
densities={[1, 2]}
quality="mid"
class={"object-contain rounded " + (className ?? "")}

View file

@ -27,6 +27,6 @@ const { photo } = Astro.props;
history.back()
"
>
<Photo photo={photo.default} class="w-auto" />
<Photo photo={photo.default} height={1000} class="w-auto h-full" />
</div>
</RootLayout>

View file

@ -48,7 +48,7 @@ export const getFileNameFromPath = (path: string) => {
class="flex w-full py-2 duration-100 hover:-translate-y-1 rounded-lg"
>
<div class="bg-gray-200 rounded">
<Photo photo={photo.default} />
<Photo photo={photo.default} width={400} />
</div>
</a>
))