Skip to content

Commit

Permalink
feat: dark mode
Browse files Browse the repository at this point in the history
  • Loading branch information
sallar committed Jan 1, 2023
1 parent ede6243 commit 15f02cc
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 20 deletions.
Binary file added public/topguntocat.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 4 additions & 7 deletions src/pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ const App = () => {
<div className="App">
<header className="App-header">
<div className="App-logo">
<img src="/tentocats.jpg" width={200} alt="Tentocats" />
<img src="/topguntocat.png" width={200} alt="Topguntocat" />
<h1>GitHub Contributions Chart Generator</h1>
<h4>All your contributions in one image!</h4>
</div>
Expand All @@ -222,12 +222,9 @@ const App = () => {
{_renderGithubButton()}
<footer>
<p>
Not affiliated with GitHub Inc. Octocat illustration made by{" "}
<a
href="https://octodex.github.com/tentocat/"
rel="noopener nofollow"
>
GitHub design team
Not affiliated with GitHub Inc. Octocat illustration from{" "}
<a href="https://octodex.github.com/topguntocat/" target="_blank">
GitHub Octodex
</a>
.
</p>
Expand Down
60 changes: 47 additions & 13 deletions src/styles/App.css
Original file line number Diff line number Diff line change
@@ -1,13 +1,45 @@
:root {
--bg: #fff;
--header-bg: #f4f5f6;
--button-bg: #9b4dca;
--button-disabled: #cfd0d4;
--button-disabled-border: #cfd0d4;
--button-text: #fff;
--twitter-button-bg: rgb(0, 169, 237);
--text: #606c76;
--loading-text: #606c76;
--input-border: #d1d1d1;
--input-text: #000;
}

@media (prefers-color-scheme: dark) {
:root {
--bg: #111517;
--header-bg: rgb(22, 28, 30);
--text: rgb(164, 157, 145);
--input-border: rgb(55, 68, 75);
--button-disabled: rgb(42, 52, 57);
--button-disabled-border: var(--input-border);
--loading-text: #rgb(164, 157, 145);
--input-text: #fff;
}
}

html {
color: var(--text);
background-color: var(--bg);
}

.App {
display: grid;
grid-template-columns: 40rem 1fr;
height: 100vh;
}

.App-header {
background-color: #f4f5f6;
background-color: var(--header-bg);
min-height: 40rem;
color: #606c76;
color: var(--text);
padding: 1rem;
overflow-y: scroll;
}
Expand All @@ -32,7 +64,7 @@
}

.App-loading {
color: #606c76;
color: var(--loading-text);
}

.App-result {
Expand Down Expand Up @@ -90,23 +122,25 @@ form {
}

input {
border: 0.1rem solid #d1d1d1;
border: 0.1rem solid var(--input-border);
border-right: 0;
border-radius: 0.4rem;
padding: 0.6rem 1rem;
height: 4rem;
outline: none;
color: var(--input-text);
background-color: var(--bg);
}

button {
height: 4rem;
line-height: 4rem;
padding: 0 1rem;
white-space: nowrap;
background-color: #9b4dca;
border: 0.1rem solid #9b4dca;
background-color: var(--button-bg);
border: 0.1rem solid var(--button-bg);
border-radius: 0.4rem;
color: #fff;
color: var(--button-text);
font-size: 0.8em;
outline: none;
cursor: pointer;
Expand All @@ -118,8 +152,8 @@ button {
}

button:disabled {
background-color: #cfd0d4;
border: 0.1rem solid #cfd0d4;
background-color: var(--button-disabled);
border: 0.1rem solid var(--button-disabled-border);
cursor: not-allowed;
}

Expand Down Expand Up @@ -150,7 +184,7 @@ form button {
min-height: 2rem;
line-height: 2rem;
margin: 0 1rem;
background-color: rgb(0, 169, 237);
background-color: var(--twitter-button-bg);
border: 0;
}

Expand All @@ -161,7 +195,7 @@ form button {
}

.App-themes {
border: 1px solid #cfd0d4;
border: 1px solid var(--button-disabled-border);
border-radius: 0.4rem;
margin-bottom: 1rem;
padding: 1rem 1rem 2rem;
Expand All @@ -172,7 +206,7 @@ form button {
}

.App-themes h6 span {
background-color: #f4f5f6;
background-color: var(--header-bg);
padding: 0 1rem;
}

Expand Down Expand Up @@ -207,7 +241,7 @@ footer {
}

footer a {
color: #606c76;
color: var(--text);
text-decoration: none;
}

Expand Down

0 comments on commit 15f02cc

Please sign in to comment.