diff --git a/frontend/src/app/(pages)/FAQ.tsx b/frontend/src/app/(pages)/FAQ.tsx index 60627bf..fa19ce8 100644 --- a/frontend/src/app/(pages)/FAQ.tsx +++ b/frontend/src/app/(pages)/FAQ.tsx @@ -13,7 +13,7 @@ const FAQ = () => { style={{ transform: "scaleX(-1)" }} className="absolute left-1 top-46 hidden xl:block" /> -

FAQ

+

FAQs

); diff --git a/frontend/src/app/assets/images/genderEllipse.tsx b/frontend/src/app/assets/images/genderEllipse.tsx index dafede0..9f158ab 100644 --- a/frontend/src/app/assets/images/genderEllipse.tsx +++ b/frontend/src/app/assets/images/genderEllipse.tsx @@ -5,6 +5,27 @@ import { Doughnut } from "react-chartjs-2"; ChartJS.register(ArcElement, Tooltip, Legend); +const EMPTY_DATA = { + labels: [], + datasets: [{ data: [], backgroundColor: [], borderWidth: 0 }], +}; + +const CHART_DATA = { + labels: ["Male", "Female", "+10%"], + datasets: [ + { + data: [75, 15, 10], + backgroundColor: [ + "rgba(117, 51, 204, 0.77)", + "rgba(157, 75, 173, 1)", + "rgba(235, 140, 253, 1)", + ], + hoverBackgroundColor: ["#3B267B", "#E08CF5", "rgba(157, 75, 173, 1)"], + borderWidth: 0, + }, + ], +}; + export default function GenderEllipseSVG({ height = 315, width = 315, @@ -16,25 +37,8 @@ export default function GenderEllipseSVG({ }): ReactElement { const [visible, setVisible] = useState({ male: true, female: true }); const [hasAnimated, setHasAnimated] = useState(false); - const chartRef = useRef>(null); const containerRef = useRef(null); - const data = { - labels: ["Male", "Female", "+10%"], - datasets: [ - { - data: [75, 15, 10], - backgroundColor: [ - "rgba(117, 51, 204, 0.77)", - "rgba(157, 75, 173, 1)", - "rgba(235, 140, 253, 1)", - ], - hoverBackgroundColor: ["#3B267B", "#E08CF5", "rgba(157, 75, 173, 1)"], - borderWidth: 0, - }, - ], - }; - useEffect(() => { const observer = new IntersectionObserver( (entries) => { @@ -49,42 +53,14 @@ export default function GenderEllipseSVG({ return () => observer.disconnect(); }, [hasAnimated]); - useEffect(() => { - if (!hasAnimated) return; - const chart = chartRef.current; - if (!chart) return; - - chart.config.options!.animation = { - duration: 1500, - easing: "easeInOutQuart", - animateRotate: true, - animateScale: true, - }; - chart.data = data; - chart.update(); - }, [hasAnimated]); - - const handleToggle = (gender: "male" | "female") => { - const chart = chartRef.current; - if (!chart) return; - - if (gender === "male") { - chart.toggleDataVisibility(0); - setVisible((prev) => ({ ...prev, male: !prev.male })); - } else { - chart.toggleDataVisibility(1); - chart.toggleDataVisibility(2); - setVisible((prev) => ({ ...prev, female: !prev.female })); - } - chart.update(); - }; + const handleToggle = (gender: "male" | "female") => { }; const options: ChartOptions<"doughnut"> = { animation: { - duration: 1500, + duration: 1700, animateRotate: true, - animateScale: true, - }, + animateScale: true + }, rotation: 90, maintainAspectRatio: false, cutout: "60%", @@ -101,15 +77,10 @@ export default function GenderEllipseSVG({ callbacks: { title: (context) => { const index = context[0].dataIndex; - if (index === 1 || index === 2) return "Female"; - return "Male"; - }, - label: (context) => { - if (context.dataIndex === 1 || context.dataIndex === 2) { - return "25%"; - } - return `75%`; + return index === 1 || index === 2 ? "Female" : "Male"; }, + label: (context) => + context.dataIndex === 1 || context.dataIndex === 2 ? "25%" : "75%", }, }, }, @@ -117,7 +88,7 @@ export default function GenderEllipseSVG({ return (
- +
); } \ No newline at end of file diff --git a/frontend/src/app/components/OtherPrizes/OtherPrizes.tsx b/frontend/src/app/components/OtherPrizes/OtherPrizes.tsx index 46e2293..f80d7e4 100644 --- a/frontend/src/app/components/OtherPrizes/OtherPrizes.tsx +++ b/frontend/src/app/components/OtherPrizes/OtherPrizes.tsx @@ -16,7 +16,7 @@ export default function OtherPrizes({ className={`${cabinetExtraBold.className} text-primary-gradient-color text-2xl sm:text-2xl md:text-2xl lg:text-4xl text-start w-[8rem] sm:w-[8rem] md:w-[8rem] lg:text-end lg:h-full lg:w-full lg:top-[3rem] relative right-[4.3rem] top-[1.3rem] leading-none text-[1.701rem]`} > Tons of Gifts &
- Merch for Everyone ! + Merch for Everyone diff --git a/frontend/src/app/components/OtherPrizes/SwagPrizes.tsx b/frontend/src/app/components/OtherPrizes/SwagPrizes.tsx index 6ce43be..c4cd517 100644 --- a/frontend/src/app/components/OtherPrizes/SwagPrizes.tsx +++ b/frontend/src/app/components/OtherPrizes/SwagPrizes.tsx @@ -25,7 +25,7 @@ export default function SwagPrizes({ scrollProgress }: { scrollProgress: number
- Swags and Freebies! + Swags and Freebies

- Environment Track Added ! + Environment Track Added

Rs. 15,000 diff --git a/frontend/src/app/sections/Benefits/BenefitsCard.tsx b/frontend/src/app/sections/Benefits/BenefitsCard.tsx index 10128dd..448d7a7 100644 --- a/frontend/src/app/sections/Benefits/BenefitsCard.tsx +++ b/frontend/src/app/sections/Benefits/BenefitsCard.tsx @@ -1,3 +1,6 @@ +'use client' + +import { useState, useEffect } from 'react'; import CardDark from "@/app/components/BenefitsOfParticipating/CardDark"; import CardLight from "@/app/components/BenefitsOfParticipating/CardLight"; import NewNetworksSVG from "@/app/assets/images/NewNetworks"; @@ -11,6 +14,19 @@ import BenefitsCardFourth from "@/app/assets/images/BenefitsCardFourth"; export default function BenefitsCards() { + const [isMobile, setIsMobile] = useState(false); + + useEffect(() => { + const handleResize = () => { + setIsMobile(window.innerWidth < 1024); + }; + + handleResize(); + + window.addEventListener("resize", handleResize); + return () => window.removeEventListener("resize", handleResize); + },[]); + return (

@@ -32,13 +48,14 @@ export default function BenefitsCards() {
} /> } diff --git a/frontend/src/app/sections/FAQ/FAQ.tsx b/frontend/src/app/sections/FAQ/FAQ.tsx index e334ad5..d765be7 100644 --- a/frontend/src/app/sections/FAQ/FAQ.tsx +++ b/frontend/src/app/sections/FAQ/FAQ.tsx @@ -106,7 +106,7 @@ const Faq = () => { ), }, { - title: "Other", + title: "Others", questions: [ { question: "What about APIs?",