import { useGSAP } from "@gsap/react"; import gsap from "gsap"; import Image from…
- User
import { useGSAP } from "@gsap/react"; import gsap from "gsap"; import Image from "next/image"; import { useRef, useState } from "react";
const Advantages = () => { const container = useRef(null);
const [bannerNumber, setBannerNumber] = useState(0);
const data = [ { title: "Transform Efficiency and Profitability", desc: "Radiology is the backbone of modern diagnostics, but as demand grows, imaging centers are under immense pressure to deliver faster results without compromising quality. That’s where we come in.", }, { title: "Faster Turnaround Times", desc: "But with only a limited number of radiologists, misdiagnosis rates have reached 5%. The pressure is mounting, and radiologists are burning out.", }, { title: "Significant cost savings", desc: "Our imaging centers save an average of 25% on their yearly teleradiology platform.", }, { title: "Higher Diagnostic Quality", desc: "Not only do we have auditing systems in place to maximize accuracy, our reports are best in class quality.", }, { title: "Happier Patients and Referring Physicians", desc: "Faster, more accurate results mean your referring physicians trust your services, and patients get the answers they need quickly.", }, ];
const { contextSafe } = useGSAP(() => {}, { scope: container });
const handleClick = contextSafe((id: number) => { gsap .timeline() .to(".banner", { xPercent: 50, opacity: 0 }) .call(() => setBannerNumber(id)) .set(".banner", { xPercent: -50, opacity: 0 }) .to(".banner", { xPercent: 0, opacity: 1 }); });
return ( Our Advantages For Imaging Centers - Faster, Cheaper, and More Accurate Teleradiology <Image className="bg-background banner object-cover w-full rounded-3xl h-[510px]" src={
/advantages/frame/${bannerNumber}.png} alt="frame" height={1000} width={1000} /> {data.map(({ desc, title }, i) => { return ( <div onClick={() => handleClick(i)} key={i} className="flex flex-col border-t-2 border-primary cursor-pointer" > <Image className="my-6" src={/advantages/icons/${i}.png} alt="icon" height={32} width={32} /> {title} {desc} ); })} ); };export default Advantages;
onclick animation play auto after 2 sec to next card and also work click animation
- Assistant
- User
- Assistant
- User
- Assistant