-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathindex.html
122 lines (115 loc) · 4.32 KB
/
index.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>HOI Test Demo</title>
<link rel="stylesheet" href="demo-sliders.css">
<style>
body {
margin: 5vw;
padding-bottom: 8rem;
display:grid;
font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif;
}
@font-face {
font-family: 'NLI-Test';
src: url("./fonts/nli-test-VF.ttf");
}
@font-face {
font-family: 'NLI-Test-Cubic';
src: url("./fonts/nli-test-cubic-VF.ttf");
}
@font-face {
font-family: 'NLI-Test-Linear';
src: url("./fonts/nli-test-linear-VF.ttf");
}
:root {
--axis-one: 0;
--axis-two: 0;
--cubic-one: 0;
--cubic-two: 0;
--cubic-three: 0;
--linear-one: 0;
}
h2 {
border-top: solid #ccc 1px;
padding-top: 1rem;
margin-top: 3rem;
}
span {
text-align: center;
font-size: 32vw;
line-height: 1.5;
}
.example {
display: grid;
}
@media (min-width: 1000px) {
.example span {
order: 2;
}
}
#example-quadratic{
font-family: 'NLI-Test';
font-variation-settings: "1111" var(--axis-one), "2222" var(--axis-two);
}
#example-cubic {
font-family: 'NLI-Test-Cubic';
font-variation-settings: "XXXX" var(--cubic-one), "YYYY" var(--cubic-two), "ZZZZ" var(--cubic-three);
}
#example-linear {
font-family: 'NLI-Test-Linear';
font-variation-settings: "XXXX" var(--linear-one);
}
#footer, #footer a {
color: #666;
text-align: center;
margin-top: 6rem;
}
</style>
</head>
<body>
<h1>Higher-Order Interpolation (HOI) Tests</h1>
<p>See <a href="https://github.com/arrowtype/NLI-test">github.com/arrowtype/NLI-test</a> for details and a written explanation.</p>
<h2>Quadratic Example</h2>
<p>Allows curved interpolations while being reasonably simple to design. Has some limitations in rotation.</p>
<div class="example">
<span id="example-quadratic">A B C</span>
<input class="slider" id="dual-slider" type="range" min="0" max="100" value="0">
</div>
<h2>Cubic Example</h2>
<p>A bit harder to make, but able to do curvier interpolations up to 180-degree rotation (beyond this, you would need an additional dimension or an additional step).</p>
<div class="example">
<span id="example-cubic">B C</span>
<input class="slider" id="trio-slider-cubic" type="range" min="0" max="100" value="0">
</div>
<h2>Linear Example, for comparison</h2>
<p>Much simpler to make with existing tools and useful for many things, but totally unable to do rotation.</p>
<div class="example">
<span id="example-linear">B C</span>
<input class="slider" id="slider-linear" type="range" min="0" max="100" value="0">
</div>
<p id="footer">HOI was discovered & detailed by <a href="https://underware.nl/">Underware</a>. These simple explorations were made by <a href="https://arrowtype.com">Arrow Type</a>.</p>
</body>
<script>
const slider=document.querySelector("#dual-slider");
const example=document.querySelector("#example-quadratic");
slider.addEventListener("input", () => {
example.style.setProperty("--axis-one",slider.value);
example.style.setProperty("--axis-two",slider.value);
});
const sliderCubic=document.querySelector("#trio-slider-cubic");
const exampleCubic=document.querySelector("#example-cubic");
sliderCubic.addEventListener("input", () => {
exampleCubic.style.setProperty("--cubic-one",sliderCubic.value);
exampleCubic.style.setProperty("--cubic-two",sliderCubic.value);
exampleCubic.style.setProperty("--cubic-three",sliderCubic.value);
});
const sliderLinear=document.querySelector("#slider-linear");
const exampleLinear=document.querySelector("#example-linear");
sliderLinear.addEventListener("input", () => {
exampleLinear.style.setProperty("--linear-one",sliderLinear.value);
});
</script>
</html>