-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
executable file
·255 lines (197 loc) · 11.5 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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
<!DOCTYPE html>
<html lang="en">
<head>
<title>form-elements</title>
<meta charset="utf-8" />
<meta name="author" content="Stephen Band" />
<meta name="description" content="A collection of advanced form controls published as custom elements" />
<meta name="viewport" content="width=device-width" />
<meta name="twitter:card" content="summary">
<meta name="twitter:site" content="@stephband">
<meta property="og:title" content="form-elements" />
<meta property="og:description" content="A collection of advanced form controls published as custom elements" />
<meta property="og:image" content="https://stephen.band/form-elements/card.png" />
<meta property="og:url" content="https://stephen.band/form-elements/" />
<script title="load">
document.documentElement.className += ' js loading';
// window.addEventListener('DOMContentLoaded', () => document.documentElement.classList.remove('content-loading'));
// Wait for other load handlers to run first - Bolt does a few things on
// load (eg. targetable scrolls) and we want them to run before the loading
// class is removed
window.addEventListener('load', () => window.requestAnimationFrame(() => document.documentElement.classList.remove('loading')));
</script>
<script title="debug">
window.DEBUG = true;
window.detailsToggleStylesheet = 'https://stephen.band/literal/documentation/build/details-toggle/shadow.css';
</script>
<link rel="stylesheet" href="literal/documentation/module.css">
<!--link rel="stylesheet" href="https://stephen.band/literal/documentation/build/module.css"-->
<link rel="preload" as="style" href="https://stephen.band/literal/documentation/build/details-toggle/shadow.css">
<link rel="stylesheet" href="./number-control/build/module.css">
<link rel="stylesheet" href="./select-control/build/module.css">
<link rel="stylesheet" href="./range-input/build/module.css">
<link rel="stylesheet" href="./rotary-input/build/module.css">
<link rel="stylesheet" href="./xy-input/build/module.css">
<link rel="stylesheet" href="./y-input/build/module.css">
<link rel="prefetch" as="style" href="./number-control/build/shadow.css">
<link rel="prefetch" as="style" href="./select-control/build/shadow.css">
<link rel="prefetch" as="style" href="./range-input/build/shadow.css">
<link rel="prefetch" as="style" href="./rotary-input/build/shadow.css">
<link rel="prefetch" as="style" href="./xy-input/build/shadow.css">
<link rel="prefetch" as="style" href="./y-input/build/shadow.css">
<script title="debug">
window.incrementControlStylesheet = './number-control/build/shadow.css';
window.selectControlStylesheet = './select-control/build/shadow.css';
window.rangeInputStylesheet = './range-input/build/shadow.css';
window.rotaryInputStylesheet = './rotary-input/build/shadow.css';
window.xyInputStylesheet = './xy-input/build/shadow.css';
window.yInputStylesheet = './y-input/build/shadow.css';
</script>
<style>
rotary-input {
max-width: 10rem;
}
* + rotary-input,
* + xy-input {
margin-top: 2rem;
}
.link-button {
--size: 2.5rem;
--border-width: 1px;
border-color: currentcolor;
border-radius: 0.3125rem;
}
.link-button:hover {
color: #4f6473;
}
* + .link-button {
margin-top: 1.25rem;
}
</style>
</head>
<body class="4x-grid @1-6x-grid @2-7x-grid @3-9x-grid grid" style="align-content: start;">
<header class="x1 4x @2-x2 x-stretch y-start">
<h1>Form elements</h1>
<p>A collection of advanced form controls published as custom elements.
Ranges of these elements can be scaled with linear, logarithm, or
exponential curves, values and tickmarks can by expressed in dB, Hz,
seconds and other units, and the elements may be used in forms with their
values being submitted like other form controls.
</p>
</header>
<section class="x1 4x @1-3x @2-x2 x-stretch y-stretch documentation-flex flex">
<h2><rotary-input></h2>
<p>A rotating knob input that can be dragged vertically, with scaling,
step, ticks, units and formatted output display.</p>
<rotary-input name="gain" min="0" max="2" ticks="-∞dB -60dB -54dB -48dB -42dB -36dB -30dB -24dB -18dB -12dB -6dB 0dB 6dB" scale="log-60dB" display="dB" value="-6dB">
Volume
</rotary-input>
<a class="link-button button x-start" href="./rotary-input">Documentation</a>
</section>
<section class="x1 4x @1-3x @1-x4 @2-x5 x-stretch y-stretch documentation-flex flex">
<h2><range-input></h2>
<p>A horizontal slider input built around an <code><input type="range"></code>
augmented with scaling, step, ticks, units and formatted output display.</p>
<range-input name="scale" min="-1" max="1" ticks="-1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1" value="-0.4">
Scale
</range-input>
<a class="link-button button x-start" href="./range-input">Documentation</a>
</section>
<section class="x1 4x @1-3x @2-x2 x-stretch y-stretch documentation-flex flex">
<h2><y-input></h2>
<p>A vertical slider input with scaling, step, ticks, units, output display
and multiple values.</p>
<y-input class="x1 3x y6" value="0 1" min="-0.5" max="2" ticks>
Range
</y-input>
<a class="link-button button x-start" href="./y-input">Documentation</a>
</section>
<section class="x1 4x @1-3x @1-x4 @2-x5 x-stretch y-stretch documentation-flex flex">
<h2><xy-input></h2>
<p>A two-axis input with scaling, step, ticks, units and multiple value handles.</p>
<xy-input value="0 0, 0.2 0.4 step 0.4 1.5 exponential 0.6 1 linear 0.8 0 target 0.4" ymin="-0.5" ymax="2" yticks xmin="0" xmax="1.4" xticks>
Envelope
</xy-input>
<a class="link-button button x-start" href="./xy-input">Documentation</a>
</section>
<section class="x1 4x @1-3x @2-x2 x-stretch y-stretch documentation-flex flex">
<h2><number-control></h2>
<p>A wrapper element that augments an <code><input type="number"></code>
with increment/decrement controls.</p>
<number-control>
<input type="number" name="number" min="-10" max="10" value="0" />
</number-control>
<a class="link-button button x-start" href="./number-control">Documentation</a>
</section>
<section class="x1 4x @1-3x @1-x4 @2-x5 x-stretch y-stretch documentation-flex flex">
<h2><select-control></h2>
<p>A wrapper element that augments a <code><select></code> with
previous/next controls.</p>
<select-control>
<select name="selection">
<option value="">Select one</option>
<option value="0">Option 0</option>
<option value="1">Option 1</option>
<option value="2">Option 2</option>
</select>
</select-control>
<a class="link-button button x-start" href="./select-control">Documentation</a>
</section>
<section class="x1 4x @2-x2 x-stretch y-start">
<h2>Contribute</h2>
<p>
Support development:
<a aria-label="Sponsor @stephband" href="https://github.com/sponsors/stephband" class="githubsponsor-button button">
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" class="fill octicon octicon-heart icon-sponsor mr-1 v-align-middle color-fg-sponsors anim-pulse-in">
<path fill-rule="evenodd" d="M4.25 2.5c-1.336 0-2.75 1.164-2.75 3 0 2.15 1.58 4.144 3.365 5.682A20.565 20.565 0 008 13.393a20.561 20.561 0 003.135-2.211C12.92 9.644 14.5 7.65 14.5 5.5c0-1.836-1.414-3-2.75-3-1.373 0-2.609.986-3.029 2.456a.75.75 0 01-1.442 0C6.859 3.486 5.623 2.5 4.25 2.5zM8 14.25l-.345.666-.002-.001-.006-.003-.018-.01a7.643 7.643 0 01-.31-.17 22.075 22.075 0 01-3.434-2.414C2.045 10.731 0 8.35 0 5.5 0 2.836 2.086 1 4.25 1 5.797 1 7.153 1.802 8 3.02 8.847 1.802 10.203 1 11.75 1 13.914 1 16 2.836 16 5.5c0 2.85-2.045 5.231-3.885 6.818a22.08 22.08 0 01-3.744 2.584l-.018.01-.006.003h-.002L8 14.25zm0 0l.345.666a.752.752 0 01-.69 0L8 14.25z"></path>
</svg>
<span class="v-align-middle">Sponsor</span>
</a>
</p>
<ul>
<li>Contribute to the repo: <a href="https://github.com/stephband/form-elements"><code>github.com/stephband/form-elements</code></a></li>
<li>Report a problem: <a href="https://github.com/stephband/form-elements/issues"><code>github.com/stephband/form-elements/issues</code></a></li>
</ul>
</section>
<hr class="x1 4x @2-x2 x-stretch" />
<div class="x1 4x @2-x2 x-stretch y-start">
<p class="text-10">
Built by <a href="https://stephen.band">Stephen Band</a> for
<a href="https://cruncher.ch"><img style="width: 1.366666667em; display: inline-block; vertical-align: bottom; margin-top: -0.1em; margin-bottom: -0.1em;" src="https://cruncher.ch/static/images/logo.svg" alt="Cruncher logo"/> Cruncher</a>.
</p>
<p class="text-10">
Documentation set in <a href="https://www.swisstypefaces.com/fonts/euclid/">Euclid</a>
and <a href="https://github.com/evilmartians/mono">Martian Mono</a>. Fonts
used for documentation not included as part of the license covering the
use of <code>form-elements</code>.
</p>
</div>
<footer class="x1 4x @1-6x @2-7x @3-9x 4x-grid @1-6x-grid @2-7x-grid @3-9x-grid grid grid footer">
<div class="x1 4x @1-2x @2-x2 x-stretch y-start">
<h3>Elements</h3>
<a class="block" href="https://stephen.band/slide-show/"><code><slide-show></code></a>
<a class="block" href="https://stephen.band/details-toggle/"><code><details-toggle></code></a>
<a class="block" href="https://stephen.band/form-elements/rotary-input/"><code><rotary-input></code></a>
<a class="block" href="https://stephen.band/form-elements/range-input/"><code><range-input></code></a>
<a class="block" href="https://stephen.band/form-elements/y-input/"><code><y-input></code></a>
<a class="block" href="https://stephen.band/form-elements/xy-input/"><code><xy-input></code></a>
<a class="block" href="https://stephen.band/form-elements/number-control/"><code><number-control></code></a>
<a class="block" href="https://stephen.band/form-elements/select-control/"><code><select-control></code></a>
<a class="block" href="https://stephen.band/literal/literal-element/"><code><literal-element></code></a>
<a class="block" href="https://stephen.band/literal/literal-include/"><code><literal-include></code></a>
</div>
<div class="x1 4x @1-2x @1-x3 @2-x4 x-stretch y-start">
<h3>Tools</h3>
<a class="block" href="https://stephen.band/font-size/">Font-size calculator</a>
</div>
</footer>
<script type="module" src="https://stephen.band/literal/documentation/build/module.js"></script>
<script type="module">
import NumberControl from './number-control/build/module.js';
import SelectControl from './select-control/build/module.js';
import RangeInput from './range-input/build/module.js';
import RotaryInput from './rotary-input/build/module.js';
import XYInput from './xy-input/build/module.js';
import YInput from './y-input/build/module.js';
</script>
</body>