import { useGSAP } from "@gsap/react";import * as React from "react" import { useRef } from "react"; import { useGsapContext } from "~/app/_providers/GsapProvicer"; import gsap from 'gsap' import { cn } from "~/lib/utils" function Card({ className, size = "default", ...props }: React.ComponentProps<"div"> & { size?: "default" | "sm" }) { return (
img:first-child]:pt-0 data-[size=sm]:gap-3 data-[size=sm]:py-3 data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl bg-opacity-60 backdrop-blur-sm", className )} {...props} /> ) } function AnimatedCard({ className, position = 0, size = "default", ...props }: React.ComponentProps<"div"> & { size?: "default" | "sm", position: gsap.Position }) { const gsapContext = useGsapContext() const ref = useRef(null) useGSAP(() => { gsapContext?.addAnimation(gsap.from(ref.current,{ x: -100, opacity: 0, duration: 0.5 }),position) }) return (
img:first-child]:pt-0 data-[size=sm]:gap-3 data-[size=sm]:py-3 data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl bg-opacity-60 backdrop-blur-sm", className )} {...props} /> ) } function CardHeader({ className, ...props }: React.ComponentProps<"div">) { return (
) } function CardTitle({ className, ...props }: React.ComponentProps<"div">) { return (
) } function CardDescription({ className, ...props }: React.ComponentProps<"div">) { return (
) } function CardAction({ className, ...props }: React.ComponentProps<"div">) { return (
) } function CardContent({ className, ...props }: React.ComponentProps<"div">) { return (
) } function CardFooter({ className, ...props }: React.ComponentProps<"div">) { return (
) } export { Card, CardHeader, CardFooter, CardTitle, CardAction, CardDescription, CardContent, AnimatedCard }