From dd4d9bc6dfdec67985867f5447c0125e0646471d Mon Sep 17 00:00:00 2001 From: Aeonoi Date: Sat, 26 Oct 2024 12:56:01 -0400 Subject: [PATCH 1/3] feat(animations): attempt at hover image --- components/project-card.tsx | 42 ++++++++++++++++++++++++++++++++----- 1 file changed, 37 insertions(+), 5 deletions(-) diff --git a/components/project-card.tsx b/components/project-card.tsx index 52f9345..006fb29 100644 --- a/components/project-card.tsx +++ b/components/project-card.tsx @@ -1,4 +1,7 @@ +"use client"; import Link from "next/link"; +import { motion } from "framer-motion"; +import { useState } from "react"; interface Props { link: string; @@ -12,6 +15,13 @@ const ProjectCard: React.FC = ({ image, title, }: Props) => { + const [isHovered, setIsHovered] = useState(false); + + // Small delay to allow hover-out before hiding the large image + const handleMouseLeave = () => { + setTimeout(() => setIsHovered(false), 200); // Adjust delay as needed + }; + return ( //
@@ -23,11 +33,16 @@ const ProjectCard: React.FC = ({
- {title} + setIsHovered(true)} + onMouseLeave={handleMouseLeave} + > + {title} +

@@ -35,6 +50,23 @@ const ProjectCard: React.FC = ({

+ {isHovered && ( + + + + )}
); }; From 0df3e205ad8653efe6ad0cf28521a4ab84e4dcb7 Mon Sep 17 00:00:00 2001 From: Aeonoi Date: Sat, 26 Oct 2024 14:49:59 -0400 Subject: [PATCH 2/3] feat(animationsd): add basic animations to buttons in navbar --- components/animated_box_hover.tsx | 38 +++++++++++++++++++++ components/navbar.tsx | 55 ++++++++++++++++++++----------- components/project-card.tsx | 2 +- 3 files changed, 74 insertions(+), 21 deletions(-) create mode 100644 components/animated_box_hover.tsx diff --git a/components/animated_box_hover.tsx b/components/animated_box_hover.tsx new file mode 100644 index 0000000..3c82cf5 --- /dev/null +++ b/components/animated_box_hover.tsx @@ -0,0 +1,38 @@ +"use client"; +import { motion } from "framer-motion"; +import Link from "next/link"; + +interface Props { + children: React.ReactNode; +} + +const HoverBox: React.FC = ({ children }) => { + return ( + + {/* biome-ignore lint/a11y/noSvgWithoutTitle: draws path */} + + + + {children} + + ); +}; + +export default HoverBox; diff --git a/components/navbar.tsx b/components/navbar.tsx index 3c378fc..49ad27a 100644 --- a/components/navbar.tsx +++ b/components/navbar.tsx @@ -1,8 +1,10 @@ +"use client"; +import { motion } from "framer-motion"; import Link from "next/link"; +import HoverBox from "./animated_box_hover"; const Navbar: React.FC = () => { return ( - //
diff --git a/components/project-card.tsx b/components/project-card.tsx index 006fb29..bd79222 100644 --- a/components/project-card.tsx +++ b/components/project-card.tsx @@ -19,7 +19,7 @@ const ProjectCard: React.FC = ({ // Small delay to allow hover-out before hiding the large image const handleMouseLeave = () => { - setTimeout(() => setIsHovered(false), 200); // Adjust delay as needed + setTimeout(() => setIsHovered(false), 200); }; return ( From 2159067d6cf9535030c3078ca663f23201d2cdb8 Mon Sep 17 00:00:00 2001 From: Aeonoi Date: Sat, 26 Oct 2024 15:48:22 -0400 Subject: [PATCH 3/3] feat(animation): add animations when scrolling or visiting different sections When scrolling down/up the section will fade in and when leaving, the section will fade out. --- app/page.tsx | 23 +++++++++++++++-------- components/about.tsx | 2 +- components/hero.tsx | 2 +- components/navbar.tsx | 2 +- components/projects.tsx | 2 +- components/resume.tsx | 2 +- components/transition.tsx | 24 ++++++++++++++++++++++++ 7 files changed, 44 insertions(+), 13 deletions(-) create mode 100644 components/transition.tsx diff --git a/app/page.tsx b/app/page.tsx index 59c1cbd..779e8a6 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -1,24 +1,31 @@ import About from "@/components/about"; -import Contact from "@/components/contact"; import Hero from "@/components/hero"; import Navbar from "@/components/navbar"; import Projects from "@/components/projects"; import Resume from "@/components/resume"; +import Transition from "@/components/transition"; const Home: React.FC = () => { return ( -
+
+ {/* Top Navigation Bar Section */} {/* Hero Section */} - + + + {/* About Section */} - + + + {/* Projects Section */} - - {/* Contacts Section */} - {/* */} + + + {/* Resume Section */} - + + +
); }; diff --git a/components/about.tsx b/components/about.tsx index c5ecd59..a1a14a0 100644 --- a/components/about.tsx +++ b/components/about.tsx @@ -3,7 +3,7 @@ import Background from "./background"; const About: React.FC = () => { return ( -
+
{/*
*/}
diff --git a/components/hero.tsx b/components/hero.tsx index c54f927..9aac8e7 100644 --- a/components/hero.tsx +++ b/components/hero.tsx @@ -7,7 +7,7 @@ import { motion } from "framer-motion"; const Hero: React.FC = () => { return ( -
+

diff --git a/components/navbar.tsx b/components/navbar.tsx index 49ad27a..5d1eec8 100644 --- a/components/navbar.tsx +++ b/components/navbar.tsx @@ -5,7 +5,7 @@ import HoverBox from "./animated_box_hover"; const Navbar: React.FC = () => { return ( -
+