Skip to content

Commit

Permalink
feat: experimental dark mode support
Browse files Browse the repository at this point in the history
Resolves #35
  • Loading branch information
renbaoshuo committed Jan 9, 2025
1 parent 7a9724d commit 7f5b568
Show file tree
Hide file tree
Showing 10 changed files with 676 additions and 116 deletions.
2 changes: 1 addition & 1 deletion src/components/Footer.module.less
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.footerIcons {
color: #888;
color: var(--theme-footer);
font-size: 0.8em;

a {
Expand Down
2 changes: 1 addition & 1 deletion src/components/PersonCard.module.less
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
.link {
padding-left: 5px;
font-size: 12px;
color: black;
color: var(--theme-foreground);
vertical-align: bottom;
}
34 changes: 0 additions & 34 deletions src/components/PersonInfo.module.less
Original file line number Diff line number Diff line change
Expand Up @@ -16,40 +16,6 @@
}
}

.progress-0 {
color: hsl(0, 100%, 50%);
}
.progress-1 {
color: hsl(12, 100%, 48%);
}
.progress-2 {
color: hsl(24, 100%, 46%);
}
.progress-3 {
color: hsl(36, 100%, 44%);
}
.progress-4 {
color: hsl(48, 100%, 42%);
}
.progress-5 {
color: hsl(60, 100%, 40%);
}
.progress-6 {
color: hsl(72, 100%, 40%);
}
.progress-7 {
color: hsl(84, 100%, 40%);
}
.progress-8 {
color: hsl(96, 100%, 40%);
}
.progress-9 {
color: hsl(108, 100%, 40%);
}
.progress-10 {
color: hsl(120, 100%, 40%);
}

.recordTotal {
color: #ccc;
font-size: smaller;
Expand Down
28 changes: 12 additions & 16 deletions src/components/PersonInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,12 @@ const PersonInfo: React.FC<PersonInfoProps> = (props) => {
) : (
<>
<span
className={
styles[
`progress-${getProgress(
data.score,
data.contest.full_score
)}`
]
}
style={{
color: `var(--theme-score-${getProgress(
data.score,
data.contest.full_score
)})`,
}}
>
{data.score}
</span>{' '}
Expand All @@ -112,14 +110,12 @@ const PersonInfo: React.FC<PersonInfoProps> = (props) => {
</Table.Cell>
<Table.Cell>
<span
className={
styles[
`progress-${getProgress(
data.contest.n_contestants() - data.rank,
data.contest.n_contestants() - 1
)}`
]
}
style={{
color: `var(--theme-score-${getProgress(
data.contest.n_contestants() - data.rank,
data.contest.n_contestants() - 1
)})`,
}}
>
{data.rank}
</span>{' '}
Expand Down
6 changes: 6 additions & 0 deletions src/components/SchoolInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,9 @@ const SchoolInfo: React.FC<SchoolProps> = ({ school }) => {
padding: AXIS_MARGIN_TOP,
precision: 0,
},
grid: {
color: '#aaaaaa50',
},
},
y: {
ticks: {
Expand All @@ -143,6 +146,9 @@ const SchoolInfo: React.FC<SchoolProps> = ({ school }) => {
padding: AXIS_MARGIN_TOP,
precision: 0,
},
grid: {
color: '#aaaaaa50',
},
},
},
}}
Expand Down
21 changes: 0 additions & 21 deletions src/main.css

This file was deleted.

Loading

0 comments on commit 7f5b568

Please sign in to comment.