diff --git a/src/components/TechSlideshow.tsx b/src/components/TechSlideshow.tsx index d378c85..295713b 100644 --- a/src/components/TechSlideshow.tsx +++ b/src/components/TechSlideshow.tsx @@ -15,10 +15,11 @@ const moveSlideshow = keyframes` // Moving background sprite container const Mover = styled(Box)(({ theme }) => ({ - marginTop: "-50px", height: "100%", width: "3184px", backgroundImage: `url(${require("../assets/slider3_opt.png")})`, + backgroundPosition: "center center", + backgroundRepeat: "repeat-x", position: "absolute", top: 0, left: 0, diff --git a/src/pages/Home.tsx b/src/pages/Home.tsx index 4605342..06ebf83 100644 --- a/src/pages/Home.tsx +++ b/src/pages/Home.tsx @@ -2,20 +2,92 @@ * Home - Main landing page with hero, about, stats, partners, and CTA sections * Update stats array and section content as needed */ -import React, { memo } from "react"; +import React, { memo, useEffect, useRef, useState } from "react"; import Box from "@mui/material/Box"; +import ArrowForwardRoundedIcon from "@mui/icons-material/ArrowForwardRounded"; import { ReactComponent as Logo } from "../assets/wat_ai_logo.svg"; import TechSlideshow from "../components/TechSlideshow"; import { useTheme } from "@mui/material/styles"; -import { HeroTitle, SectionTitle, SubsectionTitle, BodyLarge, BodyText } from "../components/Typography"; +import { HeroTitle, SectionTitle, BodyLarge } from "../components/Typography"; import UnifiedSection from "../components/UnifiedSection"; -import UnifiedCard from "../components/UnifiedCard"; import UnifiedButton from "../components/UnifiedButton"; -import UnifiedStats from "../components/UnifiedStats"; + +const AnimatedCounter: React.FC<{ value: string }> = ({ value }) => { + const target = Number.parseInt(value, 10); + const suffix = value.replace(/^\d+/, ""); + const [count, setCount] = useState(0); + const counterRef = useRef(null); + + useEffect(() => { + const element = counterRef.current; + if (!element || Number.isNaN(target)) return; + + if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) { + setCount(target); + return; + } + + let animationFrame = 0; + const observer = new IntersectionObserver( + ([entry]) => { + if (!entry.isIntersecting) return; + + const duration = 1400; + const startTime = performance.now(); + + const animate = (now: number) => { + const progress = Math.min((now - startTime) / duration, 1); + const easedProgress = 1 - Math.pow(1 - progress, 3); + setCount(Math.round(target * easedProgress)); + + if (progress < 1) { + animationFrame = window.requestAnimationFrame(animate); + } + }; + + animationFrame = window.requestAnimationFrame(animate); + observer.disconnect(); + }, + { threshold: 0.35 } + ); + + observer.observe(element); + + return () => { + observer.disconnect(); + window.cancelAnimationFrame(animationFrame); + }; + }, [target]); + + return ( + + {count}{suffix} + + ); +}; const HomePage: React.FC = memo(() => { const theme = useTheme(); + const sectionTitleSx = { + color: theme.palette.text.primary, + fontSize: { xs: "2.2rem", sm: "2.8rem", md: "3.35rem" }, + fontWeight: 750, + lineHeight: 1.1, + letterSpacing: "-0.04em", + mb: { xs: 6, md: 8 }, + position: "relative", + "&::after": { + content: '""', + display: "block", + width: 72, + height: 2, + mt: 2.5, + mx: "auto", + background: `linear-gradient(90deg, transparent, ${theme.palette.primary.main}, transparent)`, + }, + }; + // Key metrics displayed on homepage const stats = [ { number: "450+", label: "Program Graduates", description: "Students & researchers" }, @@ -35,28 +107,52 @@ const HomePage: React.FC = memo(() => { {/* Hero Section */} - + Fostering the Future of AI at Waterloo @@ -64,7 +160,7 @@ const HomePage: React.FC = memo(() => { variant="primary" size="large" to="/students" - endIcon={} + endIcon={} > Get Involved @@ -74,33 +170,37 @@ const HomePage: React.FC = memo(() => { {/* About Section */} - - + + About Us - - - Fostering The Future Of AI Talent At The University of Waterloo - - WAT.ai is a student-run Artificial Intelligence (AI) Organization at - the University of Waterloo and the undergraduate student body of the{" "} + WAT.ai is the largest AI design team at the University of Waterloo. + We're part of the{" "} { }, }} > - Waterloo AI Institute + Waterloo.ai Institute {" "} - and member of the{" "} + and the{" "} { }, }} > - Sedra Student Design Centre (SSDC) - . + Sedra Student Design Centre + . Every term, we have 60+ students running 8–12 AI projects—from + robotic manipulators to healthcare chatbots. - - Our goal is to establish an environment to enable the continued - growth of AI talent and suitable access to opportunities within the - Waterloo community. We provide opportunities for undergraduate and - graduate students to engage in impactful projects through - collaboration with companies and internal research. - - } - > - Meet The Team - - + + + For Students + + + For Partners + + + {/* Stats Section */} - - + + Our Impact - + Join a thriving community of AI enthusiasts making real impact through research, collaboration, and innovation. - + + {stats.map((stat, index) => ( + + + + + + {stat.label} + + + {stat.description} + + + ))} + @@ -193,20 +324,27 @@ const HomePage: React.FC = memo(() => { padding={8} > - + Our Partners - + We collaborate with leading companies and organizations to provide our members with real-world AI experience and opportunities. @@ -215,20 +353,36 @@ const HomePage: React.FC = memo(() => { {/* CTA Section */} - - + + Ready to Join Us? - + Whether you're a student looking to dive into AI, a professor seeking research collaborations, or a company interested in partnerships, we'd love to work with you. - + *": { + minWidth: { xs: "100%", sm: "170px" }, + fontWeight: "700 !important", + }, + }}> { For Students For Partners