-
- Road Map
-
+ return (
+
+
+
+ Road Map
+
+ {/*
*/}
+
+ {roadMapData.map((item, index) => {
+ return (
+
+
-
- {roadMapData.map((item, index) => {
- return (
-
-
- {item.phase}
-
-
- {item.listTitle.map((listItem, index) => {
- return (
- -
-
-
- {listItem}
-
-
- )
- })}
-
-
- )
+
+ {item.phase}
+
+
+ {item.listTitle.map((listItem, index) => {
+ return (
+ -
+
+
{listItem}
+
+ );
})}
+
-
- )
-}
+ );
+ })}
+
+
+ //
+ );
+};
-export default RoadMap
+export default RoadMap;
diff --git a/src/shared/components/home/TokenomicsSection.tsx b/src/shared/components/home/TokenomicsSection.tsx
index df625a7..0dba9d7 100644
--- a/src/shared/components/home/TokenomicsSection.tsx
+++ b/src/shared/components/home/TokenomicsSection.tsx
@@ -1,138 +1,191 @@
-import { useSpring, animated } from '@react-spring/web'
-import { useEffect, useState } from 'react'
-import tokenomicChart from '../../../assets/images/tokenomic-chart.png'
-
-type Props = {}
+import { useSpring, animated } from "@react-spring/web";
+import { useEffect, useState } from "react";
+import tokenomicChart from "../../../assets/images/tokenomic-chart.png";
+import { Pie } from "react-chartjs-2";
+import "chart.js/auto";
+type Props = {};
const tokenomics = [
- {
- title: 'Liquidity - 5% 1,000,000 SGPT',
- description: ' ',
- color: 'bg-[#86eae9]',
- },
- {
- title: 'Private Sale - 17% 3,400,000 SGPT',
- description: ' ',
- color: 'bg-[#5dbdd3]',
- },
- {
- title: 'Stacking & Farming - 15% 3,000,000 SGPT',
- description: ' ',
- color: 'bg-[#4591b8]',
- },
- {
- title: 'Marketing & Promotion - 15% 3,000,000 SGPT',
- description: ' ',
- color: 'bg-[#3b6696]',
- },
- {
- title: 'Public Sale - 14% 2,800,000 SGPT',
- description: ' ',
- color: 'bg-[#353c6e]',
- },
- {
- title: 'Reward & Q&A - 10% 2,000,000 SGPT',
- description: ' ',
- color: 'bg-[#705788]',
- },
- {
- title: 'Advisor - 10% 2,000,000 SGPT',
- description: ' ',
- color: 'bg-[#a5769e]',
- },
- {
- title: 'Treasury - 14% 2,800,000 SGPT',
- description: ' ',
- color: 'bg-[#d59ab3]',
- },
-]
+ {
+ title: "Liquidity - 5% 1,000,000 SGPT",
+ precent: "5",
+ description: " ",
+ color: "#86eae9",
+ bgcolor: "bg-[#86eae9]",
+ },
+ {
+ title: "Private Sale - 17% 3,400,000 SGPT",
+ description: " ",
+ precent: "17",
+ color: "#5dbdd3",
+ bgcolor: "bg-[#5dbdd3]",
+ },
+ {
+ title: "Stacking & Farming - 15% 3,000,000 SGPT",
+ description: " ",
+ precent: "15",
+ color: "#4591b8",
+ bgcolor: "bg-[#4591b8]",
+ },
+ {
+ title: "Marketing & Promotion - 15% 3,000,000 SGPT",
+ description: " ",
+ precent: "15",
+ color: "#3b6696",
+ bgcolor: "bg-[#3b6696]",
+ },
+ {
+ title: "Public Sale - 14% 2,800,000 SGPT",
+ description: " ",
+ precent: "14",
+ color: "#353c6e",
+ bgcolor: "bg-[#353c6e]",
+ },
+ {
+ title: "Reward & Q&A - 10% 2,000,000 SGPT",
+ description: " ",
+ precent: "10",
+ color: "#705788",
+ bgcolor: "bg-[#705788]",
+ },
+ {
+ title: "Advisor - 10% 2,000,000 SGPT",
+ description: " ",
+ precent: "10",
+ color: "#a5769e",
+ bgcolor: "bg-[#a5769e]",
+ },
+ {
+ title: "Treasury - 14% 2,800,000 SGPT",
+ description: " ",
+ precent: "14",
+ color: "#d59ab3",
+ bgcolor: "bg-[#d59ab3]",
+ },
+];
const TokenomicsSection = (props: Props) => {
- const [isVisible, setIsVisible] = useState(true)
+ const [isVisible, setIsVisible] = useState(false);
- useEffect(() => {
- const section = document.querySelector('#tokenomics')
- const observer = new IntersectionObserver(
- ([entry]) => {
- setIsVisible(entry.isIntersecting)
- },
- { threshold: 0.5 }
- )
+ useEffect(() => {
+ const section = document.getElementById("tokenomics");
+ const observer = new IntersectionObserver(
+ ([entry]) => {
+ setIsVisible(entry.isIntersecting);
+ },
+ { threshold: 0.5 }
+ );
- if (!section) {
- return
- }
- observer.observe(section)
+ if (!section) {
+ return;
+ }
+ observer.observe(section);
- return () => {
- observer.unobserve(section)
- }
- }, [])
+ return () => {
+ observer.unobserve(section);
+ };
+ }, []);
- useEffect(() => {
- console.log('isVisible', isVisible)
- }, [isVisible])
+ useEffect(() => {
+ console.log("isVisible", isVisible);
+ }, [isVisible]);
- const styles = useSpring({
- opacity: isVisible ? 1 : 0,
- from: {
- opacity: 0,
- transform: 'translateY(100px)',
- },
- to: {
- opacity: isVisible ? 1 : 0,
- transform: 'translateY(0px)',
- },
+ const styles = useSpring({
+ opacity: isVisible ? 1 : 0,
+ transform: isVisible ? "translateY(0)" : "translateY(100px)",
+ config: {
+ duration: 500,
+ },
+ });
- config: {
- duration: 500,
+ const textCenter = {
+ id: "textCenter",
+ beforeDatasetsDraw(chart: any, arg: any, pluginsOptions: any) {
+ const { ctx, data } = chart;
+ ctx.save();
+ ctx.fillStyle = "#fff";
+ ctx.font = "bolder 30px sen";
+ ctx.textAlign = "center";
+ ctx.textBaseline = "middle";
+ ctx.fillText(
+ `TOTAL SUPPLE`,
+ chart.getDatasetMeta(0).data[0].x,
+ chart.getDatasetMeta(0).data[0].y - 20
+ );
+ ctx.fillText(
+ `20,000,000 SGPT`,
+ chart.getDatasetMeta(0).data[0].x,
+ chart.getDatasetMeta(0).data[0].y + 25
+ );
+ },
+ };
+ const [userData, setUserData] = useState({
+ labels: tokenomics.map((data) => data.title),
+ datasets: [
+ {
+ // label: "text",
+ data: tokenomics.map((data) => data.precent),
+ backgroundColor: tokenomics.map((data) => data.color),
+ // cutout: "10%",
+ borderWidth: 2,
+ delay: 100,
+ },
+ ],
+ });
+ const labelText = {
+ hoverBorderWidth: 4,
+ plugins: {
+ legend: {
+ display: false,
+ },
+ tooltip: {
+ callbacks: {
+ label: (context: any) => {
+ return ` ${context.label}`;
+ },
},
- })
- return (
-
-
-
- Tokenomics
-
+ },
+ },
+ };
-
-
-
-
+ return (
+
+
+
+ Tokenomics
+
+
+
-
-
- {tokenomics.map((item, index) => {
- return (
-
-
-
- {item.title}
-
-
- {item.description}
-
-
- )
- })}
-
-
-
-
+
+
+ {tokenomics.map((item, index) => {
+ return (
+
+
+
+ {item.title}
+
+ {item.description}
+
+ );
+ })}
+
+
- )
-}
+
+
+ );
+};
-export default TokenomicsSection
+export default TokenomicsSection;
diff --git a/src/shared/components/home/text b/src/shared/components/home/text
new file mode 100644
index 0000000..d9c80c2
--- /dev/null
+++ b/src/shared/components/home/text
@@ -0,0 +1,26 @@
+
+
+
+
+ {index + 1}
+ {/* */}
+
+
+
{item.phase}
+
+ {item.listTitle.map((listItem, index) => {
+ return (
+ -
+
+
{listItem}
+
+ );
+ })}
+
+
+
+
+
\ No newline at end of file