From 038606a3fc6d5a1589738e2c468e4be1ca8b37d1 Mon Sep 17 00:00:00 2001 From: vaporvee Date: Sat, 13 Jul 2024 01:37:04 +0200 Subject: [PATCH] added image zoom --- src/components/GalaryZoom.astro | 53 ++++++++++++++++++++++++++++++++ src/components/ProjectCard.astro | 36 +++++++++++++++++++--- src/pages/projects.astro | 2 ++ src/styles/main.scss | 7 +---- 4 files changed, 88 insertions(+), 10 deletions(-) create mode 100644 src/components/GalaryZoom.astro diff --git a/src/components/GalaryZoom.astro b/src/components/GalaryZoom.astro new file mode 100644 index 0000000..aedf472 --- /dev/null +++ b/src/components/GalaryZoom.astro @@ -0,0 +1,53 @@ + + + + +
diff --git a/src/components/ProjectCard.astro b/src/components/ProjectCard.astro index 60b0b7c..fcc7f84 100644 --- a/src/components/ProjectCard.astro +++ b/src/components/ProjectCard.astro @@ -32,11 +32,27 @@ const { name, href, gallery } = Astro.props; max-width: 40vw; transition: border-color 0.3s; .gallery { - margin-top: -25px; + margin-top: -30px; + margin-bottom: 20px; + height: 260px; img { + position: static; max-height: 250px; margin: 20px 10px; border-radius: 10px; + transition: all 0.3s; + cursor: pointer; + &:hover { + &.single { + position: relative; + height: inherit !important; + } + & { + margin: 0 !important; + max-height: 260px; + height: 280px; + } + } } } h2 { @@ -53,7 +69,8 @@ const { name, href, gallery } = Astro.props; } @media (max-width: $responsive-width) { .gallery { - margin-top: -3px; + height: initial !important; + margin-top: -4px; text-align: center; * { margin: 2px !important; @@ -62,6 +79,10 @@ const { name, href, gallery } = Astro.props; } + + +
+

{name}

@@ -69,9 +90,16 @@ const { name, href, gallery } = Astro.props; diff --git a/src/pages/projects.astro b/src/pages/projects.astro index 40997de..3f5be8b 100644 --- a/src/pages/projects.astro +++ b/src/pages/projects.astro @@ -1,6 +1,7 @@ --- import Layout from "../layouts/Layout.astro"; import ProjectCard from "../components/ProjectCard.astro"; +import GalaryZoom from "../components/GalaryZoom.astro"; ---