diff --git a/src/Assets/Images/Star.svg b/src/Assets/Images/Star.svg index 975629a..331f390 100644 --- a/src/Assets/Images/Star.svg +++ b/src/Assets/Images/Star.svg @@ -1 +1,12 @@ - \ No newline at end of file + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Components/Button.tsx b/src/Components/Button.tsx new file mode 100644 index 0000000..2ef9f6e --- /dev/null +++ b/src/Components/Button.tsx @@ -0,0 +1,35 @@ +import { motion } from "framer-motion"; +export const buttonVariants = { + initial: { + y: 0, + }, + hover: { + y: "0.5vw", + }, +}; +const Button = ({ + onclick, + contents, +}: { + onclick: () => void; + contents: string; +}) => { + return ( +
+ + {contents} + +
+
+ ); +}; +export default Button; diff --git a/src/Components/Landing/LandingVariants.tsx b/src/Components/Landing/LandingVariants.tsx new file mode 100644 index 0000000..f01f282 --- /dev/null +++ b/src/Components/Landing/LandingVariants.tsx @@ -0,0 +1,24 @@ + +export const starVariants = { + initial: { + rotate: 0, + scale: 1, + }, + animate: { + rotate: Array.from({ length: 360 }, (_, i) => i + 10), + scale: [1, 1.1, 0.9, 1], + }, +}; + +export const AppearingVariants = { + initial: { + opacity: 0, + }, + animate: { + opacity: 1, + transition: { + staggerChildren: 0.1, + delayChildren: 0.5, + }, + }, +}; diff --git a/src/Components/Landing/Star.tsx b/src/Components/Landing/Star.tsx new file mode 100644 index 0000000..9384404 --- /dev/null +++ b/src/Components/Landing/Star.tsx @@ -0,0 +1,81 @@ +import { motion } from "framer-motion"; +import { AppearingVariants, starVariants } from "./LandingVariants"; +import { useEffect, useRef, useState } from "react"; +import star from "../../Assets/Images/Star.svg"; + +const Star = ({ + index, + rect, +}: { + index: number; + rect: React.RefObject; +}) => { + const [x, setX] = useState(Math.floor(Math.random() * 100)); + const [y, setY] = useState(10 + Math.floor(Math.random() * 70)); + const [w, setW] = useState((5 + Math.random() * 5) / 5); + const [overlap, setOverlap] = useState(false); + const starref = useRef(null); + const check_overlap = ( + rect1: DOMRect | undefined, + rect2: DOMRect | undefined + ) => { + if (!rect1 || !rect2) return false; + return !( + rect1.right < rect2.left || + rect1.left > rect2.right || + rect1.bottom < rect2.top || + rect1.top > rect2.bottom + ); + }; + + useEffect(() => { + setOverlap( + check_overlap( + rect.current?.getBoundingClientRect(), + starref.current?.getBoundingClientRect() + ) + ); + if (overlap) { + setX(Math.floor(Math.random() * 100)); + setY(10 + Math.floor(Math.random() * 70)); + setW((5 + Math.random() * 5) / 5); + } + }); + return ( + <> + +
+ +
+
+ + ); +}; + +export default Star; diff --git a/src/Components/Landing/Stars.tsx b/src/Components/Landing/Stars.tsx index 46e1be7..d5ef1d6 100644 --- a/src/Components/Landing/Stars.tsx +++ b/src/Components/Landing/Stars.tsx @@ -1,29 +1,9 @@ import { motion } from "framer-motion"; -import star from "/src/Assets/Images/Star.svg"; +import { AppearingVariants } from "./LandingVariants"; +import Star from "./Star"; +import { RefObject } from "react"; -const starVariants = { - initial: { - rotate: 0 - }, - animate: { - rotate: Array.from({ length: 360 }, (_, i) => i + 10) - } -}; - -const AppearingVariants = { - initial: { - opacity: 0 - }, - animate: { - opacity: 1, - transition: { - staggerChildren: 0.1, - delayChildren: 0.5 - } - } -}; - -const Stars = () => { +const Stars = ({ rect }: { rect: RefObject }) => { return ( { animate="animate" className="z-[-10]" > - {Array.from({ length: 10 }, (_, index) => { - const randomX = 10 + Math.floor(Math.random() * 80); - const randomY = 5 + Math.floor(Math.random() * 80); - return ( - - - - ); + {Array.from({ length: 12 }, (_, index) => { + return ; })} ); diff --git a/src/Components/Landing/TextArea.tsx b/src/Components/Landing/TextArea.tsx index 9164ab3..a822c77 100644 --- a/src/Components/Landing/TextArea.tsx +++ b/src/Components/Landing/TextArea.tsx @@ -1,40 +1,26 @@ -import { motion } from "framer-motion"; - -const buttonVariants = { - initial: { - y: 0 - }, - hover: { - y: "0.5rem" - } -}; - -const Text = () => { +import { forwardRef, LegacyRef } from "react"; +import Button from "../Button"; +const Text = forwardRef((_props, ref: LegacyRef) => { return ( -
+
-
DS3
-
+
DS3
+
Learn
,
Build
,
Innovate
, With Data
-
+
We are here to expand the horizons of data science as a community together.
- - Join Us - -
+
); -}; +}); export default Text; diff --git a/src/Components/Page/Footer.tsx b/src/Components/Page/Footer.tsx index 6b84d4f..6a7d56c 100644 --- a/src/Components/Page/Footer.tsx +++ b/src/Components/Page/Footer.tsx @@ -1,78 +1,22 @@ -import { FaDiscord, FaGithub, FaLinkedinIn } from "react-icons/fa6"; -import { SiGmail } from "react-icons/si"; import { baseURL } from "../../Utils/info"; +import SocialMedia from "./SocialMedia"; +import Sponsers from "./Sponsers"; const Footer = () => { - const btnClass = - "btn rounded-full text-white text-lg w-12 p-0 border-none bg-[#202020] hover:bg-[#282828] glow"; - return (
- DS3 Logo + DS3 Logo
© 2024 Data Science Student Society, All Rights Reserved
- - + +
); }; diff --git a/src/Components/Page/SocialMedia.tsx b/src/Components/Page/SocialMedia.tsx new file mode 100644 index 0000000..7106495 --- /dev/null +++ b/src/Components/Page/SocialMedia.tsx @@ -0,0 +1,48 @@ +import { FaDiscord, FaGithub, FaLinkedinIn } from "react-icons/fa6"; +import { SiGmail } from "react-icons/si"; + +const SocialMedia = () => { + const btnClass = + "btn rounded-full text-white text-lg w-12 p-0 border-none bg-[#202020] hover:bg-[#282828] glow"; + + return ( + + ); +}; + +export default SocialMedia; diff --git a/src/Components/Page/Sponsers.tsx b/src/Components/Page/Sponsers.tsx new file mode 100644 index 0000000..fb4dc49 --- /dev/null +++ b/src/Components/Page/Sponsers.tsx @@ -0,0 +1,41 @@ +import { baseURL } from "../../Utils/info"; + +const Sponsers = () => { + return ( +
+

Our Sponsers

+
+ CSE @ UCSD + HDSI @ UCSD + Palantir +
+

+ View our sponsor packet{" "} + + here + {" "} + or contact us at{" "} + + ds3@ucsd.edu + +

+
+ ); +}; + +export default Sponsers; diff --git a/src/Pages/Home/AboutUs.tsx b/src/Pages/Home/AboutUs.tsx index f3efa31..ba73f5e 100644 --- a/src/Pages/Home/AboutUs.tsx +++ b/src/Pages/Home/AboutUs.tsx @@ -1,27 +1,44 @@ const AboutUs = () => { return ( -
-
-
-

WHO WE ARE

-

- We share a passion for data, technology, and problem-solving. -

-

We are here to expand the horizons of data science as a community together

+
+
+ {/* WHO WE ARE Section */} +
+
+

WHO WE ARE

+

+ We share a passion for data, technology, and problem-solving. +

+

+ We are here to expand the horizons of data science as a community + together. +

+
+
- -
-
-
-
-
-

WHAT WE DO

-

- Build technical skills, network, and gain practical experience in data science. -

-

We are here to expand the horizons of data science as a community together

+ {/* First Image */} +
+ {/* Second Image */} +
+ {/* WHAT WE DO Section */} +
+
+

WHAT WE DO

+

+ Build technical skills, network, and gain practical experience in + data science. +

+

+ We are here to expand the horizons of data science as a community + together. +

+
+
-
); diff --git a/src/Pages/Home/Home.tsx b/src/Pages/Home/Home.tsx index 3e69bb7..670b80a 100644 --- a/src/Pages/Home/Home.tsx +++ b/src/Pages/Home/Home.tsx @@ -1,8 +1,7 @@ import Page from "../../Components/Page/Page"; import AboutUs from "./AboutUs"; -import Events from "./WhereWeBeen"; +import WhereWeBeen from "./WhereWeBeen"; import Landing from "./Landing"; -import Sponsers from "./Sponsers"; import Stats from "./Stats"; const Home = () => { @@ -11,8 +10,7 @@ const Home = () => { - - + ); }; diff --git a/src/Pages/Home/Landing.tsx b/src/Pages/Home/Landing.tsx index fca9bd8..2e9d842 100644 --- a/src/Pages/Home/Landing.tsx +++ b/src/Pages/Home/Landing.tsx @@ -2,12 +2,18 @@ import { motion } from "framer-motion"; import dino from "/src/Assets/Images/Dino.svg"; import TextArea from "../../Components/Landing/TextArea"; import Stars from "../../Components/Landing/Stars"; +import { useEffect, useRef, useState } from "react"; const Landing = () => { + const [rendered, setRendered] = useState(false); + const TextAreaRef = useRef(null); + useEffect(() => { + setRendered(true); + }, []); return ( -
- -