diff --git a/src/components/misc/ImageWrapper.astro b/src/components/misc/ImageWrapper.astro index 131fd5f..78d12b9 100644 --- a/src/components/misc/ImageWrapper.astro +++ b/src/components/misc/ImageWrapper.astro @@ -5,12 +5,13 @@ interface Props { src: string; class?: string; alt?: string + position?: string; basePath?: string } import { Image } from 'astro:assets'; -import {url} from "../../utils/url-utils"; +import { url } from "../../utils/url-utils"; -const {id, src, alt, basePath = '/'} = Astro.props; +const {id, src, alt, position = 'center', basePath = '/'} = Astro.props; const className = Astro.props.class; const isLocal = !(src.startsWith('/') || src.startsWith('http') || src.startsWith('https') || src.startsWith('data:')); @@ -25,10 +26,12 @@ if (isLocal) { img = await (files[normalizedPath])(); } +const imageClass = 'w-full h-full object-cover'; +const imageStyle = `object-position: ${position}` ---