Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hackhazard stat section made responsive #524

Merged
merged 1 commit into from
May 26, 2024
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
3 changes: 1 addition & 2 deletions src/Pages/Hackhazards/Hackhazards.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,8 @@ function Hackhazards() {
</a>
</div>


<>
<h2 className="mt-[100px] text-2xl text-center md:text-4xl lg:text-5xl font-bold">
<h2 className="mt-[80px] text-2xl text-center md:text-4xl lg:text-5xl font-bold">
Official{" "}
<span className="text-2xl md:text-4xl lg:text-5xl font-extrabold text-transparent bg-clip-text bg-gradient-to-r from-blue-500 to-blue-800">
<a href="https://linktr.ee/nscc_bpit">Stats</a>
Expand Down
74 changes: 40 additions & 34 deletions src/components/CounterUp.jsx
Original file line number Diff line number Diff line change
@@ -1,39 +1,45 @@
import React, {useState} from "react";
import React, { useState } from "react";
import CountUp from 'react-countup';
import ScrollTrigger from 'react-scroll-trigger'
import ScrollTrigger from 'react-scroll-trigger';

const CounterUp = () => {

const [counterOn, setCounterOn] = useState(false)

return (

<ScrollTrigger onEnter={() => setCounterOn(true)} onExit={() => setCounterOn(false)}>
<div className="flex justify-center items-center h-[30vh] w-full mt-8">
<div className=" w-[95%] text-white flex justify-between">
<div className="px-4 font-bold text-8xl">
{counterOn && <CountUp start={0} end={2400} duration={3} delay={0} />} <span>+</span>
<p className="text-3xl">Unique Participants</p>
</div>

<div className="px-4 font-bold text-8xl">
{counterOn && <CountUp start={0} end={200} duration={3} delay={0} />}<span>+</span>
<p className="text-3xl">Colleges</p>
</div>

<div className="px-4 font-bold text-8xl">
{counterOn && <CountUp start={0} end={50} duration={3} delay={0} />}<span>+</span>
<p className="text-3xl">Cities</p>
</div>

<div className="px-4 font-bold text-8xl">
{counterOn && <CountUp start={0} end={16} duration={3} delay={0} />}<span>+</span>
<p className="text-3xl">Community Partners</p>
</div>
</div>
</div>
</ScrollTrigger>
);
const [counterOn, setCounterOn] = useState(false);

return (
<ScrollTrigger onEnter={() => setCounterOn(true)} onExit={() => setCounterOn(false)}>
<div className="flex flex-col justify-center items-center h-auto w-full mt-8">
<div className="w-[95%] text-white flex flex-row justify-around flex-wrap md:flex-nowrap">
<div className="px-4 mb-8 md:mb-0 font-bold text-4xl md:text-6xl lg:text-8xl text-center md:text-left flex-1">
<div className="whitespace-nowrap">
{counterOn && <CountUp start={0} end={2400} duration={3} delay={0} />} <span>+</span>
</div>
<p className="text-lg md:text-2xl lg:text-3xl mt-2">Unique Participants</p>
</div>

<div className="px-4 mb-8 md:mb-0 font-bold text-4xl md:text-6xl lg:text-8xl text-center md:text-left flex-1">
<div className="whitespace-nowrap">
{counterOn && <CountUp start={0} end={200} duration={3} delay={0} />} <span>+</span>
</div>
<p className="text-lg md:text-2xl lg:text-3xl mt-2">Colleges</p>
</div>

<div className="px-4 mb-8 md:mb-0 font-bold text-4xl md:text-6xl lg:text-8xl text-center md:text-left flex-1">
<div className="whitespace-nowrap">
{counterOn && <CountUp start={0} end={50} duration={3} delay={0} />} <span>+</span>
</div>
<p className="text-lg md:text-2xl lg:text-3xl mt-2">Cities</p>
</div>

<div className="px-4 mb-8 md:mb-0 font-bold text-4xl md:text-6xl lg:text-8xl text-center md:text-left flex-1">
<div className="whitespace-nowrap">
{counterOn && <CountUp start={0} end={16} duration={3} delay={0} />} <span>+</span>
</div>
<p className="text-lg md:text-2xl lg:text-3xl mt-2">Community Partners</p>
</div>
</div>
</div>
</ScrollTrigger>
);
}

export default CounterUp;
export default CounterUp;
Loading