import { useSpring, animated } from '@react-spring/web' import { useEffect, useState } from 'react' import tokenomicChart from '../../../assets/images/tokenomic-chart.png' 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]', }, ] const TokenomicsSection = (props: Props) => { const [isVisible, setIsVisible] = useState(true) useEffect(() => { const section = document.querySelector('#tokenomics') const observer = new IntersectionObserver( ([entry]) => { setIsVisible(entry.isIntersecting) }, { threshold: 0.5 } ) if (!section) { return } observer.observe(section) return () => { observer.unobserve(section) } }, []) 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)', }, config: { duration: 500, }, }) return (

Tokenomics

    {tokenomics.map((item, index) => { return (

    {item.title}

    {item.description}

    ) })}
) } export default TokenomicsSection