Import image from path

Update page title based on post/project title
Use more optimised Image element
leg
This commit is contained in:
Michał Gdula 2024-05-24 19:47:03 +01:00
parent 5c41d81288
commit 44a15873f4
9 changed files with 60 additions and 25 deletions

View file

@ -1,6 +1,8 @@
---
import "../styles/styles.scss";
import { Image } from "astro:assets";
interface Props {
title: string;
src?: string,
@ -28,7 +30,7 @@ const { title, src, alt } = Astro.props;
<body>
<div class="banner">
{src && (
<img src={src} alt={alt} />
<Image src={src} width="1080" height="700" loading="eager" alt={alt} />
<script>
const img = document.querySelector(".banner > img");
document.addEventListener("scroll", () => {