Skip to content

Commit 56c6d4f

Browse files
committed
add about section, adjust typography
1 parent 56f0116 commit 56c6d4f

File tree

7 files changed

+100
-12
lines changed

7 files changed

+100
-12
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,13 @@ Go to https://tpg.makeinstallnotwar.org/
1414
- Technologies used: [react][], [redux][], [typescript][], [turf.js][], [GeoJSON][], etc.
1515
- Contact mlc if you have any questions
1616

17+
## Typography
18+
19+
[Inter][]
20+
1721
[react]: https://react.dev/
1822
[redux]: https://redux-toolkit.js.org/
1923
[typescript]: https://www.typescriptlang.org/
2024
[turf.js]: https://turfjs.org/
2125
[GeoJSON]: https://geojson.org/
26+
[Inter]: https://rsms.me/inter/

build.mjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,11 @@ import {
88
} from '@aws-sdk/client-cloudfront';
99
import { PutObjectCommand, S3Client } from '@aws-sdk/client-s3';
1010
import htmlPlugin from '@chialab/esbuild-plugin-html';
11-
import postCssPlugin from '@deanc/esbuild-plugin-postcss';
1211
import * as esbuild from 'esbuild';
1312
import { randomBytes } from 'node:crypto';
1413
import { readFile, readdir, unlink } from 'node:fs/promises';
1514
import { extname, join as joinPath } from 'node:path';
1615
import * as process from 'node:process';
17-
import postcssPresetEnv from 'postcss-preset-env';
1816

1917
const dev = process.argv[2] === 'serve';
2018
const deploy = process.argv[2] === 'deploy';
@@ -42,14 +40,15 @@ const ctx = await esbuild.context({
4240
platform: 'browser',
4341
plugins: [
4442
htmlPlugin({ minifyOptions: { minifySvg: false } }),
45-
postCssPlugin({ plugins: [postcssPresetEnv()] }),
43+
//postCssPlugin({ plugins: [postcssPresetEnv()] }),
4644
],
4745
charset: 'utf8',
4846
define: {
4947
DEBUG: JSON.stringify(dev),
5048
'process.env.NODE_ENV': dev ? '"development"' : '"production"',
5149
},
5250
target: ['chrome125', 'firefox118', 'edge133', 'ios15', 'safari17'],
51+
loader: { '.woff2': 'file' },
5352
});
5453

