<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
.container {
max-width: 300px;
display: flex;
flex-direction: column;
margin: 0 auto;
}
#todo-app {
margin: 1em;
text-align: center;
}
#todo-list,
#todo-stats {
margin: 1em auto;
text-align: left;
width: 450px;
}
#todo-list {
list-style: none;
padding: 0;
}
#todo-stats {
color: #777;
}
#new-todo {
border-radius: 5px;
}
.todo-input {
display: block;
font-family: Helvetica, sans-serif;
font-size: 20px;
line-height: normal;
margin: 5px auto 0;
padding: 6px;
width: 420px;
}
.todo-label {
color: #444;
font-size: 20px;
font-weight: bold;
text-align: center;
}
</style>
</head>
<body>
<div id="root"></div>
<script crossorigin src="https://unpkg.com/react@16/umd/react.development.js"></script>
<script crossorigin src="https://unpkg.com/react-dom@16/umd/react-dom.development.js"></script>
<script src="https://unpkg.com/@babel/standalone/babel.min.js"></script>
<script type="text/babel">
function TodoApp() {
return <div id="todo-app">
<label className="todo-label" htmlFor="new-todo">What do you want to do today?</label>
<input type="text" id="new-todo" className="todo-input" placeholder="type your tasks" />
</div>
}
function TodoList() {
return <div className="todo-list">
<div className="todo-item">
<input type="checkbox" />
<span className="todo-content">task 1</span>
</div>
</div>
}
function Container() {
return <div className="container">
<TodoApp />
<TodoList />
</div>
}
ReactDOM.render(<Container />, document.getElementById('root'))
</script>
</body>
</html>