diff --git a/src/animations/FadeIn.jsx b/src/animations/FadeIn.jsx new file mode 100644 index 0000000..8bf2109 --- /dev/null +++ b/src/animations/FadeIn.jsx @@ -0,0 +1,30 @@ +import { useRef, useEffect } from "react"; +import { motion, useInView, useAnimation } from "framer-motion"; + +export default function FadeIn({ children, duration }) { + const ref = useRef(null); + const isInView = useInView(ref, { once: true }); + const mainControls = useAnimation(); + + useEffect(() => { + if (isInView) { + mainControls.start("visible"); + } + }, [isInView, mainControls]); + + return ( +
+ + {children} + +
+ ); +} \ No newline at end of file diff --git a/src/animations/SlideIn.jsx b/src/animations/SlideIn.jsx new file mode 100644 index 0000000..8888155 --- /dev/null +++ b/src/animations/SlideIn.jsx @@ -0,0 +1,31 @@ +import { useRef, useEffect } from "react"; +import { motion, useInView, useAnimation } from "framer-motion"; + +export default function SlideIn({ children, duration, delay, className }) { + const ref = useRef(null); + const isInView = useInView(ref, { once: true }); + const mainControls = useAnimation(); + + useEffect(() => { + if (isInView) { + mainControls.start("visible"); + } + }, [isInView, mainControls]); + + return ( +
+ + {children} + +
+ ); +} \ No newline at end of file diff --git a/src/pages/LandingPage.jsx b/src/pages/LandingPage.jsx index c71c40c..6e754a4 100644 --- a/src/pages/LandingPage.jsx +++ b/src/pages/LandingPage.jsx @@ -4,7 +4,6 @@ import { IconCrossStroked } from "@douyinfe/semi-icons"; import SimpleCanvas from "../components/SimpleCanvas"; import Navbar from "../components/Navbar"; import { diagram } from "../data/heroDiagram"; -import Reveal from "../animations/Reveal"; import { Steps } from "@douyinfe/semi-ui"; import mysql_icon from "../assets/mysql.png"; import postgres_icon from "../assets/postgres.png"; @@ -12,6 +11,8 @@ import sqlite_icon from "../assets/sqlite.png"; import mariadb_icon from "../assets/mariadb.png"; import sql_server_icon from "../assets/sql-server.png"; import discord from "../assets/discord.png"; +import FadeIn from "../animations/FadeIn"; +import SlideIn from "../animations/SlideIn"; const features = [ { @@ -164,8 +165,8 @@ export default function LandingPage() {
-
- +
+

Draw, Copy, and Paste @@ -175,7 +176,7 @@ export default function LandingPage() { Free, simple, and intuitive database design tool and SQL generator.

- +