Skip to content

Commit a224168

Browse files
committed
Add 'About' section to game frontend
1 parent 39ed813 commit a224168

File tree

2 files changed

+49
-6
lines changed

2 files changed

+49
-6
lines changed

frontend/src/App.css

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,28 @@
2626
.clear-button:hover {
2727
background-color: #dc2626;
2828
}
29+
30+
.about-content {
31+
text-align: left;
32+
max-width: 300px;
33+
margin: 0 auto;
34+
padding: 2rem 1rem;
35+
}
36+
37+
.about-content h2 {
38+
margin-bottom: 8px;
39+
}
40+
41+
.about-content p {
42+
line-height: 1.6;
43+
font-weight: 400;
44+
margin: 1rem 0;
45+
text-align: left;
46+
}
47+
48+
.about-content aside {
49+
font-size: 0.9em;
50+
color: #666;
51+
margin-top: 1.5rem;
52+
text-align: left;
53+
}

frontend/src/App.tsx

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,7 @@ const App: React.FC = () => {
310310

311311
return (
312312
<div className="drawing-container">
313+
<h1>Draw Freely</h1>
313314
{shouldShowCanvas ? (
314315
<>
315316
<div>You've selected the '{gameMode}' game mode.</div>
@@ -332,12 +333,29 @@ const App: React.FC = () => {
332333
</>
333334
) : (
334335
<>
335-
<button onClick={() => selectGameMode(GameMode.OneLine)}>
336-
One Line
337-
</button>
338-
<button onClick={() => selectGameMode(GameMode.LineLengthLimit)}>
339-
Line length Limit
340-
</button>
336+
{(Object.keys(GameMode) as Array<keyof typeof GameMode>).map(
337+
(enumKey) => {
338+
return (
339+
<button onClick={() => selectGameMode(GameMode[enumKey])}>
340+
{GameMode[enumKey]}
341+
</button>
342+
)
343+
}
344+
)}
345+
<div className="about-content">
346+
<h3>About</h3>
347+
<p>
348+
Draw Freely is a free online multiplayer drawing game designed to
349+
encourage mindfulness and creativity.
350+
</p>
351+
<p>
352+
Choose your game mode and draw something with someone else or just
353+
by yourself. You don't compete against each other, you just draw things for fun!
354+
</p>
355+
<aside>
356+
Note, this game is still a work in progress!
357+
</aside>
358+
</div>
341359
</>
342360
)}
343361
</div>

0 commit comments

Comments
 (0)