@gemboss/website-ui 0.10.0 → 0.12.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/js/website.js CHANGED
@@ -1,11 +1,11 @@
1
- /*! @gemboss/website-ui 0.10.0 website.js | GENERATED by scripts/build.mjs from js/website.mjs (the source, with its comments): edit that file | spec: docs/markup-contract.md | load with defer */
1
+ /*! @gemboss/website-ui 0.12.0 website.js | GENERATED by scripts/build.mjs from js/website.mjs (the source, with its comments): edit that file | spec: docs/markup-contract.md | load with defer */
2
2
  (function () {
3
3
  'use strict';
4
4
  if (window.gwWebsite) return;
5
5
 
6
- var version = '0.10.0';
6
+ var version = '0.12.0';
7
7
  var api = { version: version, init: init, destroy: destroy };
8
- var doc, root, mine, fine, sys, wide, mid, live = [], megaOpen = null, megaTimer = 0, queued = false;
8
+ var doc, root, mine, fine, sys, wide, desk, mid, live = [], queued = false;
9
9
  var still, lights;
10
10
  var READY = 'data-gw-ready';
11
11
 
@@ -46,46 +46,286 @@ function drop(r) {
46
46
  }
47
47
  function records(kind, fn) { live.slice().forEach(function (r) { if (r.kind === kind) fn(r); }); }
48
48
 
49
- function setMega(m, show, mode) {
50
- m.p.hidden = !show;
51
- m.t.setAttribute('aria-expanded', String(show));
52
- m.item.classList.toggle('is-open', show);
53
- m.mode = mode;
54
- megaOpen = show ? m : megaOpen === m ? null : megaOpen;
55
- emit(m.t, 'gw:mega', { id: m.p.id, open: show });
56
- }
57
- function showMega(m, mode) {
58
- clearTimeout(megaTimer);
59
- if (megaOpen === m) { if (mode === 'click') m.mode = mode; return; }
60
- if (megaOpen) setMega(megaOpen, false);
61
- setMega(m, true, mode);
62
- }
63
- function hideMega(focus) {
64
- var m = megaOpen;
65
- clearTimeout(megaTimer);
66
- if (!m) return;
67
- setMega(m, false);
68
- if (focus === true) m.t.focus();
49
+ var hydrated = new WeakSet();
50
+ function hydrate(card) {
51
+ if (!card || hydrated.has(card)) return;
52
+ hydrated.add(card);
53
+ within('[data-gw-bg]', card).forEach(function (el) {
54
+ el.style.backgroundImage = 'url("' + attr(el, 'data-gw-bg', '') + '")';
55
+ el.classList.add('is-hydrated');
56
+ });
57
+ within('template[data-gw-hydrate]', card).forEach(function (t) {
58
+ t.parentNode.appendChild(t.content.cloneNode(true));
59
+ t.parentNode.classList.add('is-hydrated');
60
+ });
69
61
  }
70
- function inside(m, el) { return !!el && (m.item.contains(el) || m.p.contains(el)); }
71
62
  function mega(ctx) {
72
- each(ctx, '[data-gw-mega]', 'mega', function (t, on) {
73
- var p = doc.getElementById(attr(t, 'data-gw-mega', attr(t, 'aria-controls', '')));
74
- if (!p) return;
75
- var m = { t: t, p: p, item: t.closest('.gw-nav__item') || t.parentNode };
76
- on(t, 'click', function () { if (megaOpen === m && m.mode !== 'hover') hideMega(); else showMega(m, 'click'); });
77
- (m.item.contains(p) ? [m.item] : [m.item, p]).forEach(function (el) {
78
- on(el, 'mouseenter', function () {
79
- if (fine.matches) { clearTimeout(megaTimer); if (megaOpen !== m) megaTimer = setTimeout(function () { showMega(m, 'hover'); }, 80); }
63
+ each(ctx, '.gw-header', 'mega', function (header, on) {
64
+ var items = [];
65
+ all('.gw-nav__item', header).forEach(function (item) {
66
+ var t = item.querySelector('[data-gw-mega], .gw-nav__trigger');
67
+ var p = t && doc.getElementById(attr(t, 'data-gw-mega', attr(t, 'aria-controls', '')));
68
+ if (p) items.push({ item: item, t: t, p: p, body: p.querySelector('.gw-mega__body'), foot: p.querySelector('.gw-mega__foot'),
69
+ grid: p.querySelector('.gw-mega__grid'), rows: all('.gw-mega__link', p), pane: p.querySelector('.gw-mega__aside') });
70
+ });
71
+ if (!items.length) return;
72
+ var nav = header.querySelector('.gw-nav') || header;
73
+ var bar = header.querySelector('.gw-header__bar') || header;
74
+ var mk = function (tag, cls) { var n = doc.createElement(tag); n.className = cls; n.setAttribute('aria-hidden', 'true'); return n; };
75
+ var scrim = mk('div', 'gw-scrim'), bg = mk('div', 'gw-mega-surface'), caret = mk('div', 'gw-mega-caret'), pill = mk('span', 'gw-nav__pill');
76
+ var made = [scrim, bg, caret, pill], cards = new Map(), cur = null, openT = 0, closeT = 0, pvT = 0, pvTok = 0, quiet = false, rec;
77
+ doc.body.appendChild(scrim);
78
+ header.appendChild(pill);
79
+ header.appendChild(bg);
80
+ header.appendChild(caret);
81
+ header.classList.add('has-mega');
82
+ items.forEach(function (m) {
83
+ m.hid = m.p.hidden;
84
+ m.p.hidden = false;
85
+ m.p.inert = true;
86
+ m.feat = m.pane && m.pane.querySelector('.gw-mega__card');
87
+ });
88
+ var still2 = function () { return still.matches; };
89
+ function snap(els, fn) {
90
+ els.forEach(function (n) { if (n) n.style.transition = 'none'; });
91
+ fn();
92
+ void header.offsetWidth;
93
+ els.forEach(function (n) { if (n) n.style.transition = ''; });
94
+ }
95
+ function cardFor(m, row) {
96
+ var k = attr(row, 'data-gw-preview', '');
97
+ if (k === 'feature') return m.feat || null;
98
+ if (cards.has(row)) return cards.get(row);
99
+ var tpl = k && doc.getElementById(k);
100
+ if (!tpl || !tpl.content || !m.pane) return null;
101
+ var a = doc.createElement('a'), art = doc.createElement('span'), txt = doc.createElement('span'), go = doc.createElement('span');
102
+ var b = row.querySelector('b'), t = b ? b.cloneNode(true) : doc.createElement('b'), line = row.querySelector('i');
103
+ a.className = 'gw-mega__card';
104
+ a.href = attr(row, 'href', '#');
105
+ if (row.rel) a.rel = row.rel;
106
+ a.tabIndex = -1;
107
+ a.setAttribute('aria-hidden', 'true');
108
+ within('[aria-hidden="true"]', t).forEach(function (n) { if (n !== t) n.remove(); });
109
+ go.className = 'gw-mega__go';
110
+ go.textContent = /^https?:/.test(a.getAttribute('href')) ? '\u2197' : '\u2192';
111
+ t.appendChild(go);
112
+ art.className = 'gw-mega__art';
113
+ art.appendChild(tpl.content.cloneNode(true));
114
+ txt.className = 'gw-mega__card-text';
115
+ txt.appendChild(t);
116
+ if (line) txt.appendChild(line.cloneNode(true));
117
+ a.appendChild(art);
118
+ a.appendChild(txt);
119
+ m.pane.appendChild(a);
120
+ cards.set(row, a);
121
+ return a;
122
+ }
123
+ function build(m) {
124
+ if (m.built) return;
125
+ m.built = true;
126
+ if (m.grid) { m.hl = mk('span', 'gw-mega__hl'); m.grid.insertBefore(m.hl, m.grid.firstChild); made.push(m.hl); }
127
+ hydrate(m.feat);
128
+ if (m.pane && !m.feat && m.rows[0]) m.feat = cardFor(m, m.rows[0]);
129
+ var idle = window.requestIdleCallback || function (f) { return setTimeout(f, 200); };
130
+ if (m.pane) idle(function () { if (header.classList.contains('has-mega')) m.rows.forEach(function (row) { cardFor(m, row); }); });
131
+ }
132
+ function preview(m, row, now) {
133
+ clearTimeout(pvT);
134
+ var tok = ++pvTok;
135
+ var go = function () {
136
+ var c = row ? cardFor(m, row) : m.feat;
137
+ if (!c || c === m.on) return;
138
+ var swap = function () {
139
+ if (tok !== pvTok || m.on === c) return;
140
+ if (m.on) m.on.classList.remove('is-on');
141
+ c.classList.add('is-on');
142
+ m.on = c;
143
+ };
144
+ var wait = [].filter.call(c.querySelectorAll('img'), function (i) { return !i.complete && i.decode; });
145
+ if (!wait.length || !window.Promise) { swap(); return; }
146
+ var t = setTimeout(swap, 240);
147
+ Promise.all(wait.map(function (i) { return i.decode().catch(function () {}); })).then(function () { clearTimeout(t); swap(); });
148
+ };
149
+ if (now) go(); else pvT = setTimeout(go, 80);
150
+ }
151
+ function light(m, row) {
152
+ if (!m.hl) return;
153
+ if (!row) { m.hl.classList.remove('is-on'); return; }
154
+ var place = function () {
155
+ m.hl.style.translate = row.offsetLeft + 'px ' + row.offsetTop + 'px';
156
+ m.hl.style.width = row.offsetWidth + 'px';
157
+ m.hl.style.height = row.offsetHeight + 'px';
158
+ };
159
+ if (m.hl.classList.contains('is-on') && !still2()) place(); else snap([m.hl], place);
160
+ m.hl.classList.add('is-on');
161
+ }
162
+ function movePill(t) {
163
+ if (!t) { pill.classList.remove('is-on'); return; }
164
+ var hr = header.getBoundingClientRect(), r = t.getBoundingClientRect();
165
+ var place = function () {
166
+ pill.style.translate = Math.round(r.left - hr.left) + 'px ' + Math.round(r.top - hr.top) + 'px';
167
+ pill.style.width = Math.round(r.width) + 'px';
168
+ pill.style.height = Math.round(r.height) + 'px';
169
+ };
170
+ if (pill.classList.contains('is-on') && !still2()) place(); else snap([pill], place);
171
+ pill.classList.add('is-on');
172
+ }
173
+ function measure() {
174
+ var hr = header.getBoundingClientRect(), inner = bar.getBoundingClientRect();
175
+ var lo = inner.left - hr.left + 8, hi = inner.right - hr.left - 8;
176
+ header.style.setProperty('--gw-mega-top', (header.clientHeight + 8) + 'px');
177
+ items.forEach(function (m) {
178
+ var t = m.t.getBoundingClientRect(), w = m.p.offsetWidth, h = m.p.offsetHeight;
179
+ var cx = t.left + t.width / 2 - hr.left;
180
+ var x = Math.round(Math.max(lo, Math.min(cx - w / 2, hi - w)));
181
+ m.x = x; m.w = w; m.h = h;
182
+ m.cx = Math.round(Math.max(x + 24, Math.min(cx, x + w - 24)));
183
+ m.p.style.left = x + 'px';
184
+ m.p.style.transformOrigin = (m.cx - x) + 'px 0';
80
185
  });
81
- on(el, 'mouseleave', function () {
82
- if (fine.matches) { clearTimeout(megaTimer); if (megaOpen === m && m.mode === 'hover') megaTimer = setTimeout(hideMega, 160); }
186
+ }
187
+ function clipTo(m, r) {
188
+ if (!r) return 'inset(0px 0px 0px 0px round 20px)';
189
+ var l = Math.max(0, r.x - m.x), rt = Math.max(0, m.x + m.w - (r.x + r.w)), b = Math.max(0, m.h - r.h);
190
+ return 'inset(0px ' + Math.round(rt) + 'px ' + Math.round(b) + 'px ' + Math.round(l) + 'px round 20px)';
191
+ }
192
+ function surface(m, y) {
193
+ bg.style.left = m.x + 'px';
194
+ bg.style.translate = '0px ' + y + 'px';
195
+ bg.style.width = m.w + 'px';
196
+ bg.style.height = m.h + 'px';
197
+ bg.style.transformOrigin = (m.cx - m.x) + 'px 0';
198
+ caret.style.translate = (m.cx - 6) + 'px ' + y + 'px';
199
+ }
200
+ function show(m) {
201
+ clearTimeout(closeT);
202
+ if (cur === m) return;
203
+ var prev = cur;
204
+ cur = m;
205
+ if (prev) {
206
+ prev.pinned = false;
207
+ prev.item.classList.remove('is-open');
208
+ prev.t.setAttribute('aria-expanded', 'false');
209
+ prev.p.inert = true;
210
+ emit(prev.t, 'gw:mega', { id: prev.p.id, open: false });
211
+ }
212
+ if (!m) {
213
+ header.classList.remove('is-mega-open');
214
+ scrim.classList.remove('is-on');
215
+ if (prev) { bg.style.translate = '0px -6px'; caret.style.translate = (prev.cx - 6) + 'px -6px'; }
216
+ movePill(nav.querySelector('.gw-nav__trigger:hover, .gw-nav__link:hover'));
217
+ return;
218
+ }
219
+ build(m);
220
+ records('mega', function (o) { if (o !== rec && o.open()) o.close(); });
221
+ preview(m, null, true);
222
+ light(m, null);
223
+ if (!prev) {
224
+ measure();
225
+ snap([bg, caret, m.p, m.body, m.foot], function () {
226
+ surface(m, -6);
227
+ m.p.style.clipPath = clipTo(m, null);
228
+ m.p.style.setProperty('--gw-mega-dx', '0px');
229
+ });
230
+ header.classList.add('is-mega-open');
231
+ surface(m, 0);
232
+ } else {
233
+ var hr = header.getBoundingClientRect(), br = bg.getBoundingClientRect();
234
+ var from = { x: br.left - hr.left, w: br.width, h: br.height };
235
+ var dir = items.indexOf(m) > items.indexOf(prev) ? 1 : -1;
236
+ if (!still2()) {
237
+ snap([m.p, m.body, m.foot], function () {
238
+ m.p.style.clipPath = clipTo(m, from);
239
+ m.p.style.setProperty('--gw-mega-dx', (dir * 8) + 'px');
240
+ });
241
+ prev.p.style.clipPath = clipTo(prev, m);
242
+ prev.p.style.setProperty('--gw-mega-dx', (-dir * 8) + 'px');
243
+ }
244
+ m.p.style.clipPath = clipTo(m, null);
245
+ m.p.style.setProperty('--gw-mega-dx', '0px');
246
+ surface(m, 0);
247
+ }
248
+ m.p.inert = false;
249
+ m.item.classList.add('is-open');
250
+ m.t.setAttribute('aria-expanded', 'true');
251
+ scrim.classList.add('is-on');
252
+ movePill(m.t);
253
+ emit(m.t, 'gw:mega', { id: m.p.id, open: true });
254
+ }
255
+ function hideSoon() { clearTimeout(openT); clearTimeout(closeT); closeT = setTimeout(function () { show(null); }, 350); }
256
+ items.forEach(function (m) {
257
+ on(m.p, 'transitionend', function (e) {
258
+ if (e.target === m.p && e.propertyName === 'opacity' && !m.item.classList.contains('is-open')) m.p.style.clipPath = '';
259
+ });
260
+ on(m.item, 'pointerenter', function (e) {
261
+ if (!desk.matches || e.pointerType === 'touch') return;
262
+ clearTimeout(closeT);
263
+ clearTimeout(openT);
264
+ openT = setTimeout(function () { show(m); }, cur ? 90 : 200);
265
+ });
266
+ on(m.item, 'pointerleave', function () { if (desk.matches && !m.pinned) hideSoon(); });
267
+ on(m.item, 'focusin', function () { if (desk.matches && !quiet) show(m); });
268
+ on(m.item, 'focusout', function (e) { if (desk.matches && !m.item.contains(e.relatedTarget)) hideSoon(); });
269
+ on(m.t, 'keydown', function (e) {
270
+ if (!desk.matches || e.key !== 'ArrowDown') return;
271
+ e.preventDefault();
272
+ show(m);
273
+ if (m.rows[0]) m.rows[0].focus();
83
274
  });
275
+ if (m.t.tagName === 'BUTTON') on(m.t, 'click', function () {
276
+ if (!desk.matches) return;
277
+ clearTimeout(openT);
278
+ if (cur === m && m.pinned) { show(null); return; }
279
+ show(m);
280
+ m.pinned = true;
281
+ });
282
+ on(m.p, 'click', function (e) { if (link(e)) show(null); });
283
+ m.rows.forEach(function (row) {
284
+ on(row, 'pointerenter', function () { if (!desk.matches || cur !== m) return; light(m, row); preview(m, row, false); });
285
+ on(row, 'focus', function () { if (!desk.matches) return; if (cur !== m) show(m); light(m, row); preview(m, row, true); });
286
+ });
287
+ if (m.feat && m.feat.tagName === 'A') on(m.feat, 'focus', function () { if (!desk.matches) return; light(m, null); preview(m, null, true); });
288
+ });
289
+ all('.gw-nav__trigger, .gw-nav__link', nav).forEach(function (t) {
290
+ on(t, 'pointerenter', function (e) { if (desk.matches && e.pointerType !== 'touch') movePill(t); });
291
+ on(t, 'focus', function () { if (desk.matches) movePill(t); });
84
292
  });
85
- on(m.item, 'focusout', function (e) { if (megaOpen === m && e.relatedTarget && !inside(m, e.relatedTarget)) hideMega(); });
86
- on(p, 'click', function (e) { if (link(e)) hideMega(); });
87
- m.stop = function () { if (megaOpen === m) hideMega(); };
88
- return m;
293
+ on(nav, 'pointerleave', function () { if (desk.matches && !cur) movePill(null); });
294
+ on(nav, 'focusout', function (e) { if (desk.matches && !cur && !nav.contains(e.relatedTarget)) movePill(null); });
295
+ on(window, 'resize', function () {
296
+ if (!desk.matches) { show(null); movePill(null); return; }
297
+ if (cur) { measure(); snap([bg, caret], function () { surface(cur, 0); }); movePill(cur.t); }
298
+ });
299
+ rec = {
300
+ open: function () { return !!cur; },
301
+ has: function (el) { return !!cur && !!el && (cur.item.contains(el) || cur.p.contains(el)); },
302
+ close: function (focus) {
303
+ if (!cur) return;
304
+ var t = cur.t;
305
+ quiet = true;
306
+ show(null);
307
+ if (focus) t.focus();
308
+ quiet = false;
309
+ if (focus) movePill(t);
310
+ },
311
+ stop: function () {
312
+ clearTimeout(openT); clearTimeout(closeT); clearTimeout(pvT);
313
+ if (cur) show(null);
314
+ made.forEach(function (n) { n.remove(); });
315
+ cards.forEach(function (c) { c.remove(); });
316
+ items.forEach(function (m) {
317
+ m.p.hidden = m.hid;
318
+ m.p.inert = false;
319
+ ['left', 'transformOrigin', 'clipPath'].forEach(function (k) { m.p.style[k] = ''; });
320
+ m.p.style.removeProperty('--gw-mega-dx');
321
+ if (m.on) m.on.classList.remove('is-on');
322
+ m.built = false;
323
+ });
324
+ header.style.removeProperty('--gw-mega-top');
325
+ header.classList.remove('has-mega', 'is-mega-open');
326
+ }
327
+ };
328
+ return rec;
89
329
  });
90
330
  }
91
331
 
@@ -117,6 +357,7 @@ function mobile(ctx) {
117
357
  if (g === cur) return;
118
358
  cur = g;
119
359
  groups.forEach(function (x) { x.open = x === g; });
360
+ if (g) hydrate(g.querySelector('.gw-mega__card'));
120
361
  menu.classList.toggle('is-drilled', !!g);
121
362
  menu.classList.toggle('is-back', !g && r.open());
122
363
  menu.scrollTop = 0;
@@ -242,17 +483,41 @@ function theme(ctx) {
242
483
  relabel();
243
484
  }
244
485
 
486
+ var REVEAL = { threshold: 0.12, margin: '0px 0px -6% 0px', stagger: 70, staggerMax: 380, failsafe: 1600, count: 1100 };
487
+ function countUp(el) {
488
+ var n = el.firstChild, m = n && n.nodeType === 3 && /^(\s*\D*?)(\d[\d,]*(?:\.\d+)?)(.*)$/.exec(n.nodeValue), t0;
489
+ if (!m) return;
490
+ var num = m[2].replace(/,/g, ''), dec = (num.split('.')[1] || '').length;
491
+ function fmt(v) { v = v.toFixed(dec); return m[1] + (num !== m[2] ? Number(v).toLocaleString('en-US') : v) + m[3]; }
492
+ n.nodeValue = fmt(0);
493
+ requestAnimationFrame(function step(ts) {
494
+ var p = Math.min((ts - (t0 = t0 || ts)) / REVEAL.count, 1);
495
+ n.nodeValue = fmt(p < 1 ? num * (1 - Math.pow(1 - p, 3)) : +num);
496
+ if (p < 1) requestAnimationFrame(step);
497
+ });
498
+ }
245
499
  function reveal(ctx) {
246
- var els = [], io = null;
247
- each(ctx, '.gw-reveal', 'reveal', function (el) { els.push(el); return { stop: function () { if (io) io.unobserve(el); } }; });
248
- function showAll() { els.forEach(function (el) { el.classList.add('is-in'); }); if (io) io.disconnect(); }
500
+ var els = [], io, calm = still.matches;
501
+ each(ctx, '.gw-reveal', 'reveal', function (el) {
502
+ els.push(el);
503
+ return { stop: function () { if (io) io.unobserve(el); el.style.transitionDelay = ''; } };
504
+ });
505
+ function show(el) {
506
+ if (el.classList.contains('is-in')) return;
507
+ el.classList.add('is-in');
508
+ if (!calm) [].forEach.call(el.querySelectorAll('[data-gw-count]'), countUp);
509
+ }
249
510
  if (!els.length) return;
250
- if (!window.IntersectionObserver || mq('(prefers-reduced-motion: reduce)').matches) return showAll();
511
+ if (!window.IntersectionObserver || calm) return els.forEach(show);
512
+ els.forEach(function (el) {
513
+ var i = [].filter.call(el.parentNode.children, function (c) { return c.classList.contains('gw-reveal'); }).indexOf(el);
514
+ if (i > 0) el.style.transitionDelay = Math.min(i * REVEAL.stagger, REVEAL.staggerMax) + 'ms';
515
+ });
251
516
  io = new IntersectionObserver(function (list) {
252
- list.forEach(function (en) { if (en.isIntersecting) { en.target.classList.add('is-in'); io.unobserve(en.target); } });
253
- }, { threshold: 0.15 });
517
+ list.forEach(function (en) { if (en.isIntersecting) { show(en.target); io.unobserve(en.target); } });
518
+ }, { threshold: REVEAL.threshold, rootMargin: REVEAL.margin });
254
519
  els.forEach(function (el) { io.observe(el); });
255
- setTimeout(showAll, 2500);
520
+ setTimeout(function () { els.forEach(show); io.disconnect(); }, REVEAL.failsafe);
256
521
  }
257
522
 
258
523
  function scrolled() {
@@ -428,13 +693,15 @@ function install() {
428
693
  fine = mq('(hover: hover) and (pointer: fine)'); sys = mq('(prefers-color-scheme: dark)');
429
694
  var stored = null;
430
695
  wide = mq('(min-width: 1080px)');
696
+ desk = mq('(min-width: 1081px)');
431
697
  mid = mq('(min-width: 621px)');
432
- on(doc, 'click', function (e) { if (megaOpen && !inside(megaOpen, e.target)) hideMega(); });
433
- on(doc, 'keydown', function (e) { if (megaOpen && esc(e)) hideMega(inside(megaOpen, doc.activeElement) || megaOpen.mode === 'click'); });
698
+ on(doc, 'click', function (e) { records('mega', function (r) { if (r.open() && !r.has(e.target)) r.close(); }); });
699
+ on(doc, 'keydown', function (e) { if (esc(e)) records('mega', function (r) { if (r.open()) r.close(true); }); });
434
700
  on(doc, 'keydown', function (e) { if (esc(e)) closeMenus(true); });
435
701
  on(doc, 'keydown', function (e) { if (e.key === 'Tab') records('menu', function (r) { if (r.trap && r.open()) r.trap(e); }); });
436
702
  on(doc, 'click', function (e) { records('lang', function (r) { if (r.open() && !r.el.contains(e.target)) r.set(false); }); });
437
- watch(wide, function () { if (wide.matches) closeMenus(); records('toc', function (r) { r.fit(); }); });
703
+ watch(wide, function () { records('toc', function (r) { r.fit(); }); });
704
+ watch(desk, function () { if (desk.matches) closeMenus(); });
438
705
  watch(mid, function () { records('fold', function (r) { r.fit(); }); });
439
706
  still = mq('(prefers-reduced-motion: reduce)');
440
707
  var css = window.CSS;