familiar-vue 0.1.0 → 0.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.
Files changed (72) hide show
  1. package/README.md +8 -3
  2. package/dist/blocks/bots/engine/plastic.d.ts +5 -0
  3. package/dist/blocks/bots/engine/types.d.ts +5 -3
  4. package/dist/blocks/bots/types-1.d.ts +2 -2
  5. package/dist/blocks/bots/types.d.ts +2 -2
  6. package/dist/blocks/gallery/GalleryGrid.vue.d.ts +46 -0
  7. package/dist/blocks/gallery/MusicPlayer.vue.d.ts +34 -0
  8. package/dist/blocks/gallery/VideoPlayer.vue.d.ts +34 -0
  9. package/dist/blocks/gallery/icons.d.ts +49 -0
  10. package/dist/blocks/gallery/index.d.ts +141 -0
  11. package/dist/blocks/gallery/styles.d.ts +1 -0
  12. package/dist/blocks/gallery/support.d.ts +38 -0
  13. package/dist/blocks/gallery/types.d.ts +132 -0
  14. package/dist/blocks/image/studio/ImageStudio.vue.d.ts +1 -1
  15. package/dist/blocks/jelly/JellySurface.vue.d.ts +43 -0
  16. package/dist/blocks/jelly/engine/color.d.ts +12 -0
  17. package/dist/blocks/jelly/engine/environment.d.ts +2 -0
  18. package/dist/blocks/jelly/engine/frosted.d.ts +25 -0
  19. package/dist/blocks/jelly/engine/geometry.d.ts +13 -0
  20. package/dist/blocks/jelly/engine/icons.d.ts +16 -0
  21. package/dist/blocks/jelly/engine/renderer.d.ts +39 -0
  22. package/dist/blocks/jelly/engine/sound.d.ts +9 -0
  23. package/dist/blocks/jelly/engine/textures.d.ts +5 -0
  24. package/dist/blocks/jelly/index.d.ts +23 -0
  25. package/dist/blocks/jelly/types.d.ts +68 -0
  26. package/dist/blocks/loading/BreathingRing.vue.d.ts +25 -0
  27. package/dist/blocks/loading/index.d.ts +54 -1
  28. package/dist/blocks/loading/types.d.ts +22 -0
  29. package/dist/blocks/metal/MetalBadge.vue.d.ts +2 -2
  30. package/dist/bots.cjs +1 -1
  31. package/dist/bots.js +1 -1
  32. package/dist/familiar-vue.css +1 -1
  33. package/dist/gallery.cjs +2 -0
  34. package/dist/gallery.cjs.map +1 -0
  35. package/dist/gallery.d.ts +1 -0
  36. package/dist/gallery.js +8 -0
  37. package/dist/gallery.js.map +1 -0
  38. package/dist/index-Bb3rhhZY.cjs +221 -0
  39. package/dist/index-Bb3rhhZY.cjs.map +1 -0
  40. package/dist/index-C96O9k0x.cjs +289 -0
  41. package/dist/index-C96O9k0x.cjs.map +1 -0
  42. package/dist/index-CgkG0Pah.js +2580 -0
  43. package/dist/index-CgkG0Pah.js.map +1 -0
  44. package/dist/index-CjA5aaxl.js +934 -0
  45. package/dist/index-CjA5aaxl.js.map +1 -0
  46. package/dist/index-CpPZg7s9.js +476 -0
  47. package/dist/index-CpPZg7s9.js.map +1 -0
  48. package/dist/{index-CQIOTNIw.js → index-Da5OgBHn.js} +1269 -1239
  49. package/dist/index-Da5OgBHn.js.map +1 -0
  50. package/dist/index-Dc4JnH_g.cjs +80 -0
  51. package/dist/index-Dc4JnH_g.cjs.map +1 -0
  52. package/dist/index-U59nAOr-.cjs +1096 -0
  53. package/dist/index-U59nAOr-.cjs.map +1 -0
  54. package/dist/index.cjs +1 -1
  55. package/dist/index.d.ts +8 -2
  56. package/dist/index.js +58 -49
  57. package/dist/index.js.map +1 -1
  58. package/dist/jelly.cjs +2 -0
  59. package/dist/jelly.cjs.map +1 -0
  60. package/dist/jelly.d.ts +2 -0
  61. package/dist/jelly.js +9 -0
  62. package/dist/jelly.js.map +1 -0
  63. package/dist/loading.cjs +1 -1
  64. package/dist/loading.js +4 -3
  65. package/package.json +11 -1
  66. package/dist/index-BAZi5af3.cjs +0 -221
  67. package/dist/index-BAZi5af3.cjs.map +0 -1
  68. package/dist/index-BmMsid7x.js +0 -422
  69. package/dist/index-BmMsid7x.js.map +0 -1
  70. package/dist/index-CQIOTNIw.js.map +0 -1
  71. package/dist/index-DZJ-MNwi.cjs +0 -80
  72. package/dist/index-DZJ-MNwi.cjs.map +0 -1
