Files
asset-homepage/components/WhyAssetXSection.tsx

303 lines
11 KiB
TypeScript
Raw Permalink Normal View History

2026-01-27 17:26:30 +08:00
'use client';
import { useState, useEffect, useRef } from 'react';
import Image from 'next/image';
2026-01-29 16:23:10 +08:00
import { Card, CardBody, Chip } from '@heroui/react';
2026-01-28 17:55:01 +08:00
import { useLanguage } from '@/contexts/LanguageContext';
2026-01-29 16:23:10 +08:00
import { useTheme } from '@/contexts/ThemeContext';
2026-01-27 17:26:30 +08:00
export default function WhyAssetXSection() {
2026-01-28 17:55:01 +08:00
const { t } = useLanguage();
2026-01-29 16:23:10 +08:00
const { theme } = useTheme();
2026-01-28 17:55:01 +08:00
const [animate, setAnimate] = useState(false);
2026-01-27 17:26:30 +08:00
const sectionRef = useRef<HTMLElement>(null);
useEffect(() => {
2026-01-28 17:55:01 +08:00
const currentRef = sectionRef.current;
if (!currentRef) return;
2026-01-27 17:26:30 +08:00
const observer = new IntersectionObserver(
(entries) => {
2026-01-28 17:55:01 +08:00
if (entries[0].isIntersecting) {
setAnimate(true);
2026-01-29 16:23:10 +08:00
observer.disconnect();
2026-01-28 17:55:01 +08:00
}
2026-01-27 17:26:30 +08:00
},
2026-01-29 16:23:10 +08:00
{ threshold: 0.5 }
2026-01-27 17:26:30 +08:00
);
2026-01-28 17:55:01 +08:00
observer.observe(currentRef);
return () => observer.disconnect();
}, []);
2026-01-27 17:26:30 +08:00
2026-01-29 16:23:10 +08:00
const isDark = theme === 'dark';
2026-01-27 17:26:30 +08:00
return (
<section
ref={sectionRef}
2026-01-29 16:23:10 +08:00
className={`flex flex-row items-center justify-center flex-wrap flex-shrink-0 w-full relative ${
isDark ? 'bg-[#0a0a0a]' : 'bg-white'
}`}
2026-01-27 17:26:30 +08:00
style={{
padding: '80px 0px',
gap: '40px',
alignContent: 'center'
}}
>
2026-01-28 17:55:01 +08:00
<div className="flex flex-col items-center justify-center w-[1440px]">
<div className="flex flex-col gap-2 items-start justify-start flex-shrink-0 w-[1440px] relative mb-10">
2026-01-27 17:26:30 +08:00
<h2
2026-01-29 16:23:10 +08:00
className={`text-left relative font-domine text-5xl font-bold ${
isDark ? 'text-[#fafafa]' : 'text-[#111827]'
}`}
2026-01-27 17:26:30 +08:00
style={{
lineHeight: '120%',
2026-01-29 16:23:10 +08:00
letterSpacing: '-0.01em'
2026-01-27 17:26:30 +08:00
}}
>
2026-01-28 17:55:01 +08:00
{t('why.title')}
2026-01-27 17:26:30 +08:00
</h2>
<p
2026-01-29 16:23:10 +08:00
className={`text-left relative font-domine text-xl ${
isDark ? 'text-[#a1a1aa]' : 'text-[#9ca1af]'
}`}
2026-01-27 17:26:30 +08:00
style={{
2026-01-29 16:23:10 +08:00
lineHeight: '140%'
2026-01-27 17:26:30 +08:00
}}
>
2026-01-28 17:55:01 +08:00
{t('why.subtitle')}
2026-01-27 17:26:30 +08:00
</p>
</div>
2026-01-28 17:55:01 +08:00
<div className="flex flex-row gap-6 items-center justify-start flex-shrink-0 w-[1440px] relative">
2026-01-27 17:26:30 +08:00
2026-01-29 16:23:10 +08:00
<Card
className={`flex-1 self-stretch transition-all hover:-translate-y-2 ${
animate ? 'translate-y-0 opacity-100' : 'translate-y-12 opacity-0'
} ${
isDark ? 'bg-[#18181b] border-[#27272a]' : 'bg-white border-[#e5e7eb]'
}`}
shadow="sm"
2026-01-27 17:26:30 +08:00
style={{
transition: 'transform 0.3s ease-out, box-shadow 0.3s ease-out, opacity 0.7s ease-out, translate 0.7s ease-out'
}}
>
2026-01-29 16:23:10 +08:00
<CardBody className="flex flex-col items-start justify-between p-10 gap-6">
<div className="flex flex-col gap-6 items-start justify-start self-stretch">
<div className={`rounded-2xl flex items-center justify-center w-12 h-12 ${
isDark ? 'bg-[#27272a]' : 'bg-[#f9fafb]'
}`}>
<Image
src="/system-data0.svg"
alt="System Data"
width={24}
height={24}
style={{
filter: isDark ? 'invert(1) brightness(0.8)' : 'none'
}}
/>
</div>
2026-01-27 17:26:30 +08:00
2026-01-29 16:23:10 +08:00
<div className="flex flex-col gap-4 items-start justify-start self-stretch">
<h3 className={`text-2xl font-bold font-domine ${
isDark ? 'text-[#fafafa]' : 'text-[#111827]'
}`}
style={{
lineHeight: '130%',
letterSpacing: '-0.005em'
}}
>
{t('why.sustainable.title')}
</h3>
<p className={`text-base font-domine ${
isDark ? 'text-[#a1a1aa]' : 'text-[#9ca1af]'
}`}
style={{
lineHeight: '150%'
}}
>
{t('why.sustainable.desc')}
</p>
</div>
2026-01-27 17:26:30 +08:00
</div>
2026-01-29 16:23:10 +08:00
<Image
src="/frame-110.svg"
alt="Chart"
width={305}
height={162}
className="w-full h-auto"
/>
</CardBody>
</Card>
2026-01-27 17:26:30 +08:00
2026-01-28 17:55:01 +08:00
<div className="flex flex-col gap-6 items-start justify-start flex-shrink-0 w-[850px] relative">
2026-01-27 17:26:30 +08:00
2026-01-29 16:23:10 +08:00
<Card
className={`self-stretch transition-all hover:-translate-y-2 ${
animate ? 'translate-y-0 opacity-100' : 'translate-y-12 opacity-0'
} ${
isDark ? 'bg-[#18181b] border-[#27272a]' : 'bg-white border-[#e5e7eb]'
}`}
shadow="sm"
2026-01-27 17:26:30 +08:00
style={{
transition: 'transform 0.3s ease-out, box-shadow 0.3s ease-out, opacity 0.7s ease-out 0.15s, translate 0.7s ease-out 0.15s'
}}
>
2026-01-29 16:23:10 +08:00
<CardBody className="flex flex-row items-center justify-between p-10">
<div className="flex flex-col gap-6 items-start justify-start flex-shrink-0 w-[414px]">
<div className={`rounded-2xl flex items-center justify-center w-12 h-12 ${
isDark ? 'bg-[#27272a]' : 'bg-[#f9fafb]'
}`}>
2026-01-27 17:26:30 +08:00
<Image
src="/warning-shield-check0.svg"
alt="Shield Check"
width={24}
height={24}
2026-01-29 16:23:10 +08:00
style={{
filter: isDark ? 'invert(1) brightness(0.8)' : 'none'
}}
2026-01-27 17:26:30 +08:00
/>
</div>
2026-01-29 16:23:10 +08:00
<div className="flex flex-col gap-4 items-start justify-start self-stretch">
<h3 className={`text-2xl font-bold font-domine ${
isDark ? 'text-[#fafafa]' : 'text-[#111827]'
}`}
2026-01-27 17:26:30 +08:00
style={{
lineHeight: '130%',
2026-01-29 16:23:10 +08:00
letterSpacing: '-0.005em'
2026-01-27 17:26:30 +08:00
}}
>
2026-01-28 17:55:01 +08:00
{t('why.reliability.title')}
2026-01-27 17:26:30 +08:00
</h3>
2026-01-29 16:23:10 +08:00
<p className={`text-base font-domine ${
isDark ? 'text-[#a1a1aa]' : 'text-[#9ca1af]'
}`}
2026-01-27 17:26:30 +08:00
style={{
2026-01-29 16:23:10 +08:00
lineHeight: '150%'
2026-01-27 17:26:30 +08:00
}}
>
2026-01-28 17:55:01 +08:00
{t('why.reliability.desc')}
2026-01-27 17:26:30 +08:00
</p>
</div>
</div>
2026-01-28 17:55:01 +08:00
<div
2026-01-29 16:23:10 +08:00
className={`rounded-2xl border flex items-center justify-center ${
isDark ? 'bg-[#27272a] border-[#3f3f46]' : 'bg-[#f9fafb] border-[#e5e7eb]'
}`}
2026-01-28 17:55:01 +08:00
style={{
padding: '32px',
height: '180px',
2026-01-29 16:23:10 +08:00
width: '196px'
2026-01-28 17:55:01 +08:00
}}
>
<div
2026-01-29 16:23:10 +08:00
className={`rounded-full border-2 flex items-center justify-center ${
isDark ? 'border-[#3f3f46]' : 'border-[#e5e7eb]'
}`}
2026-01-28 17:55:01 +08:00
style={{
width: '132px',
2026-01-29 16:23:10 +08:00
height: '132px'
2026-01-28 17:55:01 +08:00
}}
>
<div
2026-01-29 16:23:10 +08:00
className={`rounded-full flex items-center justify-center ${
isDark ? 'bg-[#3f3f46]' : 'bg-[#e5e7eb]'
}`}
2026-01-28 17:55:01 +08:00
style={{
width: '88.59px',
2026-01-29 16:23:10 +08:00
height: '88.59px'
2026-01-28 17:55:01 +08:00
}}
>
<img
src="/icon0.svg"
alt="Lock Icon"
style={{
width: '44.29px',
height: '44.29px',
display: 'block'
}}
/>
</div>
</div>
2026-01-27 17:26:30 +08:00
</div>
2026-01-29 16:23:10 +08:00
</CardBody>
</Card>
2026-01-27 17:26:30 +08:00
2026-01-29 16:23:10 +08:00
<Card
className={`self-stretch transition-all hover:-translate-y-2 ${
animate ? 'translate-y-0 opacity-100' : 'translate-y-12 opacity-0'
} ${
isDark ? 'bg-[#18181b] border-[#27272a]' : 'bg-white border-[#e5e7eb]'
}`}
shadow="sm"
2026-01-27 17:26:30 +08:00
style={{
transition: 'transform 0.3s ease-out, box-shadow 0.3s ease-out, opacity 0.7s ease-out 0.3s, translate 0.7s ease-out 0.3s'
}}
>
2026-01-29 16:23:10 +08:00
<CardBody className="flex flex-row items-start justify-between p-10">
<div className="flex flex-col gap-6 items-start justify-start flex-shrink-0 w-[550px]">
<div className={`rounded-2xl flex items-center justify-center w-12 h-12 ${
isDark ? 'bg-[#27272a]' : 'bg-[#f9fafb]'
}`}>
2026-01-28 17:55:01 +08:00
<Image
src="/arrow-arrow-left-right0.svg"
alt="Arrow"
width={24}
height={24}
2026-01-29 16:23:10 +08:00
style={{
filter: isDark ? 'invert(1) brightness(0.8)' : 'none'
}}
2026-01-28 17:55:01 +08:00
/>
</div>
2026-01-27 17:26:30 +08:00
2026-01-29 16:23:10 +08:00
<div className="flex flex-col gap-4 items-start justify-start">
<h3 className={`text-2xl font-bold font-domine ${
isDark ? 'text-[#fafafa]' : 'text-[#111827]'
}`}
2026-01-28 17:55:01 +08:00
style={{
lineHeight: '130%',
2026-01-29 16:23:10 +08:00
letterSpacing: '-0.005em'
2026-01-28 17:55:01 +08:00
}}
>
{t('why.liquidity.title')}
</h3>
2026-01-29 16:23:10 +08:00
<p className={`text-base font-domine ${
isDark ? 'text-[#a1a1aa]' : 'text-[#9ca1af]'
}`}
2026-01-28 17:55:01 +08:00
style={{
2026-01-29 16:23:10 +08:00
lineHeight: '150%'
2026-01-28 17:55:01 +08:00
}}
>
{t('why.liquidity.desc')}
</p>
2026-01-27 17:26:30 +08:00
</div>
</div>
2026-01-29 16:23:10 +08:00
<div className="flex flex-row gap-3 items-center justify-end">
<Chip
className="bg-[#e1f8ec] text-[#10b981] font-bold"
size="sm"
>
{t('why.liquidity.badge1')}
</Chip>
<Chip
className="bg-[#ebf2ff] text-[#1447e6] font-bold"
size="sm"
>
{t('why.liquidity.badge2')}
</Chip>
2026-01-27 17:26:30 +08:00
</div>
2026-01-29 16:23:10 +08:00
</CardBody>
</Card>
2026-01-27 17:26:30 +08:00
</div>
</div>
</div>
</section>
);
}