Skip to content

Commit 51e6936

Browse files
committed
Add comments
1 parent 2b58f01 commit 51e6936

File tree

4 files changed

+19
-12
lines changed

4 files changed

+19
-12
lines changed

public/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
</head>
1616
<body>
1717
<noscript>You need to enable JavaScript to run this app.</noscript>
18+
<!--render root content-->
1819
<div id="root"></div>
1920
</body>
2021
</html>

src/App.css

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
.App {
2-
text-align: center;
2+
/*app content*/
3+
text-align: center; /*center text for whole app*/
34
}
45

56
.App-header {
7+
/*app header*/
68
background-color: #208040;
7-
min-height: 10vh;
9+
min-height: 10vh; /*set height to 10% of viewpoint height*/
810
display: flex;
911
flex-direction: column;
1012
align-items: center;
@@ -14,9 +16,9 @@
1416
}
1517

1618
#points-display {
17-
font-weight: bold;
19+
font-weight: bold; /*bold the numeric values*/
1820
}
1921

2022
p {
21-
line-height: 120%;
23+
line-height: 120%; /*add some line spacing between paragraphs*/
2224
}

src/App.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
1-
import './App.css';
2-
import { useState } from 'react';
1+
import "./App.css";
2+
import { useState } from "react";
33
function App() {
4-
const [points, setPoints] = useState(0);
4+
//app compoment
5+
const [points, setPoints] = useState(0); //set initial points to 0
56
function addPointsFromClick() {
6-
setPoints(points + 1);
7+
//add points from clicking a button
8+
setPoints(points + 1); //increase points by 1
79
}
810
return (
11+
//dynamic app HTML output
912
<div className="App">
1013
<header className="App-header">Endless Simple Idle Game</header>
1114
<p>Click the button to add points!</p>

src/index.css

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
body {
2+
/*body styles*/
23
margin: 0;
3-
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
4-
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
4+
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen",
5+
"Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue",
56
sans-serif;
67
-webkit-font-smoothing: antialiased;
78
-moz-osx-font-smoothing: grayscale;
89
}
910

1011
code {
11-
font-family: 'Source Code Pro', Menlo, Monaco, Consolas, 'Courier New',
12-
monospace;
12+
font-family: "Source Code Pro", Menlo, Monaco, Consolas, "Courier New",
13+
monospace; /*set font for code block to monospaced font*/
1314
}

0 commit comments

Comments
 (0)