97db9ee8c7
Add cli/code/office/platform/pricing pages, new home sections (Ecosystem, FeatureGrid, Faq, WorkflowSteps, BottomCta, ProductEcosystem), ScrollReveal and PixelTextReveal animation components, brand assets, and expanded site-content. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
43 lines
839 B
TypeScript
43 lines
839 B
TypeScript
"use client"
|
|
|
|
import { useEffect, useRef } from "react"
|
|
|
|
interface ScrollRevealProps {
|
|
children: React.ReactNode
|
|
className?: string
|
|
delay?: number
|
|
}
|
|
|
|
export default function ScrollReveal({
|
|
children,
|
|
className = "",
|
|
delay = 0,
|
|
}: ScrollRevealProps) {
|
|
const ref = useRef<HTMLDivElement>(null)
|
|
|
|
useEffect(() => {
|
|
const el = ref.current
|
|
if (!el) return
|
|
|
|
const observer = new IntersectionObserver(
|
|
([entry]) => {
|
|
if (entry.isIntersecting) {
|
|
setTimeout(() => {
|
|
el.classList.add("reveal-visible")
|
|
}, delay)
|
|
observer.unobserve(el)
|
|
}
|
|
},
|
|
{ threshold: 0.1 },
|
|
)
|
|
observer.observe(el)
|
|
return () => observer.disconnect()
|
|
}, [delay])
|
|
|
|
return (
|
|
<div ref={ref} className={`reveal-up ${className}`}>
|
|
{children}
|
|
</div>
|
|
)
|
|
}
|