aerolith 1.0.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +4 -0
- package/README.md +61 -108
- package/library/dist/aerolith.css +171 -16
- package/library/dist/aerolith.js +289 -36
- package/library/dist/fonts/OFL-Aerolith-Display.txt +100 -0
- package/library/dist/fonts/OFL-Aerolith-Text.txt +97 -0
- package/library/dist/fonts/OFL-Istok-Web.txt +94 -0
- package/library/dist/fonts/aerolith-display-aqua.bmp.woff2 +0 -0
- package/library/dist/fonts/aerolith-display-aqua.svg.woff2 +0 -0
- package/library/dist/fonts/aerolith-display-glass-dark.bmp.woff2 +0 -0
- package/library/dist/fonts/aerolith-display-glass-dark.svg.woff2 +0 -0
- package/library/dist/fonts/aerolith-display-glass.bmp.woff2 +0 -0
- package/library/dist/fonts/aerolith-display-glass.svg.woff2 +0 -0
- package/library/dist/fonts/aerolith-display-pearl.bmp.woff2 +0 -0
- package/library/dist/fonts/aerolith-display-pearl.svg.woff2 +0 -0
- package/library/dist/fonts/aerolith-text-bold.woff2 +0 -0
- package/library/dist/fonts/aerolith-text-light.woff2 +0 -0
- package/library/dist/fonts/aerolith-text-regular.woff2 +0 -0
- package/library/dist/fonts/aerolith-text-semibold.woff2 +0 -0
- package/library/dist/fonts/istok-web-bold-italic.woff2 +0 -0
- package/library/dist/fonts/istok-web-bold.woff2 +0 -0
- package/library/dist/fonts/istok-web-italic.woff2 +0 -0
- package/library/dist/fonts/istok-web-regular.woff2 +0 -0
- package/library/dist/sprites/lens.dark@1x.png +0 -0
- package/library/dist/sprites/lens.dark@2x.png +0 -0
- package/library/dist/sprites/lens.dark@3x.png +0 -0
- package/library/dist/sprites/lens@1x.png +0 -0
- package/library/dist/sprites/lens@2x.png +0 -0
- package/library/dist/sprites/lens@3x.png +0 -0
- package/library/dist/sprites/logo-aqua@1x.png +0 -0
- package/library/dist/sprites/logo-aqua@2x.png +0 -0
- package/library/dist/sprites/logo-aqua@3x.png +0 -0
- package/library/dist/sprites/logo-liquid@1x.png +0 -0
- package/library/dist/sprites/logo-liquid@2x.png +0 -0
- package/library/dist/sprites/logo-liquid@3x.png +0 -0
- package/library/dist/sprites.json +88 -0
- package/package.json +7 -5
package/library/dist/aerolith.js
CHANGED
|
@@ -3,7 +3,11 @@
|
|
|
3
3
|
// - slider / compare: keeps --aer-fill in sync with the native range value
|
|
4
4
|
// - drop zone: [data-aer-over] while files are dragged over an .aer-drop
|
|
5
5
|
// - theme switch: input[data-aer-theme] toggles <html data-theme> and remembers the choice
|
|
6
|
-
// - lens: the rim refraction of .aer-lens (Chromium
|
|
6
|
+
// - lens: the rim refraction of .aer-lens (Chromium; Firefox too with data-aer-lens-backdrop);
|
|
7
|
+
// data-aer-drag makes it movable
|
|
8
|
+
// - menus: popovers drop down from their button; [data-aer-menu] opens one at the pointer
|
|
9
|
+
// - segmented: the selected chip slides between items
|
|
10
|
+
// - preload: sprites of closed dialogs and popovers load with the page
|
|
7
11
|
(function () {
|
|
8
12
|
"use strict";
|
|
9
13
|
var KEY = "aerolith-theme";
|
|
@@ -34,33 +38,64 @@
|
|
|
34
38
|
}
|
|
35
39
|
|
|
36
40
|
// ---------------------------------------------------------------- lens: displacement map from the bevel profile
|
|
37
|
-
|
|
41
|
+
// Two ways to bend what is behind the rim:
|
|
42
|
+
// - data-aer-lens-backdrop="<selector>": the lens carries a copy of that element, lined up with the
|
|
43
|
+
// original, and bends the copy with filter: url(). Chromium and Firefox.
|
|
44
|
+
// - otherwise, Chromium only: backdrop-filter: url(). Safari shows plain glass either way.
|
|
45
|
+
// data-aer-drag makes the lens movable (pointer, touch, arrow keys) inside its parent.
|
|
46
|
+
var lensId = 0, svgRoot = null, PAD = 2;
|
|
47
|
+
// Lens geometry, same as the rendered sprite (catalog.py): superellipse corners (n = 4) of radius
|
|
48
|
+
// LENS_R, a convex edge 1-(1-t)^4 over LENS_BEVEL px. Light comes straight down, refracts at the
|
|
49
|
+
// curved top and the flat bottom (IOR 1.5), then travels LIFT px to the page under the glass.
|
|
50
|
+
var LENS_R = 32, LENS_BEVEL = 30, GLASS = 20, BASE = 4, LIFT = 24, IOR = 1.5;
|
|
51
|
+
var DISPERSION = [0.9, 1, 1.16]; // red, green, blue: blue bends most
|
|
38
52
|
function chromium() { return !!(navigator.userAgentData && navigator.userAgentData.brands &&
|
|
39
53
|
navigator.userAgentData.brands.some(function (b) { return /Chromium/.test(b.brand); })); }
|
|
40
|
-
function
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
var
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
for (var
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
54
|
+
function bend(d, bevel) { // px of sideways shift at depth d (px in from the outline)
|
|
55
|
+
var t = Math.min(Math.max(d / bevel, 0), 1), u = 1 - t;
|
|
56
|
+
var z = GLASS * (1 - u * u * u * u), slope = GLASS * 4 * u * u * u / bevel;
|
|
57
|
+
var ti = Math.atan(slope), dl = ti - Math.asin(Math.sin(ti) / IOR);
|
|
58
|
+
return (z + BASE) * Math.tan(dl) + LIFT * Math.tan(Math.asin(Math.min(1, IOR * Math.sin(dl))));
|
|
59
|
+
}
|
|
60
|
+
function lensMap(w, h, W, H, q) {
|
|
61
|
+
// W x H map (lens centred) at q px per CSS px. R and G hold the inward shift as a fraction of the
|
|
62
|
+
// largest one (128 = none); returns the map and that largest shift in px. One lookup table, then
|
|
63
|
+
// a few multiplications per pixel: cheap enough to redo on every resize.
|
|
64
|
+
var R = Math.min(LENS_R, w / 2, h / 2), bevel = Math.min(LENS_BEVEL, R);
|
|
65
|
+
var STEP = 16, lut = new Float32Array(Math.ceil(bevel * STEP) + 2), max = bend(0, bevel);
|
|
66
|
+
for (var k = 0; k < lut.length; k++) lut[k] = bend(k / STEP, bevel) / max;
|
|
67
|
+
var cw = Math.round(W * q), ch = Math.round(H * q);
|
|
68
|
+
var c = document.createElement("canvas"); c.width = cw; c.height = ch;
|
|
69
|
+
var g = c.getContext("2d"), img = g.createImageData(cw, ch), px = img.data;
|
|
70
|
+
var hx = w / 2, hy = h / 2, ex = hx - R, ey = hy - R;
|
|
71
|
+
for (var Y = 0; Y < ch; Y++) {
|
|
72
|
+
var y = (Y + 0.5) / q - H / 2, ay = Math.abs(y), qy = ay - ey;
|
|
73
|
+
for (var X = 0; X < cw; X++) {
|
|
74
|
+
var x = (X + 0.5) / q - W / 2, ax = Math.abs(x), qx = ax - ex, d, ux = 0, uy = 0;
|
|
75
|
+
if (qx > 0 && qy > 0) { // corner: superellipse, n = 4
|
|
76
|
+
var x3 = qx * qx * qx, y3 = qy * qy * qy, L = Math.sqrt(Math.sqrt(x3 * qx + y3 * qy));
|
|
77
|
+
d = R - L;
|
|
78
|
+
var gl = Math.hypot(x3, y3); ux = -x3 / gl; uy = -y3 / gl;
|
|
79
|
+
} else if (qx > qy) { d = R - qx; ux = -1; }
|
|
80
|
+
else { d = R - qy; uy = -1; }
|
|
81
|
+
if (x < 0) ux = -ux;
|
|
82
|
+
if (y < 0) uy = -uy;
|
|
83
|
+
var m = 0;
|
|
84
|
+
if (d > 0 && d < bevel) { var f = d * STEP, k0 = f | 0; m = lut[k0] + (lut[k0 + 1] - lut[k0]) * (f - k0); }
|
|
85
|
+
var i = (Y * cw + X) * 4;
|
|
86
|
+
px[i] = 128 + Math.round(127 * m * ux); px[i + 1] = 128 + Math.round(127 * m * uy);
|
|
87
|
+
px[i + 2] = 128; px[i + 3] = 255;
|
|
88
|
+
}
|
|
58
89
|
}
|
|
59
90
|
g.putImageData(img, 0, 0);
|
|
60
|
-
return c.toDataURL();
|
|
91
|
+
return { url: c.toDataURL(), max: max };
|
|
61
92
|
}
|
|
62
93
|
function lens(el) {
|
|
63
|
-
if (
|
|
94
|
+
if (el.hasAttribute("data-aer-drag")) drag(el);
|
|
95
|
+
// WebKit (Safari, every iOS browser) misplaces SVG filters on HTML: plain glass there
|
|
96
|
+
var sel = el.getAttribute("data-aer-lens-backdrop"), gecko = CSS.supports("-moz-appearance", "none");
|
|
97
|
+
var src = sel && (chromium() || gecko) ? document.querySelector(sel) : null;
|
|
98
|
+
if (!src && !chromium()) return;
|
|
64
99
|
var NS = "http://www.w3.org/2000/svg";
|
|
65
100
|
if (!svgRoot) {
|
|
66
101
|
svgRoot = document.createElementNS(NS, "svg");
|
|
@@ -68,39 +103,257 @@
|
|
|
68
103
|
svgRoot.style.cssText = "position:absolute;width:0;height:0;overflow:hidden";
|
|
69
104
|
document.body.appendChild(svgRoot);
|
|
70
105
|
}
|
|
71
|
-
var id = "aer-lens-" + (++lensId), filter = null;
|
|
106
|
+
var id = "aer-lens-" + (++lensId), filter = null, view = null, copy = null, ox = 0, oy = 0;
|
|
107
|
+
if (src) {
|
|
108
|
+
// the copy: same element, same classes, no ids, no lens inside, lined up with the original
|
|
109
|
+
view = document.createElement("div");
|
|
110
|
+
view.className = "aer-lens-view"; view.setAttribute("aria-hidden", "true"); view.inert = true;
|
|
111
|
+
copy = src.cloneNode(true);
|
|
112
|
+
copy.removeAttribute("id");
|
|
113
|
+
copy.querySelectorAll("[id]").forEach(function (n) { n.removeAttribute("id"); });
|
|
114
|
+
copy.querySelectorAll(".aer-lens").forEach(function (n) { n.remove(); });
|
|
115
|
+
view.appendChild(copy);
|
|
116
|
+
el.insertBefore(view, el.firstChild);
|
|
117
|
+
el.setAttribute("data-aer-lens-view", "");
|
|
118
|
+
}
|
|
119
|
+
function sync() { // line the copy up with the original
|
|
120
|
+
if (!copy) return;
|
|
121
|
+
var cs = getComputedStyle(src), a = src.getBoundingClientRect(), b = el.getBoundingClientRect();
|
|
122
|
+
var st = copy.style;
|
|
123
|
+
st.position = "absolute"; st.margin = "0"; st.boxSizing = "border-box"; st.transform = "none"; st.translate = "none";
|
|
124
|
+
st.width = src.offsetWidth + "px"; st.height = src.offsetHeight + "px";
|
|
125
|
+
st.left = (a.left - b.left + ox) + "px"; st.top = (a.top - b.top + oy) + "px";
|
|
126
|
+
["color", "fontFamily", "fontSize", "fontWeight", "lineHeight", "letterSpacing"].forEach(function (p) { st[p] = cs[p]; });
|
|
127
|
+
}
|
|
72
128
|
function build() {
|
|
73
129
|
var w = Math.round(el.offsetWidth), h = Math.round(el.offsetHeight);
|
|
74
130
|
if (!w || !h) return;
|
|
75
131
|
if (filter) filter.remove();
|
|
132
|
+
var pad = view ? PAD : 0, W = w + 2 * pad, H = h + 2 * pad;
|
|
133
|
+
var map = lensMap(w, h, W, H, Math.min(2, window.devicePixelRatio || 1));
|
|
134
|
+
if (view) {
|
|
135
|
+
ox = pad; oy = pad;
|
|
136
|
+
var vs = view.style;
|
|
137
|
+
vs.left = -pad + "px"; vs.top = -pad + "px"; vs.width = W + "px"; vs.height = H + "px";
|
|
138
|
+
}
|
|
139
|
+
// map -> three displacements (red, green, blue bend by different amounts) -> recombined
|
|
76
140
|
filter = document.createElementNS(NS, "filter");
|
|
77
141
|
filter.id = id;
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
filter.setAttribute(
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
142
|
+
var attrs = { x: 0, y: 0, width: W, height: H, filterUnits: "userSpaceOnUse", primitiveUnits: "userSpaceOnUse",
|
|
143
|
+
"color-interpolation-filters": "sRGB" };
|
|
144
|
+
for (var a in attrs) filter.setAttribute(a, attrs[a]);
|
|
145
|
+
function prim(tag, at) {
|
|
146
|
+
var n = document.createElementNS(NS, tag);
|
|
147
|
+
for (var a in at) n.setAttribute(a, at[a]);
|
|
148
|
+
filter.appendChild(n);
|
|
149
|
+
}
|
|
150
|
+
prim("feImage", { href: map.url, x: 0, y: 0, width: W, height: H, preserveAspectRatio: "none", result: "map" });
|
|
151
|
+
["r", "g", "b"].forEach(function (ch, k) {
|
|
152
|
+
prim("feDisplacementMap", { in: "SourceGraphic", in2: "map", scale: (2 * map.max * DISPERSION[k]).toFixed(2),
|
|
153
|
+
xChannelSelector: "R", yChannelSelector: "G", result: "d" + ch });
|
|
154
|
+
var m = ["0 0 0 0 0", "0 0 0 0 0", "0 0 0 0 0"]; m[k] = ["1 0 0 0 0", "0 1 0 0 0", "0 0 1 0 0"][k];
|
|
155
|
+
prim("feColorMatrix", { in: "d" + ch, type: "matrix", values: m.join(" ") + " 0 0 0 1 0", result: ch });
|
|
156
|
+
});
|
|
157
|
+
prim("feComposite", { in: "r", in2: "g", operator: "arithmetic", k2: 1, k3: 1, result: "rg" });
|
|
158
|
+
prim("feComposite", { in: "rg", in2: "b", operator: "arithmetic", k2: 1, k3: 1 });
|
|
90
159
|
svgRoot.appendChild(filter);
|
|
91
|
-
|
|
160
|
+
if (view) { sync(); view.style.filter = "url(#" + id + ")"; }
|
|
161
|
+
else el.style.backdropFilter = "url(#" + id + ")";
|
|
92
162
|
el.setAttribute("data-aer-lens", "");
|
|
93
163
|
}
|
|
164
|
+
el._aerLensSync = sync;
|
|
94
165
|
build();
|
|
95
166
|
if (window.ResizeObserver) {
|
|
96
167
|
var t;
|
|
97
168
|
new ResizeObserver(function () { clearTimeout(t); t = setTimeout(build, 120); }).observe(el);
|
|
169
|
+
if (src) new ResizeObserver(sync).observe(src);
|
|
98
170
|
}
|
|
171
|
+
addEventListener("resize", sync);
|
|
172
|
+
}
|
|
173
|
+
function drag(el) {
|
|
174
|
+
var x = 0, y = 0, start = null;
|
|
175
|
+
if (!el.hasAttribute("tabindex")) el.tabIndex = 0;
|
|
176
|
+
function moveTo(nx, ny) {
|
|
177
|
+
var box = el.parentElement.getBoundingClientRect(), r = el.getBoundingClientRect();
|
|
178
|
+
var bx = r.left - x, by = r.top - y; // where it sits without the shift
|
|
179
|
+
x = Math.round(clamp(nx, box.left - bx, box.right - r.width - bx));
|
|
180
|
+
y = Math.round(clamp(ny, box.top - by, box.bottom - r.height - by));
|
|
181
|
+
el.style.translate = x + "px " + y + "px";
|
|
182
|
+
if (el._aerLensSync) el._aerLensSync();
|
|
183
|
+
}
|
|
184
|
+
el.addEventListener("pointerdown", function (e) {
|
|
185
|
+
if (e.button !== 0 || e.target.closest("a, button, input, select, textarea")) return;
|
|
186
|
+
start = { px: e.clientX, py: e.clientY, x: x, y: y };
|
|
187
|
+
el.setPointerCapture(e.pointerId); el.setAttribute("data-aer-dragging", "");
|
|
188
|
+
e.preventDefault();
|
|
189
|
+
});
|
|
190
|
+
el.addEventListener("pointermove", function (e) {
|
|
191
|
+
if (start) moveTo(start.x + e.clientX - start.px, start.y + e.clientY - start.py);
|
|
192
|
+
});
|
|
193
|
+
["pointerup", "pointercancel", "lostpointercapture"].forEach(function (t) {
|
|
194
|
+
el.addEventListener(t, function () { start = null; el.removeAttribute("data-aer-dragging"); });
|
|
195
|
+
});
|
|
196
|
+
el.addEventListener("keydown", function (e) {
|
|
197
|
+
var d = e.shiftKey ? 40 : 10, k = { ArrowLeft: [-d, 0], ArrowRight: [d, 0], ArrowUp: [0, -d], ArrowDown: [0, d] }[e.key];
|
|
198
|
+
if (!k) return;
|
|
199
|
+
e.preventDefault(); moveTo(x + k[0], y + k[1]);
|
|
200
|
+
});
|
|
201
|
+
if (window.ResizeObserver) new ResizeObserver(function () { moveTo(x, y); }).observe(el.parentElement);
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
// ---------------------------------------------------------------- menus: placed like a context menu
|
|
205
|
+
// A [popover].aer-popover opened by a popovertarget button drops down from that button (or opens
|
|
206
|
+
// above it when there is no room); [data-aer-menu="id"] on any element opens that popover at the
|
|
207
|
+
// pointer on right-click or long-press. Either way it stays 8 px inside the window.
|
|
208
|
+
var invoker = null;
|
|
209
|
+
function clamp(v, lo, hi) { return Math.max(lo, Math.min(v, hi)); }
|
|
210
|
+
function place(pop, at) {
|
|
211
|
+
var M = 8, vw = document.documentElement.clientWidth, vh = window.innerHeight;
|
|
212
|
+
var w = pop.offsetWidth, h = pop.offsetHeight, left, top;
|
|
213
|
+
if (at.nodeType) {
|
|
214
|
+
var r = at.getBoundingClientRect();
|
|
215
|
+
left = r.left; top = r.bottom + 6;
|
|
216
|
+
if (top + h > vh - M && r.top - 6 - h >= M) top = r.top - 6 - h;
|
|
217
|
+
if (left + w > vw - M) left = r.right - w;
|
|
218
|
+
} else {
|
|
219
|
+
left = at.x; top = at.y;
|
|
220
|
+
if (left + w > vw - M) left = at.x - w;
|
|
221
|
+
if (top + h > vh - M) top = at.y - h;
|
|
222
|
+
}
|
|
223
|
+
pop.style.left = clamp(left, M, vw - M - w) + "px";
|
|
224
|
+
pop.style.top = clamp(top, M, vh - M - h) + "px";
|
|
225
|
+
}
|
|
226
|
+
function openAt(pop, at) {
|
|
227
|
+
pop.style.position = "fixed"; pop.style.inset = "auto"; pop.style.margin = "0";
|
|
228
|
+
pop._aerAt = at;
|
|
229
|
+
if (!pop.matches(":popover-open")) pop.showPopover(); else place(pop, at);
|
|
230
|
+
}
|
|
231
|
+
function bindPopover(pop) {
|
|
232
|
+
function close() { if (pop.matches(":popover-open")) pop.hidePopover(); }
|
|
233
|
+
// before it shows: anchor it, so it never flashes at the window's corner
|
|
234
|
+
pop.addEventListener("beforetoggle", function (e) {
|
|
235
|
+
if (e.newState !== "open") return;
|
|
236
|
+
if (!pop._aerAt && invoker && invoker.getAttribute("popovertarget") === pop.id) pop._aerAt = invoker;
|
|
237
|
+
if (!pop._aerAt) return;
|
|
238
|
+
pop.style.position = "fixed"; pop.style.inset = "auto"; pop.style.margin = "0";
|
|
239
|
+
place(pop, pop._aerAt); // size unknown yet: a first guess
|
|
240
|
+
});
|
|
241
|
+
pop.addEventListener("toggle", function (e) {
|
|
242
|
+
if (e.newState === "open") {
|
|
243
|
+
if (pop._aerAt) place(pop, pop._aerAt); // measured: flip or clamp if needed
|
|
244
|
+
addEventListener("resize", close);
|
|
245
|
+
addEventListener("scroll", close, { capture: true, passive: true });
|
|
246
|
+
} else {
|
|
247
|
+
pop._aerAt = null;
|
|
248
|
+
removeEventListener("resize", close);
|
|
249
|
+
removeEventListener("scroll", close, { capture: true });
|
|
250
|
+
}
|
|
251
|
+
});
|
|
252
|
+
// picking an item closes the menu
|
|
253
|
+
pop.addEventListener("click", function (e) {
|
|
254
|
+
if (e.target.closest(".aer-menu > a, .aer-menu > button") && pop.matches(":popover-open")) pop.hidePopover();
|
|
255
|
+
});
|
|
256
|
+
}
|
|
257
|
+
function bindContext(el) {
|
|
258
|
+
var pop = document.getElementById(el.getAttribute("data-aer-menu"));
|
|
259
|
+
if (!pop || !pop.showPopover) return;
|
|
260
|
+
var timer = 0, start = null, pending = null, down = false;
|
|
261
|
+
el.addEventListener("contextmenu", function (e) {
|
|
262
|
+
e.preventDefault();
|
|
263
|
+
var at = { x: e.clientX, y: e.clientY };
|
|
264
|
+
// Linux and macOS fire contextmenu on mouse-down, phones while the finger is down. Opened
|
|
265
|
+
// then, the release would light-dismiss the menu, so it opens when the button or finger lifts.
|
|
266
|
+
if (down) pending = at; else openAt(pop, at);
|
|
267
|
+
});
|
|
268
|
+
el.addEventListener("pointerdown", function (e) {
|
|
269
|
+
if (e.pointerType === "mouse" && e.button !== 2) return;
|
|
270
|
+
down = true;
|
|
271
|
+
if (e.pointerType !== "touch") return;
|
|
272
|
+
start = { x: e.clientX, y: e.clientY };
|
|
273
|
+
clearTimeout(timer);
|
|
274
|
+
timer = setTimeout(function () { pending = start; }, 500); // iOS sends no contextmenu
|
|
275
|
+
});
|
|
276
|
+
el.addEventListener("pointermove", function (e) {
|
|
277
|
+
if (start && Math.hypot(e.clientX - start.x, e.clientY - start.y) > 10) { clearTimeout(timer); start = null; }
|
|
278
|
+
});
|
|
279
|
+
function release() {
|
|
280
|
+
if (!down) return;
|
|
281
|
+
down = false; clearTimeout(timer); start = null;
|
|
282
|
+
if (pending) { var at = pending; pending = null; setTimeout(function () { openAt(pop, at); }, 0); }
|
|
283
|
+
}
|
|
284
|
+
addEventListener("pointerup", release, true); // on the window: the pointer may have left el
|
|
285
|
+
addEventListener("pointercancel", release, true);
|
|
286
|
+
}
|
|
287
|
+
document.addEventListener("click", function (e) {
|
|
288
|
+
var b = e.target.closest && e.target.closest("[popovertarget]");
|
|
289
|
+
if (b) invoker = b;
|
|
290
|
+
}, true);
|
|
291
|
+
|
|
292
|
+
// ---------------------------------------------------------------- sprites of things that start hidden
|
|
293
|
+
// A closed dialog or popover is not rendered, so its sprites would load only when it first opens
|
|
294
|
+
// (one empty frame). One off-screen probe fetches them with the page (.aer-preload in the CSS).
|
|
295
|
+
function preload(root) {
|
|
296
|
+
if (document.querySelector(".aer-preload") || !root.querySelector(".aer-dialog, .aer-popover, .aer-toaster")) return;
|
|
297
|
+
var i = document.createElement("i");
|
|
298
|
+
i.className = "aer-preload"; i.setAttribute("aria-hidden", "true");
|
|
299
|
+
document.body.appendChild(i);
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
// ---------------------------------------------------------------- segmented: one pill that slides
|
|
303
|
+
// Without this every selected item draws its own chip. With it, one .aer-seg-pill under the items
|
|
304
|
+
// carries the chip and CSS moves it. It follows radio changes, aria-current / -selected / -pressed
|
|
305
|
+
// (MutationObserver), form resets and size changes; a size change snaps instead of sliding.
|
|
306
|
+
function selected(c) {
|
|
307
|
+
var i = c.querySelector("input");
|
|
308
|
+
if (i) return i.checked;
|
|
309
|
+
var a = c.getAttribute("aria-current");
|
|
310
|
+
return (a !== null && a !== "false") || c.getAttribute("aria-selected") === "true" ||
|
|
311
|
+
c.getAttribute("aria-pressed") === "true";
|
|
312
|
+
}
|
|
313
|
+
function slide(seg) {
|
|
314
|
+
var pill = document.createElement("span"), shown = false;
|
|
315
|
+
pill.className = "aer-seg-pill"; pill.setAttribute("aria-hidden", "true");
|
|
316
|
+
seg.appendChild(pill); // last, so a fieldset's legend stays first
|
|
317
|
+
seg.setAttribute("data-aer-slide", "");
|
|
318
|
+
function place(snap) {
|
|
319
|
+
var c = null;
|
|
320
|
+
for (var k = 0; k < seg.children.length; k++) {
|
|
321
|
+
var e = seg.children[k];
|
|
322
|
+
if (e !== pill && selected(e)) { c = e; break; }
|
|
323
|
+
}
|
|
324
|
+
if (!c || !c.offsetWidth) { pill.style.opacity = "0"; shown = false; return; }
|
|
325
|
+
if (snap || !shown) seg.removeAttribute("data-aer-ready");
|
|
326
|
+
pill.style.opacity = "";
|
|
327
|
+
pill.style.transform = "translate(" + c.offsetLeft + "px, " + c.offsetTop + "px)";
|
|
328
|
+
pill.style.width = c.offsetWidth + "px"; pill.style.height = c.offsetHeight + "px";
|
|
329
|
+
if (snap || !shown) { void pill.offsetWidth; seg.setAttribute("data-aer-ready", ""); } // reflow, then animate again
|
|
330
|
+
shown = true;
|
|
331
|
+
}
|
|
332
|
+
seg._aerPlace = place;
|
|
333
|
+
seg.addEventListener("change", function () { place(); });
|
|
334
|
+
if (window.MutationObserver)
|
|
335
|
+
new MutationObserver(function () { place(); }).observe(seg, { subtree: true, attributes: true,
|
|
336
|
+
attributeFilter: ["aria-current", "aria-selected", "aria-pressed"] });
|
|
337
|
+
var form = seg.closest && seg.closest("form");
|
|
338
|
+
if (form) form.addEventListener("reset", function () { setTimeout(place, 0); });
|
|
339
|
+
if (window.ResizeObserver) {
|
|
340
|
+
var ro = new ResizeObserver(function () { place(true); });
|
|
341
|
+
ro.observe(seg);
|
|
342
|
+
for (var k = 0; k < seg.children.length; k++) if (seg.children[k] !== pill) ro.observe(seg.children[k]);
|
|
343
|
+
}
|
|
344
|
+
place(true);
|
|
99
345
|
}
|
|
100
346
|
|
|
101
347
|
// ---------------------------------------------------------------- init
|
|
348
|
+
// Calling init again re-places the segmented pills, e.g. after setting input.checked from script.
|
|
102
349
|
function init(root) {
|
|
103
350
|
root = root || document;
|
|
351
|
+
preload(root);
|
|
352
|
+
root.querySelectorAll(".aer-segmented").forEach(function (s) {
|
|
353
|
+
if (once(s, "aerSlide")) slide(s); else if (s._aerPlace) s._aerPlace();
|
|
354
|
+
});
|
|
355
|
+
root.querySelectorAll(".aer-popover[popover]").forEach(function (p) { if (once(p, "aerBound")) bindPopover(p); });
|
|
356
|
+
root.querySelectorAll("[data-aer-menu]").forEach(function (el) { if (once(el, "aerCtxBound")) bindContext(el); });
|
|
104
357
|
root.querySelectorAll(".aer-slider > input[type=range], .aer-compare > input[type=range]").forEach(function (input) {
|
|
105
358
|
if (!once(input, "aerBound")) return;
|
|
106
359
|
input.parentElement.setAttribute("data-aer-ready", "");
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
Aerolith Display is derived from Istok Web Bold by Andrey V. Panov. The outlines were made
|
|
2
|
+
heavier and each glyph was rendered in Bryce; it is a Modified Version under the SIL Open
|
|
3
|
+
Font License 1.1 below and does not use the Reserved Font Name "Istok".
|
|
4
|
+
|
|
5
|
+
Copyright (c) 2026, Immineal (colour glyphs).
|
|
6
|
+
|
|
7
|
+
Copyright (c) 2008-2012, 2014, Andrey V. Panov (panov@canopus.iacp.dvo.ru),
|
|
8
|
+
with Reserved Font Name Istok.
|
|
9
|
+
|
|
10
|
+
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
|
11
|
+
This license is copied below, and is also available with a FAQ at:
|
|
12
|
+
http://scripts.sil.org/OFL
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
-----------------------------------------------------------
|
|
16
|
+
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
|
17
|
+
-----------------------------------------------------------
|
|
18
|
+
|
|
19
|
+
PREAMBLE
|
|
20
|
+
The goals of the Open Font License (OFL) are to stimulate worldwide
|
|
21
|
+
development of collaborative font projects, to support the font creation
|
|
22
|
+
efforts of academic and linguistic communities, and to provide a free and
|
|
23
|
+
open framework in which fonts may be shared and improved in partnership
|
|
24
|
+
with others.
|
|
25
|
+
|
|
26
|
+
The OFL allows the licensed fonts to be used, studied, modified and
|
|
27
|
+
redistributed freely as long as they are not sold by themselves. The
|
|
28
|
+
fonts, including any derivative works, can be bundled, embedded,
|
|
29
|
+
redistributed and/or sold with any software provided that any reserved
|
|
30
|
+
names are not used by derivative works. The fonts and derivatives,
|
|
31
|
+
however, cannot be released under any other type of license. The
|
|
32
|
+
requirement for fonts to remain under this license does not apply
|
|
33
|
+
to any document created using the fonts or their derivatives.
|
|
34
|
+
|
|
35
|
+
DEFINITIONS
|
|
36
|
+
"Font Software" refers to the set of files released by the Copyright
|
|
37
|
+
Holder(s) under this license and clearly marked as such. This may
|
|
38
|
+
include source files, build scripts and documentation.
|
|
39
|
+
|
|
40
|
+
"Reserved Font Name" refers to any names specified as such after the
|
|
41
|
+
copyright statement(s).
|
|
42
|
+
|
|
43
|
+
"Original Version" refers to the collection of Font Software components as
|
|
44
|
+
distributed by the Copyright Holder(s).
|
|
45
|
+
|
|
46
|
+
"Modified Version" refers to any derivative made by adding to, deleting,
|
|
47
|
+
or substituting -- in part or in whole -- any of the components of the
|
|
48
|
+
Original Version, by changing formats or by porting the Font Software to a
|
|
49
|
+
new environment.
|
|
50
|
+
|
|
51
|
+
"Author" refers to any designer, engineer, programmer, technical
|
|
52
|
+
writer or other person who contributed to the Font Software.
|
|
53
|
+
|
|
54
|
+
PERMISSION & CONDITIONS
|
|
55
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
56
|
+
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
|
57
|
+
redistribute, and sell modified and unmodified copies of the Font
|
|
58
|
+
Software, subject to the following conditions:
|
|
59
|
+
|
|
60
|
+
1) Neither the Font Software nor any of its individual components,
|
|
61
|
+
in Original or Modified Versions, may be sold by itself.
|
|
62
|
+
|
|
63
|
+
2) Original or Modified Versions of the Font Software may be bundled,
|
|
64
|
+
redistributed and/or sold with any software, provided that each copy
|
|
65
|
+
contains the above copyright notice and this license. These can be
|
|
66
|
+
included either as stand-alone text files, human-readable headers or
|
|
67
|
+
in the appropriate machine-readable metadata fields within text or
|
|
68
|
+
binary files as long as those fields can be easily viewed by the user.
|
|
69
|
+
|
|
70
|
+
3) No Modified Version of the Font Software may use the Reserved Font
|
|
71
|
+
Name(s) unless explicit written permission is granted by the corresponding
|
|
72
|
+
Copyright Holder. This restriction only applies to the primary font name as
|
|
73
|
+
presented to the users.
|
|
74
|
+
|
|
75
|
+
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
|
76
|
+
Software shall not be used to promote, endorse or advertise any
|
|
77
|
+
Modified Version, except to acknowledge the contribution(s) of the
|
|
78
|
+
Copyright Holder(s) and the Author(s) or with their explicit written
|
|
79
|
+
permission.
|
|
80
|
+
|
|
81
|
+
5) The Font Software, modified or unmodified, in part or in whole,
|
|
82
|
+
must be distributed entirely under this license, and must not be
|
|
83
|
+
distributed under any other license. The requirement for fonts to
|
|
84
|
+
remain under this license does not apply to any document created
|
|
85
|
+
using the Font Software.
|
|
86
|
+
|
|
87
|
+
TERMINATION
|
|
88
|
+
This license becomes null and void if any of the above conditions are
|
|
89
|
+
not met.
|
|
90
|
+
|
|
91
|
+
DISCLAIMER
|
|
92
|
+
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
93
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
|
94
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
|
95
|
+
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
|
96
|
+
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
97
|
+
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
|
98
|
+
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
99
|
+
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
|
100
|
+
OTHER DEALINGS IN THE FONT SOFTWARE.
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
Aerolith Text is derived from Selawik by Microsoft Corporation. A kern table was added and the
|
|
2
|
+
font was renamed; it is a Modified Version under the SIL Open Font License 1.1 below and does not
|
|
3
|
+
use the Reserved Font Name "Selawik".
|
|
4
|
+
|
|
5
|
+
Copyright (c) 2026, Immineal (kern table).
|
|
6
|
+
|
|
7
|
+
Copyright 2015, Microsoft Corporation (www.microsoft.com), with Reserved Font Name Selawik. All Rights Reserved. Selawik is a trademark of Microsoft Corporation in the United States and/or other countries.
|
|
8
|
+
|
|
9
|
+
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
|
10
|
+
This license is copied below, and is also available with a FAQ at:
|
|
11
|
+
http://scripts.sil.org/OFL
|
|
12
|
+
|
|
13
|
+
-----------------------------------------------------------
|
|
14
|
+
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
|
15
|
+
-----------------------------------------------------------
|
|
16
|
+
PREAMBLE
|
|
17
|
+
The goals of the Open Font License (OFL) are to stimulate worldwide
|
|
18
|
+
development of collaborative font projects, to support the font creation
|
|
19
|
+
efforts of academic and linguistic communities, and to provide a free and
|
|
20
|
+
open framework in which fonts may be shared and improved in partnership
|
|
21
|
+
with others.
|
|
22
|
+
|
|
23
|
+
The OFL allows the licensed fonts to be used, studied, modified and
|
|
24
|
+
redistributed freely as long as they are not sold by themselves. The
|
|
25
|
+
fonts, including any derivative works, can be bundled, embedded,
|
|
26
|
+
redistributed and/or sold with any software provided that any reserved
|
|
27
|
+
names are not used by derivative works. The fonts and derivatives,
|
|
28
|
+
however, cannot be released under any other type of license. The
|
|
29
|
+
requirement for fonts to remain under this license does not apply
|
|
30
|
+
to any document created using the fonts or their derivatives.
|
|
31
|
+
|
|
32
|
+
DEFINITIONS
|
|
33
|
+
"Font Software" refers to the set of files released by the Copyright
|
|
34
|
+
Holder(s) under this license and clearly marked as such. This may
|
|
35
|
+
include source files, build scripts and documentation.
|
|
36
|
+
|
|
37
|
+
"Reserved Font Name" refers to any names specified as such after the
|
|
38
|
+
copyright statement(s).
|
|
39
|
+
|
|
40
|
+
"Original Version" refers to the collection of Font Software components as
|
|
41
|
+
distributed by the Copyright Holder(s).
|
|
42
|
+
|
|
43
|
+
"Modified Version" refers to any derivative made by adding to, deleting,
|
|
44
|
+
or substituting -- in part or in whole -- any of the components of the
|
|
45
|
+
Original Version, by changing formats or by porting the Font Software to a
|
|
46
|
+
new environment.
|
|
47
|
+
|
|
48
|
+
"Author" refers to any designer, engineer, programmer, technical
|
|
49
|
+
writer or other person who contributed to the Font Software.
|
|
50
|
+
|
|
51
|
+
PERMISSION & CONDITIONS
|
|
52
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
53
|
+
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
|
54
|
+
redistribute, and sell modified and unmodified copies of the Font
|
|
55
|
+
Software, subject to the following conditions:
|
|
56
|
+
|
|
57
|
+
1) Neither the Font Software nor any of its individual components,
|
|
58
|
+
in Original or Modified Versions, may be sold by itself.
|
|
59
|
+
|
|
60
|
+
2) Original or Modified Versions of the Font Software may be bundled,
|
|
61
|
+
redistributed and/or sold with any software, provided that each copy
|
|
62
|
+
contains the above copyright notice and this license. These can be
|
|
63
|
+
included either as stand-alone text files, human-readable headers or
|
|
64
|
+
in the appropriate machine-readable metadata fields within text or
|
|
65
|
+
binary files as long as those fields can be easily viewed by the user.
|
|
66
|
+
|
|
67
|
+
3) No Modified Version of the Font Software may use the Reserved Font
|
|
68
|
+
Name(s) unless explicit written permission is granted by the corresponding
|
|
69
|
+
Copyright Holder. This restriction only applies to the primary font name as
|
|
70
|
+
presented to the users.
|
|
71
|
+
|
|
72
|
+
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
|
73
|
+
Software shall not be used to promote, endorse or advertise any
|
|
74
|
+
Modified Version, except to acknowledge the contribution(s) of the
|
|
75
|
+
Copyright Holder(s) and the Author(s) or with their explicit written
|
|
76
|
+
permission.
|
|
77
|
+
|
|
78
|
+
5) The Font Software, modified or unmodified, in part or in whole,
|
|
79
|
+
must be distributed entirely under this license, and must not be
|
|
80
|
+
distributed under any other license. The requirement for fonts to
|
|
81
|
+
remain under this license does not apply to any document created
|
|
82
|
+
using the Font Software.
|
|
83
|
+
|
|
84
|
+
TERMINATION
|
|
85
|
+
This license becomes null and void if any of the above conditions are
|
|
86
|
+
not met.
|
|
87
|
+
|
|
88
|
+
DISCLAIMER
|
|
89
|
+
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
90
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
|
91
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
|
92
|
+
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
|
93
|
+
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
94
|
+
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
|
95
|
+
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
96
|
+
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
|
97
|
+
OTHER DEALINGS IN THE FONT SOFTWARE.
|