From 7ea9721e9085b48536dc829e77ae3cb4f53e1b76 Mon Sep 17 00:00:00 2001 From: Sakindu Ransindu Date: Fri, 15 Nov 2024 01:29:19 +0530 Subject: [PATCH] add about section --- src/app/page.tsx | 11 +++- src/components/ui/text-generate-effect.tsx | 62 ++++++++++++++++++++++ 2 files changed, 72 insertions(+), 1 deletion(-) create mode 100644 src/components/ui/text-generate-effect.tsx diff --git a/src/app/page.tsx b/src/app/page.tsx index f96ec5e..d26c046 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -37,6 +37,7 @@ import { MultiStepLoader } from "@/components/ui/multi-step-loader"; import { HeroHighlight, Highlight } from "@/components/ui/hero-highlight"; import { Highlighter } from "@/components/blocks/hilight"; import { HomeIcon, ClockIcon , MegaphoneIcon , PhoneArrowUpRightIcon } from "@heroicons/react/24/solid"; +import { TextGenerateEffect } from "@/components/ui/text-generate-effect"; export const products = [ @@ -288,7 +289,8 @@ export default function Home() { { text: "Are You Ready?"}, { text: "2025" }, ]; - + + const content:string = " \"Are You Ready?\" stands as a monumental initiative led by the Rotaract Club of the University of Moratuwa in partnership with the Career Guidance Unit. Our primary focus is 4th year undergraduates from our university, aiming to guide them towards a secure entry into the professional world. The scope of this endeavor knows no bounds, with over 100 companies aligning to provide opportunities for budding professionals. This project promises to be a valuable asset for those aspiring to forge strong connections with companies and their managers, even if the finish line of their degree is still on the horizon. In the initial stages, participants will gain the essential knowledge and training to confidently engage with industry experts." return ( @@ -297,6 +299,13 @@ export default function Home() { setIsLoading(false)} /> + +
+

+ About Are You Ready? +

+ +
{ diff --git a/src/components/ui/text-generate-effect.tsx b/src/components/ui/text-generate-effect.tsx new file mode 100644 index 0000000..c5575d8 --- /dev/null +++ b/src/components/ui/text-generate-effect.tsx @@ -0,0 +1,62 @@ +"use client"; +import { useEffect } from "react"; +import { motion, stagger, useAnimate } from "framer-motion"; +import { cn } from "@/lib/utils"; + +export const TextGenerateEffect = ({ + words, + className, + filter = true, + duration = 0.1, +}: { + words: string; + className?: string; + filter?: boolean; + duration?: number; +}) => { + const [scope, animate] = useAnimate(); + let wordsArray = words.split(" "); + useEffect(() => { + animate( + "span", + { + opacity: 1, + filter: filter ? "blur(0px)" : "none", + }, + { + duration: duration ? duration : 1, + delay: stagger(0.1), + } + ); + }, [scope.current]); + + const renderWords = () => { + return ( + + {wordsArray.map((word, idx) => { + return ( + + {word}{" "} + + ); + })} + + ); + }; + + return ( +
+
+
+ {renderWords()} +
+
+
+ ); +};