Skip to content

Commit 82f13ac

Browse files
committed
Make font dynamic
1 parent e656467 commit 82f13ac

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

longest_streak/longest_streak.css

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
1+
:root {
2+
--lines: 10;
3+
--font-size-vh: calc(100vh / ((var(--lines) + 8) * 1.3));
4+
--font-size-vw: 1.6vw;
5+
}
6+
17
body {
28
background-color: black;
39
margin: 0;
410
font-family: 'Droid Sans Mono', monospace;
5-
font-size: min(1.6vw, 0.7vh);
11+
font-size: min(var(--font-size-vh), var(--font-size-vw));
612
color: white;
713
}
814

longest_streak/longest_streak.js

+3
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,9 @@ function createContent() {
6969
}
7070
}
7171
while (hasStreak);
72+
73+
const root = document.documentElement;
74+
root.style.setProperty('--lines', price/1000);
7275
}
7376

7477
function formatDays(longest) {

0 commit comments

Comments
 (0)