-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8775137
commit 73f2222
Showing
8 changed files
with
114 additions
and
119 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,51 @@ | ||
body { | ||
margin: 0; | ||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', | ||
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', | ||
sans-serif; | ||
-webkit-font-smoothing: antialiased; | ||
-moz-osx-font-smoothing: grayscale; | ||
} | ||
|
||
code { | ||
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', | ||
monospace; | ||
} | ||
font: 14px "Century Gothic", Futura, sans-serif; | ||
margin: 20px; | ||
} | ||
|
||
ol, ul { | ||
padding-left: 30px; | ||
} | ||
|
||
.board-row:after { | ||
clear: both; | ||
content: ""; | ||
display: table; | ||
} | ||
|
||
.status { | ||
margin-bottom: 10px; | ||
} | ||
|
||
.square { | ||
background: #fff; | ||
border: 1px solid #999; | ||
float: left; | ||
font-size: 24px; | ||
font-weight: bold; | ||
line-height: 34px; | ||
height: 34px; | ||
margin-right: -1px; | ||
margin-top: -1px; | ||
padding: 0; | ||
text-align: center; | ||
width: 34px; | ||
} | ||
|
||
.square:focus { | ||
outline: none; | ||
} | ||
|
||
.kbd-navigation .square:focus { | ||
background: #ddd; | ||
} | ||
|
||
.game { | ||
display: flex; | ||
flex-direction: row; | ||
} | ||
|
||
.game-info { | ||
margin-left: 20px; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,64 @@ | ||
import React from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
import './index.css'; | ||
import App from './App'; | ||
import reportWebVitals from './reportWebVitals'; | ||
|
||
ReactDOM.render( | ||
<React.StrictMode> | ||
<App /> | ||
</React.StrictMode>, | ||
document.getElementById('root') | ||
); | ||
|
||
// If you want to start measuring performance in your app, pass a function | ||
// to log results (for example: reportWebVitals(console.log)) | ||
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals | ||
reportWebVitals(); | ||
class Square extends React.Component { | ||
render() { | ||
return ( | ||
<button className="square"> | ||
{/* TODO */} | ||
</button> | ||
); | ||
} | ||
} | ||
|
||
class Board extends React.Component { | ||
renderSquare(i) { | ||
return <Square />; | ||
} | ||
|
||
render() { | ||
const status = 'Next player: X'; | ||
|
||
return ( | ||
<div> | ||
<div className="status">{status}</div> | ||
<div className="board-row"> | ||
{this.renderSquare(0)} | ||
{this.renderSquare(1)} | ||
{this.renderSquare(2)} | ||
</div> | ||
<div className="board-row"> | ||
{this.renderSquare(3)} | ||
{this.renderSquare(4)} | ||
{this.renderSquare(5)} | ||
</div> | ||
<div className="board-row"> | ||
{this.renderSquare(6)} | ||
{this.renderSquare(7)} | ||
{this.renderSquare(8)} | ||
</div> | ||
</div> | ||
); | ||
} | ||
} | ||
|
||
class Game extends React.Component { | ||
render() { | ||
return ( | ||
<div className="game"> | ||
<div className="game-board"> | ||
<Board /> | ||
</div> | ||
<div className="game-info"> | ||
<div>{/* status */}</div> | ||
<ol>{/* TODO */}</ol> | ||
</div> | ||
</div> | ||
); | ||
} | ||
} | ||
|
||
// ======================================== | ||
|
||
ReactDOM.render( | ||
<Game />, | ||
document.getElementById('root') | ||
); | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.