-
Notifications
You must be signed in to change notification settings - Fork 3
/
ewert.html
64 lines (54 loc) · 1.47 KB
/
ewert.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<!DOCTYPE html>
<meta charset="utf-8">
<link href="https://fonts.googleapis.com/css2?family=Ewert&display=swap" rel="stylesheet">
<style>
@font-face {
font-family: "Ewert Spice";
src: url("./fonts/ewert/Ewert-Spice.ttf");
}
sample {
font-family: "Ewert Spice";
font-size: 8em;
font-palette: --palette;
}
select{
font-family: Ewert;
font-size: 6em;
}
</style>
<style id="palette_overrides"></style>
<div>
<select name="palette" id="palette" >
<option value="0">palette 0</option>
<option value="1">palette 1</option>
<option value="2">palette 2</option>
<option value="3">palette 3</option>
<option value="4">palette 4</option>
<option value="5">palette 5</option>
<option value="6">palette 6</option>
<option value="7">palette 7</option>
</select>
</div>
<div>
It can have gradients too, I just haven't scripted that yet :)
</div>
<sample>
The quick brown fox jumps over the lazy dog
<br/>
0123456789
</sample>
<script>
function update_palette(e) {
let base_palette = document.getElementById("palette").value;
let style = document.getElementById("palette_overrides");
style.innerHTML = `
@font-palette-values --palette {
font-family: "Ewert Spice";
base-palette: ${base_palette};
}
`;
}
document.getElementById("palette")
.addEventListener("change", update_palette);
update_palette();
</script>