merge in new changes
This commit is contained in:
17
src/components/ui/images/Image.astro
Normal file
17
src/components/ui/images/Image.astro
Normal file
@@ -0,0 +1,17 @@
|
||||
---
|
||||
import { Image } from 'astro:assets';
|
||||
import { ImageMetadata } from 'astro';
|
||||
import { blurStyle } from '@support/image';
|
||||
|
||||
interface FsPathImage extends ImageMetadata {
|
||||
fsPath?: string;
|
||||
}
|
||||
|
||||
const props = Astro.props;
|
||||
|
||||
const image = props.src as FsPathImage;
|
||||
const showBlur = !props.disableBlur;
|
||||
const blurCSS = image.fsPath && showBlur ? await blurStyle(image.fsPath) : {};
|
||||
---
|
||||
|
||||
<Image {...props} style={blurCSS} inferSize={true} />
|
||||
Reference in New Issue
Block a user