Files
doing-it-website/components/AnimatedIcon.tsx
2025-12-05 01:01:04 +01:00

26 lines
560 B
TypeScript

'use client'
import { motion } from 'framer-motion'
import { ReactNode } from 'react'
interface AnimatedIconProps {
children: ReactNode
delay?: number
}
export default function AnimatedIcon({ children, delay = 0 }: AnimatedIconProps) {
return (
<motion.div
className="animation-icon"
initial={{ opacity: 0, scale: 0.8 }}
whileInView={{ opacity: 1, scale: 1 }}
viewport={{ once: true }}
transition={{ duration: 0.5, delay }}
whileHover={{ scale: 1.1, rotate: 5 }}
>
{children}
</motion.div>
)
}