From 96c053d5fff3145297f9c8d56aba774cc3ae8f42 Mon Sep 17 00:00:00 2001 From: Max Richter Date: Sat, 6 Apr 2024 23:40:31 +0200 Subject: [PATCH] feat: make thumbhash work with image slider --- public/app.css | 5 +- src/components/HeroCard.astro | 1 + src/components/Image.astro | 32 +++-------- src/components/ImageSlider.svelte | 67 ++++++++++++++--------- src/components/Max.astro | 8 ++- src/content/projects/plantarium/index.mdx | 3 +- src/helpers/image.ts | 34 ++++++++++++ src/layouts/Layout.astro | 34 ++++++++---- src/pages/index.astro | 2 +- uno.config.ts | 8 +++ 10 files changed, 126 insertions(+), 68 deletions(-) create mode 100644 src/helpers/image.ts diff --git a/public/app.css b/public/app.css index 6a3f5fd..8513d2c 100644 --- a/public/app.css +++ b/public/app.css @@ -70,8 +70,8 @@ picture.thumb::before { position: absolute; bottom: 10px; right: 10px; - width: 30px; - height: 30px; + width: 20px; + height: 20px; opacity: 0; transition: opacity 0.3s; pointer-events: none; @@ -81,7 +81,6 @@ picture.thumb::before { z-index: 2; } - picture.thumb-loading::before { opacity: 0.5; } diff --git a/src/components/HeroCard.astro b/src/components/HeroCard.astro index df0d51a..5c2123b 100644 --- a/src/components/HeroCard.astro +++ b/src/components/HeroCard.astro @@ -49,6 +49,7 @@ const link = translatePath(`/${collection}/${slug.split("/")[0]}`); {"cover size.width)} sizes={sizes diff --git a/src/components/ImageSlider.svelte b/src/components/ImageSlider.svelte index 3c03aa2..be23a95 100644 --- a/src/components/ImageSlider.svelte +++ b/src/components/ImageSlider.svelte @@ -1,8 +1,6 @@ diff --git a/src/pages/index.astro b/src/pages/index.astro index 4afeeef..ea94f9b 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -43,7 +43,7 @@ const otherPosts = posts.filter((post) => featuredPost !== post).slice(0, 3); {featuredProject && } -
+
{ otherProjects.length > 0 && otherProjects.map((project) => ) diff --git a/uno.config.ts b/uno.config.ts index 06468b5..cd370f0 100644 --- a/uno.config.ts +++ b/uno.config.ts @@ -22,6 +22,14 @@ export default defineConfig({ "md": "20px", "diag-md": "0px var(--border-radius-md) 0px var(--border-radius-md)" }, + screens: { + xs: "375px", + sm: "640px", + md: "768px", + lg: "1024px", + xl: "1280px", + "2xl": "1536px", + }, colors: { neutral: { "000": "var(--neutral-000)",