Skip to content

Commit 37ada4a

Browse files
committed
update styles
1 parent b31df38 commit 37ada4a

File tree

8 files changed

+37
-19
lines changed

8 files changed

+37
-19
lines changed

src/App.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,13 @@ import { TypingGame } from "./components/TypingGame";
33

44
export function App() {
55
return (
6-
<MantineProvider withGlobalStyles withNormalizeCSS>
6+
<MantineProvider
7+
withGlobalStyles
8+
withNormalizeCSS
9+
theme={{
10+
colorScheme: "dark",
11+
}}
12+
>
713
<TypingGame />
814
</MantineProvider>
915
);

src/components/ActionBar.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ export function ActionBar({
1111
}) {
1212
return (
1313
<Group position="center">
14-
<Button onClick={onRestart}>Restart</Button>
14+
<Button color="yellow" uppercase onClick={onRestart}>
15+
Restart
16+
</Button>
1517
</Group>
1618
);
1719
}

src/components/LetterCard.tsx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,26 +49,30 @@ function styleLetterCard(
4949

5050
function styleColor(letter: Letter) {
5151
if (letter.successStatus === SuccessStatus.Fail) {
52-
return "red";
52+
return "#ed5252";
5353
}
5454

5555
if (letter.successStatus === SuccessStatus.Success) {
56-
return "green";
56+
return "#d7d7d7";
5757
}
5858

59-
return "black";
59+
return "#727272";
6060
}
6161

6262
function styleBackgroundColor(isHighlight: boolean, isCurrent: boolean) {
63+
/*
6364
if (isCurrent) {
6465
return "lightgreen";
6566
}
67+
*/
6668

69+
/*
6770
if (isHighlight) {
6871
return "#cccccc";
6972
}
73+
*/
7074

71-
return "#f5f5f5";
75+
return "#323437";
7276
}
7377

7478
export const LetterCard = memo(LetterCardFn);

src/components/StatsBar.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ export function StatsBar({ wpm, timeLeft }: { wpm: number; timeLeft: number }) {
2222
}
2323

2424
const StatsBox = styled.div({
25-
backgroundColor: "rgb(253, 253, 253)",
26-
border: "1px solid lightgray",
25+
// backgroundColor: "rgb(253, 253, 253)",
26+
// border: "1px solid lightgray",
27+
color: "#c8c7c7",
2728
padding: "5px",
2829
});

src/components/TypingAreaProvier.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@ export function TypingAreaProvider({
2525
children: ReactNode;
2626
}) {
2727
const scrollToSelf = useCallback(
28-
(top: number) => {
28+
(target: number) => {
2929
if (
30-
top >= viewport.current.scrollTop &&
31-
top < viewport.current.scrollTop + viewport.current.clientHeight
30+
target >= viewport.current.scrollTop &&
31+
target < viewport.current.scrollTop + viewport.current.clientHeight
3232
) {
3333
return;
3434
}
3535

36-
viewport.current.scrollTo({ top, behavior: "smooth" });
36+
viewport.current.scrollTo({ top: target, behavior: "smooth" });
3737
},
3838
[viewport]
3939
);

src/components/TypingGame.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,14 @@ export function TypingGame() {
1414
const { wpm, timeLeft, board, restart } = useTypingGame();
1515

1616
return (
17-
<Container sx={{ height: "100vh" }} p={25}>
17+
<Container
18+
sx={{ height: "100vh", backgroundColor: "#323437" }}
19+
p={25}
20+
fluid={true}
21+
>
1822
<Stack align="stretch" sx={{ height: "100%" }}>
1923
<Group position="center">
20-
<Title order={1}>Typing Test</Title>
24+
<Title order={1}>T y p i n g _ T e s t</Title>
2125
</Group>
2226
<ActionBar wpm={wpm} timeLeft={timeLeft} onRestart={restart} />
2327
<Space h="xl" />

src/components/WordCard.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,11 @@ function WordCardFn({
3030
<Group
3131
ref={ref as any}
3232
spacing={3}
33-
sx={{
34-
backgroundColor: isCurrent ? "#f1f1f1" : "none",
35-
}}
33+
sx={
34+
{
35+
// backgroundColor: isCurrent ? "#f1f1f1" : "none",
36+
}
37+
}
3638
p={8}
3739
>
3840
{word.letters.map((letter, index) => (

src/components/WordsCard.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ function WordsCardFn({ board }: { board: Board }) {
1111
<ScrollArea
1212
style={{
1313
height: 250,
14-
backgroundColor: "#fdfdfd",
15-
border: "1px solid lightgray",
14+
backgroundColor: "#323437",
1615
}}
1716
p={15}
1817
viewportRef={viewport as any}

0 commit comments

Comments
 (0)