mirror of
https://github.com/WDI-Ideas/rubix.git
synced 2026-04-27 19:35:50 +00:00
306 lines
8.2 KiB
JavaScript
306 lines
8.2 KiB
JavaScript
import { Box, Container, Text } from "@chakra-ui/react";
|
|
import { useInView } from "react-intersection-observer";
|
|
import CountUp from "react-countup";
|
|
import banner from "../../assets/images/Statsbanner.png";
|
|
import { useMediaQuery } from "@chakra-ui/react";
|
|
import { useGetStatsApiQuery } from "../../Redux/slice/statsSlice";
|
|
|
|
const StatsContent = {
|
|
heading: `Key Statistics`,
|
|
};
|
|
|
|
const Stats = () => {
|
|
const { data, isLoading, error } = useGetStatsApiQuery();
|
|
console.log(data);
|
|
const [isSmallScreen] = useMediaQuery("(max-width: 435px)");
|
|
const { ref, inView } = useInView({
|
|
threshold: 0.5,
|
|
triggerOnce: true,
|
|
});
|
|
return (
|
|
<Box
|
|
height={"auto"}
|
|
backgroundImage={`url(${banner})`}
|
|
backgroundSize={"cover"}
|
|
backgroundRepeat={"no-repeat"}
|
|
padding={"3rem"}
|
|
sx={{
|
|
"@media (max-width: 1024px)": {
|
|
height: "auto",
|
|
},
|
|
"@media (max-width: 600px)": {
|
|
fontSize: "28px",
|
|
},
|
|
}}
|
|
>
|
|
<Text
|
|
as={"h2"}
|
|
paddingTop={"2rem"}
|
|
paddingBottom={"2rem"}
|
|
fontWeight={500}
|
|
fontSize={"40px"}
|
|
textAlign={"center"}
|
|
textTransform={"capitalize"}
|
|
color={"#fff"}
|
|
sx={{
|
|
"@media (max-width: 1024px)": {},
|
|
"@media (max-width: 600px)": {
|
|
fontSize: "25px",
|
|
},
|
|
}}
|
|
>
|
|
{StatsContent.heading}
|
|
</Text>
|
|
<Container
|
|
maxW="container.lg"
|
|
display={"grid"}
|
|
placeContent={"center"}
|
|
paddingBottom="3rem"
|
|
sx={{
|
|
"@media (max-width: 996px)": {
|
|
height: "auto",
|
|
paddingBottom: "2rem",
|
|
},
|
|
}}
|
|
>
|
|
<Box
|
|
display={"flex"}
|
|
justifyContent={"center"}
|
|
alignItems={"center"}
|
|
gap={"8rem"}
|
|
marginBottom={"6rem"}
|
|
flexWrap={"wrap"}
|
|
sx={{
|
|
"@media (max-width: 1024px)": {},
|
|
"@media (max-width: 996px)": {
|
|
flexDirection: "column",
|
|
gap: "2rem",
|
|
marginBottom: "2rem",
|
|
},
|
|
"@media (max-width: 375px)": {
|
|
gap: "2rem",
|
|
marginBottom: "2rem",
|
|
},
|
|
}}
|
|
>
|
|
<Box
|
|
ref={ref}
|
|
color={"#fff"}
|
|
textAlign={"center"}
|
|
position={"relative"}
|
|
_before={{
|
|
content: "''",
|
|
position: "absolute",
|
|
height: "100%",
|
|
right: "-70px",
|
|
borderRight: "1px solid #EFEFEF",
|
|
zIndex: "2",
|
|
}}
|
|
sx={{
|
|
"@media (max-width: 1024px)": {},
|
|
"@media (max-width: 996px)": {
|
|
_before: {
|
|
borderRight: "none",
|
|
},
|
|
},
|
|
}}
|
|
>
|
|
{inView && (
|
|
<CountUp
|
|
start={50000000}
|
|
end={51400000}
|
|
delay={0}
|
|
style={{
|
|
fontSize: `${isSmallScreen ? "23px" : "38px"}`,
|
|
fontWeight: "500",
|
|
}}
|
|
/>
|
|
)}
|
|
<Text
|
|
textTransform={"uppercase"}
|
|
color={"#ADADAD"}
|
|
sx={{
|
|
"@media (max-width: 1024px)": {},
|
|
"@media (max-width: 435px)": {
|
|
fontSize: "14px",
|
|
},
|
|
"@media (max-width: 375px)": {},
|
|
}}
|
|
>
|
|
Total Capped Supply
|
|
</Text>
|
|
</Box>
|
|
<Box
|
|
color={"#fff"}
|
|
// ref={ref}
|
|
textAlign={"center"}
|
|
position={"relative"}
|
|
_before={{
|
|
content: "''",
|
|
position: "absolute",
|
|
height: "100%",
|
|
right: "-70px",
|
|
borderRight: "1px solid #EFEFEF",
|
|
zIndex: "2",
|
|
}}
|
|
sx={{
|
|
"@media (max-width: 1024px)": {},
|
|
"@media (max-width: 996px)": {
|
|
_before: {
|
|
borderRight: "none",
|
|
},
|
|
},
|
|
}}
|
|
>
|
|
{inView && (
|
|
<CountUp
|
|
start={10000000}
|
|
end={10247786}
|
|
delay={0}
|
|
style={{
|
|
fontSize: `${isSmallScreen ? "23px" : "38px"}`,
|
|
fontWeight: "500",
|
|
}}
|
|
/>
|
|
)}
|
|
<Text
|
|
textTransform={"uppercase"}
|
|
color={"#ADADAD"}
|
|
sx={{
|
|
"@media (max-width: 1024px)": {},
|
|
"@media (max-width: 435px)": {
|
|
fontSize: "14px",
|
|
},
|
|
"@media (max-width: 375px)": {},
|
|
}}
|
|
>
|
|
Digital Asset Tools mined
|
|
</Text>
|
|
</Box>
|
|
<Box color={"#fff"} textAlign={"center"}>
|
|
{inView && (
|
|
<CountUp
|
|
start={100000}
|
|
end={201413}
|
|
delay={0}
|
|
style={{
|
|
fontSize: `${isSmallScreen ? "23px" : "38px"}`,
|
|
fontWeight: "700",
|
|
}}
|
|
/>
|
|
)}
|
|
<Text
|
|
textTransform={"uppercase"}
|
|
color={"#ADADAD"}
|
|
sx={{
|
|
"@media (max-width: 1024px)": {},
|
|
"@media (max-width: 435px)": {
|
|
fontSize: "14px",
|
|
},
|
|
"@media (max-width: 375px)": {},
|
|
}}
|
|
>
|
|
DID Count
|
|
</Text>
|
|
</Box>
|
|
</Box>
|
|
|
|
<Box
|
|
display={"flex"}
|
|
justifyContent={"center"}
|
|
alignItems={"center"}
|
|
gap={"8rem"}
|
|
sx={{
|
|
"@media (max-width: 1024px)": {},
|
|
"@media (max-width: 996px)": {
|
|
flexDirection: "column",
|
|
gap: "4rem",
|
|
},
|
|
"@media (max-width: 600px)": {
|
|
gap: "2rem",
|
|
},
|
|
"@media (max-width: 375px)": {
|
|
gap: "2rem",
|
|
},
|
|
}}
|
|
>
|
|
<Box
|
|
color={"#fff"}
|
|
textAlign={"center"}
|
|
position={"relative"}
|
|
_before={{
|
|
content: "''",
|
|
position: "absolute",
|
|
height: "100%",
|
|
right: "-70px",
|
|
borderRight: "1px solid #EFEFEF",
|
|
zIndex: "2",
|
|
}}
|
|
sx={{
|
|
"@media (max-width: 1024px)": {},
|
|
"@media (max-width: 996px)": {
|
|
_before: {
|
|
borderRight: "none",
|
|
},
|
|
},
|
|
}}
|
|
>
|
|
{inView && (
|
|
<CountUp
|
|
start={50000000}
|
|
end={10247786}
|
|
delay={0}
|
|
style={{
|
|
fontSize: `${isSmallScreen ? "23px" : "38px"}`,
|
|
fontWeight: "500",
|
|
}}
|
|
/>
|
|
)}
|
|
<Text
|
|
textTransform={"uppercase"}
|
|
color={"#ADADAD"}
|
|
sx={{
|
|
"@media (max-width: 1024px)": {},
|
|
"@media (max-width: 435px)": {
|
|
fontSize: "14px",
|
|
},
|
|
"@media (max-width: 375px)": {},
|
|
}}
|
|
>
|
|
Circulating Supply at level 4
|
|
</Text>
|
|
</Box>
|
|
<Box color={"#fff"} textAlign={"center"}>
|
|
{inView && (
|
|
<CountUp
|
|
start={10000000}
|
|
end={13572940}
|
|
delay={0}
|
|
style={{
|
|
fontSize: `${isSmallScreen ? "23px" : "38px"}`,
|
|
fontWeight: "500",
|
|
}}
|
|
/>
|
|
)}
|
|
<Text
|
|
textTransform={"uppercase"}
|
|
color={"#ADADAD"}
|
|
sx={{
|
|
"@media (max-width: 1024px)": {},
|
|
"@media (max-width: 435px)": {
|
|
fontSize: "14px",
|
|
},
|
|
"@media (max-width: 375px)": {},
|
|
}}
|
|
>
|
|
Transactions
|
|
</Text>
|
|
</Box>
|
|
</Box>
|
|
</Container>
|
|
</Box>
|
|
);
|
|
};
|
|
|
|
export default Stats;
|