diff --git a/package-lock.json b/package-lock.json index 1bc508ef8..6971d84e9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "0.0.0", "dependencies": { "axios": "^1.6.8", - "framer-motion": "^11.1.7", + "framer-motion": "^11.18.2", "gsap": "^3.12.5", "lil-gui": "^0.19.2", "react": "^18.2.0", @@ -18,6 +18,7 @@ "react-dom": "^18.2.0", "react-icon-cloud": "^1.1.3", "react-icons": "^5.2.1", + "react-intersection-observer": "^9.15.1", "react-router-dom": "^6.23.0", "react-spring": "^9.7.3", "react-three-fiber": "^6.0.13", @@ -6667,16 +6668,19 @@ } }, "node_modules/framer-motion": { - "version": "11.1.7", - "resolved": "https://registry.npmjs.org/framer-motion/-/framer-motion-11.1.7.tgz", - "integrity": "sha512-cW11Pu53eDAXUEhv5hEiWuIXWhfkbV32PlgVISn7jRdcAiVrJ1S03YQQ0/DzoswGYYwKi4qYmHHjCzAH52eSdQ==", + "version": "11.18.2", + "resolved": "https://registry.npmjs.org/framer-motion/-/framer-motion-11.18.2.tgz", + "integrity": "sha512-5F5Och7wrvtLVElIpclDT0CBzMVg3dL22B64aZwHtsIY8RB4mXICLrkajK4G9R+ieSAGcgrLeae2SeUTg2pr6w==", + "license": "MIT", "dependencies": { + "motion-dom": "^11.18.1", + "motion-utils": "^11.18.1", "tslib": "^2.4.0" }, "peerDependencies": { "@emotion/is-prop-valid": "*", - "react": "^18.0.0", - "react-dom": "^18.0.0" + "react": "^18.0.0 || ^19.0.0", + "react-dom": "^18.0.0 || ^19.0.0" }, "peerDependenciesMeta": { "@emotion/is-prop-valid": { @@ -8917,6 +8921,21 @@ "mkdirp": "bin/cmd.js" } }, + "node_modules/motion-dom": { + "version": "11.18.1", + "resolved": "https://registry.npmjs.org/motion-dom/-/motion-dom-11.18.1.tgz", + "integrity": "sha512-g76KvA001z+atjfxczdRtw/RXOM3OMSdd1f4DL77qCTF/+avrRJiawSG4yDibEQ215sr9kpinSlX2pCTJ9zbhw==", + "license": "MIT", + "dependencies": { + "motion-utils": "^11.18.1" + } + }, + "node_modules/motion-utils": { + "version": "11.18.1", + "resolved": "https://registry.npmjs.org/motion-utils/-/motion-utils-11.18.1.tgz", + "integrity": "sha512-49Kt+HKjtbJKLtgO/LKj9Ld+6vw9BjH5d9sc40R/kVyH8GLAXgT42M2NnuPcJNuA3s9ZfZBUcwIgpmZWGEE+hA==", + "license": "MIT" + }, "node_modules/ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", @@ -10016,6 +10035,21 @@ "react": "*" } }, + "node_modules/react-intersection-observer": { + "version": "9.15.1", + "resolved": "https://registry.npmjs.org/react-intersection-observer/-/react-intersection-observer-9.15.1.tgz", + "integrity": "sha512-vGrqYEVWXfH+AGu241uzfUpNK4HAdhCkSAyFdkMb9VWWXs6mxzBLpWCxEy9YcnDNY2g9eO6z7qUtTBdA9hc8pA==", + "license": "MIT", + "peerDependencies": { + "react": "^17.0.0 || ^18.0.0 || ^19.0.0", + "react-dom": "^17.0.0 || ^18.0.0 || ^19.0.0" + }, + "peerDependenciesMeta": { + "react-dom": { + "optional": true + } + } + }, "node_modules/react-is": { "version": "16.13.1", "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", diff --git a/package.json b/package.json index d555ef09d..5b20ec849 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ }, "dependencies": { "axios": "^1.6.8", - "framer-motion": "^11.1.7", + "framer-motion": "^11.18.2", "gsap": "^3.12.5", "lil-gui": "^0.19.2", "react": "^18.2.0", @@ -20,6 +20,7 @@ "react-dom": "^18.2.0", "react-icon-cloud": "^1.1.3", "react-icons": "^5.2.1", + "react-intersection-observer": "^9.15.1", "react-router-dom": "^6.23.0", "react-spring": "^9.7.3", "react-three-fiber": "^6.0.13", diff --git a/src/App.css b/src/App.css index f447ad6ac..de8a0de2a 100644 --- a/src/App.css +++ b/src/App.css @@ -69,6 +69,4 @@ .title { color:aliceblue; } - - \ No newline at end of file diff --git a/src/App.jsx b/src/App.jsx index 99d8d90b1..ca021b939 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -15,10 +15,10 @@ import VerticalTimeline from './Components/Timeline'; import Carousel from './Components/Carousel'; import Hero from './Components/Hero'; import Footer from "./Components/Footer" - - +import SlideBottomPageWrapper from './Components/slidebottom'; const Homepage = () => { return ( +
{/* Text Section between Hero and Carousel */} @@ -33,6 +33,7 @@ const Homepage = () => {
+
); }; diff --git a/src/Components/Achievements.jsx b/src/Components/Achievements.jsx index 3214455e2..8b06cb71c 100644 --- a/src/Components/Achievements.jsx +++ b/src/Components/Achievements.jsx @@ -1,12 +1,16 @@ import React from 'react'; import CircularCard from './CircularCard'; - +import SlideUpPageWrapper from './fadeSlideup'; +import SlideInFromLeft from './slideInleftfade'; +import SlideInFromRight from './slideinRightfade'; const Achievements = () => { return ( +
-

+

GSoC Contributors -

+

+
@@ -14,8 +18,8 @@ const Achievements = () => {
-
-
+
+
@@ -23,8 +27,9 @@ const Achievements = () => {
-
+
+ ); } diff --git a/src/Components/Events.jsx b/src/Components/Events.jsx index c6085cfa1..6823fa346 100644 --- a/src/Components/Events.jsx +++ b/src/Components/Events.jsx @@ -1,7 +1,7 @@ import React from "react"; import { Chrono } from "react-chrono"; import '../App.css' - +import SlideUpPageWrapper from "./fadeSlideup"; const Events = () => { const items = [ { @@ -66,9 +66,11 @@ const Events = () => { } ]; + return (
+
{ }} cardHeight={180} /> -
+
) diff --git a/src/Components/PageWrapper.jsx b/src/Components/PageWrapper.jsx new file mode 100644 index 000000000..dcd899f38 --- /dev/null +++ b/src/Components/PageWrapper.jsx @@ -0,0 +1,24 @@ +import React from "react"; +import { motion } from "framer-motion"; + +const pageVariants = { + initial: { opacity: 0, x: -100 }, + animate: { opacity: 1, x: 0 }, + exit: { opacity: 0, x: 100 }, +}; + +const PageWrapper = ({ children }) => { + return ( + + {children} + + ); +}; + +export default PageWrapper; diff --git a/src/Components/PastProjects.jsx b/src/Components/PastProjects.jsx index 700cfc7bd..9f68ffe25 100644 --- a/src/Components/PastProjects.jsx +++ b/src/Components/PastProjects.jsx @@ -1,12 +1,15 @@ import React from 'react'; import FeatureCard from './FeatureCard'; // Assuming FeatureCard is in the same directory - +import SlideUpPageWrapper from './fadeSlideup'; +import SlideRotatePageWrapper from './slideinleftRotate'; const PastProjects = () => { return ( +
-

Past Projects

+

Past Projects

+
{ page="https://github.com/extint/Semantic_Segmentation" />
+ + {/* { tagStyle="gradient-text" page="/project-details-10" /> */} -
+
+ ); }; diff --git a/src/Components/Projects.jsx b/src/Components/Projects.jsx index 788a4b0ba..4ac368cd6 100644 --- a/src/Components/Projects.jsx +++ b/src/Components/Projects.jsx @@ -1,8 +1,9 @@ import React from 'react'; import { Link } from 'react-router-dom'; - +import SlideRotatePageWrapper from './slideinleftRotate'; const CardRow = () => { return ( +
@@ -16,6 +17,7 @@ const CardRow = () => {
+
); }; diff --git a/src/Components/Timeline.jsx b/src/Components/Timeline.jsx index 074281036..2473ebed9 100644 --- a/src/Components/Timeline.jsx +++ b/src/Components/Timeline.jsx @@ -22,7 +22,8 @@ const VerticalTimeline = () => { item.classList.add("show"); } }); - + // Initial check on load + run(); // Events window.addEventListener("load", run); window.addEventListener("resize", run); @@ -34,8 +35,7 @@ const VerticalTimeline = () => { window.removeEventListener("scroll", run); }; }, []); - - return ( + return (
@@ -47,6 +47,7 @@ const VerticalTimeline = () => {

    2015

    +
  • @@ -59,6 +60,7 @@ const VerticalTimeline = () => {
  • 2016

    +
  • @@ -71,6 +73,7 @@ const VerticalTimeline = () => {
  • 2017

    +
  • @@ -84,6 +87,7 @@ const VerticalTimeline = () => {
  • 2018

    +
  • @@ -96,6 +100,7 @@ const VerticalTimeline = () => {
  • 2019

    +
  • @@ -108,7 +113,8 @@ const VerticalTimeline = () => {
  • 2020

    -
  • + +
  • Title Six

    diff --git a/src/Components/UpcomingProjects.jsx b/src/Components/UpcomingProjects.jsx index 8753429ca..a6fe8a862 100644 --- a/src/Components/UpcomingProjects.jsx +++ b/src/Components/UpcomingProjects.jsx @@ -1,4 +1,5 @@ import React from 'react'; +import PulsePageWrapper from './pulse'; const UpcomingProjects = () => { // Custom styles for gradient text @@ -11,12 +12,14 @@ const UpcomingProjects = () => { }; return ( +

    Upcoming Projects

    Coming Soon

    +
    ); } diff --git a/src/Components/bounce.jsx b/src/Components/bounce.jsx new file mode 100644 index 000000000..19e36c96b --- /dev/null +++ b/src/Components/bounce.jsx @@ -0,0 +1,24 @@ +import React from "react"; +import { motion } from "framer-motion"; + +const bounceVariants = { + initial: { opacity: 0, y: 100 }, + animate: { opacity: 1, y: 0, transition: { type: "spring", stiffness: 300, damping: 20 } }, + exit: { opacity: 0, y: -100 }, +}; + +const BouncePageWrapper = ({ children }) => { + return ( + + {children} + + ); +}; + +export default BouncePageWrapper; diff --git a/src/Components/fadeSlideup.jsx b/src/Components/fadeSlideup.jsx new file mode 100644 index 000000000..60efe7211 --- /dev/null +++ b/src/Components/fadeSlideup.jsx @@ -0,0 +1,24 @@ +import React from "react"; +import { motion } from "framer-motion"; + +const slideUpVariants = { + initial: { opacity: 0, y: 100 }, + animate: { opacity: 1, y: 0, transition: { duration: 0.8, ease: "easeOut" } }, + exit: { opacity: 0, y: -50 }, +}; + +const SlideUpPageWrapper = ({ children }) => { + return ( + + {children} + + ); +}; + +export default SlideUpPageWrapper; diff --git a/src/Components/pulse.jsx b/src/Components/pulse.jsx new file mode 100644 index 000000000..1f64108e2 --- /dev/null +++ b/src/Components/pulse.jsx @@ -0,0 +1,24 @@ +import React from "react"; +import { motion } from "framer-motion"; + +const pulseVariants = { + initial: { opacity: 0, scale: 0.6 }, + animate: { opacity: 1, scale: 1.1, transition: { duration: 0.6, yoyo: Infinity, repeatDelay: 0.2 } }, + exit: { opacity: 0, scale: 0.6 }, +}; + +const PulsePageWrapper = ({ children }) => { + return ( + + {children} + + ); +}; + +export default PulsePageWrapper; diff --git a/src/Components/slideInleftfade.jsx b/src/Components/slideInleftfade.jsx new file mode 100644 index 000000000..da434eeb6 --- /dev/null +++ b/src/Components/slideInleftfade.jsx @@ -0,0 +1,40 @@ +// SlideInFromLeft.js +import { motion, useAnimation } from 'framer-motion'; +import { useEffect } from 'react'; + +const SlideInFromLeft = ({ children, duration = 0.7 }) => { + const controls = useAnimation(); + + const isInViewport = (el) => { + const rect = el.getBoundingClientRect(); + return rect.top <= window.innerHeight && rect.bottom >= 0; + }; + + useEffect(() => { + const handleScroll = () => { + const el = document.getElementById('slide-left'); + if (isInViewport(el)) { + controls.start({ opacity: 1, x: 0, transition: { duration } }); + } + }; + + window.addEventListener('scroll', handleScroll); + handleScroll(); // Trigger once on load + + return () => { + window.removeEventListener('scroll', handleScroll); + }; + }, [controls, duration]); + + return ( + + {children} + + ); +}; + +export default SlideInFromLeft; diff --git a/src/Components/slidebottom.jsx b/src/Components/slidebottom.jsx new file mode 100644 index 000000000..394ad34c1 --- /dev/null +++ b/src/Components/slidebottom.jsx @@ -0,0 +1,24 @@ +import React from "react"; +import { motion } from "framer-motion"; + +const slideBottomVariants = { + initial: { opacity: 0, y: 200 }, + animate: { opacity: 1, y: 0, transition: { type: "spring", stiffness: 100, damping: 25 } }, + exit: { opacity: 0, y: 200 }, +}; + +const SlideBottomPageWrapper = ({ children }) => { + return ( + + {children} + + ); +}; + +export default SlideBottomPageWrapper; diff --git a/src/Components/slideinRightfade.jsx b/src/Components/slideinRightfade.jsx new file mode 100644 index 000000000..dd8d01688 --- /dev/null +++ b/src/Components/slideinRightfade.jsx @@ -0,0 +1,40 @@ +// SlideInFromRight.js +import { motion, useAnimation } from 'framer-motion'; +import { useEffect } from 'react'; + +const SlideInFromRight = ({ children, duration = 0.7 }) => { + const controls = useAnimation(); + + const isInViewport = (el) => { + const rect = el.getBoundingClientRect(); + return rect.top <= window.innerHeight && rect.bottom >= 0; + }; + + useEffect(() => { + const handleScroll = () => { + const el = document.getElementById('slide-right'); + if (isInViewport(el)) { + controls.start({ opacity: 1, x: 0, transition: { duration } }); + } + }; + + window.addEventListener('scroll', handleScroll); + handleScroll(); // Trigger once on load + + return () => { + window.removeEventListener('scroll', handleScroll); + }; + }, [controls, duration]); + + return ( + + {children} + + ); +}; + +export default SlideInFromRight; diff --git a/src/Components/slideinleftRotate.jsx b/src/Components/slideinleftRotate.jsx new file mode 100644 index 000000000..7a1909181 --- /dev/null +++ b/src/Components/slideinleftRotate.jsx @@ -0,0 +1,24 @@ +import React from "react"; +import { motion } from "framer-motion"; + +const slideRotateVariants = { + initial: { opacity: 0, x: -100, rotate: -10 }, + animate: { opacity: 1, x: 0, rotate: 0, transition: { type: "spring", stiffness: 400, damping: 25 } }, + exit: { opacity: 0, x: 100, rotate: 10 }, +}; + +const SlideRotatePageWrapper = ({ children }) => { + return ( + + {children} + + ); +}; + +export default SlideRotatePageWrapper;