Skip to content

Commit fb53e5c

Browse files
committed
credits and docs
1 parent 3ec5e14 commit fb53e5c

2 files changed

Lines changed: 132 additions & 2 deletions

File tree

src/components/HomeScreen.tsx

Lines changed: 63 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { RANK_OPTIONS } from "../data/levels";
2-
import { FaPlay } from "react-icons/fa";
1+
import { LEVELS, RANK_OPTIONS } from "../data/levels";
2+
import { FaBookOpen, FaPlay } from "react-icons/fa";
33

44
type HomeScreenProps = {
55
selectedRank: string;
@@ -31,6 +31,67 @@ export function HomeScreen({
3131
Study each board position, hide it, and recreate the stones from memory on an empty
3232
board.
3333
</p>
34+
<p className="source-credit">
35+
Based on visualization exercises by{" "}
36+
<a href="https://go-welticke.com/exercises" target="_blank" rel="noreferrer">
37+
Jonas Welticke
38+
</a>.
39+
</p>
40+
41+
<details className="rules-box">
42+
<summary>
43+
<FaBookOpen aria-hidden="true" />
44+
How it works
45+
</summary>
46+
<div className="rules-content">
47+
<p>
48+
Start with the exercise that is two levels below the first level where your rank
49+
appears. The app suggests this automatically, but you can choose another level.
50+
</p>
51+
<ul>
52+
<li>Set out to finish all problems of the level within the listed time.</li>
53+
<li>Memorize each position from top left to bottom right as well as you can.</li>
54+
<li>When you think you have it, hide the board, close your eyes for three seconds, then rebuild it from memory.</li>
55+
<li>Repeat this until you have finished all problems of that level.</li>
56+
</ul>
57+
<p>Count your mistakes:</p>
58+
<ul>
59+
<li>1 point if a stone is one intersection away from the correct spot, not diagonal.</li>
60+
<li>1 point if a stone is on the correct spot but has the wrong color.</li>
61+
<li>2 points for each remaining missing, extra, or otherwise misplaced stone.</li>
62+
</ul>
63+
<p>
64+
After the level, compare your total mistakes with the table. A low score lets you
65+
level up; a high score means you should try a lower level next time.
66+
</p>
67+
<div className="rules-table-wrap">
68+
<table className="rules-table">
69+
<thead>
70+
<tr>
71+
<th>Level</th>
72+
<th>Rank</th>
73+
<th>Time</th>
74+
<th>Level up</th>
75+
<th>Level down</th>
76+
</tr>
77+
</thead>
78+
<tbody>
79+
{LEVELS.map((level) => (
80+
<tr key={level.level}>
81+
<td>{level.level}</td>
82+
<td>{level.rank}</td>
83+
<td>{level.timeLimitMinutes} min</td>
84+
<td>&lt;{level.levelUpBelow}</td>
85+
<td>
86+
{level.levelDownAbove === null ? "/" : `>${level.levelDownAbove}`}
87+
</td>
88+
</tr>
89+
))}
90+
</tbody>
91+
</table>
92+
</div>
93+
</div>
94+
</details>
3495

3596
<div className="field-row">
3697
<label htmlFor="rank-select">Approximate rank</label>

src/styles.css

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,75 @@ button:disabled {
8989
font-weight: 600;
9090
}
9191

92+
.source-credit {
93+
color: #b8c2d1;
94+
font-size: 0.95rem;
95+
}
96+
97+
a {
98+
color: #8fbeff;
99+
}
100+
101+
a:hover {
102+
color: #b8d7ff;
103+
}
104+
105+
.rules-box {
106+
margin: 14px 0;
107+
border: 1px solid #2c3644;
108+
border-radius: 8px;
109+
background: #161d27;
110+
}
111+
112+
.rules-box summary {
113+
display: flex;
114+
align-items: center;
115+
gap: 8px;
116+
padding: 10px 12px;
117+
cursor: pointer;
118+
font-weight: 600;
119+
}
120+
121+
.rules-content {
122+
padding: 0 12px 12px;
123+
}
124+
125+
.rules-content ul {
126+
margin: 0 0 12px;
127+
padding-left: 20px;
128+
}
129+
130+
.rules-content li {
131+
margin-bottom: 5px;
132+
}
133+
134+
.rules-table-wrap {
135+
overflow-x: auto;
136+
}
137+
138+
.rules-table {
139+
width: 100%;
140+
min-width: 620px;
141+
border-collapse: collapse;
142+
font-size: 0.92rem;
143+
}
144+
145+
.rules-table th,
146+
.rules-table td {
147+
padding: 7px 8px;
148+
border: 1px solid #2c3644;
149+
text-align: left;
150+
white-space: nowrap;
151+
}
152+
153+
.rules-table th {
154+
background: #222b37;
155+
}
156+
157+
.rules-table td {
158+
background: #141a23;
159+
}
160+
92161
.summary-box {
93162
margin-top: 16px;
94163
padding-top: 12px;

0 commit comments

Comments
 (0)