Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion frontend/src/app/(pages)/FAQ.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const FAQ = () => {
style={{ transform: "scaleX(-1)" }}
className="absolute left-1 top-46 hidden xl:block"
/>
<h1 className={`headings mb-[3rem] ${cabinetExtraBold.className}`}>FAQ</h1>
<h1 className={`headings mb-[3rem] ${cabinetExtraBold.className}`}>FAQs</h1>
<Faq />
</div>
);
Expand Down
87 changes: 29 additions & 58 deletions frontend/src/app/assets/images/genderEllipse.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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<ChartJS<"doughnut">>(null);
const containerRef = useRef<HTMLDivElement>(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) => {
Expand All @@ -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%",
Expand All @@ -101,23 +77,18 @@ 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%",
},
},
},
};

return (
<div ref={containerRef} style={{ width, height }} className={className}>
<Doughnut ref={chartRef} data={{ labels: [], datasets: [] }} options={options} />
<Doughnut data={hasAnimated ? CHART_DATA : EMPTY_DATA} options={options} />
</div>
);
}
2 changes: 1 addition & 1 deletion frontend/src/app/components/OtherPrizes/OtherPrizes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 & <br />
Merch for Everyone !
Merch for Everyone
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/app/components/OtherPrizes/SwagPrizes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export default function SwagPrizes({ scrollProgress }: { scrollProgress: number
<div
className={`${cabinetExtraBold.className} flex items-center lg:text-center text-start text-primary-gradient-color h-[7.875rem] w-[10.375rem] leading-none text-[1.701rem] sm:text-[1.701rem] md:text-[2.01rem] lg:text-[2.5rem] py-4 sm:w-[10.375rem] md:w-[10.375rem] lg:w-[20rem] lg:items-center`}
>
Swags and Freebies!
Swags and Freebies
</div>
<div className="flex justify-center lg:w-full md:w-[150px] w-[100px] h-fit">
<Lottie
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/app/components/TrackWinner/TrackWinner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export default function TrackWinner({ scrollProgress }: { scrollProgress: number
</div>
<div className="flex flex-col items-start gap-1 lg:gap-2 px-6">
<p className={`${cabinetRegular.className} text-white text-xs sm:text-xs md:text-xl lg:text-2xl tracking-wide w-full`}>
Environment Track Added !
Environment Track Added
</p>
<p className={`${cabinetBlack.className} text-4xl sm:text-4xl md:text-5xl lg:text-7xl text-[#F5C144] `}>
Rs. 15,000
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/app/sections/FAQ/FAQ.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ const Faq = () => {
),
},
{
title: "Other",
title: "Others",
questions: [
{
question: "What about APIs?",
Expand Down
Loading