"use client";

import { motion } from "framer-motion";
import Image from "next/image";

interface AnimatedBackgroundProps {
  src: string;
  alt: string;
}

export default function AnimatedBackground({
  src,
  alt,
}: AnimatedBackgroundProps) {
  return (
    <motion.div
      className="absolute inset-0 -z-10"
      animate={{
        rotate: [0, 180, 360],   
        scale: [0.7, 1.35, 0.7],
        }}
        transition={{
        duration: 3,
        repeat: Infinity,
        ease: "linear",
        }}
    >
      <Image
        src={src}
        alt={alt}
        fill
        priority
        className="object-contain"
      />
    </motion.div>
  );
}