React
by Abdul Ahmad
HTML
<div id="app"></div>
CSS
body {
background: #20262E;
padding: 20px;
font-family: Helvetica;
}
#app {
border-radius: 4px;
padding: 20px;
}
.boxes {
display: flex;
flex-wrap: wrap;
align-items: flex-start;
align-content: flex-start;
}
.box {
padding: 40px;
background: white;
border-radius: 10px;
margin: 5px;
}
React
class TodoApp extends React.Component {
render() {
const items = [];
for (let i = 0; i < 50; i++) {
const word = 'one two';
items.push(
<div class='box' style={{
width: i * Math.random() + i * Math.random(),
height: i * Math.random() + i * Math.random(),
}}>
</div>
);
}
return (
<div class='boxes'>
{ items }
</div>
)
}
}
ReactDOM.render(<TodoApp />, document.querySelector("#app"))