src/components/Features/index.tsx (84 lines of code) (raw):

"use client"; import { useEffect, useRef } from 'react'; import lottie from 'lottie-web'; import SectionTitle from "../Common/SectionTitle"; const checkIcon = ( <svg width="16" height="13" viewBox="0 0 16 13" className="fill-current"> <path d="M5.8535 12.6631C5.65824 12.8584 5.34166 12.8584 5.1464 12.6631L0.678505 8.1952C0.483242 7.99994 0.483242 7.68336 0.678505 7.4881L2.32921 5.83739C2.52467 5.64193 2.84166 5.64216 3.03684 5.83791L5.14622 7.95354C5.34147 8.14936 5.65859 8.14952 5.85403 7.95388L13.3797 0.420561C13.575 0.22513 13.8917 0.225051 14.087 0.420383L15.7381 2.07143C15.9333 2.26669 15.9333 2.58327 15.7381 2.77854L5.8535 12.6631Z" /> </svg> ); const Features = () => { const animationContainer = useRef(null); useEffect(() => { const instance = lottie.loadAnimation({ container: animationContainer.current, renderer: 'svg', loop: true, autoplay: true, path: '/images/features/features.json' }); const observer = new IntersectionObserver((entries) => { entries.forEach(entry => { if (entry.isIntersecting) { instance.play(); } else { instance.pause(); } }); }); observer.observe(animationContainer.current); return () => { instance.destroy(); observer.disconnect(); }; }, []); const List = ({ text }) => ( <p className="mb-5 flex items-center text-lg font-medium text-body-color"> <span className="mr-4 flex h-[30px] w-[30px] items-center justify-center rounded-md bg-primary bg-opacity-10 text-primary"> {checkIcon} </span> {text} </p> ); return ( <section id="about" className="pt-16 md:pt-20 lg:pt-28" style={{ backgroundColor: '#0F0F1A' }}> <div className="container"> <div> <div className="-mx-4 flex flex-wrap items-center"> <div className="w-full px-4 lg:w-1/2"> <SectionTitle title="Main Features" paragraph="Explore Apache ResilientDB (Incubating), a high-throughput blockchain fabric with a multi-threaded design." mb="44px" /> <div className="mb-12 max-w-[570px] lg:mb-0" data-wow-delay=".15s" > <div className="mx-[-12px] flex flex-wrap"> <div className="w-full px-3 sm:w-1/2 lg:w-full xl:w-1/2"> <List text="GraphQL Support" /> <List text="Wallet Integration" /> <List text="SDK Support" /> <List text="In-Memory" /> <List text="Durable Storage" /> </div> <div className="w-full px-3 sm:w-1/2 lg:w-full xl:w-1/2"> <List text="Multiple Interfaces" /> <List text="RPC Architecture" /> <List text="Dockerized CLI" /> <List text="Secure Authentication" /> <List text="Open Source" /> </div> </div> </div> </div> <div className="w-full px-4 lg:w-1/2"> <div className="relative mx-auto aspect-[25/24] max-w-[500px] lg:mr-0"> <div ref={animationContainer}></div> </div> </div> </div> </div> </div> </section> ); }; export default Features;