@@ -1,422 +0,0 @@
1
- import { defineComponent as X, computed as D, openBlock as w, createElementBlock as S, normalizeClass as $, createElementVNode as C, createTextVNode as B, toDisplayString as F, Fragment as J, createCommentVNode as k, useModel as te, ref as E, watch as H, onBeforeUnmount as ae, createBlock as oe, Teleport as ne, normalizeStyle as re, renderSlot as le, mergeModels as W, nextTick as ie } from "vue";
2
- const se = {
3
- class: "fv-loading__ring",
4
- viewBox: "0 0 40 40",
5
- "aria-hidden": "true"
6
- }, ue = ["stroke-dasharray"], ce = {
7
- key: 0,
8
- class: "fv-loading__label"
9
- }, Y = 15.5, de = /* @__PURE__ */ X({
10
- name: "Loading",
11
- __name: "Loading",
12
- props: {
13
- label: { default: "Loading" },
14
- progress: { default: null },
15
- size: { default: "md" }
16
- },
17
- setup(t) {
18
- const b = t, a = 2 * Math.PI * 15.5, e = D(() => g(b.progress)), n = D(
19
- () => e.value == null ? `${a * 0.25} ${a}` : `${a * (e.value / 100)} ${a}`
20
- );
21
- function g(f) {
22
- return f == null || Number.isNaN(f) ? null : Math.min(100, Math.max(0, Math.round(f)));
23
- }
24
- return (f, A) => (w(), S("div", {
25
- class: $(["fv-loading", `fv-loading--${t.size}`]),
26
- role: "status",
27
- "aria-live": "polite"
28
- }, [
29
- (w(), S("svg", se, [
30
- C("circle", {
31
- class: "fv-loading__track",
32
- cx: "20",
33
- cy: "20",
34
- r: Y
35
- }),
36
- C("circle", {
37
- class: $(["fv-loading__arc", { "is-indeterminate": e.value == null }]),
38
- cx: "20",
39
- cy: "20",
40
- r: Y,
41
- "stroke-dasharray": n.value
42
- }, null, 10, ue)
43
- ])),
44
- t.label ? (w(), S("span", ce, [
45
- B(F(t.label), 1),
46
- e.value != null ? (w(), S(J, { key: 0 }, [
47
- B(" · " + F(e.value) + "%", 1)
48
- ], 64)) : k("", !0)
49
- ])) : k("", !0)
50
- ], 2));
51
- }
52
- }), fe = `
53
- attribute vec2 aPos;
54
- void main () { gl_Position = vec4(aPos, 0.0, 1.0); }
55
- `, he = `
56
- precision highp float;
57
- uniform vec2 uRes;
58
- uniform float uTime;
59
- uniform float uGather;
60
- uniform float uScatter;
61
- uniform float uDensity;
62
- uniform float uScale;
63
- uniform float uOpacity;
64
- uniform vec3 uTint;
65
-
66
- const mat2 M = mat2(1.6, 1.2, -1.2, 1.6);
67
-
68
- vec2 hash (vec2 p) {
69
- p = vec2(dot(p, vec2(127.1, 311.7)), dot(p, vec2(269.5, 183.3)));
70
- return -1.0 + 2.0 * fract(sin(p) * 43758.5453123);
71
- }
72
-
73
- float noise (vec2 p) {
74
- const float K1 = 0.366025404;
75
- const float K2 = 0.211324865;
76
- vec2 i = floor(p + (p.x + p.y) * K1);
77
- vec2 a = p - i + (i.x + i.y) * K2;
78
- vec2 o = (a.x > a.y) ? vec2(1.0, 0.0) : vec2(0.0, 1.0);
79
- vec2 b = a - o + K2;
80
- vec2 c = a - 1.0 + 2.0 * K2;
81
- vec3 h = max(0.5 - vec3(dot(a, a), dot(b, b), dot(c, c)), 0.0);
82
- vec3 n = h * h * h * h
83
- * vec3(dot(a, hash(i)), dot(b, hash(i + o)), dot(c, hash(i + 1.0)));
84
- return dot(n, vec3(70.0));
85
- }
86
-
87
- float fbm (vec2 p) {
88
- float total = 0.0;
89
- float amp = 0.5;
90
- for (int i = 0; i < 5; i++) {
91
- total += noise(p) * amp;
92
- p = M * p;
93
- amp *= 0.45;
94
- }
95
- return total;
96
- }
97
-
98
- void main () {
99
- float aspect = uRes.x / max(uRes.y, 1.0);
100
- vec2 p = vec2(gl_FragCoord.x / uRes.x * aspect, gl_FragCoord.y / uRes.y);
101
- vec2 fromC = p - vec2(aspect * 0.5, 0.5);
102
-
103
- // Gathering samples further out from the centre, so the shapes translate
104
- // inward from every edge; scattering pushes them back out and up, the way
105
- // wind lifts a cloud bank off the ground.
106
- vec2 q = p + fromC * (uGather * 1.7 - uScatter * 2.4) - vec2(0.0, uScatter * 1.3);
107
-
108
- float drift = 0.3 + uGather * 0.45 + uScatter * 1.2;
109
- float shape = fbm(q * uScale + vec2(uTime * drift, -uTime * drift * 0.35));
110
- float detail = fbm(q * uScale * 2.3 + shape * 1.4 + vec2(-uTime * drift * 0.6, uTime * 0.1));
111
-
112
- // The sky stays open while the clouds stream in — coverage follows a
113
- // quadratic ramp so the gather journey is visible before the fog closes.
114
- float ramp = uGather * uGather;
115
- float cov = detail * uDensity * 0.5 - 0.4 + ramp * 2.1 - uScatter * 1.8;
116
- float mist = smoothstep(0.35, 0.8, cov);
117
-
118
- // The flat fog term guarantees complete cover once the gather ends.
119
- float alpha = max(mist, smoothstep(0.55, 1.0, uGather)) * uOpacity;
120
- alpha *= 1.0 - smoothstep(0.05, 0.8, uScatter);
121
-
122
- float shade = fbm(q * uScale * 3.1 + detail);
123
- vec3 col = uTint * (0.9 + shade * 0.22);
124
- // A breath of blue-grey in the crevices while the sky is still open.
125
- col = mix(col, col * vec3(0.86, 0.9, 1.02), mist * (1.0 - uGather) * 0.45);
126
-
127
- // The canvas is composited as premultiplied alpha.
128
- gl_FragColor = vec4(col * alpha, alpha);
129
- }
130
- `, V = (t) => t < 0.5 ? 4 * t * t * t : 1 - Math.pow(-2 * t + 2, 3) / 2, me = (t) => t * t, pe = (t) => 1 - Math.pow(1 - t, 3);
131
- function Q() {
132
- return typeof window < "u" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
133
- }
134
- function Z(t, b) {
135
- t.clearRect(0, 0, 1, 1), t.fillStyle = b, t.fillRect(0, 0, 1, 1);
136
- const [a, e, n, g] = t.getImageData(0, 0, 1, 1).data;
137
- return g === 0 ? null : [a / 255, e / 255, n / 255];
138
- }
139
- function ge(t, b) {
140
- let a = t;
141
- for (; a; ) {
142
- const e = getComputedStyle(a).backgroundColor;
143
- if (e && e !== "transparent") {
144
- const n = Z(b, e);
145
- if (n) return n;
146
- }
147
- a = a.parentElement;
148
- }
149
- return [1, 1, 1];
150
- }
151
- function ve(t, b, a = {}) {
152
- const e = t.getContext("webgl", {
153
- alpha: !0,
154
- depth: !1,
155
- stencil: !1,
156
- antialias: !1,
157
- premultipliedAlpha: !0,
158
- // Cheap for a soft fog, and it keeps readPixels honest for tests and
159
- // debugging instead of racing the compositor's buffer clear.
160
- preserveDrawingBuffer: !0
161
- });
162
- if (!e || e.isContextLost()) return null;
163
- const n = {
164
- color: "auto",
165
- speed: 0.5,
166
- density: 2.2,
167
- scale: 1,
168
- opacity: 0.96,
169
- quality: 0.66,
170
- ...a
171
- }, g = document.createElement("canvas");
172
- g.width = g.height = 1;
173
- const f = g.getContext("2d", { willReadFrequently: !0 });
174
- if (!f) return null;
175
- function A(o, l) {
176
- const r = e.createShader(o);
177
- return e.shaderSource(r, l), e.compileShader(r), e.getShaderParameter(r, e.COMPILE_STATUS) ? r : (console.error("CloudLoading shader error:", e.getShaderInfoLog(r)), e.deleteShader(r), null);
178
- }
179
- const h = A(e.VERTEX_SHADER, fe), x = A(e.FRAGMENT_SHADER, he);
180
- if (!h || !x) return null;
181
- const d = e.createProgram();
182
- if (e.attachShader(d, h), e.attachShader(d, x), e.linkProgram(d), !e.getProgramParameter(d, e.LINK_STATUS))
183
- return console.error("CloudLoading program error:", e.getProgramInfoLog(d)), null;
184
- e.useProgram(d);
185
- const I = e.createBuffer();
186
- e.bindBuffer(e.ARRAY_BUFFER, I), e.bufferData(e.ARRAY_BUFFER, new Float32Array([-1, -1, 1, -1, -1, 1, 1, 1]), e.STATIC_DRAW);
187
- const u = e.getAttribLocation(d, "aPos");
188
- e.enableVertexAttribArray(u), e.vertexAttribPointer(u, 2, e.FLOAT, !1, 0, 0);
189
- const c = (o) => e.getUniformLocation(d, o), m = {
190
- res: c("uRes"),
191
- time: c("uTime"),
192
- gather: c("uGather"),
193
- scatter: c("uScatter"),
194
- density: c("uDensity"),
195
- scale: c("uScale"),
196
- opacity: c("uOpacity"),
197
- tint: c("uTint")
198
- };
199
- let v = 0, y = 0, T = [1, 1, 1], P = Math.random() * 64;
200
- function R() {
201
- T = n.color === "auto" ? ge(b, f) : Z(f, n.color) ?? [1, 1, 1];
202
- }
203
- function M() {
204
- const o = Math.min(window.devicePixelRatio || 1, 1.5), l = Math.min(Math.max(n.quality, 0.2), 1), r = Math.max(2, Math.round(t.clientWidth * o * l)), i = Math.max(2, Math.round(t.clientHeight * o * l));
205
- (t.width !== r || t.height !== i) && (t.width = r, t.height = i), e.viewport(0, 0, r, i);
206
- }
207
- R(), M();
208
- let s = [];
209
- function p(o, l, r, i = V, _) {
210
- const j = o === "gather" ? v : y;
211
- if (r <= 0 || j === l) {
212
- z(o, l), _?.();
213
- return;
214
- }
215
- s = s.filter((ee) => ee.param !== o), s.push({ param: o, from: j, to: l, start: performance.now(), duration: r, ease: i, done: _ });
216
- }
217
- function z(o, l) {
218
- o === "gather" ? v = l : y = l;
219
- }
220
- let q = 0, O = !1, G = !1;
221
- function U(o) {
222
- if (G) return;
223
- const l = Math.min((o - N) / 1e3, 1 / 20);
224
- if (N = o, P += l * n.speed * 0.12, s = s.filter((i) => {
225
- const _ = Math.min((o - i.start) / i.duration, 1);
226
- return z(i.param, i.from + (i.to - i.from) * i.ease(_)), _ >= 1 ? (i.done?.(), !1) : !0;
227
- }), e.uniform2f(m.res, t.width, t.height), e.uniform1f(m.time, P), e.uniform1f(m.gather, v), e.uniform1f(m.scatter, y), e.uniform1f(m.density, Math.max(n.density, 0)), e.uniform1f(m.scale, Math.max(n.scale, 0.05)), e.uniform1f(m.opacity, Math.min(Math.max(n.opacity, 0), 1)), e.uniform3f(m.tint, T[0], T[1], T[2]), e.drawArrays(e.TRIANGLE_STRIP, 0, 4), v <= 0 && y >= 1 && s.length === 0) {
228
- O = !1;
229
- return;
230
- }
231
- q = requestAnimationFrame(U);
232
- }
233
- let N = 0;
234
- function L() {
235
- G || O || (O = !0, N = performance.now(), q = requestAnimationFrame(U));
236
- }
237
- const K = new ResizeObserver(() => {
238
- M(), L();
239
- });
240
- return K.observe(t), {
241
- show(o = 1600) {
242
- R(), M();
243
- const l = () => L();
244
- return Q() ? (v = 1, y = 0, l(), Promise.resolve()) : new Promise((r) => {
245
- p("scatter", 0, Math.min(420, o * 0.4), pe), p("gather", 1, o, V, () => {
246
- l(), r();
247
- });
248
- });
249
- },
250
- hide(o = 1400) {
251
- const l = () => {
252
- v = 0, y = 1, L(), r();
253
- };
254
- let r = () => {
255
- };
256
- const i = new Promise((_) => {
257
- r = _;
258
- });
259
- return Q() ? (v = 0, y = 1, L(), r(), i) : (p("gather", 0, o, V), p("scatter", 1, o * 0.78, me, l), i);
260
- },
261
- snap(o) {
262
- v = o === "shown" ? 1 : 0, y = o === "shown" ? 0 : 1, s = [], L();
263
- },
264
- setOptions(o) {
265
- Object.assign(n, o), R(), M(), L();
266
- },
267
- destroy() {
268
- G = !0, cancelAnimationFrame(q), K.disconnect(), e.getExtension("WEBGL_lose_context")?.loseContext();
269
- }
270
- };
271
- }
272
- const ye = ["aria-busy", "data-fullscreen"], we = {
273
- key: 0,
274
- class: "fv-cloud-fallback",
275
- "aria-hidden": "true"
276
- }, be = { class: "fv-cloud-body" }, Se = {
277
- key: 0,
278
- class: "fv-cloud-spinner",
279
- "aria-hidden": "true"
280
- }, Te = {
281
- key: 1,
282
- class: "fv-cloud-label"
283
- }, Me = /* @__PURE__ */ X({
284
- name: "CloudLoading",
285
- __name: "CloudLoading",
286
- props: /* @__PURE__ */ W({
287
- modelValue: { type: Boolean, default: !0 },
288
- label: { default: "Loading" },
289
- progress: { default: null },
290
- showSpinner: { type: Boolean, default: !0 },
291
- fullscreen: { type: Boolean, default: !0 },
292
- zIndex: { default: 2e3 },
293
- lockScroll: { type: Boolean, default: !0 },
294
- gatherDuration: { default: 1600 },
295
- dissipateDuration: { default: 1400 },
296
- speed: { default: 0.5 },
297
- density: { default: 2.2 },
298
- scale: { default: 1 },
299
- opacity: { default: 0.96 },
300
- quality: { default: 0.66 },
301
- color: { default: "auto" },
302
- respectReducedMotion: { type: Boolean, default: !0 }
303
- }, {
304
- modelValue: { type: Boolean, default: !0 },
305
- modelModifiers: {}
306
- }),
307
- emits: /* @__PURE__ */ W(["shown", "dissipated"], ["update:modelValue"]),
308
- setup(t, { emit: b }) {
309
- const a = t, e = b, n = te(t, "modelValue"), g = E(null), f = E(null), A = E(!0), h = E("idle"), x = E(!1), d = D(() => a.progress == null || Number.isNaN(a.progress) ? null : Math.min(100, Math.max(0, Math.round(a.progress)))), I = D(() => ({ zIndex: a.zIndex }));
310
- let u = null, c = 0;
311
- function m() {
312
- return a.respectReducedMotion && typeof window < "u" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
313
- }
314
- async function v() {
315
- await ie();
316
- const s = f.value;
317
- if (!(!s || u)) {
318
- try {
319
- u = ve(s, g.value, {
320
- color: a.color,
321
- speed: a.speed,
322
- density: a.density,
323
- scale: a.scale,
324
- opacity: a.opacity,
325
- quality: a.quality
326
- });
327
- } catch {
328
- u = null;
329
- }
330
- A.value = u !== null;
331
- }
332
- }
333
- function y() {
334
- x.value = !0, v().then(() => {
335
- if (n.value) {
336
- if (h.value = "gathering", !u) {
337
- T = window.setTimeout(() => {
338
- h.value = "holding", e("shown");
339
- }, m() ? 0 : a.gatherDuration);
340
- return;
341
- }
342
- u.show(a.gatherDuration).then(() => {
343
- n.value && (h.value = "holding", e("shown"));
344
- });
345
- }
346
- });
347
- }
348
- let T = 0;
349
- function P() {
350
- if (h.value = "dissipating", window.clearTimeout(T), !u) {
351
- window.setTimeout(() => R(), m() ? 0 : a.dissipateDuration);
352
- return;
353
- }
354
- u.hide(a.dissipateDuration).then(R), c = window.setTimeout(R, a.dissipateDuration + 600);
355
- }
356
- function R() {
357
- window.clearTimeout(c), !n.value && h.value === "dissipating" && (h.value = "idle", x.value = !1, e("dissipated"), u?.destroy(), u = null);
358
- }
359
- H(n, (s) => {
360
- s ? (window.clearTimeout(c), y()) : x.value && P();
361
- }, { flush: "post", immediate: !0 });
362
- let M = "";
363
- return H(n, (s) => {
364
- if (!a.lockScroll || typeof document > "u") return;
365
- const p = document.documentElement;
366
- s ? (M = p.style.overflow, p.style.overflow = "hidden") : p.style.overflow = M;
367
- }), ae(() => {
368
- window.clearTimeout(T), window.clearTimeout(c), a.lockScroll && typeof document < "u" && (document.documentElement.style.overflow = M), u?.destroy(), u = null;
369
- }), (s, p) => (w(), oe(ne, {
370
- to: "body",
371
- disabled: !t.fullscreen
372
- }, [
373
- x.value ? (w(), S("div", {
374
- key: 0,
375
- ref_key: "overlayRef",
376
- ref: g,
377
- class: $(["fv-cloud-loading", `is-${h.value}`]),
378
- style: re(I.value),
379
- role: "status",
380
- "aria-live": "polite",
381
- "aria-busy": n.value,
382
- "data-fullscreen": t.fullscreen || void 0
383
- }, [
384
- C("canvas", {
385
- ref_key: "canvasRef",
386
- ref: f,
387
- class: "fv-cloud-canvas",
388
- "aria-hidden": "true"
389
- }, null, 512),
390
- A.value ? k("", !0) : (w(), S("div", we, [...p[0] || (p[0] = [
391
- C("i", null, null, -1),
392
- C("i", null, null, -1),
393
- C("i", null, null, -1)
394
- ])])),
395
- C("div", be, [
396
- le(s.$slots, "default", {
397
- phase: h.value,
398
- progress: d.value
399
- }, () => [
400
- t.showSpinner ? (w(), S("span", Se)) : k("", !0),
401
- t.label ? (w(), S("span", Te, [
402
- B(F(t.label), 1),
403
- d.value != null ? (w(), S(J, { key: 0 }, [
404
- B(" · " + F(d.value) + "%", 1)
405
- ], 64)) : k("", !0)
406
- ])) : k("", !0)
407
- ])
408
- ])
409
- ], 14, ye)) : k("", !0)
410
- ], 8, ["disabled"]));
411
- }
412
- }), xe = de, Re = Me, Ce = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
413
- __proto__: null,
414
- CloudLoading: Re,
415
- Loading: xe
416
- }, Symbol.toStringTag, { value: "Module" }));
417
- export {
418
- Re as C,
419
- xe as L,
420
- Ce as i
421
- };
422
- //# sourceMappingURL=index-BmMsid7x.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index-BmMsid7x.js","sources":["../src/blocks/loading/Loading.vue","../src/blocks/loading/engine.ts","../src/blocks/loading/CloudLoading.vue","../src/blocks/loading/index.ts"],"sourcesContent":["<script setup lang=\"ts\">\n/* ══ Loading — the plain spinner component ═══════════════════════════════\n *\n * An SVG ring for inline, determinate or indeterminate loading. It sizes\n * through `sm`/`md`/`lg`, shows a label and an optional percentage, and\n * sits still under `prefers-reduced-motion` (the arc stops spinning, the\n * label carries the state).\n */\nimport { computed } from 'vue'\nimport type { LoadingProps } from './types'\n\ndefineOptions({ name: 'Loading' })\n\nconst props = withDefaults(defineProps<LoadingProps>(), {\n label: 'Loading',\n progress: null,\n size: 'md',\n})\n\nconst RADIUS = 15.5\nconst CIRCUMFERENCE = 2 * Math.PI * 15.5\n\nconst percent = computed(() => clampProgress(props.progress))\nconst dash = computed(() =>\n percent.value == null\n ? `${CIRCUMFERENCE * 0.25} ${CIRCUMFERENCE}`\n : `${CIRCUMFERENCE * (percent.value / 100)} ${CIRCUMFERENCE}`,\n)\n\nfunction clampProgress(value: number | null | undefined): number | null {\n if (value == null || Number.isNaN(value)) return null\n return Math.min(100, Math.max(0, Math.round(value)))\n}\n</script>\n\n<template>\n <div class=\"fv-loading\" :class=\"`fv-loading--${size}`\" role=\"status\" aria-live=\"polite\">\n <svg class=\"fv-loading__ring\" viewBox=\"0 0 40 40\" aria-hidden=\"true\">\n <circle class=\"fv-loading__track\" cx=\"20\" cy=\"20\" :r=\"RADIUS\" />\n <circle\n class=\"fv-loading__arc\"\n cx=\"20\" cy=\"20\" :r=\"RADIUS\"\n :stroke-dasharray=\"dash\"\n :class=\"{ 'is-indeterminate': percent == null }\"\n />\n </svg>\n <span v-if=\"label\" class=\"fv-loading__label\">\n {{ label }}<template v-if=\"percent != null\"> · {{ percent }}%</template>\n </span>\n </div>\n</template>\n\n<style>\n.fv-loading {\n display: inline-flex;\n align-items: center;\n gap: 10px;\n color: inherit;\n}\n.fv-loading__ring {\n width: 28px;\n height: 28px;\n flex: none;\n}\n.fv-loading--sm .fv-loading__ring { width: 18px; height: 18px; }\n.fv-loading--lg .fv-loading__ring { width: 44px; height: 44px; }\n.fv-loading__track {\n fill: none;\n stroke: color-mix(in srgb, currentColor 18%, transparent);\n stroke-width: 3;\n}\n.fv-loading__arc {\n fill: none;\n stroke: currentColor;\n stroke-width: 3;\n stroke-linecap: round;\n transform: rotate(-90deg);\n transform-origin: 50% 50%;\n}\n.fv-loading__arc.is-indeterminate {\n animation: fv-loading-spin 1.1s linear infinite;\n}\n@keyframes fv-loading-spin {\n to { transform: rotate(270deg); }\n}\n.fv-loading__label {\n font: 500 12px/1.4 var(--fv-font-ui, system-ui);\n color: inherit;\n white-space: nowrap;\n}\n@media (prefers-reduced-motion: reduce) {\n .fv-loading__arc.is-indeterminate { animation: none; }\n}\n</style>\n","/** Cloud Loading — a full-screen fog of procedural clouds that gathers\n * over the page while it loads and blows away when it is done.\n *\n * One fragment shader builds a fractal-noise cloud field and the component\n * drives it through two phases. Gathering warps the sample coordinates\n * outward, so every cloud shape streams in from the edges toward the\n * centre while the coverage threshold climbs — when it ends the screen is\n * completely fogged. Dissipating runs the field in reverse with an upward\n * wind bias and a fading alpha, so the fog evaporates off the page instead\n * of rewinding.\n *\n * The engine owns its own requestAnimationFrame loop and pauses itself\n * once the fog has fully gone; while the screen is covered the clouds keep\n * drifting so the pause never looks frozen.\n */\n\nexport interface CloudEngineOptions {\n /** Cloud tint as any CSS color, or `'auto'` to resolve the page\n * background so the fog melts into it. Default `'auto'`. */\n color?: 'auto' | string\n /** Drift speed multiplier (0 to 5). Default `0.5`. */\n speed?: number\n /** How sharply cloud shapes condense out of the noise field (0 to 16).\n * Default `2.2`. */\n density?: number\n /** Cloud pattern scale (0.3 to 3). Lower values make bigger clouds.\n * Default `1`. */\n scale?: number\n /** Peak opacity of the fog once the screen is covered (0 to 1).\n * Default `0.96`. */\n opacity?: number\n /** Render resolution as a fraction of the overlay's CSS size (0.2 to 1).\n * Clouds are soft, so lower values look nearly identical. Default `0.66`. */\n quality?: number\n}\n\nexport interface CloudEngine {\n /** Stream the clouds in from every edge until the screen is fully fogged. */\n show(duration?: number): Promise<void>\n /** Evaporate the fog off the page. Resolves when the last cloud is gone. */\n hide(duration?: number): Promise<void>\n /** Jump straight to a state with no animation (reduced motion). */\n snap(state: 'shown' | 'hidden'): void\n /** Update tuning without rebuilding the pipeline. */\n setOptions(options: CloudEngineOptions): void\n destroy(): void\n}\n\nconst VERT = `\nattribute vec2 aPos;\nvoid main () { gl_Position = vec4(aPos, 0.0, 1.0); }\n`\n\nconst FRAG = `\nprecision highp float;\nuniform vec2 uRes;\nuniform float uTime;\nuniform float uGather;\nuniform float uScatter;\nuniform float uDensity;\nuniform float uScale;\nuniform float uOpacity;\nuniform vec3 uTint;\n\nconst mat2 M = mat2(1.6, 1.2, -1.2, 1.6);\n\nvec2 hash (vec2 p) {\n p = vec2(dot(p, vec2(127.1, 311.7)), dot(p, vec2(269.5, 183.3)));\n return -1.0 + 2.0 * fract(sin(p) * 43758.5453123);\n}\n\nfloat noise (vec2 p) {\n const float K1 = 0.366025404;\n const float K2 = 0.211324865;\n vec2 i = floor(p + (p.x + p.y) * K1);\n vec2 a = p - i + (i.x + i.y) * K2;\n vec2 o = (a.x > a.y) ? vec2(1.0, 0.0) : vec2(0.0, 1.0);\n vec2 b = a - o + K2;\n vec2 c = a - 1.0 + 2.0 * K2;\n vec3 h = max(0.5 - vec3(dot(a, a), dot(b, b), dot(c, c)), 0.0);\n vec3 n = h * h * h * h\n * vec3(dot(a, hash(i)), dot(b, hash(i + o)), dot(c, hash(i + 1.0)));\n return dot(n, vec3(70.0));\n}\n\nfloat fbm (vec2 p) {\n float total = 0.0;\n float amp = 0.5;\n for (int i = 0; i < 5; i++) {\n total += noise(p) * amp;\n p = M * p;\n amp *= 0.45;\n }\n return total;\n}\n\nvoid main () {\n float aspect = uRes.x / max(uRes.y, 1.0);\n vec2 p = vec2(gl_FragCoord.x / uRes.x * aspect, gl_FragCoord.y / uRes.y);\n vec2 fromC = p - vec2(aspect * 0.5, 0.5);\n\n // Gathering samples further out from the centre, so the shapes translate\n // inward from every edge; scattering pushes them back out and up, the way\n // wind lifts a cloud bank off the ground.\n vec2 q = p + fromC * (uGather * 1.7 - uScatter * 2.4) - vec2(0.0, uScatter * 1.3);\n\n float drift = 0.3 + uGather * 0.45 + uScatter * 1.2;\n float shape = fbm(q * uScale + vec2(uTime * drift, -uTime * drift * 0.35));\n float detail = fbm(q * uScale * 2.3 + shape * 1.4 + vec2(-uTime * drift * 0.6, uTime * 0.1));\n\n // The sky stays open while the clouds stream in — coverage follows a\n // quadratic ramp so the gather journey is visible before the fog closes.\n float ramp = uGather * uGather;\n float cov = detail * uDensity * 0.5 - 0.4 + ramp * 2.1 - uScatter * 1.8;\n float mist = smoothstep(0.35, 0.8, cov);\n\n // The flat fog term guarantees complete cover once the gather ends.\n float alpha = max(mist, smoothstep(0.55, 1.0, uGather)) * uOpacity;\n alpha *= 1.0 - smoothstep(0.05, 0.8, uScatter);\n\n float shade = fbm(q * uScale * 3.1 + detail);\n vec3 col = uTint * (0.9 + shade * 0.22);\n // A breath of blue-grey in the crevices while the sky is still open.\n col = mix(col, col * vec3(0.86, 0.9, 1.02), mist * (1.0 - uGather) * 0.45);\n\n // The canvas is composited as premultiplied alpha.\n gl_FragColor = vec4(col * alpha, alpha);\n}\n`\n\ninterface Tween {\n param: 'gather' | 'scatter'\n from: number\n to: number\n start: number\n duration: number\n ease: (t: number) => number\n done?: () => void\n}\n\nconst easeInOutCubic = (t: number) => (t < 0.5 ? 4 * t * t * t : 1 - Math.pow(-2 * t + 2, 3) / 2)\nconst easeInQuad = (t: number) => t * t\nconst easeOutCubic = (t: number) => 1 - Math.pow(1 - t, 3)\n\nfunction prefersReducedMotion(): boolean {\n return typeof window !== 'undefined'\n && window.matchMedia('(prefers-reduced-motion: reduce)').matches\n}\n\nfunction parseCssColor(probe: CanvasRenderingContext2D, input: string): [number, number, number] | null {\n probe.clearRect(0, 0, 1, 1)\n probe.fillStyle = input\n probe.fillRect(0, 0, 1, 1)\n const [r, g, b, a] = probe.getImageData(0, 0, 1, 1).data\n if (a === 0) return null\n return [r / 255, g / 255, b / 255]\n}\n\n/** Resolve `'auto'` to the nearest opaque background colour above `el`, so\n * the fog melts into whatever surface the overlay sits on. */\nfunction resolveAutoColor(el: Element | null, probe: CanvasRenderingContext2D): [number, number, number] {\n let node: Element | null = el\n while (node) {\n const bg = getComputedStyle(node).backgroundColor\n if (bg && bg !== 'transparent') {\n const rgb = parseCssColor(probe, bg)\n if (rgb) return rgb\n }\n node = node.parentElement\n }\n return [1, 1, 1]\n}\n\nexport function createCloudEngine(\n canvas: HTMLCanvasElement,\n host: Element | null,\n options: CloudEngineOptions = {},\n): CloudEngine | null {\n const gl = canvas.getContext('webgl', {\n alpha: true,\n depth: false,\n stencil: false,\n antialias: false,\n premultipliedAlpha: true,\n // Cheap for a soft fog, and it keeps readPixels honest for tests and\n // debugging instead of racing the compositor's buffer clear.\n preserveDrawingBuffer: true,\n })\n if (!gl || gl.isContextLost()) return null\n\n const config = {\n color: 'auto' as 'auto' | string,\n speed: 0.5,\n density: 2.2,\n scale: 1,\n opacity: 0.96,\n quality: 0.66,\n ...options,\n }\n\n const probeCanvas = document.createElement('canvas')\n probeCanvas.width = probeCanvas.height = 1\n const probe = probeCanvas.getContext('2d', { willReadFrequently: true })\n if (!probe) return null\n\n function compile(type: number, source: string): WebGLShader | null {\n const shader = gl!.createShader(type)!\n gl!.shaderSource(shader, source)\n gl!.compileShader(shader)\n if (!gl!.getShaderParameter(shader, gl!.COMPILE_STATUS)) {\n console.error('CloudLoading shader error:', gl!.getShaderInfoLog(shader))\n gl!.deleteShader(shader)\n return null\n }\n return shader\n }\n\n const vs = compile(gl.VERTEX_SHADER, VERT)\n const fs = compile(gl.FRAGMENT_SHADER, FRAG)\n if (!vs || !fs) return null\n const program = gl.createProgram()!\n gl.attachShader(program, vs)\n gl.attachShader(program, fs)\n gl.linkProgram(program)\n if (!gl.getProgramParameter(program, gl.LINK_STATUS)) {\n console.error('CloudLoading program error:', gl.getProgramInfoLog(program))\n return null\n }\n gl.useProgram(program)\n\n const quad = gl.createBuffer()\n gl.bindBuffer(gl.ARRAY_BUFFER, quad)\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([-1, -1, 1, -1, -1, 1, 1, 1]), gl.STATIC_DRAW)\n const aPos = gl.getAttribLocation(program, 'aPos')\n gl.enableVertexAttribArray(aPos)\n gl.vertexAttribPointer(aPos, 2, gl.FLOAT, false, 0, 0)\n\n const u = (name: string) => gl!.getUniformLocation(program, name)\n const uniforms = {\n res: u('uRes'),\n time: u('uTime'),\n gather: u('uGather'),\n scatter: u('uScatter'),\n density: u('uDensity'),\n scale: u('uScale'),\n opacity: u('uOpacity'),\n tint: u('uTint'),\n }\n\n let gather = 0\n let scatter = 0\n let tint: [number, number, number] = [1, 1, 1]\n let time = Math.random() * 64\n\n function syncTint() {\n tint = config.color === 'auto'\n ? resolveAutoColor(host, probe!)\n : parseCssColor(probe!, config.color) ?? [1, 1, 1]\n }\n\n function syncSize() {\n const dpr = Math.min(window.devicePixelRatio || 1, 1.5)\n const quality = Math.min(Math.max(config.quality, 0.2), 1)\n const width = Math.max(2, Math.round(canvas.clientWidth * dpr * quality))\n const height = Math.max(2, Math.round(canvas.clientHeight * dpr * quality))\n if (canvas.width !== width || canvas.height !== height) {\n canvas.width = width\n canvas.height = height\n }\n gl!.viewport(0, 0, width, height)\n }\n\n syncTint()\n syncSize()\n\n let tweens: Tween[] = []\n function tween(param: 'gather' | 'scatter', to: number, duration: number, ease = easeInOutCubic, done?: () => void) {\n const from = param === 'gather' ? gather : scatter\n if (duration <= 0 || from === to) {\n applyParam(param, to)\n done?.()\n return\n }\n tweens = tweens.filter((t) => t.param !== param)\n tweens.push({ param, from, to, start: performance.now(), duration, ease, done })\n }\n\n function applyParam(param: 'gather' | 'scatter', value: number) {\n if (param === 'gather') gather = value\n else scatter = value\n }\n\n let raf = 0\n let running = false\n let destroyed = false\n\n function frame(now: number) {\n if (destroyed) return\n const delta = Math.min((now - lastTick) / 1000, 1 / 20)\n lastTick = now\n time += delta * config.speed * 0.12\n\n const still = tweens.filter((t) => {\n const raw = Math.min((now - t.start) / t.duration, 1)\n applyParam(t.param, t.from + (t.to - t.from) * t.ease(raw))\n if (raw >= 1) {\n t.done?.()\n return false\n }\n return true\n })\n tweens = still\n\n gl!.uniform2f(uniforms.res, canvas.width, canvas.height)\n gl!.uniform1f(uniforms.time, time)\n gl!.uniform1f(uniforms.gather, gather)\n gl!.uniform1f(uniforms.scatter, scatter)\n gl!.uniform1f(uniforms.density, Math.max(config.density, 0))\n gl!.uniform1f(uniforms.scale, Math.max(config.scale, 0.05))\n gl!.uniform1f(uniforms.opacity, Math.min(Math.max(config.opacity, 0), 1))\n gl!.uniform3f(uniforms.tint, tint[0], tint[1], tint[2])\n gl!.drawArrays(gl!.TRIANGLE_STRIP, 0, 4)\n\n // Fully hidden and nothing left to animate — stop drawing until the\n // next show(); a covered screen keeps drifting so the pause reads as\n // weather, not a freeze-frame.\n if (gather <= 0 && scatter >= 1 && tweens.length === 0) {\n running = false\n return\n }\n raf = requestAnimationFrame(frame)\n }\n\n let lastTick = 0\n function startLoop() {\n if (destroyed || running) return\n running = true\n lastTick = performance.now()\n raf = requestAnimationFrame(frame)\n }\n\n const observer = new ResizeObserver(() => {\n syncSize()\n startLoop()\n })\n observer.observe(canvas)\n\n return {\n show(duration = 1600) {\n syncTint()\n syncSize()\n const finish = () => startLoop()\n if (prefersReducedMotion()) {\n gather = 1\n scatter = 0\n finish()\n return Promise.resolve()\n }\n return new Promise<void>((resolve) => {\n tween('scatter', 0, Math.min(420, duration * 0.4), easeOutCubic)\n tween('gather', 1, duration, easeInOutCubic, () => {\n finish()\n resolve()\n })\n })\n },\n hide(duration = 1400) {\n const finish = () => {\n gather = 0\n scatter = 1\n startLoop()\n resolve()\n }\n let resolve = () => {}\n const promise = new Promise<void>((r) => { resolve = r })\n if (prefersReducedMotion()) {\n gather = 0\n scatter = 1\n startLoop()\n resolve()\n return promise\n }\n tween('gather', 0, duration, easeInOutCubic)\n tween('scatter', 1, duration * 0.78, easeInQuad, finish)\n return promise\n },\n snap(state) {\n gather = state === 'shown' ? 1 : 0\n scatter = state === 'shown' ? 0 : 1\n tweens = []\n startLoop()\n },\n setOptions(next) {\n Object.assign(config, next)\n syncTint()\n syncSize()\n startLoop()\n },\n destroy() {\n destroyed = true\n cancelAnimationFrame(raf)\n observer.disconnect()\n gl!.getExtension('WEBGL_lose_context')?.loseContext()\n },\n }\n}\n","<script setup lang=\"ts\">\n/* ══ CloudLoading — a full-screen loading overlay of gathering clouds ════\n *\n * Bind it with v-model and run your work while the sky closes over the\n * page: clouds stream in from every edge until the screen is completely\n * fogged, the label and spinner surface once it is, and when the model\n * flips back the fog evaporates off the page before the overlay unmounts.\n *\n * ── WHY THE OVERLAY OUTLIVES THE MODEL ──────────────────────────────────\n * `overlayVisible` (what is in the DOM) is not `modelValue` (what is\n * loading). Setting the model false starts the dissipate animation; only\n * when the engine reports the sky clear does the overlay unmount and\n * `dissipated` fire, so the reveal is never cut short.\n *\n * ── NO WEBGL, REDUCED MOTION ────────────────────────────────────────────\n * Without a WebGL context a CSS fog (three drifting blurred blobs over a\n * gradient) takes over, timed with the same durations. Reduced motion\n * snaps: instant cover, instant reveal, no drift.\n */\nimport { computed, nextTick, onBeforeUnmount, ref, watch } from 'vue'\nimport { createCloudEngine, type CloudEngine } from './engine'\nimport type { CloudLoadingPhase, CloudLoadingProps, CloudLoadingSlotProps } from './types'\n\ndefineOptions({ name: 'CloudLoading' })\n\nconst props = withDefaults(defineProps<CloudLoadingProps>(), {\n modelValue: true,\n label: 'Loading',\n progress: null,\n showSpinner: true,\n fullscreen: true,\n zIndex: 2000,\n lockScroll: true,\n gatherDuration: 1600,\n dissipateDuration: 1400,\n speed: 0.5,\n density: 2.2,\n scale: 1,\n opacity: 0.96,\n quality: 0.66,\n color: 'auto',\n respectReducedMotion: true,\n})\n\nconst emit = defineEmits<{\n /** The screen is now completely covered. */\n shown: []\n /** The last cloud is gone and the overlay has left the DOM. */\n dissipated: []\n}>()\n\ndefineSlots<{\n /** Replace the spinner + label with your own loading content. */\n default?: (props: CloudLoadingSlotProps) => unknown\n}>()\n\nconst loading = defineModel<boolean>('modelValue', { default: true })\n\nconst overlayRef = ref<HTMLElement | null>(null)\nconst canvasRef = ref<HTMLCanvasElement | null>(null)\nconst webglOk = ref(true)\nconst phase = ref<CloudLoadingPhase>('idle')\nconst overlayVisible = ref(false)\n\nconst percent = computed(() => {\n if (props.progress == null || Number.isNaN(props.progress)) return null\n return Math.min(100, Math.max(0, Math.round(props.progress)))\n})\n\nconst overlayStyle = computed(() => ({ zIndex: props.zIndex }))\n\nlet engine: CloudEngine | null = null\n\n/** Belt and braces: if the engine's hide() never resolves (a lost context\n * between the flip and the reveal), unmount anyway. */\nlet safetyTimer = 0\n\nfunction reducedMotion(): boolean {\n return props.respectReducedMotion\n && typeof window !== 'undefined'\n && window.matchMedia('(prefers-reduced-motion: reduce)').matches\n}\n\nasync function initEngine() {\n await nextTick()\n const canvas = canvasRef.value\n if (!canvas || engine) return\n try {\n engine = createCloudEngine(canvas, overlayRef.value, {\n color: props.color,\n speed: props.speed,\n density: props.density,\n scale: props.scale,\n opacity: props.opacity,\n quality: props.quality,\n })\n } catch {\n engine = null\n }\n webglOk.value = engine !== null\n}\n\nfunction startLoading() {\n overlayVisible.value = true\n initEngine().then(() => {\n if (!loading.value) return // model already flipped back mid-init\n phase.value = 'gathering'\n if (!engine) {\n // CSS fallback: the fog div's transition does the timing.\n shownTimer = window.setTimeout(() => {\n phase.value = 'holding'\n emit('shown')\n }, reducedMotion() ? 0 : props.gatherDuration)\n return\n }\n engine.show(props.gatherDuration).then(() => {\n if (!loading.value) return\n phase.value = 'holding'\n emit('shown')\n })\n })\n}\n\nlet shownTimer = 0\n\nfunction stopLoading() {\n phase.value = 'dissipating'\n window.clearTimeout(shownTimer)\n if (!engine) {\n // CSS fallback fade.\n window.setTimeout(() => finishDissipate(), reducedMotion() ? 0 : props.dissipateDuration)\n return\n }\n engine.hide(props.dissipateDuration).then(finishDissipate)\n // If the context dies mid-dissipate, still leave on time.\n safetyTimer = window.setTimeout(finishDissipate, props.dissipateDuration + 600)\n}\n\nfunction finishDissipate() {\n window.clearTimeout(safetyTimer)\n if (loading.value) return // model flipped true again mid-dissipate\n if (phase.value !== 'dissipating') return // safety timer raced the engine\n phase.value = 'idle'\n overlayVisible.value = false\n emit('dissipated')\n // The canvas leaves the DOM with the overlay, so the engine dies with it\n // and the next gather builds a fresh one.\n engine?.destroy()\n engine = null\n}\n\nwatch(loading, (on) => {\n if (on) {\n window.clearTimeout(safetyTimer)\n startLoading()\n } else if (overlayVisible.value) {\n stopLoading()\n }\n}, { flush: 'post', immediate: true })\n\n/* ── Scroll lock ─────────────────────────────────────────────────────────\n * The overlay covers the page, so scrolling behind it is noise. Saved and\n * restored rather than assumed, in case the page itself had locked it. */\nlet savedOverflow = ''\nwatch(loading, (on) => {\n if (!props.lockScroll || typeof document === 'undefined') return\n const root = document.documentElement\n if (on) {\n savedOverflow = root.style.overflow\n root.style.overflow = 'hidden'\n } else {\n root.style.overflow = savedOverflow\n }\n})\n\nonBeforeUnmount(() => {\n window.clearTimeout(shownTimer)\n window.clearTimeout(safetyTimer)\n if (props.lockScroll && typeof document !== 'undefined') {\n document.documentElement.style.overflow = savedOverflow\n }\n engine?.destroy()\n engine = null\n})\n</script>\n\n<template>\n <Teleport to=\"body\" :disabled=\"!fullscreen\">\n <div\n v-if=\"overlayVisible\"\n ref=\"overlayRef\"\n class=\"fv-cloud-loading\"\n :class=\"`is-${phase}`\"\n :style=\"overlayStyle\"\n role=\"status\"\n aria-live=\"polite\"\n :aria-busy=\"loading\"\n :data-fullscreen=\"fullscreen || undefined\"\n >\n <canvas ref=\"canvasRef\" class=\"fv-cloud-canvas\" aria-hidden=\"true\"></canvas>\n <div v-if=\"!webglOk\" class=\"fv-cloud-fallback\" aria-hidden=\"true\">\n <i></i><i></i><i></i>\n </div>\n <div class=\"fv-cloud-body\">\n <slot :phase=\"phase\" :progress=\"percent\">\n <span v-if=\"showSpinner\" class=\"fv-cloud-spinner\" aria-hidden=\"true\"></span>\n <span v-if=\"label\" class=\"fv-cloud-label\">\n {{ label }}<template v-if=\"percent != null\"> · {{ percent }}%</template>\n </span>\n </slot>\n </div>\n </div>\n </Teleport>\n</template>\n\n<style>\n.fv-cloud-loading {\n position: fixed;\n inset: 0;\n /* Beats positioned page chrome (sticky headers et al.) without a fight. */\n z-index: 2000;\n display: grid;\n place-items: center;\n overflow: hidden;\n /* The fog is page-background tinted; the ink above it should be the\n * page's own ink. `var(--fv-cloud-ink, …)` lets a page pick its own. */\n color: var(--fv-cloud-ink, var(--color, var(--ink, #1c1e24)));\n font: 500 13px/1.4 var(--fv-font-ui, system-ui);\n pointer-events: auto;\n}\n.fv-cloud-loading[data-fullscreen] { position: fixed; }\n.fv-cloud-loading:not([data-fullscreen]) { position: absolute; }\n.fv-cloud-canvas,\n.fv-cloud-fallback {\n position: absolute;\n inset: 0;\n width: 100%;\n height: 100%;\n pointer-events: none;\n}\n.fv-cloud-fallback {\n background: linear-gradient(color-mix(in srgb, var(--fv-cloud-tint, #ffffff) 86%, #9fb4d8), var(--fv-cloud-tint, #ffffff));\n opacity: 0;\n transition: opacity 600ms ease;\n}\n.fv-cloud-fallback i {\n position: absolute;\n border-radius: 50%;\n background: radial-gradient(closest-side, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0));\n filter: blur(18px);\n animation: fv-cloud-drift 9s ease-in-out infinite alternate;\n}\n.fv-cloud-fallback i:nth-child(1) { width: 60%; height: 44%; left: -12%; top: 8%; animation-delay: -2s; }\n.fv-cloud-fallback i:nth-child(2) { width: 55%; height: 40%; right: -10%; top: 30%; animation-delay: -5s; }\n.fv-cloud-fallback i:nth-child(3) { width: 65%; height: 46%; left: 4%; bottom: -8%; animation-delay: -8s; }\n.fv-cloud-loading.is-gathering .fv-cloud-fallback,\n.fv-cloud-loading.is-holding .fv-cloud-fallback { opacity: 1; transition: opacity 900ms ease; }\n.fv-cloud-loading.is-dissipating .fv-cloud-fallback {\n opacity: 0;\n transition: opacity 1100ms ease;\n transform: translateY(-6%);\n transition-property: opacity, transform;\n}\n@keyframes fv-cloud-drift {\n from { transform: translate3d(-4%, 2%, 0) scale(1); }\n to { transform: translate3d(6%, -3%, 0) scale(1.15); }\n}\n\n.fv-cloud-body {\n position: relative;\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 14px;\n padding: 24px;\n opacity: 0;\n transform: translateY(6px);\n transition: opacity 480ms ease, transform 480ms ease;\n pointer-events: none;\n}\n.fv-cloud-loading.is-holding .fv-cloud-body { opacity: 1; transform: none; }\n\n.fv-cloud-spinner {\n width: 30px;\n height: 30px;\n border-radius: 50%;\n border: 2.5px solid color-mix(in srgb, currentColor 20%, transparent);\n border-top-color: currentColor;\n animation: fv-cloud-spin 0.9s linear infinite;\n}\n@keyframes fv-cloud-spin {\n to { transform: rotate(360deg); }\n}\n.fv-cloud-label {\n letter-spacing: 0.02em;\n color: color-mix(in srgb, currentColor 78%, transparent);\n}\n@media (prefers-reduced-motion: reduce) {\n .fv-cloud-spinner { animation: none; }\n .fv-cloud-fallback i { animation: none; }\n .fv-cloud-body,\n .fv-cloud-fallback { transition-duration: 1ms; }\n}\n</style>\n","import LoadingRoot from './Loading.vue'\nimport CloudLoadingRoot from './CloudLoading.vue'\n\n/** The plain spinner: an SVG ring, indeterminate or driven by `progress`,\n * with a label and `sm`/`md`/`lg` sizes.\n *\n * ```\n * <Loading size=\"lg\" :progress=\"62\" label=\"Uploading\" />\n * ```\n */\nexport const Loading = LoadingRoot\n\n/** A full-screen loading overlay of procedural clouds. The clouds gather\n * from every edge until the screen is completely fogged while `v-model`\n * is true, hold while the work runs, and evaporate off the page when it\n * ends — the overlay only leaves the DOM after the last cloud is gone.\n *\n * ```\n * <CloudLoading v-model=\"busy\" label=\"Loading workspace\" />\n * ```\n */\nexport const CloudLoading = CloudLoadingRoot\n\nexport type {\n CloudLoadingPhase,\n CloudLoadingProps,\n CloudLoadingSlotProps,\n LoadingProps,\n LoadingSize,\n} from './types'\nexport type { CloudEngine, CloudEngineOptions } from './engine'\n"],"names":["RADIUS","props","__props","CIRCUMFERENCE","percent","computed","clampProgress","dash","value","_createElementBlock","_normalizeClass","_openBlock","_hoisted_1","_createElementVNode","_hoisted_3","_Fragment","_toDisplayString","VERT","FRAG","easeInOutCubic","easeInQuad","easeOutCubic","prefersReducedMotion","parseCssColor","probe","input","r","g","b","a","resolveAutoColor","el","node","bg","rgb","createCloudEngine","canvas","host","options","gl","config","probeCanvas","compile","type","source","shader","vs","fs","program","quad","aPos","u","name","uniforms","gather","scatter","tint","time","syncTint","syncSize","dpr","quality","width","height","tweens","tween","param","to","duration","ease","done","from","applyParam","t","raf","running","destroyed","frame","now","delta","lastTick","raw","startLoop","observer","finish","resolve","promise","state","next","emit","__emit","loading","_useModel","overlayRef","ref","canvasRef","webglOk","phase","overlayVisible","overlayStyle","engine","safetyTimer","reducedMotion","initEngine","nextTick","startLoading","shownTimer","stopLoading","finishDissipate","watch","on","savedOverflow","root","onBeforeUnmount","_createBlock","_Teleport","_hoisted_2","_cache","_renderSlot","_ctx","_hoisted_4","_hoisted_5","Loading","LoadingRoot","CloudLoading","CloudLoadingRoot"],"mappings":";;;;;;;;GAmBMA,IAAS;;;;;;;;;AANf,UAAMC,IAAQC,GAORC,IAAgB,IAAI,KAAK,KAAK,MAE9BC,IAAUC,EAAS,MAAMC,EAAcL,EAAM,QAAQ,CAAC,GACtDM,IAAOF;AAAA,MAAS,MACpBD,EAAQ,SAAS,OACb,GAAGD,IAAgB,IAAI,IAAIA,CAAa,KACxC,GAAGA,KAAiBC,EAAQ,QAAQ,IAAI,IAAID,CAAa;AAAA,IAAA;AAG/D,aAASG,EAAcE,GAAiD;AACtE,aAAIA,KAAS,QAAQ,OAAO,MAAMA,CAAK,IAAU,OAC1C,KAAK,IAAI,KAAK,KAAK,IAAI,GAAG,KAAK,MAAM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