<div id="root"></div>
@import url("https://fonts.googleapis.com/css2?family=Exo:wght@600&display=swap");
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
html {
line-height: 1.5;
font-size: 15px;
font-weight: 400;
}
body {
width: 100vw;
min-height: 100vh;
display: flex;
justify-content: center;
align-items: center;
gap: 20px;
font-family: "Exo", Arial, sans-serif;
background-color: #151522;
color: #fff;
}
#root {
display: flex;
justify-content: center;
align-items: center;
}
.box {
width: 30vh;
aspect-ratio: 1/1;
background-color: #f36;
}
const { motion } = Motion;
const App = () => {
return (
<motion.div
className="box"
animate={{
x: 200,
y: -100,
rotate: [0, 360]
}}
/>
);
};
ReactDOM.render(<App />, document.getElementById("root"));
View Compiled
This Pen doesn't use any external CSS resources.