From e14eb0942bc893627dd65d3fbf034508f1707a43 Mon Sep 17 00:00:00 2001 From: Abhishek Tyagi Date: Thu, 4 Jan 2024 18:37:47 +0530 Subject: [PATCH] update of the images --- globleEffect/index.css | 64 ++++++++++++++++++++++++++++++++++++++---- globleEffect/index.js | 46 +++++++++++++++++------------- index.html | 29 +++++++++++-------- 3 files changed, 103 insertions(+), 36 deletions(-) diff --git a/globleEffect/index.css b/globleEffect/index.css index 474bb64..8ecd7de 100644 --- a/globleEffect/index.css +++ b/globleEffect/index.css @@ -152,12 +152,16 @@ canvas { #page3 { + display: flex; + height: 100vh; + position: relative; width: 100%; border-top: 1px solid transparent; z-index: 1; } #page3 video { + /* display: flex; */ width: 100%; -o-object-fit: cover; object-fit: cover; @@ -165,23 +169,73 @@ canvas { #video video { + position: absolute; width: 100%; + z-index: 1; height: auto; object-fit: cover; object-position: center top; background: transparent; } -.collage-image { +#page-left { + position: absolute; display: flex; - flex-wrap: wrap; + flex-direction: column; + margin-top: 20vh; + margin-left: 8vw; + color: #F4F4F4; +} + +#page-left #image1 img{ + position: absolute; + width: 20vw; + height: 25vh; + margin-top: -20vh; + object-fit: cover; + border-radius: 2vw; + object-position: center top; + background: transparent; +} + +#page-left #image2 img{ + position: absolute; + width: 20vw; + height: 25vh; margin-top: 10vh; + object-fit: cover; + border-radius: 2vw; + object-position: center top; + background: transparent; +} + +#page-right { + position: absolute; + display: flex; + flex-direction: column; + margin-top: 20vh; + margin-left: 70vw; + color: #F4F4F4; } -.collage-image img{ - width:20vw; - height: 30vh; +#page-right #image3 img{ + position: absolute; + width: 20vw; + height: 25vh; + margin-top: -20vh; + border-radius: 2vw; + object-fit: cover; + object-position: center top; + background: transparent; +} + +#page-right #image4 img{ + position: absolute; + width: 20vw; + height: 25vh; + margin-top: 10vh; object-fit: cover; + border-radius: 2vw; object-position: center top; background: transparent; } diff --git a/globleEffect/index.js b/globleEffect/index.js index 037d722..384ed42 100644 --- a/globleEffect/index.js +++ b/globleEffect/index.js @@ -318,7 +318,7 @@ https://arvr.google.com/static/images/frames/hero/small/00466.png scrollTrigger: { scrub: 0.4, trigger: "#home2", - start: "bottom 2%", + start: "bottom 10%", end: "bottom 120%", ease: "none" }, @@ -330,7 +330,7 @@ https://arvr.google.com/static/images/frames/hero/small/00466.png scrollTrigger: { scrub: 0.4, trigger: "#home2", - start: "bottom 2%", + start: "bottom 10%", end: "bottom 120%", ease: "none" }, @@ -369,8 +369,8 @@ function shrinkVideoOnScroll() { scrub: 0.4, // markers: true, trigger: "#page3", - start: "top 10%", - end: "bottom 20%", + start: "top 10%", + end: "bottom 20%", ease: "none", pin: true, }, @@ -382,45 +382,53 @@ function shrinkVideoOnScroll() { scrollTrigger: { scrub: 0.4, trigger: "#page3", - start: "bottom 20%", - end: "bottom 120%", + start: "bottom 20%", + end: "bottom 120%", ease: "none", }, }); } shrinkVideoOnScroll(); -function zoomImagesOnScroll() { - // Set initial scale for images - gsap.set(["#image1", "#image2", "#image3", "#image4"], { scale: 0.2, transformOrigin: "center center" }); +function setupPage3Animations() { + const leftImages = ["#image1", "#image2"]; + const rightImages = ["#image3", "#image4"]; + + gsap.set([leftImages, rightImages], { scale: 0.2, transformOrigin: "center center" }); - // Scroll-triggered animation for zooming images - gsap.to(["#image1", "#image2"], { + + // Scroll-triggered animation for zooming and rotating left images + gsap.to(leftImages, { scale: 1, + rotation: 360, + x: "-50%", // Left images + y: "-50%", scrollTrigger: { scrub: 0.4, - // markers: true, trigger: "#page3", - start: "top 0%", - end: "bottom 20%", + start: "top 40%", + end: "bottom 20%", ease: "none", }, }); - gsap.to(["#image3", "#image4"], { + // Scroll-triggered animation for zooming and rotating right images + gsap.to(rightImages, { scale: 1, + rotation: -360, + x: "50%", // Right images + y: "-50%", scrollTrigger: { scrub: 0.4, - // markers: true, trigger: "#page3", - start: "top 0%", - end: "bottom 20%", + start: "top 40%", + end: "bottom 20%", ease: "none", }, }); } -zoomImagesOnScroll(); +setupPage3Animations(); diff --git a/index.html b/index.html index eaf997a..3bcfab9 100644 --- a/index.html +++ b/index.html @@ -47,23 +47,28 @@

Another section's text goes here

+
+
+ error +
+
+ error +
+
+
-
- error -
-
- error -
-
- error -
-
- error +
- +

Hey this is my website