Skip to content

Instantly share code, notes, and snippets.

@vamshi9666
Created August 5, 2022 11:10
Show Gist options
  • Save vamshi9666/50804c8bce774d6b8f56d5ec18990ff7 to your computer and use it in GitHub Desktop.
Save vamshi9666/50804c8bce774d6b8f56d5ec18990ff7 to your computer and use it in GitHub Desktop.
import { useState } from "react";
import logo from "./logo.svg";
import "./App.css";
function App() {
return (
<div className="App">
<div
style={{
// width: "200px",
backgroundColor: "green",
paddingRight: 13,
// justifyContent: "space-evenly",
// flexDirection: "row-reverse",
display: "flex",
}}
>
{new Array(5).fill(0).map((_, index) => {
return (
<div
key={index}
style={{
width: 100,
height: 100,
borderRadius: 50,
backgroundColor: "red",
transform: `translateX(-${index * 50}px)`,
display: "flex",
alignItems: "center",
justifyContent: "center",
border: "1px solid black",
}}
>
{index}
</div>
);
})}
</div>
</div>
);
}
export default App;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment