diff --git a/public/images/jambox-kyanit-catchup1.webp b/public/images/jambox-kyanit-catchup1.webp deleted file mode 100644 index 481b894..0000000 Binary files a/public/images/jambox-kyanit-catchup1.webp and /dev/null differ diff --git a/public/images/jambox-kyanit-jpvr.webp b/public/images/jambox-kyanit-jpvr.webp deleted file mode 100644 index 83aeb2d..0000000 Binary files a/public/images/jambox-kyanit-jpvr.webp and /dev/null differ diff --git a/public/images/jambox-kyanit-record-time.webp b/public/images/jambox-kyanit-record-time.webp deleted file mode 100644 index 94a0255..0000000 Binary files a/public/images/jambox-kyanit-record-time.webp and /dev/null differ diff --git a/public/images/jambox-kyanit-startover.webp b/public/images/jambox-kyanit-startover.webp deleted file mode 100644 index fd96ff0..0000000 Binary files a/public/images/jambox-kyanit-startover.webp and /dev/null differ diff --git a/public/images/jambox-kyanit-startover1.webp b/public/images/jambox-kyanit-startover1.webp deleted file mode 100644 index ed8f448..0000000 Binary files a/public/images/jambox-kyanit-startover1.webp and /dev/null differ diff --git a/src/assets/logo.webp b/src/assets/logo.webp new file mode 100644 index 0000000..f0433c3 Binary files /dev/null and b/src/assets/logo.webp differ diff --git a/src/assets/sections/arris5202.png b/src/assets/sections/arris5202.png new file mode 100644 index 0000000..603b3dd Binary files /dev/null and b/src/assets/sections/arris5202.png differ diff --git a/src/assets/sections/tv-smart-4k.webp b/src/assets/sections/tv-smart-4k.webp new file mode 100644 index 0000000..cdbe711 Binary files /dev/null and b/src/assets/sections/tv-smart-4k.webp differ diff --git a/src/components/hero/Hero.astro b/src/components/hero/Hero.astro index 1c625fb..efd03a9 100644 --- a/src/components/hero/Hero.astro +++ b/src/components/hero/Hero.astro @@ -1,5 +1,6 @@ --- -import type { ImageMetadata } from 'astro'; +import { Image, getImage } from "astro:assets"; +import type { ImageMetadata } from "astro"; interface CTA { label: string; @@ -22,49 +23,69 @@ const { description = "", imageUrl = "", textPosition = "right", - ctas = [] + ctas = [], } = Astro.props; -const imageBase = imageUrl.replace(/\.(webp|png|jpg|jpeg)$/i, ''); +const imageBase = imageUrl.replace(/\.(webp|png|jpg|jpeg)$/i, ""); const images = import.meta.glob<{ default: ImageMetadata }>( - '/src/assets/hero/**/*.webp', - { eager: true } + "/src/assets/hero/**/*.webp", + { eager: true }, ); function findImage(folder: string): ImageMetadata | null { const key = `/src/assets/hero/${folder}/${imageBase}-${folder}.webp`; - return images[key]?.default || null; + return images[key]?.default ?? null; } -const mobile = findImage('mobile'); -const tablet = findImage('tablet'); -const desktop = findImage('desktop'); +const mobile = findImage("mobile"); +const tablet = findImage("tablet"); +const desktop = findImage("desktop"); + +// Generujemy prawdziwe srcsety (a nie pojedynczy URL) +const mobileSet = mobile + ? await getImage({ src: mobile, widths: [480, 640], format: "webp" }) + : null; + +const tabletSet = tablet + ? await getImage({ src: tablet, widths: [768, 1024], format: "webp" }) + : null; + +// Fallback (największy, eager) +const desktopImg = desktop + ? await getImage({ src: desktop, widths: [1280, 1440, 1920], format: "webp" }) + : null; ---
- {mobile && ( - )} - {tablet && ( - )} - + {desktop && ( - {imageBase} )} @@ -74,7 +95,7 @@ const desktop = findImage('desktop');
{Array.isArray(title) ? ( - title.map(t =>

{t}

) + title.map((t) =>

{t}

) ) : (

{title}

)} @@ -91,9 +112,9 @@ const desktop = findImage('desktop'); {ctas.length > 0 && (
-
\ No newline at end of file + diff --git a/src/components/layout/Header.astro b/src/components/layout/Header.astro index 981de39..2c23bfb 100644 --- a/src/components/layout/Header.astro +++ b/src/components/layout/Header.astro @@ -1,5 +1,7 @@ --- import MobileMenu from "../../islands/MobileMenu.jsx"; +import { Image } from "astro:assets"; +import logo from "../../assets/logo.webp"; const links = [ { name: "START", href: "/" }, @@ -21,7 +23,13 @@ const links = [