"use client"; import { useRef } from "react"; import { useGSAP } from "@gsap/react"; import gsap from "gsap"; import { ScrollTrigger } from "gsap/ScrollTrigger"; gsap.registerPlugin(ScrollTrigger); export default function BeforeAfterSection() { const sectionRef = useRef(null); const primaRef = useRef(null); const dopoRef = useRef(null); const ctaRef = useRef(null); useGSAP(() => { if (!sectionRef.current || !primaRef.current || !dopoRef.current) return; // Prima fades in first gsap.fromTo( primaRef.current, { y: 30, opacity: 0 }, { y: 0, opacity: 1, duration: 0.8, ease: "power3.out", scrollTrigger: { trigger: sectionRef.current, start: "top 70%", toggleActions: "play none none reverse", }, } ); // Dopo fades in with slight delay gsap.fromTo( dopoRef.current, { y: 30, opacity: 0 }, { y: 0, opacity: 1, duration: 0.8, delay: 0.3, ease: "power3.out", scrollTrigger: { trigger: sectionRef.current, start: "top 70%", toggleActions: "play none none reverse", }, } ); // CTA fades in after both panels if (ctaRef.current) { gsap.fromTo( ctaRef.current, { y: 20, opacity: 0 }, { y: 0, opacity: 1, duration: 0.6, delay: 0.6, ease: "power3.out", scrollTrigger: { trigger: sectionRef.current, start: "top 70%", toggleActions: "play none none reverse", }, } ); } }, { scope: sectionRef }); return (
{/* Prima */}
architecture

Prima

    {[ "Dati sparsi ovunque", "Processi manuali e lenti", "Sistemi vulnerabili", "Zero visibilità strategica", ].map((item) => (
  • {item}
  • ))}
{/* Dopo */}
domain

Dopo

    {[ "Un unico flusso di dati", "Automazione dove serve", "Sicurezza di livello enterprise", "Dashboard per decidere in tempo reale", ].map((item) => (
  • {item}
  • ))}
); }