5554
if (dev) {
@@ -65,6 +64,7 @@ const mimeTypes = {
6564
'.map': 'application/json',
6665
'.txt': 'text/plain;charset=utf-8',
6766
'.html': 'text/html;charset=utf-8',
67+
'.woff2': 'font/woff2',
6868
};
6969

7070
if (deploy) {

src/About.tsx

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import * as React from 'react';
2+
3+
const About: React.FC = () => (
4+
<>
5+
<h2>About</h2>
6+
<p className="hint">
7+
This is a utility for finding your closest photo for several different
8+
game modes. All computations are performed on your computer and no data is
9+
transmitted anywhere. If you want to see or modify the source code, feel
10+
free to{' '}
11+
<a href="https://github.com/mlc/tpg-solver">have a look on GitHub</a>. For
12+
any other questions, contact mlc.
13+
</p>
14+
</>
15+
);
16+
17+
export default About;

src/InterVariable.woff2

344 KB
Binary file not shown.

src/Results.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ const stringify = (p: unknown, hint: string) => {
3838
if (typeof p === 'string') {
3939
return p;
4040
} else if (typeof p === 'number') {
41-
return hint === 'distance' ? p.toFixed(3) : p.toString();
41+
return hint === 'distance' ? `${p.toFixed(3)}\u2009km` : p.toString();
4242
} else {
4343
return '';
4444
}

src/index.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import * as React from 'react';
22
import * as ReactDOM from 'react-dom/client';
3+
import About from './About';
34
import Data from './Data';
45
import Game from './Game';
56
import Providers from './Providers';
@@ -12,6 +13,7 @@ const App = () => (
1213
<Game />
1314
<Data />
1415
<Results />
16+
<About />
1517
</Providers>
1618
);
1719

src/style.css

Lines changed: 72 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,76 @@
1-
@import url('https://fonts.googleapis.com/css2?family=Cabin:wdth,[email protected],400..700&display=swap');
2-
31
:root {
42
--main-bg-color: #222;
53
--main-text-color: #ffe;
64
--error-color: #e77;
75
}
86

9-
body {
10-
font-family: 'Cabin', sans-serif;
7+
@font-face {
8+
font-family: 'Inter';
9+
font-style: normal;
10+
font-weight: 100 900;
11+
font-display: swap;
12+
src: url(InterVariable.woff2) format('woff2');
13+
}
14+
15+
@font-feature-values Inter {
16+
@character-variant {
17+
cv01: 1;
18+
cv02: 2;
19+
cv03: 3;
20+
cv04: 4;
21+
cv05: 5;
22+
cv06: 6;
23+
cv07: 7;
24+
cv08: 8;
25+
cv09: 9;
26+
cv10: 10;
27+
cv11: 11;
28+
cv12: 12;
29+
cv13: 13;
30+
alt-1: 1; /* Alternate one */
31+
alt-3: 9; /* Flat-top three */
32+
open-4: 2; /* Open four */
33+
open-6: 3; /* Open six */
34+
open-9: 4; /* Open nine */
35+
lc-l-with-tail: 5; /* Lower-case L with tail */
36+
simplified-u: 6; /* Simplified u */
37+
alt-double-s: 7; /* Alternate German double s */
38+
uc-i-with-serif: 8; /* Upper-case i with serif */
39+
uc-g-with-spur: 10; /* Capital G with spur */
40+
single-story-a: 11; /* Single-story a */
41+
compact-lc-f: 12; /* Compact f */
42+
compact-lc-t: 13; /* Compact t */
43+
}
44+
@styleset {
45+
ss01: 1;
46+
ss02: 2;
47+
ss03: 3;
48+
ss04: 4;
49+
ss05: 5;
50+
ss06: 6;
51+
ss07: 7;
52+
ss08: 8;
53+
open-digits: 1; /* Open digits */
54+
disambiguation: 2; /* Disambiguation (with zero) */
55+
disambiguation-except-zero: 4; /* Disambiguation (no zero) */
56+
round-quotes-and-commas: 3; /* Round quotes &amp; commas */
57+
square-punctuation: 7; /* Square punctuation */
58+
square-quotes: 8; /* Square quotes */
59+
circled-characters: 5; /* Circled characters */
60+
squared-characters: 6; /* Squared characters */
61+
}
62+
}
63+
64+
:root {
65+
font-family: 'Inter', sans-serif;
1166
font-optical-sizing: auto;
12-
font-weight: 400;
67+
font-weight: 300;
1368
font-style: normal;
14-
font-variation-settings: 'wdth' 87.5;
1569
font-variant-numeric: tabular-nums;
70+
font-variant-alternates: character-variant(open-6, open-9);
71+
}
72+
73+
body {
1674
font-size: 18px;
1775
background-color: var(--main-bg-color);
1876
color: var(--main-text-color);
@@ -30,16 +88,22 @@ body {
3088
h1 {
3189
font: inherit;
3290
font-size: 2rem;
33-
font-weight: 700;
91+
font-weight: 550;
3492
}
3593
h2 {
3694
font: inherit;
3795
font-size: 1.5rem;
38-
font-weight: 500;
96+
font-weight: 425;
3997
border-top: 1px solid var(--main-text-color);
4098
padding-top: 8px;
4199
}
42100

101+
th,
102+
strong,
103+
b {
104+
font-weight: 550;
105+
}
106+
43107
#mode-selector {
44108
display: flex;
45109
flex-direction: row;

0 commit comments

Comments
 (0)