@kolkrabbi/design-editor 0.20.0 → 0.22.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/dist/{RuleRow-DNVlUgGV.js → RuleRow-BXkjpTyN.js} +136 -76
- package/dist/TreePicker-DLmMl0aU.js +68 -0
- package/dist/{core-BWSY6z9e.js → core-G5e-pSOt.js} +2514 -2146
- package/dist/core.js +3 -3
- package/dist/design-editor.css +1 -1
- package/dist/design-editor.js +978 -1246
- package/dist/{effects-At3W3Ak1.js → effectCategories-BcaQSD_V.js} +734 -1076
- package/dist/effects-pCd8YTdQ.js +469 -0
- package/dist/effects.js +1 -1
- package/dist/{generators-C4R15Cgp.js → generators-B8_StNAy.js} +261 -322
- package/dist/generators.js +1 -1
- package/dist/{host-BE7dtdx9.js → host-B4SRaN9h.js} +170 -171
- package/dist/labels-B5qkocWy.js +2007 -0
- package/dist/motion-DFnAar_2.js +2263 -0
- package/dist/motion.js +1 -1
- package/dist/{rolls-CkmuE-Ya.js → rolls-Bg1XHuvJ.js} +2198 -1963
- package/dist/{src-DFtETCsY.js → src-B5fQgAVE.js} +1 -1
- package/dist/{registry-CSOtIU7o.js → useLayerEdit-ieOjHx6x.js} +2873 -2619
- package/package.json +5 -5
- package/dist/BindDot-CuCS4LS-.js +0 -127
- package/dist/TreePicker-D5XZT0Zi.js +0 -303
- package/dist/labels-B10g9Um5.js +0 -40
- package/dist/motion-CntX25g3.js +0 -4229
- package/dist/useLayerEdit-B-NfMWe-.js +0 -257
package/dist/generators.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as e } from "./generators-
|
|
1
|
+
import { t as e } from "./generators-B8_StNAy.js";
|
|
2
2
|
export { e as generators };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { a as
|
|
4
|
-
import { a as y, i as ee, o as te, r as b } from "./generators-C4R15Cgp.js";
|
|
1
|
+
import { It as e, Rt as t } from "./rolls-Bg1XHuvJ.js";
|
|
2
|
+
import { A as n, C as r, D as i, E as a, M as o, O as s, S as c, T as l, Z as u, _ as d, b as f, j as p, k as m, v as h, w as g, x as _, y as v } from "./useLayerEdit-ieOjHx6x.js";
|
|
3
|
+
import { a as y, i as ee, o as te, r as b } from "./generators-B8_StNAy.js";
|
|
5
4
|
import { $ as ne, A as x, B as re, C as ie, D as ae, E as oe, F as se, G as S, H as ce, I as le, J as ue, K as de, L as fe, N as C, O as pe, P as me, Q as he, R as ge, S as _e, T as ve, U as ye, V as be, W as w, X as T, Y as E, Z as xe, _ as Se, a as D, at as O, b as Ce, c as we, ct as k, d as A, et as Te, f as j, g as M, i as N, it as P, k as Ee, l as F, lt as De, m as Oe, n as ke, nt as Ae, o as je, ot as I, p as Me, q as Ne, r as L, rt as Pe, s as Fe, st as Ie, t as R, tt as Le, u as z, v as Re, w as B, x as V, y as H, z as ze } from "./OrbitControls-Cql8Rn2i.js";
|
|
6
5
|
//#region src/loops/gl/DriftEngine.js
|
|
7
6
|
var Be = {
|
|
@@ -31,7 +30,7 @@ var Be = {
|
|
|
31
30
|
antialias: !0,
|
|
32
31
|
preserveDrawingBuffer: !0
|
|
33
32
|
}), this.scene = new E(), this.cam = new j();
|
|
34
|
-
let t =
|
|
33
|
+
let t = p[this.family][0];
|
|
35
34
|
this.uniforms = {
|
|
36
35
|
uPhase: { value: 0 },
|
|
37
36
|
uAspect: { value: 1 },
|
|
@@ -81,7 +80,7 @@ var Be = {
|
|
|
81
80
|
t.uLight.value.set(Math.cos(n), Math.sin(n));
|
|
82
81
|
}
|
|
83
82
|
if (e.period != null && (this.period = e.period), e.speed != null && (this.speed = e.speed), e.style != null && (t.uStyle.value = Be[e.style] ?? 0), e.palette != null) {
|
|
84
|
-
let n =
|
|
83
|
+
let n = o(this.family, e.palette);
|
|
85
84
|
t.uColors.value = n.cols.map(U), t.uBase.value = U(n.base);
|
|
86
85
|
}
|
|
87
86
|
}
|
|
@@ -170,19 +169,19 @@ var Be = {
|
|
|
170
169
|
}
|
|
171
170
|
setParams(e) {
|
|
172
171
|
if (!this.uniforms) return;
|
|
173
|
-
let
|
|
174
|
-
|
|
172
|
+
let t = e.look ? i.find((t) => t.value === e.look) : null;
|
|
173
|
+
t?.p && (e = {
|
|
175
174
|
...e,
|
|
176
|
-
...
|
|
175
|
+
...t.p
|
|
177
176
|
});
|
|
178
|
-
let
|
|
179
|
-
if (e.cat != null && (
|
|
177
|
+
let n = this.uniforms;
|
|
178
|
+
if (e.cat != null && (n.uCat.value = Math.round(e.cat)), e.form != null && (n.uType.value = Math.round(e.form)), e.count != null && (n.uCount.value = Math.max(1, Math.min(6, Math.round(e.count)))), e.size != null && (n.uSize.value = e.size), e.spread != null && (n.uSpread.value = e.spread), e.irid != null && (n.uIrid.value = e.irid), e.hue != null && (n.uHue.value = e.hue), e.sheen != null && (n.uSheen.value = e.sheen), e.gloss != null && (n.uGloss.value = e.gloss), n.uRelief.value = e.relief ?? .9, e.warp != null && (n.uWarp.value = e.warp), e.grain != null && (n.uGrain.value = e.grain), e.spectral != null && (n.uSpectral.value = +!!e.spectral), e.angle != null && (n.uAngle.value = e.angle), n.uFreq.value = e.freq ?? 2, e.winds != null && (n.uWinds.value = e.winds), e.pitch != null && (n.uPitch.value = e.pitch), e.petals != null && (n.uPetals.value = e.petals), n.uSpin.value = e.spin ?? 1, e.mouth != null && (n.uMouth.value = e.mouth), e.speed != null && (this.speed = e.speed), e.palette != null) {
|
|
180
179
|
let t = s.find((t) => t.value === e.palette) || s[0];
|
|
181
|
-
|
|
180
|
+
n.uColors.value = t.cols.map(W);
|
|
182
181
|
}
|
|
183
182
|
if (e.backdrop != null) {
|
|
184
|
-
let
|
|
185
|
-
|
|
183
|
+
let t = a.find((t) => t.value === e.backdrop) || a[0];
|
|
184
|
+
n.uBg.value = W(t.col);
|
|
186
185
|
}
|
|
187
186
|
}
|
|
188
187
|
setPlaying(e) {
|
|
@@ -281,7 +280,7 @@ var Be = {
|
|
|
281
280
|
}
|
|
282
281
|
setParams(e) {
|
|
283
282
|
if (!this.uniforms) return;
|
|
284
|
-
let
|
|
283
|
+
let t = this.uniforms, n = {
|
|
285
284
|
hue: "uHue",
|
|
286
285
|
irid: "uIrid",
|
|
287
286
|
sheen: "uSheen",
|
|
@@ -295,18 +294,18 @@ var Be = {
|
|
|
295
294
|
grain: "uGrain",
|
|
296
295
|
edge: "uEdge"
|
|
297
296
|
};
|
|
298
|
-
for (let
|
|
299
|
-
if (
|
|
300
|
-
let
|
|
301
|
-
|
|
297
|
+
for (let r in n) e[r] != null && (t[n[r]].value = e[r]);
|
|
298
|
+
if (t.uBulge.value = e.bulge ?? .55, e.spectral != null && (t.uSpectral.value = +!!e.spectral), e.sweep != null) {
|
|
299
|
+
let n = e.sweep * Math.PI / 180;
|
|
300
|
+
t.uDir.value.set(Math.sin(n), Math.cos(n));
|
|
302
301
|
}
|
|
303
302
|
if (e.speed != null && (this.speed = e.speed), e.forms && this.setForms(e.forms), e.palette != null) {
|
|
304
|
-
let
|
|
305
|
-
|
|
303
|
+
let n = s.find((t) => t.value === e.palette) || s[0];
|
|
304
|
+
t.uColors.value = n.cols.map(Qe);
|
|
306
305
|
}
|
|
307
306
|
if (e.backdrop != null) {
|
|
308
|
-
let
|
|
309
|
-
|
|
307
|
+
let n = a.find((t) => t.value === e.backdrop) || a[0];
|
|
308
|
+
t.uBg.value = Qe(n.col);
|
|
310
309
|
}
|
|
311
310
|
}
|
|
312
311
|
setPlaying(e) {
|
|
@@ -405,7 +404,7 @@ var Be = {
|
|
|
405
404
|
}
|
|
406
405
|
setParams(e) {
|
|
407
406
|
if (!this.uniforms) return;
|
|
408
|
-
let
|
|
407
|
+
let t = this.uniforms, n = {
|
|
409
408
|
hue: "uHue",
|
|
410
409
|
irid: "uIrid",
|
|
411
410
|
sheen: "uSheen",
|
|
@@ -417,18 +416,18 @@ var Be = {
|
|
|
417
416
|
motion: "uMotion",
|
|
418
417
|
grain: "uGrain"
|
|
419
418
|
};
|
|
420
|
-
for (let
|
|
421
|
-
if (e.spectral != null && (
|
|
422
|
-
let
|
|
423
|
-
|
|
419
|
+
for (let r in n) e[r] != null && (t[n[r]].value = e[r]);
|
|
420
|
+
if (e.spectral != null && (t.uSpectral.value = +!!e.spectral), e.metaball != null && (t.uMetaball.value = +!!e.metaball), e.sweep != null) {
|
|
421
|
+
let n = e.sweep * Math.PI / 180;
|
|
422
|
+
t.uDir.value.set(Math.sin(n), Math.cos(n));
|
|
424
423
|
}
|
|
425
424
|
if (e.speed != null && (this.speed = e.speed), e.forms && this.setForms(e.forms), e.palette != null) {
|
|
426
|
-
let
|
|
427
|
-
|
|
425
|
+
let n = s.find((t) => t.value === e.palette) || s[0];
|
|
426
|
+
t.uColors.value = n.cols.map(rt);
|
|
428
427
|
}
|
|
429
428
|
if (e.backdrop != null) {
|
|
430
|
-
let
|
|
431
|
-
|
|
429
|
+
let n = a.find((t) => t.value === e.backdrop) || a[0];
|
|
430
|
+
t.uBg.value = rt(n.col);
|
|
432
431
|
}
|
|
433
432
|
}
|
|
434
433
|
setPlaying(e) {
|
|
@@ -905,17 +904,17 @@ var gt = "#0b0b0e", _t = .004, vt = 24, yt = class {
|
|
|
905
904
|
return this.envTex ||= this.pmrem.fromScene(new ht(), .04).texture, this.envTex;
|
|
906
905
|
}
|
|
907
906
|
update({ globals: e, primitive: t, params: n } = {}) {
|
|
908
|
-
let
|
|
909
|
-
if (t && t !== this.primId && (this.primId = t,
|
|
907
|
+
let r = !1;
|
|
908
|
+
if (t && t !== this.primId && (this.primId = t, r = !0), n && (this.params = {
|
|
910
909
|
...this.params,
|
|
911
910
|
...n
|
|
912
|
-
},
|
|
911
|
+
}, r = !0), e) {
|
|
913
912
|
this.globals = e, this.color = e.color || this.color, this.roughness = e.roughness ?? this.roughness, this.metalness = e.metalness ?? this.metalness, this.flat = !!e.flatShading, this.setMaterialType(e.materialType || "standard"), this.applyMaterialProps();
|
|
914
913
|
let t = !!e.wireframe;
|
|
915
914
|
for (let e of this.items) e.mesh.visible = !t, e.wire.visible = t;
|
|
916
|
-
this.lineMat.linewidth = (e.strokeWidth ?? 3) * _t, e.rounding != null && e.rounding !== this.rounding && (this.rounding = e.rounding, this.primId === "box" && (
|
|
915
|
+
this.lineMat.linewidth = (e.strokeWidth ?? 3) * _t, e.rounding != null && e.rounding !== this.rounding && (this.rounding = e.rounding, this.primId === "box" && (r = !0)), this.setCount(e.count ?? 1), this.layoutPos = m(e.arrangement || "single", e.count ?? 1, e.spread ?? 2.2), e.duration && (this.dur = e.duration), e.fov != null && e.fov !== this.camera.fov && (this.camera.fov = e.fov, this.camera.updateProjectionMatrix()), this.scene.environment = e.environment ? this.ensureEnv() : null, this.axes.visible = !!e.showAxis, this.axes.scale.setScalar(e.axisLength ?? 1.5), this.axes.material.opacity = e.axisOpacity ?? .7;
|
|
917
916
|
}
|
|
918
|
-
|
|
917
|
+
r && this.rebuildGeometry();
|
|
919
918
|
}
|
|
920
919
|
resize(e, t) {
|
|
921
920
|
this.renderer.setSize(e, t, !1), this.camera.aspect = e / t, this.camera.updateProjectionMatrix(), this.lineMat.resolution.set(e, t), this.w = e, this.h = t;
|
|
@@ -1049,7 +1048,7 @@ var Ct = class {
|
|
|
1049
1048
|
}, this.onProgress = null, this.autoLoop && (this.raf = requestAnimationFrame(this.loop));
|
|
1050
1049
|
}
|
|
1051
1050
|
_rebuild() {
|
|
1052
|
-
this.count =
|
|
1051
|
+
this.count = r(this.form, this.samples), this.posArr = new Float32Array(this.count * 3), this.colArr = new Float32Array(this.count * 3), this.vparArr = new Float32Array(this.count), l(this.form, this.samples, this.vparArr);
|
|
1053
1052
|
let e = new A();
|
|
1054
1053
|
e.setAttribute("position", new z(this.posArr, 3)), e.setAttribute("color", new z(this.colArr, 3));
|
|
1055
1054
|
let t = this.geometry;
|
|
@@ -1208,9 +1207,9 @@ var Ct = class {
|
|
|
1208
1207
|
}
|
|
1209
1208
|
_rebuild() {
|
|
1210
1209
|
let e = this.samples * this.samples;
|
|
1211
|
-
this.posArr = new Float32Array(e * 3), this.colArr = new Float32Array(e * 3), this.vparArr = new Float32Array(e),
|
|
1210
|
+
this.posArr = new Float32Array(e * 3), this.colArr = new Float32Array(e * 3), this.vparArr = new Float32Array(e), c(this.env, this.samples, this.vparArr);
|
|
1212
1211
|
let t = new A();
|
|
1213
|
-
t.setAttribute("position", new z(this.posArr, 3)), t.setAttribute("color", new z(this.colArr, 3)), t.setIndex(new z(
|
|
1212
|
+
t.setAttribute("position", new z(this.posArr, 3)), t.setAttribute("color", new z(this.colArr, 3)), t.setIndex(new z(v(this.env, this.samples), 1));
|
|
1214
1213
|
let n = this.geometry;
|
|
1215
1214
|
this.geometry = t, this.mesh.geometry = t, n.dispose(), this._recolor();
|
|
1216
1215
|
}
|
|
@@ -1259,7 +1258,7 @@ var Ct = class {
|
|
|
1259
1258
|
dur: this.dur
|
|
1260
1259
|
});
|
|
1261
1260
|
let r = (this.dur > 0 ? n / this.dur : 0) * wt * (t.cycles ?? 2);
|
|
1262
|
-
if (
|
|
1261
|
+
if (_(this.env, this.samples, r, { amp: t.amp ?? .5 }, this.posArr), this.geometry.attributes.position.needsUpdate = !0, this.geometry.computeVertexNormals(), this.controls.autoRotate = !this.recording && !!t.spin && !t.paused && !f(this.env), this.controls.autoRotateSpeed = 2 * (t.spinSpeed ?? 1), this.controls.update(), this.w && this.h && this.renderer.render(this.scene, this.camera), this.recording && this.accum >= this.dur && this._recStop) {
|
|
1263
1262
|
let e = this._recStop;
|
|
1264
1263
|
this._recStop = null, e();
|
|
1265
1264
|
}
|
|
@@ -1607,26 +1606,26 @@ function zt(e, t, n, r) {
|
|
|
1607
1606
|
}
|
|
1608
1607
|
return o;
|
|
1609
1608
|
}
|
|
1610
|
-
function Bt({ seed: e = 1, loops: t = 3, height: n = 2.2, gap: r = .92, depth:
|
|
1611
|
-
let
|
|
1612
|
-
f.push(new I(t, n, Math.sin(p * 1.7 + e) *
|
|
1609
|
+
function Bt({ seed: e = 1, loops: t = 3, height: n = 2.2, gap: r = .92, depth: i = .35, curl: a = 1 } = {}) {
|
|
1610
|
+
let o = u(e >>> 0 || 1), s = (e) => (o() - .5) * 2 * e, c = Math.max(1, Math.round(t)), l = -((c - 1) * r) / 2, d = n, f = [], p = 0, m = (t, n) => {
|
|
1611
|
+
f.push(new I(t, n, Math.sin(p * 1.7 + e) * i)), p += 1;
|
|
1613
1612
|
};
|
|
1614
|
-
for (let e = 0; e <
|
|
1615
|
-
let t =
|
|
1613
|
+
for (let e = 0; e < c; e++) {
|
|
1614
|
+
let t = l + e * r + s(r * .06), n = e % 2 == 0, i = n ? -d / 2 : d / 2, a = n ? d / 2 : -d / 2;
|
|
1616
1615
|
for (let e = 0; e < 10; e++) m(t, i + (a - i) * e / 10);
|
|
1617
|
-
if (e <
|
|
1618
|
-
let i =
|
|
1616
|
+
if (e < c - 1) {
|
|
1617
|
+
let i = l + (e + 1) * r, o = (t + i) / 2, s = (i - t) / 2, c = n ? 1 : -1;
|
|
1619
1618
|
for (let e = 0; e <= 24; e++) {
|
|
1620
1619
|
let t = e / 24 * Math.PI;
|
|
1621
1620
|
m(o - Math.cos(t) * s, a + c * Math.sin(t) * s);
|
|
1622
1621
|
}
|
|
1623
1622
|
}
|
|
1624
1623
|
}
|
|
1625
|
-
if (
|
|
1626
|
-
let t = f[f.length - 1], n = f[f.length - 2],
|
|
1624
|
+
if (a > 0 && f.length >= 2) {
|
|
1625
|
+
let t = f[f.length - 1], n = f[f.length - 2], o = t.clone().sub(n).setZ(0).normalize(), s = new I(-o.y, o.x, 0).normalize(), c = r * .5, l = t.clone().add(s.clone().multiplyScalar(c)), u = Math.atan2(t.y - l.y, t.x - l.x), d = 1.1 * a;
|
|
1627
1626
|
for (let n = 1; n <= 44; n++) {
|
|
1628
|
-
let r = n / 44,
|
|
1629
|
-
f.push(new I(l.x + Math.cos(
|
|
1627
|
+
let r = n / 44, a = u - d * Math.PI * 2 * r, o = c * (1 - .7 * r);
|
|
1628
|
+
f.push(new I(l.x + Math.cos(a) * o, l.y + Math.sin(a) * o, t.z + Math.sin(r * 3 + e) * i * .4));
|
|
1630
1629
|
}
|
|
1631
1630
|
}
|
|
1632
1631
|
return new Oe(f, !1, "centripetal");
|
|
@@ -2159,184 +2158,184 @@ var on = {
|
|
|
2159
2158
|
paused: !1,
|
|
2160
2159
|
speed: 0
|
|
2161
2160
|
};
|
|
2162
|
-
function sn(
|
|
2163
|
-
if (cn(
|
|
2164
|
-
let
|
|
2165
|
-
if (
|
|
2166
|
-
let
|
|
2167
|
-
|
|
2168
|
-
x:
|
|
2161
|
+
function sn(e, n, r) {
|
|
2162
|
+
if (cn(e, n, r), typeof n.setPointer == "function") {
|
|
2163
|
+
let e = t.getCtx().stage, i = r.w ?? 0, a = r.h ?? 0, o = null;
|
|
2164
|
+
if (e && i > 0 && a > 0) {
|
|
2165
|
+
let t = (e.x - (r.x ?? 0)) / i, n = (e.y - (r.y ?? 0)) / a;
|
|
2166
|
+
t >= 0 && t <= 1 && n >= 0 && n <= 1 && (o = {
|
|
2167
|
+
x: t,
|
|
2169
2168
|
y: n,
|
|
2170
|
-
down: !!
|
|
2169
|
+
down: !!e.down
|
|
2171
2170
|
});
|
|
2172
2171
|
}
|
|
2173
2172
|
n.setPointer(o);
|
|
2174
2173
|
}
|
|
2175
|
-
|
|
2174
|
+
e.bgToggle && n.renderer?.setClearAlpha(r.bgOn === !1 ? 0 : 1);
|
|
2176
2175
|
}
|
|
2177
|
-
function cn(
|
|
2178
|
-
switch (
|
|
2176
|
+
function cn(t, n, r) {
|
|
2177
|
+
switch (t.engine) {
|
|
2179
2178
|
case "scene": {
|
|
2180
|
-
$t.set(
|
|
2179
|
+
$t.set(n, r.duration ?? 8);
|
|
2181
2180
|
let e = {
|
|
2182
|
-
tube:
|
|
2183
|
-
p:
|
|
2184
|
-
q:
|
|
2185
|
-
detail:
|
|
2186
|
-
},
|
|
2187
|
-
i && en.set(
|
|
2188
|
-
primitive:
|
|
2181
|
+
tube: r.tube ?? .32,
|
|
2182
|
+
p: r.pWinds ?? 2,
|
|
2183
|
+
q: r.qWinds ?? 3,
|
|
2184
|
+
detail: r.detail ?? 0
|
|
2185
|
+
}, t = `${e.tube}|${e.p}|${e.q}|${e.detail}`, i = en.get(n) !== t;
|
|
2186
|
+
i && en.set(n, t), n.update({
|
|
2187
|
+
primitive: r.primitive,
|
|
2189
2188
|
...i ? { params: e } : {},
|
|
2190
2189
|
globals: {
|
|
2191
|
-
preset:
|
|
2192
|
-
animMode:
|
|
2193
|
-
keyframes: Array.isArray(
|
|
2190
|
+
preset: r.pose,
|
|
2191
|
+
animMode: r.animMode === "keyframes" || r.animMode === "keyframe" ? "keyframe" : "preset",
|
|
2192
|
+
keyframes: Array.isArray(r.keyframes) && r.keyframes.length ? r.keyframes : y,
|
|
2194
2193
|
loop: !0,
|
|
2195
2194
|
paused: !1,
|
|
2196
2195
|
speed: 0,
|
|
2197
|
-
duration:
|
|
2198
|
-
count:
|
|
2199
|
-
arrangement:
|
|
2200
|
-
spread:
|
|
2201
|
-
objectSize:
|
|
2202
|
-
stagger:
|
|
2203
|
-
cameraMotion:
|
|
2204
|
-
orbitSpeed:
|
|
2205
|
-
fov:
|
|
2206
|
-
wireframe:
|
|
2207
|
-
strokeWidth:
|
|
2208
|
-
materialType:
|
|
2209
|
-
environment:
|
|
2210
|
-
roughness:
|
|
2211
|
-
metalness:
|
|
2212
|
-
color:
|
|
2213
|
-
flatShading: !!
|
|
2214
|
-
rounding:
|
|
2215
|
-
showAxis: !!
|
|
2216
|
-
axisLength:
|
|
2217
|
-
axisOpacity:
|
|
2196
|
+
duration: r.duration ?? 8,
|
|
2197
|
+
count: r.count,
|
|
2198
|
+
arrangement: r.arrangement,
|
|
2199
|
+
spread: r.spread,
|
|
2200
|
+
objectSize: r.objectSize,
|
|
2201
|
+
stagger: r.stagger,
|
|
2202
|
+
cameraMotion: r.cameraMotion,
|
|
2203
|
+
orbitSpeed: r.orbitSpeed,
|
|
2204
|
+
fov: r.fov,
|
|
2205
|
+
wireframe: r.wireframe,
|
|
2206
|
+
strokeWidth: r.strokeWidth,
|
|
2207
|
+
materialType: r.materialType,
|
|
2208
|
+
environment: r.environment,
|
|
2209
|
+
roughness: r.roughness,
|
|
2210
|
+
metalness: r.metalness,
|
|
2211
|
+
color: r.sceneColor,
|
|
2212
|
+
flatShading: !!r.flatShading,
|
|
2213
|
+
rounding: r.rounding,
|
|
2214
|
+
showAxis: !!r.showAxis,
|
|
2215
|
+
axisLength: r.axisLength,
|
|
2216
|
+
axisOpacity: r.axisOpacity
|
|
2218
2217
|
}
|
|
2219
2218
|
});
|
|
2220
2219
|
return;
|
|
2221
2220
|
}
|
|
2222
2221
|
case "softforms3d":
|
|
2223
|
-
|
|
2224
|
-
theta:
|
|
2225
|
-
phi:
|
|
2226
|
-
dist:
|
|
2222
|
+
n.setParams(r), r.camTheta != null && n.setCamera({
|
|
2223
|
+
theta: r.camTheta,
|
|
2224
|
+
phi: r.camPhi ?? .35,
|
|
2225
|
+
dist: r.camDist ?? 3
|
|
2227
2226
|
});
|
|
2228
2227
|
return;
|
|
2229
2228
|
case "forms":
|
|
2230
|
-
|
|
2231
|
-
form:
|
|
2229
|
+
n.update({
|
|
2230
|
+
form: r.form,
|
|
2232
2231
|
globals: {
|
|
2233
2232
|
...on,
|
|
2234
2233
|
duration: 8,
|
|
2235
|
-
samples:
|
|
2236
|
-
cycles:
|
|
2237
|
-
amp:
|
|
2238
|
-
pointSize:
|
|
2239
|
-
turns:
|
|
2240
|
-
radius:
|
|
2241
|
-
height:
|
|
2242
|
-
spin:
|
|
2243
|
-
spinSpeed:
|
|
2244
|
-
fov:
|
|
2245
|
-
color:
|
|
2246
|
-
accent:
|
|
2234
|
+
samples: r.samples,
|
|
2235
|
+
cycles: r.cycles,
|
|
2236
|
+
amp: r.amp,
|
|
2237
|
+
pointSize: r.pointSize,
|
|
2238
|
+
turns: r.turns,
|
|
2239
|
+
radius: r.radius,
|
|
2240
|
+
height: r.height,
|
|
2241
|
+
spin: r.spin,
|
|
2242
|
+
spinSpeed: r.spinSpeed,
|
|
2243
|
+
fov: r.fov,
|
|
2244
|
+
color: r.formColor,
|
|
2245
|
+
accent: r.accent
|
|
2247
2246
|
}
|
|
2248
2247
|
});
|
|
2249
2248
|
return;
|
|
2250
2249
|
case "environment":
|
|
2251
|
-
|
|
2252
|
-
env:
|
|
2250
|
+
n.update({
|
|
2251
|
+
env: r.env,
|
|
2253
2252
|
globals: {
|
|
2254
2253
|
...on,
|
|
2255
2254
|
duration: 8,
|
|
2256
|
-
samples:
|
|
2257
|
-
cycles:
|
|
2258
|
-
amp:
|
|
2259
|
-
spin:
|
|
2260
|
-
spinSpeed:
|
|
2261
|
-
fov:
|
|
2262
|
-
color:
|
|
2263
|
-
accent:
|
|
2255
|
+
samples: r.samples,
|
|
2256
|
+
cycles: r.cycles,
|
|
2257
|
+
amp: r.amp,
|
|
2258
|
+
spin: r.spin,
|
|
2259
|
+
spinSpeed: r.spinSpeed,
|
|
2260
|
+
fov: r.fov,
|
|
2261
|
+
color: r.formColor,
|
|
2262
|
+
accent: r.accent
|
|
2264
2263
|
}
|
|
2265
2264
|
});
|
|
2266
2265
|
return;
|
|
2267
2266
|
case "ribbon":
|
|
2268
|
-
$t.set(
|
|
2267
|
+
$t.set(n, r.duration ?? 12), n.update({
|
|
2269
2268
|
geom: {
|
|
2270
|
-
seed:
|
|
2271
|
-
loops:
|
|
2272
|
-
height:
|
|
2273
|
-
gap:
|
|
2274
|
-
depth:
|
|
2275
|
-
curl:
|
|
2276
|
-
width:
|
|
2277
|
-
ribbonThickness:
|
|
2278
|
-
corner:
|
|
2269
|
+
seed: r.seed,
|
|
2270
|
+
loops: r.loops,
|
|
2271
|
+
height: r.height,
|
|
2272
|
+
gap: r.gap,
|
|
2273
|
+
depth: r.depth,
|
|
2274
|
+
curl: r.curl,
|
|
2275
|
+
width: r.width,
|
|
2276
|
+
ribbonThickness: r.ribbonThickness ?? .12,
|
|
2277
|
+
corner: r.corner ?? .045
|
|
2279
2278
|
},
|
|
2280
2279
|
globals: {
|
|
2281
2280
|
...on,
|
|
2282
|
-
duration:
|
|
2283
|
-
flow:
|
|
2284
|
-
cameraOrbit:
|
|
2285
|
-
orbitSpeed:
|
|
2286
|
-
fov:
|
|
2287
|
-
materialType:
|
|
2288
|
-
color:
|
|
2289
|
-
roughness:
|
|
2290
|
-
metalness:
|
|
2291
|
-
ior:
|
|
2292
|
-
dispersion:
|
|
2293
|
-
wireframe: !!
|
|
2294
|
-
strokeWidth:
|
|
2295
|
-
aberration:
|
|
2296
|
-
bloom:
|
|
2297
|
-
vignette:
|
|
2298
|
-
grain:
|
|
2281
|
+
duration: r.duration ?? 12,
|
|
2282
|
+
flow: r.flow,
|
|
2283
|
+
cameraOrbit: r.cameraOrbit,
|
|
2284
|
+
orbitSpeed: r.orbitSpeed,
|
|
2285
|
+
fov: r.fov,
|
|
2286
|
+
materialType: r.materialType,
|
|
2287
|
+
color: r.ribbonColor,
|
|
2288
|
+
roughness: r.roughness,
|
|
2289
|
+
metalness: r.metalness,
|
|
2290
|
+
ior: r.ior,
|
|
2291
|
+
dispersion: r.dispersion,
|
|
2292
|
+
wireframe: !!r.wireframe,
|
|
2293
|
+
strokeWidth: r.wireStroke ?? 2.5,
|
|
2294
|
+
aberration: r.aberration,
|
|
2295
|
+
bloom: r.bloom,
|
|
2296
|
+
vignette: r.vignette,
|
|
2297
|
+
grain: r.grain
|
|
2299
2298
|
}
|
|
2300
|
-
}),
|
|
2299
|
+
}), r.background != null && n.setBackground(r.background);
|
|
2301
2300
|
return;
|
|
2302
2301
|
case "mesh": {
|
|
2303
|
-
let
|
|
2304
|
-
|
|
2305
|
-
mode:
|
|
2302
|
+
let t = r.mode === "grid" ? "grid" : "single", i = r.seed ?? 7, a = t === "grid" ? Array.from({ length: 9 }, (e, t) => i + t * 7919) : [i];
|
|
2303
|
+
n.update({
|
|
2304
|
+
mode: t,
|
|
2306
2305
|
idx: 0,
|
|
2307
|
-
specs:
|
|
2306
|
+
specs: a.map((e) => ln(e, r)),
|
|
2308
2307
|
globals: {
|
|
2309
|
-
glow:
|
|
2310
|
-
grain:
|
|
2311
|
-
speed:
|
|
2308
|
+
glow: r.glow,
|
|
2309
|
+
grain: r.grain,
|
|
2310
|
+
speed: r.speed,
|
|
2312
2311
|
paused: !1,
|
|
2313
|
-
bg:
|
|
2314
|
-
bgStyle:
|
|
2312
|
+
bg: r.bgAmount ?? .85,
|
|
2313
|
+
bgStyle: r.bgStyle ?? 0
|
|
2315
2314
|
}
|
|
2316
|
-
}),
|
|
2315
|
+
}), n.setBackground(e(r.themeId ?? "kol", !!r.themeInvert).bg);
|
|
2317
2316
|
return;
|
|
2318
2317
|
}
|
|
2319
|
-
default:
|
|
2318
|
+
default: n.setParams(r);
|
|
2320
2319
|
}
|
|
2321
2320
|
}
|
|
2322
2321
|
function ln(e, t) {
|
|
2323
|
-
let n =
|
|
2322
|
+
let n = u(e);
|
|
2324
2323
|
n(), n(), n();
|
|
2325
|
-
let r = n(),
|
|
2324
|
+
let r = n(), i = .12 + n() * .3, a = n() * Math.PI * 2, o = d.find((e) => e.id === t.palette) || d[0];
|
|
2326
2325
|
return {
|
|
2327
2326
|
seed: e,
|
|
2328
2327
|
shape: t.shape || "sphere",
|
|
2329
|
-
colors:
|
|
2328
|
+
colors: o.colors.map((e) => h(e, t.hueShift || 0)),
|
|
2330
2329
|
driver: t.driver ?? 0,
|
|
2331
2330
|
distort: (t.distort ?? .5) * (.6 + r * .5),
|
|
2332
|
-
rotSpeed:
|
|
2333
|
-
phase:
|
|
2331
|
+
rotSpeed: i,
|
|
2332
|
+
phase: a
|
|
2334
2333
|
};
|
|
2335
2334
|
}
|
|
2336
|
-
function un(
|
|
2337
|
-
if (
|
|
2338
|
-
else if (
|
|
2339
|
-
let
|
|
2335
|
+
function un(e, n, { u: r, dt: i }) {
|
|
2336
|
+
if (e.drive === "phase") n.renderAtPhase(r);
|
|
2337
|
+
else if (e.drive === "seek") {
|
|
2338
|
+
let e = $t.get(n), i = e ? ee(r, b(e, t.getLoopSeconds())) : r;
|
|
2340
2339
|
n.seek(i), n.frame(0);
|
|
2341
2340
|
} else n.frame(i);
|
|
2342
2341
|
}
|