'use client'; import { useState, useEffect, useRef } from 'react'; import Image from 'next/image'; export default function TrustedBySection() { const [mounted, setMounted] = useState(false); const [visible, setVisible] = useState(false); const sectionRef = useRef(null); useEffect(() => { setMounted(true); // 使用 IntersectionObserver 检测元素进入视口 const observer = new IntersectionObserver( (entries) => { entries.forEach((entry) => { if (entry.isIntersecting && !visible) { setVisible(true); } }); }, { threshold: 0.2, // 当20%的元素可见时触发 } ); if (sectionRef.current) { observer.observe(sectionRef.current); } return () => { if (sectionRef.current) { observer.unobserve(sectionRef.current); } }; }, [visible]); // 合作伙伴 logo 数据 const partners = [ { name: 'BlackRock', src: '/nav-ireland0.svg', width: 193, height: 28, className: 'w-[193px] h-[28px]' }, { name: 'Coinbase', src: '/coinbase-10.svg', width: 179, height: 32, className: 'w-[179px] h-[32px]' }, { name: 'Wintermute', src: '/wintermute0.svg', width: 247, height: 40, className: 'w-[247px] h-[40px]' }, { name: 'Circle', src: '/group0.svg', width: 156, height: 40, className: 'w-[156px] h-[40px]' }, { name: 'ConsenSys', src: '/logo1.svg', // 临时使用一个 logo width: 176, height: 40, className: 'w-[176px] h-[40px]' } ]; return (
{/* 标题 - .text6 */}
Trusted by Industry Leaders
{/* Logo容器 - .frame-26 */}
{partners.map((partner, index) => (
{partner.name}
))}
); }