From 5650d634341bdf8a059d9a3f56549858702e1a1e Mon Sep 17 00:00:00 2001 From: YasinShaikh123 <123150391+YasinShaikh123@users.noreply.github.com> Date: Mon, 15 Apr 2024 13:09:41 +0530 Subject: [PATCH] inner-page --- .../SubnetsComponent/Component3.jsx | 4 +- .../SubnetsComponent/Component4.jsx | 4 +- .../SubnetsComponent/NewSubnetComp.jsx | 92 +++++++++---------- 3 files changed, 49 insertions(+), 51 deletions(-) diff --git a/src/components/SubnetsComponent/Component3.jsx b/src/components/SubnetsComponent/Component3.jsx index b1b82d9..981b5f1 100644 --- a/src/components/SubnetsComponent/Component3.jsx +++ b/src/components/SubnetsComponent/Component3.jsx @@ -42,8 +42,8 @@ export const Component3 = () => { }} _hover={{ background: "transparent", - width: "165px", - height: "57px", + // width: "165px", + // height: "57px", borderRadius: "28.5px", color: "#fff", border: "1px solid #A5A5A5", diff --git a/src/components/SubnetsComponent/Component4.jsx b/src/components/SubnetsComponent/Component4.jsx index 2c0814d..67999ea 100644 --- a/src/components/SubnetsComponent/Component4.jsx +++ b/src/components/SubnetsComponent/Component4.jsx @@ -43,8 +43,8 @@ export const Component4 = () => { }} _hover={{ background: "transparent", - width: "165px", - height: "57px", + // width: "165px", + // height: "57px", borderRadius: "28.5px", color: "#fff", border: "1px solid #A5A5A5", diff --git a/src/components/SubnetsComponent/NewSubnetComp.jsx b/src/components/SubnetsComponent/NewSubnetComp.jsx index 37253f3..d9b0e8b 100644 --- a/src/components/SubnetsComponent/NewSubnetComp.jsx +++ b/src/components/SubnetsComponent/NewSubnetComp.jsx @@ -1,5 +1,4 @@ /* eslint-disable no-unused-vars */ -/ eslint-disable no-unused-vars /; import { Box, Container, Image, Stack, Text } from "@chakra-ui/react"; import { Fade, Slide, SlideFade, Collapse } from "@chakra-ui/react"; import { useEffect, useRef, useState } from "react"; @@ -16,33 +15,33 @@ import { ScrollTrigger } from "gsap/ScrollTrigger"; // Initialize ScrollTrigger gsap.registerPlugin(ScrollTrigger); -// const SubnetContent = { -// heading: `decentralised Auto Syncing subnets`, -// }; +const SubnetContent = { + heading: `decentralised Auto Syncing subnets`, +}; export const NewSubnetComp = () => { - // const firstBoxRef = useRef(null); - // const secondBoxRef = useRef(null); - // const thirdBoxRef = useRef(null); - // const mainBox = useRef(null); + const firstBoxRef = useRef(null); + const secondBoxRef = useRef(null); + const thirdBoxRef = useRef(null); + const mainBox = useRef(null); useEffect(() => { // gsap.set(firstBoxRef.current, { opacity: 1 }); - // let tl = gsap - // .timeline({ - // scrollTrigger: { - // trigger: mainBox.current, - // start: "top top", - // scrub: 1, - // pin: true, - // end: "bottom bottom-=500vh", - // markers: false, - // }, - // }) - // .fromTo(firstBoxRef.current, { opacity: 1 }, { opacity: 0 }) - // .fromTo(secondBoxRef.current, { opacity: 0 }, { opacity: 1 }) - // .fromTo(secondBoxRef.current, { opacity: 1 }, { opacity: 0 }) - // .fromTo(thirdBoxRef.current, { opacity: 0 }, { opacity: 1 }); + let tl = gsap + .timeline({ + scrollTrigger: { + trigger: mainBox.current, + start: "top top", + scrub: 1, + pin: true, + end: "bottom bottom-=500vh", + markers: false, + }, + }) + .fromTo(firstBoxRef.current, { opacity: 1 }, { opacity: 0 }) + .fromTo(secondBoxRef.current, { opacity: 0 }, { opacity: 1 }) + .fromTo(secondBoxRef.current, { opacity: 1 }, { opacity: 0 }) + .fromTo(thirdBoxRef.current, { opacity: 0 }, { opacity: 1 }); // .fromTo( // firstBoxRef.current, @@ -66,7 +65,7 @@ export const NewSubnetComp = () => { // ); return () => { - // tl.kill(); + tl.kill(); }; }, []); @@ -78,18 +77,18 @@ export const NewSubnetComp = () => { }} > { textAlign={"center"} height={"100vh"} display={"grid"} - // p={10} - paddingTop={"10rem"} alignContent={"center"} > { }, }} > - decentralised Auto Syncing subnets + {SubnetContent.heading} { width={"100%"} padding={"0 5rem"} paddingBottom={"2rem"} - // ref={secondBoxRef} - // position={"absolute"} - // top={"0"} - // left={"0"} + ref={secondBoxRef} + position={"absolute"} + top={"0"} + left={"0"} display={"grid"} placeContent={"center"} > { width={"100%"} padding={"2rem"} // paddingBottom={"2rem"} - // ref={thirdBoxRef} - // position={"absolute"} - // top={"0"} - // left={"0"} + ref={thirdBoxRef} + position={"absolute"} + top={"0"} + left={"0"} display={"grid"} placeContent={"center"} >