Skip to content

Commit 37b327b

Browse files
o2shspenserblack
andauthored
[onefetch.dev] switch to dark theme (#1297)
* use sakura-dark.css * fix text * fix text * revert last change * Update docs/vercel/README.md Co-authored-by: Spenser Black <[email protected]> * rename sakura.css to sakura-dark.css * fix * fix --------- Co-authored-by: Spenser Black <[email protected]>
1 parent 37719a8 commit 37b327b

16 files changed

+127
-90
lines changed

docs/vercel/.eslintrc.cjs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
module.exports = {
2+
env: {
3+
browser: true,
4+
es2021: true,
5+
node: true,
6+
},
7+
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended'],
8+
parser: '@typescript-eslint/parser',
9+
parserOptions: {
10+
ecmaVersion: 12,
11+
sourceType: 'module',
12+
parser: '@typescript-eslint/parser',
13+
extraFileExtensions: ['.svelte'],
14+
},
15+
plugins: ['@typescript-eslint'],
16+
overrides: [
17+
{
18+
files: ['*.svelte'],
19+
parser: 'svelte-eslint-parser',
20+
},
21+
],
22+
};

docs/vercel/.eslintrc.json

Lines changed: 0 additions & 25 deletions
This file was deleted.

docs/vercel/.prettierrc.json renamed to docs/vercel/.prettierrc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,7 @@
77
"bracketSameLine": true,
88
"singleAttributePerLine": false,
99
"quoteProps": "consistent",
10-
"plugins": ["prettier-plugin-svelte"]
10+
"plugins": ["prettier-plugin-svelte"],
11+
"svelteSortOrder": "scripts-options-markup-styles",
12+
"svelteIndentScriptAndStyle": true
1113
}

docs/vercel/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@
88
npm i
99

