From 900dbbaef150c1afeca396e16648db68e113cabb Mon Sep 17 00:00:00 2001 From: Prince Kumar Date: Sun, 8 Oct 2023 18:34:42 +0530 Subject: [PATCH] update --- src/components/data-display/tech-details.tsx | 23 ++++---- src/hooks/Reavel.tsx | 51 ------------------ src/hooks/scrollAnimation.tsx | 29 ---------- src/hooks/skillsReavel.tsx | 57 -------------------- 4 files changed, 9 insertions(+), 151 deletions(-) delete mode 100644 src/hooks/skillsReavel.tsx diff --git a/src/components/data-display/tech-details.tsx b/src/components/data-display/tech-details.tsx index a6cb89d..ca957c5 100644 --- a/src/components/data-display/tech-details.tsx +++ b/src/components/data-display/tech-details.tsx @@ -5,27 +5,22 @@ import Typography from '@/components/general/typography'; import Link from '@/components/navigation/link'; import ImageWrapper from '@/components/data-display/image-wrapper'; import ScrollAnimation from '@/hooks/scrollAnimation'; -import SkillsReavel from "@/hooks/skillsReavel"; const TechDetails = ({ url, logo, darkModeLogo, label }: TechDetails) => { return (
- - - - - + + + - - {label} - + {label}
); diff --git a/src/hooks/Reavel.tsx b/src/hooks/Reavel.tsx index e429f1e..69ec8a5 100644 --- a/src/hooks/Reavel.tsx +++ b/src/hooks/Reavel.tsx @@ -55,54 +55,3 @@ export default function Reavel({ children, width = "fit-content" }: Props){ ); } - - -// export default function Reavel({ children, width = "fit-content" }: Props){ -// const mainControls = useAnimation(); -// const slideControls = useAnimation(); -// const ref = useRef(null); -// const isInView = useInView(ref, {once: true}); -// useEffect(() => { -// if (isInView) { -// mainControls.start("visible"); -// slideControls.start("visible"); -// } -// }, [isInView]) - -// return ( -//
-// -// {children} -// -// -//
-// ); -// } \ No newline at end of file diff --git a/src/hooks/scrollAnimation.tsx b/src/hooks/scrollAnimation.tsx index 06388fa..4205102 100644 --- a/src/hooks/scrollAnimation.tsx +++ b/src/hooks/scrollAnimation.tsx @@ -30,32 +30,3 @@ const ScrollAnimation = ({ children }: any) => { ) } export default ScrollAnimation; - -// import React, { useRef, useEffect } from "react"; - -// interface Props { -// children: JSX.Element; -// } - -// export default function ScrollAnimation({ children }: Props) { -// const ref = useRef(null); - -// useEffect(() => { -// const element = ref.current; -// if (element) { -// const handleScroll = () => { -// const scrollTop = window.pageYOffset + window.innerHeight; -// const elementTop = element.offsetTop + element.offsetHeight / 2; -// if (scrollTop > elementTop) { -// element.classList.add("animate"); -// } else { -// element.classList.remove("animate"); -// } -// }; -// window.addEventListener("scroll", handleScroll); -// return () => window.removeEventListener("scroll", handleScroll); -// } -// }, [ref]); - -// return
{children}
; -// } \ No newline at end of file diff --git a/src/hooks/skillsReavel.tsx b/src/hooks/skillsReavel.tsx deleted file mode 100644 index e60efc4..0000000 --- a/src/hooks/skillsReavel.tsx +++ /dev/null @@ -1,57 +0,0 @@ -import React, {useEffect, useRef} from "react"; -import { motion, useInView, useAnimation } from "framer-motion"; - -interface Props { - children: JSX.Element; - width?: "fit-content" | "100%"; -} - -export default function Reavel({ children, width = "fit-content" }: Props){ - const mainControls = useAnimation(); - const slideControls = useAnimation(); - const ref = useRef(null); - const isInView = useInView(ref, {once: true}); - useEffect(() => { - if (isInView) { - mainControls.start("visible"); - slideControls.start("visible"); - } - }, [isInView]) - - return ( -
- - {children} - - -
- ); -}