import React from 'react';
import { motion } from 'framer-motion';
import './App.css';
const App = () => {
return (
<div className="container">
<motion.div
className="box"
animate={{ rotate: 360 }}
transition={{ duration: 2, repeat: Infinity, repeatType: 'reverse' }}
/>
</div>
);
};
export default App;
<style>
.container {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
}
.box {
width: 100px;
height: 100px;
background-color: #61dafb;
}
</style>
import React from 'react';
import { motion } from 'framer-motion';
import './App.css';
const App = () => {
return (
<div className="container">
<motion.div
className="box"
initial={{ scale: 0.5, opacity: 0 }}
animate={{ scale: 1, opacity: 1 }}
whileHover={{ scale: 1.2 }}
whileTap={{ scale: 0.8 }}
transition={{ type: 'spring', stiffness: 300, damping: 20 }}
/>
</div>
);
};
export default App;