1010
# run server with hot reloading
11-
npm run dev
11+
npm start
1212
```

docs/vercel/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<meta charset="UTF-8" />
55
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
66
<link rel="icon" href="/onefetch.ico" />
7-
<link rel="stylesheet" href="/sakura.css" type="text/css" />
7+
<link rel="stylesheet" href="/sakura-dark.css" type="text/css" />
88
<title>Onefetch</title>
99
</head>
1010

docs/vercel/package-lock.json

Lines changed: 46 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/vercel/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44
"version": "0.0.0",
55
"type": "module",
66
"scripts": {
7-
"dev": "vite",
7+
"start": "vite",
88
"build": "vite build",
99
"format": "prettier -w .",
1010
"preview": "vite preview",
11-
"check": "check:svelte && check:prettier && check:eslint",
11+
"check": "npm run check:svelte && npm run check:prettier && npm run check:lint",
1212
"check:svelte": "svelte-check",
1313
"check:prettier": "prettier --check **/*.{ts,js,svelte,css,html,json}",
14-
"check:lint": "eslint 'src/**/*.{ts,js,svelte}'"
14+
"check:lint": "eslint src/**/*.{ts,js,svelte}"
1515
},
1616
"devDependencies": {
1717
"@rollup/plugin-yaml": "^4.1.2",

docs/vercel/public/sakura.css renamed to docs/vercel/public/sakura-dark.css

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* $color-text: #dedce5; */
12
/* Sakura.css v1.5.0
23
* ================
34
* Minimal css theme.
@@ -15,8 +16,8 @@ body {
1516
line-height: 1.618;
1617
max-width: 38em;
1718
margin: auto;
18-
color: #222222;
19-
background-color: #ffffff;
19+
color: #c9c9c9;
20+
background-color: #222222;
2021
padding: 13px;
2122
}
2223

@@ -84,19 +85,19 @@ sup {
8485
}
8586

8687
hr {
87-
border-color: #007559;
88+
border-color: #ffffff;
8889
}
8990

9091
a {
9192
text-decoration: none;
92-
color: #007559;
93+
color: #ffffff;
9394
}
9495
a:visited {
95-
color: #004232;
96+
color: #e6e6e6;
9697
}
9798
a:hover {
98-
color: #006994;
99-
border-bottom: 2px solid #222222;
99+
color: #c9c9c9;
100+
border-bottom: 2px solid #c9c9c9;
100101
}
101102

102103
ul {
@@ -116,9 +117,9 @@ blockquote {
116117
padding-top: 0.8em;
117118
padding-bottom: 0.8em;
118119
padding-right: 0.8em;
119-
border-left: 5px solid #007559;
120+
border-left: 5px solid #ffffff;
120121
margin-bottom: 2.5rem;
121-
background-color: #f7f7f7;
122+
background-color: #4a4a4a;
122123
}
123124

124125
blockquote p {
@@ -135,7 +136,7 @@ video {
135136

136137
/* Pre and Code */
137138
pre {
138-
background-color: #f7f7f7;
139+
background-color: #4a4a4a;
139140
display: block;
140141
padding: 1em;
141142
overflow-x: auto;
@@ -149,7 +150,7 @@ kbd,
149150
samp {
150151
font-size: 0.9em;
151152
padding: 0 0.5em;
152-
background-color: #f7f7f7;
153+
background-color: #4a4a4a;
153154
white-space: pre-wrap;
154155
}
155156

@@ -171,17 +172,17 @@ table {
171172
td,
172173
th {
173174
padding: 0.5em;
174-
border-bottom: 1px solid #f7f7f7;
175+
border-bottom: 1px solid #4a4a4a;
175176
}
176177

177178
/* Buttons, forms and input */
178179
input,
179180
textarea {
180-
border: 1px solid #222222;
181+
border: 1px solid #c9c9c9;
181182
}
182183
input:focus,
183184
textarea:focus {
184-
border: 1px solid #007559;
185+
border: 1px solid #ffffff;
185186
}
186187

187188
textarea {
@@ -199,10 +200,10 @@ input[type='file']::file-selector-button {
199200
text-align: center;
200201
text-decoration: none;
201202
white-space: nowrap;
202-
background-color: #007559;
203-
color: #ffffff;
203+
background-color: #ffffff;
204+
color: #222222;
204205
border-radius: 1px;
205-
border: 1px solid #007559;
206+
border: 1px solid #ffffff;
206207
cursor: pointer;
207208
box-sizing: border-box;
208209
}
@@ -221,8 +222,8 @@ input[type='submit']:hover,
221222
input[type='reset']:hover,
222223
input[type='button']:hover,
223224
input[type='file']::file-selector-button:hover {
224-
background-color: #006994;
225-
color: #ffffff;
225+
background-color: #c9c9c9;
226+
color: #222222;
226227
outline: 0;
227228
}
228229
.button:focus-visible,
@@ -238,24 +239,24 @@ input[type='file']::file-selector-button:focus-visible {
238239
textarea,
239240
select,
240241
input {
241-
color: #222222;
242+
color: #c9c9c9;
242243
padding: 6px 10px; /* The 6px vertically centers text on FF, ignored by Webkit */
243244
margin-bottom: 10px;
244-
background-color: #f7f7f7;
245-
border: 1px solid #f7f7f7;
245+
background-color: #4a4a4a;
246+
border: 1px solid #4a4a4a;
246247
border-radius: 4px;
247248
box-shadow: none;
248249
box-sizing: border-box;
249250
}
250251
textarea:focus,
251252
select:focus,
252253
input:focus {
253-
border: 1px solid #007559;
254+
border: 1px solid #ffffff;
254255
outline: 0;
255256
}
256257

257258
input[type='checkbox']:focus {
258-
outline: 1px dotted #007559;
259+
outline: 1px dotted #ffffff;
259260
}
260261

261262
label,

docs/vercel/src/Index.svelte

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script lang="ts">
2-
import AsciiPreview from './lib/AsciiPreview.svelte';
2+
import AsciiPreview from './components/AsciiPreview.svelte';
33
import data from '../../../languages.yaml';
44
import type { Languages, Language } from '../../../languages.yaml';
55
import { onMount } from 'svelte';
@@ -45,7 +45,7 @@
4545
{#if tagName && htmlUrl}
4646
<div class="banner">
4747
<small
48-
>Version {tagName} is available 🎉 Check the
48+
>🎉 Version {tagName} is available, check the
4949
<a href={htmlUrl}>release notes</a>!!</small>
5050
</div>
5151
{/if}
@@ -62,20 +62,19 @@
6262
</header>
6363
<main>
6464
<p>
65-
This page shows you an ASCII preview for all the programming languages
66-
supported by onefetch. Like the binary, the data is taken from the <a
65+
This page displays an ASCII preview for all the programming languages
66+
supported by onefetch. Like the binary, the data is sourced from the <a
6767
href="https://raw.githubusercontent.com/o2sh/onefetch/main/languages.yaml"
68-
><code>Languages.yaml</code></a> file and the layout is meant to mimic the
69-
way the logo would look inside a terminal.
68+
><code>Languages.yaml</code></a> file, and the layout aims to replicate how
69+
the logo would appear inside a terminal.
7070
</p>
7171
<p>
7272
Suggestions and PRs are welcome at <a
7373
href="https://github.com/o2sh/onefetch">github.com/o2sh/onefetch</a>
7474
</p>
7575
<div class="title">
7676
<h3>Languages <small>({$filteredLanguages.length})</small></h3>
77-
<button class="filter-button" on:click={() => (showMenu = !showMenu)}
78-
>Filter by type</button>
77+
<button on:click={() => (showMenu = !showMenu)}>Filter by type</button>
7978
</div>
8079

8180
<div class:hide={!showMenu}>
@@ -110,13 +109,14 @@
110109

111110
<style>
112111
.banner {
113-
background-color: #e1f6e5;
112+
background-color: black;
114113
position: absolute;
115114
top: 0;
116115
left: 0;
117116
width: 100%;
118117
text-align: center;
119118
padding: 0.5rem 0;
119+
color: white;
120120
}
121121
122122
.title {

docs/vercel/src/lib/AsciiPreview.svelte renamed to docs/vercel/src/components/AsciiPreview.svelte

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<script lang="ts">
2+
import { mapToDefaultTerminalFgColor } from '../lib/utils';
23
import Chip from './Chip.svelte';
34
import TitleLink from './TitleLink.svelte';
45
@@ -27,10 +28,6 @@
2728
return `${htmlLine}${'</span>'.repeat(spanCount)}`;
2829
})
2930
.join('\n');
30-
31-
function mapToDefaultTerminalFgColor(color: string, dark: boolean): string {
32-
return color === 'white' && !dark ? 'black' : color;
33-
}
3431
</script>
3532

3633
<div class="title-row">
@@ -59,6 +56,7 @@
5956
.logo-container {
6057
display: flex;
6158
justify-content: center;
59+
background-color: white;
6260
}
6361
6462
.logo-container.dark {

0 commit comments

Comments
 (0)