Add hover zoom to images in projects/MDX
All checks were successful
Build and Deploy to Web Server / deploy (push) Successful in 2m45s

This commit is contained in:
2025-12-11 11:11:38 +10:30
parent 5a83282da4
commit 4acbf3ef8a

View File

@@ -5,12 +5,19 @@ const { src, alt } = Astro.props;
import { getImageByPath } from "@lib/utils"; import { getImageByPath } from "@lib/utils";
const image = getImageByPath(src); const image = getImageByPath(src);
// width of container is 896, width of image is set to 1344 to allow for hover zoom
--- ---
{ {
image && ( image && (
<div class="my-8"> <div class="my-8">
<Image src={image} alt={alt} width={896} /> <Image
src={image}
alt={alt}
width={1344}
class="transition ease-in-out lg:hover:scale-150"
/>
<div class="mt-2 block w-full text-center text-sm italic">{alt}</div> <div class="mt-2 block w-full text-center text-sm italic">{alt}</div>
</div> </div>
) )