diff --git a/src/About.jsx b/src/About.jsx index 5dccd95..02c3f9f 100644 --- a/src/About.jsx +++ b/src/About.jsx @@ -1,22 +1,23 @@ -import React, { useEffect } from 'react' -import Speakers from './components/Speakers' +import React, { useEffect } from "react"; +import Speakers from "./components/Speakers"; +import gsap from "gsap"; +import { ScrollTrigger } from "gsap/ScrollTrigger"; + +gsap.registerPlugin(ScrollTrigger); const About = () => { useEffect(() => { - const hasReloaded = localStorage.getItem('hasReloaded') - if (!hasReloaded) { - localStorage.setItem('hasReloaded', 'true') - setTimeout(() => { - window.location.reload() - }, 1000) - } - }, []) + // Force GSAP animations to refresh when navigating to About page + setTimeout(() => { + ScrollTrigger.refresh(); + }, 500); + }, []); return (
- ) -} + ); +}; -export default About +export default About; diff --git a/src/components/Speaker.jsx b/src/components/Speaker.jsx index 611efef..a5c51be 100644 --- a/src/components/Speaker.jsx +++ b/src/components/Speaker.jsx @@ -1,138 +1,88 @@ -import React, { useRef } from 'react' -import { useGSAP } from '@gsap/react' -import gsap from 'gsap' -import AnimatedText from './text' +import React, { useRef, useEffect } from "react"; +import gsap from "gsap"; +import AnimatedText from "./text"; -function Speaker({ - values = {}, - name = 'Ankit Prasad', - subname = 'Mr. Prasad', - ct = '', - customaudio = '', - image -}) { - const containerRef = useRef(null) - const rowRefs = useRef([]) - const lineRefs = useRef([]) - const valueRefs = useRef([]) +function Speaker({ values = {}, name, subname, ct = "", image, index }) { + const containerRef = useRef(null); + const valueRefs = useRef([]); - useGSAP(() => { - const timeline = gsap.timeline({ - scrollTrigger: { - trigger: containerRef.current, - start: 'top center', - toggleActions: 'play reverse play reverse' - } - }) + useEffect(() => { + const context = gsap.context(() => { + gsap.fromTo( + valueRefs.current, + { opacity: 0, y: 10 }, + { + opacity: 1, + y: 0, + duration: 0.5, + ease: "power2.out", + stagger: 0.15, + } + ); + }, containerRef); - timeline.fromTo( - lineRefs.current, - { - scaleX: 0, - transformOrigin: 'left' - }, - { - scaleX: 1, - duration: 0.8, - ease: 'power3.out' - } - ) - - timeline.fromTo( - rowRefs.current, - { - x: '-100%' - }, - { - x: 0, - duration: 0.3, - ease: 'power3.out' - }, - '-=0.8' - ) - - timeline.fromTo( - valueRefs.current, - { - x: '-100%' - }, - { - x: 0, - duration: 0.3, - ease: 'power3.out' - }, - '-=0.8' - ) - - timeline.reverse(0.1) - }, []) + return () => context.revert(); + }, []); return ( -
-
-
- -
- +
+
+ +
+ + + {image && ( -
- -
- {Object.entries(values).map(([key, value], index) => ( -
-
-
-
(rowRefs.current[index] = el)}> - -
-
+ )} +
-
-
-
(valueRefs.current[index] = el)}> - -
-
-
+
+ {Object.entries(values).map(([key, value], idx) => ( +
+
+
+ +
-
-
(lineRefs.current[index] = el)} - className="h-[1px] w-full bg-white" - /> -
+
(valueRefs.current[idx] = el)} + > +
- ))} -
+ +
+
+ ))}
- ) + ); } -export default Speaker +export default Speaker; diff --git a/src/components/Speakers.jsx b/src/components/Speakers.jsx index da1e9eb..aaf875f 100644 --- a/src/components/Speakers.jsx +++ b/src/components/Speakers.jsx @@ -1,87 +1,70 @@ -import React from 'react' -import Speaker from './Speaker.jsx' -import AnimatedText from './text.jsx' +import React from "react"; +import Speaker from "./Speaker.jsx"; +import AnimatedText from "./text.jsx"; function Speakers() { + const speakersData = [ + { + name: "Yeyati Prasher", + image: "/cool-peeps/yeyati.jpg", + subname: "Linux Basics", + values: { + "Introduction to Linux": "Understanding the basics", + "Command Line Tools": "Essential CLI utilities", + "File System": "Navigating and managing files", + "Networking": "Linux network fundamentals", + }, + }, + { + name: "Sid Karnam", + image: "/cool-peeps/sid.jpg", + subname: "Binary Exploitation", + values: { + "OSINT Basics": "What is Open Source Intelligence?", + "Finding Information": "Techniques and tools", + "Data Analysis": "Extracting insights", + "Social Engineering": "How OSINT aids in cybersecurity", + }, + }, + { + name: "Goutham Rajeev", + image: "/cool-peeps/goutham.jpg", + subname: "Web Security", + values: { + "Web Vulnerabilities": "XSS, CSRF, SQL Injection", + "Penetration Testing": "Tools and techniques", + "Exploiting Web Apps": "Fixing security loopholes", + }, + }, + { + name: "Preetham Pemmasani", + image: "/cool-peeps/preetham.jpg", + subname: "OSINT", + values: { + "OSINT Basics": "What is Open Source Intelligence?", + "Finding Information": "Techniques and tools", + "Data Analysis": "Extracting insights", + "Social Engineering": "How OSINT aids in cybersecurity", + }, + }, + ]; + return ( - <> -
- +
+ + +
+ {speakersData.map((speaker, index) => ( + + ))}
- - - - - - ) +
+ ); } -export default Speakers +export default Speakers;