@kolkrabbi/design-editor 0.36.0 → 0.38.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/{BindDot-dBz2NUVr.js → BindDot-CFTKW7W4.js} +1 -1
- package/dist/{Timeline-BDMxiVYe.js → Timeline-ckBCdlTr.js} +2 -2
- package/dist/{TreePicker-BawzFyzV.js → TreePicker-D4vypelv.js} +1 -1
- package/dist/{core-d8m3o_mg.js → core-VWNEmGcX.js} +21 -17
- package/dist/core.js +4 -4
- package/dist/design-editor.css +1 -1
- package/dist/design-editor.js +18 -15
- package/dist/{effectCategories-D1t5Vdqf.js → effectCategories-o8c1BoBZ.js} +3 -3
- package/dist/{effects-BFAtGRPu.js → effects-fBuIj2Pn.js} +6 -6
- package/dist/effects.js +1 -1
- package/dist/{generators-JkPVwcTT.js → generators-D0TkUp8a.js} +910 -889
- package/dist/generators.js +1 -1
- package/dist/{host-CsF4CKfw.js → host-BCPL5xi5.js} +4 -4
- package/dist/{host-C3_Oy1ck.js → host-mBJsX8-O.js} +1 -1
- package/dist/{morphStore-CidzL7wV.js → morphStore-CJc9nt6q.js} +1 -1
- package/dist/{motion-KvPCj1EZ.js → motion-BBBfa2mP.js} +3 -3
- package/dist/motion.js +1 -1
- package/dist/{previewScale-BAmIBoWY.js → previewScale-BCpuL5uC.js} +1 -1
- package/dist/{rolls-5hhrWX96.js → rolls-yFvM7gmE.js} +751 -722
- package/dist/{src-8EvSuuNG.js → src-BTZk0nvE.js} +1 -1
- package/dist/{store-QnsWv-26.js → store-rdo7FUxn.js} +1 -1
- package/dist/{useLayerEdit-BikuFIoi.js → useLayerEdit-BLjEK2Gv.js} +8 -8
- package/package.json +10 -10
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { $ as e, B as t, C as n, D as r, Dn as i, F as a, I as o, J as s, Kn as c, L as l, Mt as u, Q as d, Qn as f, Rt as p, S as m, St as h, Tn as g, Wn as _, X as v, Y as y, Yn as b, Z as x, a as S, at as C, c as w, d as T, dn as E, er as D, et as ee, f as O, gt as te, hn as ne, it as k, l as re, ln as A, m as ie, mn as ae, mt as oe, n as se, nt as ce, o as le, ot as ue, p as de, pn as fe, q as pe, qn as me, rt as he, s as ge, t as _e, tr as ve, tt as ye, u as be, un as xe, wn as Se, x as Ce, yn as we } from "./rolls-
|
|
2
|
-
import { c as Te, n as Ee, t as De } from "./useLayerEdit-
|
|
3
|
-
import { C as Oe, D as ke, E as Ae, O as je, S as Me, T as Ne, _ as Pe, at as Fe, b as Ie, ct as Le, d as Re, dt as ze, f as Be, ft as Ve, h as He, ht as Ue, it as We, l as Ge, lt as Ke, m as qe, mt as Je, n as Ye, nt as Xe, ot as Ze, pt as Qe, r as $e, rt as et, st as tt, t as nt, tt as rt, v as it, w as at, x as ot, y as st } from "./effectCategories-
|
|
4
|
-
import { n as ct, t as lt } from "./TreePicker-
|
|
5
|
-
import { I as ut, N as dt, a as ft, c as pt, i as mt, m as ht, n as gt, o as _t, r as vt } from "./store-
|
|
6
|
-
import { h as yt, r as bt, s as xt, t as St, u as Ct } from "./morphStore-
|
|
1
|
+
import { $ as e, B as t, C as n, D as r, Dn as i, F as a, I as o, J as s, Kn as c, L as l, Mt as u, Q as d, Qn as f, Rt as p, S as m, St as h, Tn as g, Wn as _, X as v, Y as y, Yn as b, Z as x, a as S, at as C, c as w, d as T, dn as E, er as D, et as ee, f as O, gt as te, hn as ne, it as k, l as re, ln as A, m as ie, mn as ae, mt as oe, n as se, nt as ce, o as le, ot as ue, p as de, pn as fe, q as pe, qn as me, rt as he, s as ge, t as _e, tr as ve, tt as ye, u as be, un as xe, wn as Se, x as Ce, yn as we } from "./rolls-yFvM7gmE.js";
|
|
2
|
+
import { c as Te, n as Ee, t as De } from "./useLayerEdit-BLjEK2Gv.js";
|
|
3
|
+
import { C as Oe, D as ke, E as Ae, O as je, S as Me, T as Ne, _ as Pe, at as Fe, b as Ie, ct as Le, d as Re, dt as ze, f as Be, ft as Ve, h as He, ht as Ue, it as We, l as Ge, lt as Ke, m as qe, mt as Je, n as Ye, nt as Xe, ot as Ze, pt as Qe, r as $e, rt as et, st as tt, t as nt, tt as rt, v as it, w as at, x as ot, y as st } from "./effectCategories-o8c1BoBZ.js";
|
|
4
|
+
import { n as ct, t as lt } from "./TreePicker-D4vypelv.js";
|
|
5
|
+
import { I as ut, N as dt, a as ft, c as pt, i as mt, m as ht, n as gt, o as _t, r as vt } from "./store-rdo7FUxn.js";
|
|
6
|
+
import { h as yt, r as bt, s as xt, t as St, u as Ct } from "./morphStore-CJc9nt6q.js";
|
|
7
7
|
import { BezierPathEditor as wt, Button as j, CurveEditor as Tt, Dialog as Et, Divider as Dt, Dropdown as Ot, FullscreenOverlay as kt, Input as At, KeyframeEditor as jt, LabeledControl as Mt, LabeledControlSection as Nt, ModalShell as Pt, SettingsCell as Ft, SettingsDisclosure as It, SettingsFieldMap as Lt, SettingsGrid as Rt, SettingsGroup as zt, SettingsLights as Bt, SettingsPoint as Vt, SettingsRamp as Ht, SettingsRampHead as Ut, SettingsRange as Wt, SettingsRow as Gt, SettingsSegmented as Kt, SettingsSelect as qt, SettingsSlider as Jt, SettingsText as Yt, SettingsToggle as Xt, ShellSearchOverlay as Zt, Slider as Qt, StepList as $t, TabsRow as en, ToggleSwitch as tn, Tooltip as nn, XYPad as rn } from "@kolkrabbi/kol-component";
|
|
8
|
-
import {
|
|
8
|
+
import { Fragment as an, useCallback as on, useEffect as sn, useId as cn, useMemo as ln, useRef as un, useState as M } from "react";
|
|
9
9
|
import { Fragment as N, jsx as P, jsxs as F } from "react/jsx-runtime";
|
|
10
|
-
import { PropertyRail as
|
|
10
|
+
import { PropertyRail as dn } from "@kolkrabbi/kol-shell";
|
|
11
11
|
//#region src/loops/taxonomy.js
|
|
12
|
-
var
|
|
12
|
+
var fn = [
|
|
13
13
|
{
|
|
14
14
|
label: "Scanline",
|
|
15
15
|
groups: ["scanline"]
|
|
@@ -70,31 +70,31 @@ var dn = [
|
|
|
70
70
|
softforms3d: "Soft forms"
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
|
-
],
|
|
73
|
+
], pn = [{
|
|
74
74
|
label: "Para Type",
|
|
75
75
|
groups: ["paratype"]
|
|
76
|
-
}],
|
|
76
|
+
}], mn = fn, hn = {
|
|
77
77
|
optic: "Pattern · Effects",
|
|
78
78
|
paratype: "Para Type · Misc",
|
|
79
79
|
distress: "Distressor · Vector",
|
|
80
80
|
modulator: "Modulator · Vector"
|
|
81
|
-
},
|
|
82
|
-
function
|
|
83
|
-
let t = { ...
|
|
84
|
-
for (let n of Object.keys(
|
|
81
|
+
}, gn = Object.fromEntries(rt.params.map((e) => [e.key, e.default]));
|
|
82
|
+
function _n(e) {
|
|
83
|
+
let t = { ...gn };
|
|
84
|
+
for (let n of Object.keys(gn)) {
|
|
85
85
|
let r = e[n];
|
|
86
86
|
r != null && typeof r != "object" && (t[n] = r);
|
|
87
87
|
}
|
|
88
88
|
return t;
|
|
89
89
|
}
|
|
90
|
-
function
|
|
90
|
+
function vn(e, t) {
|
|
91
91
|
let n = t.stemWidth ?? 18, r = 0;
|
|
92
92
|
return (t.serif ?? 0) > 0 && (r = Math.max(2, n * .7) * t.serif + (t.jut ?? 0) * n * 1.5 + 1), e === "i" && (r = Math.max(r, n * .1 + 1)), r;
|
|
93
93
|
}
|
|
94
|
-
var
|
|
95
|
-
function
|
|
94
|
+
var yn = (e) => Number(e.toFixed(2));
|
|
95
|
+
function bn(e, t, n) {
|
|
96
96
|
if (!e || e.loopId !== "paratype-glyph") return null;
|
|
97
|
-
let r = Math.max(1, e.w ?? 480), i = Math.max(1, e.h ?? 480), a =
|
|
97
|
+
let r = Math.max(1, e.w ?? 480), i = Math.max(1, e.h ?? 480), a = _n(e), o = Xe(a, r, i);
|
|
98
98
|
if (!o.length) return null;
|
|
99
99
|
let s = [];
|
|
100
100
|
t.bg && s.push({
|
|
@@ -111,7 +111,7 @@ function yn(e, t, n) {
|
|
|
111
111
|
blend: "normal"
|
|
112
112
|
});
|
|
113
113
|
for (let e of o) {
|
|
114
|
-
let r =
|
|
114
|
+
let r = vn(e.name, a) + 1.5, i = 1.5, o = e.gw + r * 2, c = e.gh + i * 2, l = e.g.paths.map((e) => `<path d="${e.d.replace(/\s+/g, " ").trim()}"${e.fillRule ? ` fill-rule="${e.fillRule}"` : ""} fill="currentColor"/>`).join(""), u = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${yn(o)} ${yn(c)}" preserveAspectRatio="none"><g transform="translate(${yn(r)} ${yn(e.y1 + i)}) scale(1 -1)">${l}</g></svg>`;
|
|
115
115
|
s.push({
|
|
116
116
|
id: n("shape"),
|
|
117
117
|
type: "shape",
|
|
@@ -119,10 +119,10 @@ function yn(e, t, n) {
|
|
|
119
119
|
svg: u,
|
|
120
120
|
fit: "fill",
|
|
121
121
|
color: t.fg,
|
|
122
|
-
x:
|
|
123
|
-
y:
|
|
124
|
-
w: Math.max(1,
|
|
125
|
-
h: Math.max(1,
|
|
122
|
+
x: yn(e.tx - r * e.s),
|
|
123
|
+
y: yn(e.ty - (e.y1 + i) * e.s),
|
|
124
|
+
w: Math.max(1, yn(o * e.s)),
|
|
125
|
+
h: Math.max(1, yn(c * e.s)),
|
|
126
126
|
visible: !0,
|
|
127
127
|
opacity: 1,
|
|
128
128
|
blend: "normal"
|
|
@@ -143,7 +143,7 @@ function yn(e, t, n) {
|
|
|
143
143
|
}
|
|
144
144
|
//#endregion
|
|
145
145
|
//#region src/editor/labs/presetStep.js
|
|
146
|
-
function
|
|
146
|
+
function xn(e, t) {
|
|
147
147
|
return {
|
|
148
148
|
loopGroup: t,
|
|
149
149
|
presetId: e.id,
|
|
@@ -155,7 +155,7 @@ function bn(e, t) {
|
|
|
155
155
|
...Ne(e)
|
|
156
156
|
};
|
|
157
157
|
}
|
|
158
|
-
function
|
|
158
|
+
function Sn(e, t, n = "preset") {
|
|
159
159
|
if (!e?.loopGroup) return null;
|
|
160
160
|
let r = e.loopGroup, i = Ae(r);
|
|
161
161
|
if (!i.length) return null;
|
|
@@ -164,12 +164,12 @@ function xn(e, t, n = "preset") {
|
|
|
164
164
|
let e = [...new Set(i.map((e) => e.sub).filter(Boolean))];
|
|
165
165
|
if (e.length < 2) return null;
|
|
166
166
|
let n = e[o(e.indexOf(a.sub) + t, e.length)];
|
|
167
|
-
return
|
|
167
|
+
return xn(i.find((e) => e.sub === n), r);
|
|
168
168
|
}
|
|
169
169
|
let s = a.sub ? i.filter((e) => e.sub === a.sub) : i;
|
|
170
|
-
return s.length < 2 ? null :
|
|
170
|
+
return s.length < 2 ? null : xn(s[o(s.indexOf(a) + t, s.length)], r);
|
|
171
171
|
}
|
|
172
|
-
var
|
|
172
|
+
var Cn = {
|
|
173
173
|
h: ["preset", -1],
|
|
174
174
|
ArrowLeft: ["preset", -1],
|
|
175
175
|
l: ["preset", 1],
|
|
@@ -179,13 +179,13 @@ var Sn = {
|
|
|
179
179
|
j: ["category", 1],
|
|
180
180
|
ArrowDown: ["category", 1]
|
|
181
181
|
};
|
|
182
|
-
function
|
|
182
|
+
function wn(e, t, n) {
|
|
183
183
|
let r = e?.loopGroup;
|
|
184
184
|
if (!r) return !1;
|
|
185
185
|
let i = Ae(r).filter((e) => !st(e)), a = i.find((t) => t.id === e.presetId) ?? i[0];
|
|
186
186
|
return t === "type" ? n.some((e) => e !== r && Ae(e).some((e) => !st(e))) : t === "category" ? new Set(i.map((e) => e.sub).filter((e) => e && e !== a?.sub)).size > 0 : i.some((e) => e.id !== a?.id && (!a?.sub || e.sub === a.sub));
|
|
187
187
|
}
|
|
188
|
-
function
|
|
188
|
+
function Tn(e, t, n, r) {
|
|
189
189
|
let i = e?.loopGroup;
|
|
190
190
|
if (!i) return null;
|
|
191
191
|
let a = (e) => e[Math.floor(n() * e.length)], o = (e) => Ae(e).filter((e) => !st(e));
|
|
@@ -193,19 +193,19 @@ function wn(e, t, n, r) {
|
|
|
193
193
|
let e = r.filter((e) => e !== i && o(e).length);
|
|
194
194
|
if (!e.length) return null;
|
|
195
195
|
let t = a(e);
|
|
196
|
-
return
|
|
196
|
+
return xn(a(o(t)), t);
|
|
197
197
|
}
|
|
198
198
|
let s = o(i), c = s.find((t) => t.id === e.presetId) ?? s[0];
|
|
199
199
|
if (t === "category") {
|
|
200
200
|
let e = [...new Set(s.map((e) => e.sub).filter((e) => e && e !== c?.sub))];
|
|
201
201
|
if (!e.length) return null;
|
|
202
202
|
let t = a(e);
|
|
203
|
-
return
|
|
203
|
+
return xn(a(s.filter((e) => e.sub === t)), i);
|
|
204
204
|
}
|
|
205
205
|
let l = s.filter((e) => e.id !== c?.id && (!c?.sub || e.sub === c.sub));
|
|
206
|
-
return l.length ?
|
|
206
|
+
return l.length ? xn(a(l), i) : null;
|
|
207
207
|
}
|
|
208
|
-
function
|
|
208
|
+
function En(e, t, n) {
|
|
209
209
|
let r = {};
|
|
210
210
|
for (let i of t) {
|
|
211
211
|
if (i.type !== "range" || i.noRandom || i.min == null || i.max == null) continue;
|
|
@@ -216,32 +216,32 @@ function Tn(e, t, n) {
|
|
|
216
216
|
}
|
|
217
217
|
return r;
|
|
218
218
|
}
|
|
219
|
-
var
|
|
219
|
+
var Dn = null, On = () => Dn ??= [...$e(Be).filter((e) => !e.rack).map((e) => ({
|
|
220
220
|
id: e.id,
|
|
221
221
|
filters: e.filters
|
|
222
222
|
})), ...nt.map((e) => ({
|
|
223
223
|
id: e.id,
|
|
224
224
|
filters: Re(e, Be)
|
|
225
225
|
}))].filter((e) => e.filters.length);
|
|
226
|
-
function
|
|
226
|
+
function kn(e, t, n) {
|
|
227
227
|
let r = (e) => e[Math.floor(n() * e.length)], i = Ye(e);
|
|
228
228
|
if (t === "type") {
|
|
229
|
-
let e =
|
|
229
|
+
let e = On().filter((e) => e.id !== i);
|
|
230
230
|
return e.length ? r(r(e).filters).id : null;
|
|
231
231
|
}
|
|
232
|
-
let a =
|
|
232
|
+
let a = On().find((e) => e.id === i)?.filters.filter((t) => t.id !== e) ?? [];
|
|
233
233
|
return a.length ? r(a).id : null;
|
|
234
234
|
}
|
|
235
|
-
function
|
|
235
|
+
function An(e, t, n) {
|
|
236
236
|
let r = Ge(e?.id), i = (e?.params.find((e) => e.key === r)?.options ?? []).map((e) => typeof e == "object" ? e.value : e).filter((e) => e !== t[r]);
|
|
237
237
|
return i.length ? i[Math.floor(n() * i.length)] : null;
|
|
238
238
|
}
|
|
239
|
-
function
|
|
240
|
-
return e ? t === "type" ?
|
|
239
|
+
function jn(e, t) {
|
|
240
|
+
return e ? t === "type" ? On().length > 1 : t === "category" ? (On().find((t) => t.id === Ye(e.id))?.filters.length ?? 0) > 1 : t === "preset" ? !!Ge(e.id) : !0 : !1;
|
|
241
241
|
}
|
|
242
242
|
//#endregion
|
|
243
243
|
//#region src/editor/compose/inspectors/LoopPicker.jsx
|
|
244
|
-
function
|
|
244
|
+
function Mn({ layer: e, tree: t = mn, inline: n = !0, about: r = null }) {
|
|
245
245
|
let { updateLayer: i } = s(), a = l(), o = e.loopGroup ?? "shape", c = t.find((e) => e.groups.includes(o)) ?? null, u = Ae(o), d = u.find((t) => t.id === e.presetId), f = [...new Set(u.map((e) => e.sub).filter(Boolean))], p = d?.sub ?? f[0], m = f.length ? u.filter((e) => e.sub === p) : u, h = (t, n = o) => {
|
|
246
246
|
t && i(e.id, {
|
|
247
247
|
loopGroup: n,
|
|
@@ -272,7 +272,7 @@ function jn({ layer: e, tree: t = pn, inline: n = !0, about: r = null }) {
|
|
|
272
272
|
}
|
|
273
273
|
}) : /* @__PURE__ */ P("span", {
|
|
274
274
|
className: "kol-helper-12 text-meta px-1",
|
|
275
|
-
children:
|
|
275
|
+
children: hn[o] ?? Pe(o).label
|
|
276
276
|
}), c && c.groups.length > 1 && /* @__PURE__ */ P(lt, {
|
|
277
277
|
options: c.groups.map((e) => ({
|
|
278
278
|
value: e,
|
|
@@ -304,7 +304,7 @@ function jn({ layer: e, tree: t = pn, inline: n = !0, about: r = null }) {
|
|
|
304
304
|
iconOnly: "chevron-left",
|
|
305
305
|
"aria-label": "Previous preset (H)",
|
|
306
306
|
onClick: () => {
|
|
307
|
-
let t =
|
|
307
|
+
let t = Sn(e, -1);
|
|
308
308
|
t && i(e.id, t);
|
|
309
309
|
}
|
|
310
310
|
}),
|
|
@@ -322,7 +322,7 @@ function jn({ layer: e, tree: t = pn, inline: n = !0, about: r = null }) {
|
|
|
322
322
|
iconOnly: "chevron-right",
|
|
323
323
|
"aria-label": "Next preset (L)",
|
|
324
324
|
onClick: () => {
|
|
325
|
-
let t =
|
|
325
|
+
let t = Sn(e, 1);
|
|
326
326
|
t && i(e.id, t);
|
|
327
327
|
}
|
|
328
328
|
}),
|
|
@@ -334,7 +334,7 @@ function jn({ layer: e, tree: t = pn, inline: n = !0, about: r = null }) {
|
|
|
334
334
|
}
|
|
335
335
|
//#endregion
|
|
336
336
|
//#region src/editor/params/RollScopesDialog.jsx
|
|
337
|
-
function
|
|
337
|
+
function Nn({ open: e, onClose: t, schema: n, layer: r, size: i = "md" }) {
|
|
338
338
|
if (c(), !e) return null;
|
|
339
339
|
let a = le(n ?? [], r);
|
|
340
340
|
return /* @__PURE__ */ P(kt, {
|
|
@@ -385,7 +385,7 @@ function Mn({ open: e, onClose: t, schema: n, layer: r, size: i = "md" }) {
|
|
|
385
385
|
}
|
|
386
386
|
//#endregion
|
|
387
387
|
//#region src/editor/params/motionPresets.js
|
|
388
|
-
var
|
|
388
|
+
var Pn = (e) => D("generators")?.loopById(e) ?? null, Fn = {
|
|
389
389
|
frame: [
|
|
390
390
|
{
|
|
391
391
|
id: "static",
|
|
@@ -451,7 +451,7 @@ var Nn = (e) => D("generators")?.loopById(e) ?? null, Pn = {
|
|
|
451
451
|
}
|
|
452
452
|
}
|
|
453
453
|
]
|
|
454
|
-
},
|
|
454
|
+
}, In = [
|
|
455
455
|
{
|
|
456
456
|
id: "static",
|
|
457
457
|
label: "Static",
|
|
@@ -505,7 +505,7 @@ var Nn = (e) => D("generators")?.loopById(e) ?? null, Pn = {
|
|
|
505
505
|
panDir: "anti"
|
|
506
506
|
}
|
|
507
507
|
}
|
|
508
|
-
],
|
|
508
|
+
], Ln = [
|
|
509
509
|
{
|
|
510
510
|
id: "static",
|
|
511
511
|
label: "Static",
|
|
@@ -618,7 +618,7 @@ var Nn = (e) => D("generators")?.loopById(e) ?? null, Pn = {
|
|
|
618
618
|
colorMix: 0
|
|
619
619
|
}
|
|
620
620
|
}
|
|
621
|
-
],
|
|
621
|
+
], Rn = [
|
|
622
622
|
{
|
|
623
623
|
id: "static",
|
|
624
624
|
label: "Static",
|
|
@@ -686,7 +686,7 @@ var Nn = (e) => D("generators")?.loopById(e) ?? null, Pn = {
|
|
|
686
686
|
stripeAngle: 135
|
|
687
687
|
}
|
|
688
688
|
}
|
|
689
|
-
],
|
|
689
|
+
], zn = [
|
|
690
690
|
{
|
|
691
691
|
id: "static",
|
|
692
692
|
label: "Static",
|
|
@@ -751,7 +751,7 @@ var Nn = (e) => D("generators")?.loopById(e) ?? null, Pn = {
|
|
|
751
751
|
stripeAngle: 45
|
|
752
752
|
}
|
|
753
753
|
}
|
|
754
|
-
],
|
|
754
|
+
], Bn = [
|
|
755
755
|
{
|
|
756
756
|
id: "static",
|
|
757
757
|
label: "Static",
|
|
@@ -788,7 +788,7 @@ var Nn = (e) => D("generators")?.loopById(e) ?? null, Pn = {
|
|
|
788
788
|
fieldCycles: 1
|
|
789
789
|
}
|
|
790
790
|
}
|
|
791
|
-
],
|
|
791
|
+
], Vn = [
|
|
792
792
|
{
|
|
793
793
|
id: "static",
|
|
794
794
|
label: "Static",
|
|
@@ -833,7 +833,7 @@ var Nn = (e) => D("generators")?.loopById(e) ?? null, Pn = {
|
|
|
833
833
|
fade: .4
|
|
834
834
|
}
|
|
835
835
|
}
|
|
836
|
-
],
|
|
836
|
+
], Hn = {
|
|
837
837
|
frame: [
|
|
838
838
|
{
|
|
839
839
|
id: "static",
|
|
@@ -976,7 +976,7 @@ var Nn = (e) => D("generators")?.loopById(e) ?? null, Pn = {
|
|
|
976
976
|
}
|
|
977
977
|
}
|
|
978
978
|
]
|
|
979
|
-
},
|
|
979
|
+
}, Un = {
|
|
980
980
|
frame: [
|
|
981
981
|
{
|
|
982
982
|
id: "static",
|
|
@@ -1050,7 +1050,7 @@ var Nn = (e) => D("generators")?.loopById(e) ?? null, Pn = {
|
|
|
1050
1050
|
}
|
|
1051
1051
|
}
|
|
1052
1052
|
]
|
|
1053
|
-
},
|
|
1053
|
+
}, Wn = {
|
|
1054
1054
|
frame: [
|
|
1055
1055
|
{
|
|
1056
1056
|
id: "static",
|
|
@@ -1137,7 +1137,7 @@ var Nn = (e) => D("generators")?.loopById(e) ?? null, Pn = {
|
|
|
1137
1137
|
}
|
|
1138
1138
|
}
|
|
1139
1139
|
]
|
|
1140
|
-
},
|
|
1140
|
+
}, Gn = {
|
|
1141
1141
|
frame: [
|
|
1142
1142
|
{
|
|
1143
1143
|
id: "static",
|
|
@@ -1219,7 +1219,7 @@ var Nn = (e) => D("generators")?.loopById(e) ?? null, Pn = {
|
|
|
1219
1219
|
}
|
|
1220
1220
|
}
|
|
1221
1221
|
]
|
|
1222
|
-
},
|
|
1222
|
+
}, Kn = {
|
|
1223
1223
|
frame: [
|
|
1224
1224
|
{
|
|
1225
1225
|
id: "static",
|
|
@@ -1289,30 +1289,30 @@ var Nn = (e) => D("generators")?.loopById(e) ?? null, Pn = {
|
|
|
1289
1289
|
}
|
|
1290
1290
|
]
|
|
1291
1291
|
};
|
|
1292
|
-
function
|
|
1292
|
+
function qn(e, t = {}) {
|
|
1293
1293
|
switch (e) {
|
|
1294
|
-
case "scanline": return
|
|
1294
|
+
case "scanline": return Fn;
|
|
1295
1295
|
case "pattern-rules": {
|
|
1296
1296
|
let e = t.render ?? "tiles", n = e === "field" && t.field === "organic";
|
|
1297
1297
|
return {
|
|
1298
|
-
frame: e === "tiles" ?
|
|
1299
|
-
form: e === "tiles" ?
|
|
1298
|
+
frame: e === "tiles" ? In : n ? zn : Rn,
|
|
1299
|
+
form: e === "tiles" ? Ln : e === "weave" ? Vn : Bn
|
|
1300
1300
|
};
|
|
1301
1301
|
}
|
|
1302
|
-
case "math-waveform": return
|
|
1303
|
-
case "math-surface": return
|
|
1304
|
-
case "math-field": return (t.kind ?? "scalar") === "complex" ?
|
|
1305
|
-
default: return
|
|
1302
|
+
case "math-waveform": return Hn;
|
|
1303
|
+
case "math-surface": return Un;
|
|
1304
|
+
case "math-field": return (t.kind ?? "scalar") === "complex" ? Gn : Wn;
|
|
1305
|
+
default: return Pn(e)?.params?.some((e) => e.key === "vpSpin") ? Kn : null;
|
|
1306
1306
|
}
|
|
1307
1307
|
}
|
|
1308
|
-
function
|
|
1308
|
+
function Jn(e) {
|
|
1309
1309
|
let t = /* @__PURE__ */ new Set();
|
|
1310
1310
|
for (let n of e ?? []) for (let e of Object.keys(n.params ?? {})) t.add(e);
|
|
1311
1311
|
return t;
|
|
1312
1312
|
}
|
|
1313
1313
|
//#endregion
|
|
1314
1314
|
//#region src/editor/params/lookPresets.js
|
|
1315
|
-
var
|
|
1315
|
+
var Yn = {
|
|
1316
1316
|
Spectrum: {
|
|
1317
1317
|
palette: "spectrum",
|
|
1318
1318
|
spectral: !0,
|
|
@@ -1351,16 +1351,16 @@ var Jn = {
|
|
|
1351
1351
|
rim: 1
|
|
1352
1352
|
}
|
|
1353
1353
|
};
|
|
1354
|
-
function
|
|
1355
|
-
return e === "softforms" || e === "softforms3d" ?
|
|
1354
|
+
function Xn(e) {
|
|
1355
|
+
return e === "softforms" || e === "softforms3d" ? Yn : null;
|
|
1356
1356
|
}
|
|
1357
1357
|
//#endregion
|
|
1358
1358
|
//#region src/loops/gl/primitiveEasing.js
|
|
1359
|
-
function
|
|
1359
|
+
function Zn(e) {
|
|
1360
1360
|
let t = 7.5625, n = 2.75;
|
|
1361
1361
|
return e < 1 / n ? t * e * e : e < 2 / n ? (e -= 1.5 / n, t * e * e + .75) : e < 2.5 / n ? (e -= 2.25 / n, t * e * e + .9375) : (e -= 2.625 / n, t * e * e + .984375);
|
|
1362
1362
|
}
|
|
1363
|
-
var
|
|
1363
|
+
var Qn = {
|
|
1364
1364
|
linear: (e) => e,
|
|
1365
1365
|
in: (e) => e * e,
|
|
1366
1366
|
out: (e) => 1 - (1 - e) * (1 - e),
|
|
@@ -1382,8 +1382,8 @@ var Zn = {
|
|
|
1382
1382
|
let t = 2 * Math.PI / 3;
|
|
1383
1383
|
return 2 ** (-10 * e) * Math.sin((e * 10 - .75) * t) + 1;
|
|
1384
1384
|
},
|
|
1385
|
-
bounceOut:
|
|
1386
|
-
},
|
|
1385
|
+
bounceOut: Zn
|
|
1386
|
+
}, $n = {
|
|
1387
1387
|
linear: "Linear",
|
|
1388
1388
|
in: "Ease in",
|
|
1389
1389
|
out: "Ease out",
|
|
@@ -1398,14 +1398,14 @@ var Zn = {
|
|
|
1398
1398
|
backInOut: "Back in-out",
|
|
1399
1399
|
elasticOut: "Elastic out",
|
|
1400
1400
|
bounceOut: "Bounce out"
|
|
1401
|
-
},
|
|
1401
|
+
}, er = Object.keys(Qn).map((e) => ({
|
|
1402
1402
|
value: e,
|
|
1403
|
-
label:
|
|
1404
|
-
})),
|
|
1403
|
+
label: $n[e] || e
|
|
1404
|
+
})), tr = (e, t, n) => [
|
|
1405
1405
|
f(e[0], t[0], n),
|
|
1406
1406
|
f(e[1], t[1], n),
|
|
1407
1407
|
f(e[2], t[2], n)
|
|
1408
|
-
],
|
|
1408
|
+
], nr = (e) => ({
|
|
1409
1409
|
rot: e.rot || [
|
|
1410
1410
|
0,
|
|
1411
1411
|
0,
|
|
@@ -1418,14 +1418,14 @@ var Zn = {
|
|
|
1418
1418
|
],
|
|
1419
1419
|
scale: e.scale ?? 1
|
|
1420
1420
|
});
|
|
1421
|
-
function
|
|
1421
|
+
function rr(e, t) {
|
|
1422
1422
|
if (!e || !e.length) return {};
|
|
1423
|
-
if (e.length === 1) return
|
|
1423
|
+
if (e.length === 1) return nr(e[0]);
|
|
1424
1424
|
let n = 0;
|
|
1425
1425
|
for (; n < e.length - 1 && t > e[n + 1].t;) n++;
|
|
1426
1426
|
let r = e[n], i = e[n + 1] || r, a = i.t - r.t || 1, o = Math.max(0, Math.min(1, (t - r.t) / a));
|
|
1427
|
-
return o = (
|
|
1428
|
-
rot:
|
|
1427
|
+
return o = (Qn[i.ease] || Qn.inout)(o), {
|
|
1428
|
+
rot: tr(r.rot || [
|
|
1429
1429
|
0,
|
|
1430
1430
|
0,
|
|
1431
1431
|
0
|
|
@@ -1434,7 +1434,7 @@ function nr(e, t) {
|
|
|
1434
1434
|
0,
|
|
1435
1435
|
0
|
|
1436
1436
|
], o),
|
|
1437
|
-
pos:
|
|
1437
|
+
pos: tr(r.pos || [
|
|
1438
1438
|
0,
|
|
1439
1439
|
0,
|
|
1440
1440
|
0
|
|
@@ -1446,7 +1446,7 @@ function nr(e, t) {
|
|
|
1446
1446
|
scale: f(r.scale ?? 1, i.scale ?? 1, o)
|
|
1447
1447
|
};
|
|
1448
1448
|
}
|
|
1449
|
-
var
|
|
1449
|
+
var ir = [{
|
|
1450
1450
|
t: 0,
|
|
1451
1451
|
rot: [
|
|
1452
1452
|
0,
|
|
@@ -1477,30 +1477,30 @@ var rr = [{
|
|
|
1477
1477
|
}];
|
|
1478
1478
|
//#endregion
|
|
1479
1479
|
//#region src/loops/gl/phase.js
|
|
1480
|
-
function
|
|
1480
|
+
function ar(e, t) {
|
|
1481
1481
|
let n = Number(e), r = Number(t);
|
|
1482
1482
|
return !n || n <= 0 || !r || r <= 0 ? 1 : Math.max(1, Math.round(r / n));
|
|
1483
1483
|
}
|
|
1484
|
-
function
|
|
1484
|
+
function or(e, t) {
|
|
1485
1485
|
return e * t % 1;
|
|
1486
1486
|
}
|
|
1487
1487
|
//#endregion
|
|
1488
1488
|
//#region src/editor/compose/inspectors/KeyframeEditor.jsx
|
|
1489
|
-
function
|
|
1490
|
-
let r = () =>
|
|
1489
|
+
function sr({ layer: e, patch: t, defaultDuration: n = 8 }) {
|
|
1490
|
+
let r = () => ar(e.duration ?? n, i.getLoopSeconds());
|
|
1491
1491
|
return /* @__PURE__ */ P(jt, {
|
|
1492
1492
|
keyframes: e.keyframes,
|
|
1493
1493
|
onChange: (e) => t({ keyframes: e }),
|
|
1494
1494
|
t: () => i.getT() * r() % 1,
|
|
1495
1495
|
onPause: () => i.pause(),
|
|
1496
1496
|
onSeek: (e) => i.seek(e / r()),
|
|
1497
|
-
easeOptions:
|
|
1498
|
-
defaultKeyframes:
|
|
1497
|
+
easeOptions: er,
|
|
1498
|
+
defaultKeyframes: ir
|
|
1499
1499
|
});
|
|
1500
1500
|
}
|
|
1501
1501
|
//#endregion
|
|
1502
1502
|
//#region src/editor/compose/inspectors/CameraPoseSlots.jsx
|
|
1503
|
-
function
|
|
1503
|
+
function cr({ layer: e, patch: t, camParams: n, isEngine: r, showHeader: i = !1 }) {
|
|
1504
1504
|
let a = l(), o = Array.isArray(e._camSlots) ? e._camSlots : [], s = [
|
|
1505
1505
|
o[0] ?? null,
|
|
1506
1506
|
o[1] ?? null,
|
|
@@ -1534,7 +1534,7 @@ function sr({ layer: e, patch: t, camParams: n, isEngine: r, showHeader: i = !1
|
|
|
1534
1534
|
onClick: () => {
|
|
1535
1535
|
let i = {};
|
|
1536
1536
|
for (let e of n) i[e.key] = e.default;
|
|
1537
|
-
t(i), r && import("./host-
|
|
1537
|
+
t(i), r && import("./host-BCPL5xi5.js").then((t) => t.hostAction?.(e.id, "resetCamera")).catch(() => {});
|
|
1538
1538
|
},
|
|
1539
1539
|
children: "Reset"
|
|
1540
1540
|
})]
|
|
@@ -1542,7 +1542,7 @@ function sr({ layer: e, patch: t, camParams: n, isEngine: r, showHeader: i = !1
|
|
|
1542
1542
|
}
|
|
1543
1543
|
//#endregion
|
|
1544
1544
|
//#region src/editor/compose/inspectors/RulesEditor.jsx
|
|
1545
|
-
function
|
|
1545
|
+
function lr({ layer: e, patch: t, seed: n }) {
|
|
1546
1546
|
let r = l(), i = e.rules ?? [], a = (e, n) => t({
|
|
1547
1547
|
rules: e,
|
|
1548
1548
|
...n
|
|
@@ -1585,7 +1585,7 @@ function cr({ layer: e, patch: t, seed: n }) {
|
|
|
1585
1585
|
}
|
|
1586
1586
|
//#endregion
|
|
1587
1587
|
//#region src/editor/compose/inspectors/ProfileEditor.jsx
|
|
1588
|
-
var
|
|
1588
|
+
var ur = (e) => e.map((e) => ({
|
|
1589
1589
|
x: e.x,
|
|
1590
1590
|
y: (1 - e.y) / 2,
|
|
1591
1591
|
hl: {
|
|
@@ -1596,7 +1596,7 @@ var lr = (e) => e.map((e) => ({
|
|
|
1596
1596
|
x: e.hrx ?? 0,
|
|
1597
1597
|
y: -(e.hry ?? 0) / 2
|
|
1598
1598
|
}
|
|
1599
|
-
})),
|
|
1599
|
+
})), dr = (e) => e.map((e) => ({
|
|
1600
1600
|
x: e.x,
|
|
1601
1601
|
y: b(1 - 2 * e.y, -1, 1),
|
|
1602
1602
|
hlx: e.hl?.x ?? 0,
|
|
@@ -1604,12 +1604,12 @@ var lr = (e) => e.map((e) => ({
|
|
|
1604
1604
|
hrx: e.hr?.x ?? 0,
|
|
1605
1605
|
hry: -2 * (e.hr?.y ?? 0)
|
|
1606
1606
|
}));
|
|
1607
|
-
function
|
|
1607
|
+
function fr({ value: e, onChange: t }) {
|
|
1608
1608
|
let n = Array.isArray(e) && e.length > 1 ? e : Qe, r = l();
|
|
1609
1609
|
return /* @__PURE__ */ P(wt, {
|
|
1610
|
-
value:
|
|
1610
|
+
value: ur(n),
|
|
1611
1611
|
onChange: (e) => {
|
|
1612
|
-
let r =
|
|
1612
|
+
let r = dr(e);
|
|
1613
1613
|
if (r.length < 3 || r[0].x > .001 || r[r.length - 1].x < .999) return;
|
|
1614
1614
|
r[0].x = 0, r[r.length - 1].x = 1;
|
|
1615
1615
|
let i = Math.abs(r[0].y - n[0].y) > 1e-6 ? r[0].y : r[r.length - 1].y;
|
|
@@ -1623,10 +1623,10 @@ function dr({ value: e, onChange: t }) {
|
|
|
1623
1623
|
ariaLabel: "Profile curve"
|
|
1624
1624
|
});
|
|
1625
1625
|
}
|
|
1626
|
-
function
|
|
1626
|
+
function pr({ layer: e, patch: t }) {
|
|
1627
1627
|
return e.render !== "field" || e.field !== "organic" || e.waveProfile !== "custom" ? null : /* @__PURE__ */ P(Mt, {
|
|
1628
1628
|
label: "Profile curve",
|
|
1629
|
-
children: /* @__PURE__ */ P(
|
|
1629
|
+
children: /* @__PURE__ */ P(fr, {
|
|
1630
1630
|
value: Array.isArray(e.waveCurve) && e.waveCurve.length > 1 ? e.waveCurve : Qe,
|
|
1631
1631
|
onChange: (e) => t({ waveCurve: e })
|
|
1632
1632
|
})
|
|
@@ -1634,7 +1634,7 @@ function fr({ layer: e, patch: t }) {
|
|
|
1634
1634
|
}
|
|
1635
1635
|
//#endregion
|
|
1636
1636
|
//#region src/editor/compose/inspectors/CurveEditor.jsx
|
|
1637
|
-
function
|
|
1637
|
+
function mr({ layer: e, patch: t }) {
|
|
1638
1638
|
let n = e.clip === "custom", r = n ? null : Ze(e.clip), i = n ? null : {
|
|
1639
1639
|
label: (et.find((t) => t.id === e.clip) || et[0]).label,
|
|
1640
1640
|
copies: r.copies,
|
|
@@ -1657,14 +1657,14 @@ function pr({ layer: e, patch: t }) {
|
|
|
1657
1657
|
}
|
|
1658
1658
|
//#endregion
|
|
1659
1659
|
//#region src/editor/compose/inspectors/ParatypeTools.jsx
|
|
1660
|
-
function
|
|
1661
|
-
return e?.loopId === "paratype-glyph" ? n === "generate" ? /* @__PURE__ */ P(
|
|
1660
|
+
function hr({ layer: e, patch: t, tab: n, renderAnimate: r }) {
|
|
1661
|
+
return e?.loopId === "paratype-glyph" ? n === "generate" ? /* @__PURE__ */ P(gr, { layer: e }) : n === "style" ? /* @__PURE__ */ P(_r, {
|
|
1662
1662
|
layer: e,
|
|
1663
1663
|
patch: t,
|
|
1664
1664
|
renderAnimate: r
|
|
1665
1665
|
}) : null : null;
|
|
1666
1666
|
}
|
|
1667
|
-
function
|
|
1667
|
+
function gr({ layer: e }) {
|
|
1668
1668
|
let t = l(), { flattenParatype: n } = s();
|
|
1669
1669
|
return n ? /* @__PURE__ */ P(nn, {
|
|
1670
1670
|
label: "Flatten the glyph(s) to vector shape layers (one-way)",
|
|
@@ -1678,7 +1678,7 @@ function hr({ layer: e }) {
|
|
|
1678
1678
|
})
|
|
1679
1679
|
}) : null;
|
|
1680
1680
|
}
|
|
1681
|
-
function
|
|
1681
|
+
function _r({ layer: e, patch: t, renderAnimate: n }) {
|
|
1682
1682
|
let i = l(), a = te(ot(e.loopId)?.params ?? [], e).filter((e) => e.type === "range");
|
|
1683
1683
|
if (a.length < 2) return null;
|
|
1684
1684
|
let o = (e, t) => a.some((t) => t.key === e) && e !== t ? e : a.find((e) => e.key !== t)?.key, s = o(e._xyX ?? "stemWidth", null), c = o(e._xyY ?? "oWidth", s), u = a.find((e) => e.key === s), d = a.find((e) => e.key === c);
|
|
@@ -1743,7 +1743,7 @@ function gr({ layer: e, patch: t, renderAnimate: n }) {
|
|
|
1743
1743
|
}
|
|
1744
1744
|
//#endregion
|
|
1745
1745
|
//#region src/editor/compose/inspectors/SoftformsLayers.jsx
|
|
1746
|
-
var
|
|
1746
|
+
var vr = 5, yr = [
|
|
1747
1747
|
{
|
|
1748
1748
|
value: "teardrop",
|
|
1749
1749
|
label: "Teardrop"
|
|
@@ -1764,7 +1764,7 @@ var _r = 5, vr = [
|
|
|
1764
1764
|
value: "super",
|
|
1765
1765
|
label: "Lozenge"
|
|
1766
1766
|
}
|
|
1767
|
-
],
|
|
1767
|
+
], br = [
|
|
1768
1768
|
{
|
|
1769
1769
|
value: "sphere",
|
|
1770
1770
|
label: "Sphere"
|
|
@@ -1781,7 +1781,7 @@ var _r = 5, vr = [
|
|
|
1781
1781
|
value: "lozenge",
|
|
1782
1782
|
label: "Lozenge"
|
|
1783
1783
|
}
|
|
1784
|
-
],
|
|
1784
|
+
], xr = [
|
|
1785
1785
|
{
|
|
1786
1786
|
k: "x",
|
|
1787
1787
|
label: "Position X",
|
|
@@ -1831,7 +1831,7 @@ var _r = 5, vr = [
|
|
|
1831
1831
|
step: .01,
|
|
1832
1832
|
def: 0
|
|
1833
1833
|
}
|
|
1834
|
-
],
|
|
1834
|
+
], Sr = [
|
|
1835
1835
|
{
|
|
1836
1836
|
k: "x",
|
|
1837
1837
|
label: "Position X",
|
|
@@ -1898,17 +1898,17 @@ var _r = 5, vr = [
|
|
|
1898
1898
|
step: .01,
|
|
1899
1899
|
def: 0
|
|
1900
1900
|
}
|
|
1901
|
-
],
|
|
1902
|
-
let n = t * Math.sqrt(e()), r = e() *
|
|
1901
|
+
], Cr = Math.PI * 2, I = (e) => Math.round(e * 100) / 100, L = (e, t, n) => t + e() * (n - t), wr = (e, t) => {
|
|
1902
|
+
let n = t * Math.sqrt(e()), r = e() * Cr;
|
|
1903
1903
|
return [n * Math.cos(r), n * Math.sin(r)];
|
|
1904
|
-
},
|
|
1905
|
-
let n = t * Math.cbrt(e()), r = e() *
|
|
1904
|
+
}, Tr = (e, t) => {
|
|
1905
|
+
let n = t * Math.cbrt(e()), r = e() * Cr, i = Math.acos(2 * e() - 1);
|
|
1906
1906
|
return [
|
|
1907
1907
|
n * Math.sin(i) * Math.cos(r),
|
|
1908
1908
|
n * Math.sin(i) * Math.sin(r),
|
|
1909
1909
|
n * Math.cos(i) * .8
|
|
1910
1910
|
];
|
|
1911
|
-
},
|
|
1911
|
+
}, Er = (e) => {
|
|
1912
1912
|
let t = e.length || 1, n = e.reduce((e, n) => ({
|
|
1913
1913
|
x: e.x + n.x / t,
|
|
1914
1914
|
y: e.y + n.y / t
|
|
@@ -1921,7 +1921,7 @@ var _r = 5, vr = [
|
|
|
1921
1921
|
x: I(e.x - n.x),
|
|
1922
1922
|
y: I(e.y - n.y)
|
|
1923
1923
|
}));
|
|
1924
|
-
},
|
|
1924
|
+
}, Dr = (e) => {
|
|
1925
1925
|
let t = e.length || 1, n = e.reduce((e, n) => ({
|
|
1926
1926
|
x: e.x + n.x / t,
|
|
1927
1927
|
y: e.y + n.y / t,
|
|
@@ -1937,16 +1937,16 @@ var _r = 5, vr = [
|
|
|
1937
1937
|
y: I(e.y - n.y),
|
|
1938
1938
|
z: I(e.z - n.z)
|
|
1939
1939
|
}));
|
|
1940
|
-
},
|
|
1941
|
-
function
|
|
1942
|
-
let t = l(), { updateLayer: n } = s(), r = De(e.id, { history: "coalesce" }), i = e.loopId === "softforms3d", a = i && !!e.metaball, o = i ?
|
|
1940
|
+
}, Or = (e, t) => e.find((e) => e.value === t)?.label ?? t;
|
|
1941
|
+
function kr({ layer: e }) {
|
|
1942
|
+
let t = l(), { updateLayer: n } = s(), r = De(e.id, { history: "coalesce" }), i = e.loopId === "softforms3d", a = i && !!e.metaball, o = i ? br : yr, c = i ? Sr : xr, u = a ? 2 : 1, d = Array.isArray(e.forms) ? e.forms : [], [f, p] = M(-1), m = f >= 0 && f < d.length ? d[f] : null, h = (t) => {
|
|
1943
1943
|
p(t), window.dispatchEvent(new CustomEvent("kol:softform-select", { detail: {
|
|
1944
1944
|
id: e.id,
|
|
1945
1945
|
index: t,
|
|
1946
1946
|
from: "panel"
|
|
1947
1947
|
} }));
|
|
1948
1948
|
};
|
|
1949
|
-
|
|
1949
|
+
sn(() => {
|
|
1950
1950
|
let t = (t) => {
|
|
1951
1951
|
t.detail?.id === e.id && t.detail.from === "canvas" && p(t.detail.index);
|
|
1952
1952
|
};
|
|
@@ -1956,7 +1956,7 @@ function Or({ layer: e }) {
|
|
|
1956
1956
|
...n,
|
|
1957
1957
|
[e]: t
|
|
1958
1958
|
} : n) }), v = () => {
|
|
1959
|
-
if (d.length >=
|
|
1959
|
+
if (d.length >= vr) return;
|
|
1960
1960
|
let e = i ? {
|
|
1961
1961
|
t: "sphere",
|
|
1962
1962
|
x: 0,
|
|
@@ -1978,7 +1978,7 @@ function Or({ layer: e }) {
|
|
|
1978
1978
|
};
|
|
1979
1979
|
g([...d, e]), h(d.length);
|
|
1980
1980
|
}, y = (e) => {
|
|
1981
|
-
if (d.length >=
|
|
1981
|
+
if (d.length >= vr) return;
|
|
1982
1982
|
let t = {
|
|
1983
1983
|
...d[e],
|
|
1984
1984
|
x: b((d[e].x ?? 0) + .12, -1.2, 1.2),
|
|
@@ -2011,11 +2011,11 @@ function Or({ layer: e }) {
|
|
|
2011
2011
|
let n = d.length - 1 - t;
|
|
2012
2012
|
return {
|
|
2013
2013
|
id: n,
|
|
2014
|
-
label:
|
|
2014
|
+
label: Or(o, d[n].t),
|
|
2015
2015
|
actions: [{
|
|
2016
2016
|
icon: "copy",
|
|
2017
2017
|
label: "Duplicate form",
|
|
2018
|
-
hidden: d.length >=
|
|
2018
|
+
hidden: d.length >= vr,
|
|
2019
2019
|
onClick: () => y(n)
|
|
2020
2020
|
}, {
|
|
2021
2021
|
icon: "trash",
|
|
@@ -2028,7 +2028,7 @@ function Or({ layer: e }) {
|
|
|
2028
2028
|
onSelect: (e) => h(d.length - 1 - e),
|
|
2029
2029
|
onMove: (e, t) => S(d.length - 1 - e, d.length - 1 - t)
|
|
2030
2030
|
}),
|
|
2031
|
-
d.length <
|
|
2031
|
+
d.length < vr && /* @__PURE__ */ P(j, {
|
|
2032
2032
|
tone: "primary",
|
|
2033
2033
|
size: t,
|
|
2034
2034
|
className: "w-full",
|
|
@@ -2170,8 +2170,8 @@ function Or({ layer: e }) {
|
|
|
2170
2170
|
if (i) {
|
|
2171
2171
|
if (a) {
|
|
2172
2172
|
let t = 2 + Math.floor(e() * 4), n = L(e, .45, .9);
|
|
2173
|
-
g(
|
|
2174
|
-
let [a, o, s] =
|
|
2173
|
+
g(Dr(Array.from({ length: t }, (r, i) => {
|
|
2174
|
+
let [a, o, s] = Tr(e, n), c = I(L(e, .5, .92));
|
|
2175
2175
|
return {
|
|
2176
2176
|
t: "sphere",
|
|
2177
2177
|
x: I(a),
|
|
@@ -2186,8 +2186,8 @@ function Or({ layer: e }) {
|
|
|
2186
2186
|
})));
|
|
2187
2187
|
} else {
|
|
2188
2188
|
let t = L(e, .6, 1.15);
|
|
2189
|
-
g(
|
|
2190
|
-
let [r, i, a] =
|
|
2189
|
+
g(Dr(d.map((n) => {
|
|
2190
|
+
let [r, i, a] = Tr(e, t);
|
|
2191
2191
|
return {
|
|
2192
2192
|
...n,
|
|
2193
2193
|
x: I(r),
|
|
@@ -2200,10 +2200,10 @@ function Or({ layer: e }) {
|
|
|
2200
2200
|
return;
|
|
2201
2201
|
}
|
|
2202
2202
|
let t = 2 + Math.floor(e() * 4), n = L(e, .45, .85);
|
|
2203
|
-
g(
|
|
2204
|
-
let [a, o] =
|
|
2203
|
+
g(Er(Array.from({ length: t }, (r, i) => {
|
|
2204
|
+
let [a, o] = wr(e, n);
|
|
2205
2205
|
return {
|
|
2206
|
-
t:
|
|
2206
|
+
t: yr[Math.floor(e() * yr.length)].value,
|
|
2207
2207
|
x: I(a),
|
|
2208
2208
|
y: I(o),
|
|
2209
2209
|
sx: I(L(e, .4, .85)),
|
|
@@ -2220,7 +2220,7 @@ function Or({ layer: e }) {
|
|
|
2220
2220
|
}
|
|
2221
2221
|
//#endregion
|
|
2222
2222
|
//#region src/editor/compose/inspectors/PenroseLayers.jsx
|
|
2223
|
-
var
|
|
2223
|
+
var Ar = [
|
|
2224
2224
|
{
|
|
2225
2225
|
role: "fg",
|
|
2226
2226
|
label: "Foreground"
|
|
@@ -2237,16 +2237,16 @@ var kr = [
|
|
|
2237
2237
|
role: "warm",
|
|
2238
2238
|
label: "Warm"
|
|
2239
2239
|
}
|
|
2240
|
-
],
|
|
2240
|
+
], jr = {
|
|
2241
2241
|
fg: 1,
|
|
2242
2242
|
accent: 1,
|
|
2243
2243
|
dim: 5,
|
|
2244
2244
|
warm: 1
|
|
2245
2245
|
};
|
|
2246
|
-
function
|
|
2246
|
+
function Mr({ layer: e, setProp: t, patch: n }) {
|
|
2247
2247
|
let r = l();
|
|
2248
2248
|
Ve();
|
|
2249
|
-
let i = ze(e.loopId), a =
|
|
2249
|
+
let i = ze(e.loopId), a = Ar.filter((e) => i?.has(e.role));
|
|
2250
2250
|
if (!a.length) return null;
|
|
2251
2251
|
let o = e._layerPrev ?? {};
|
|
2252
2252
|
return /* @__PURE__ */ P(Nt, {
|
|
@@ -2255,7 +2255,7 @@ function jr({ layer: e, setProp: t, patch: n }) {
|
|
|
2255
2255
|
children: /* @__PURE__ */ P($t, {
|
|
2256
2256
|
size: r,
|
|
2257
2257
|
items: a.map(({ role: n, label: r }) => {
|
|
2258
|
-
let i = `${n}Opacity`, a = Number(e[i] ??
|
|
2258
|
+
let i = `${n}Opacity`, a = Number(e[i] ?? jr[n]);
|
|
2259
2259
|
return {
|
|
2260
2260
|
id: n,
|
|
2261
2261
|
label: r,
|
|
@@ -2276,21 +2276,21 @@ function jr({ layer: e, setProp: t, patch: n }) {
|
|
|
2276
2276
|
};
|
|
2277
2277
|
}),
|
|
2278
2278
|
onToggleShown: (t) => {
|
|
2279
|
-
let { role: r } = a[t], i = `${r}Opacity`, s = Number(e[i] ??
|
|
2279
|
+
let { role: r } = a[t], i = `${r}Opacity`, s = Number(e[i] ?? jr[r]);
|
|
2280
2280
|
n(s > 0 ? {
|
|
2281
2281
|
[i]: 0,
|
|
2282
2282
|
_layerPrev: {
|
|
2283
2283
|
...o,
|
|
2284
2284
|
[r]: s
|
|
2285
2285
|
}
|
|
2286
|
-
} : { [i]: o[r] ||
|
|
2286
|
+
} : { [i]: o[r] || jr[r] });
|
|
2287
2287
|
}
|
|
2288
2288
|
})
|
|
2289
2289
|
});
|
|
2290
2290
|
}
|
|
2291
2291
|
//#endregion
|
|
2292
2292
|
//#region src/loops/about.js
|
|
2293
|
-
var
|
|
2293
|
+
var Nr = {
|
|
2294
2294
|
"morph-circle": "Shape interpolation — a circle eased into polygons, point by point",
|
|
2295
2295
|
"square-circle": "Superellipse morph between a square and a circle",
|
|
2296
2296
|
"star-morph": "Star polygon whose inner radius and point count are tweened",
|
|
@@ -2428,34 +2428,34 @@ var Mr = {
|
|
|
2428
2428
|
"filter-outline": "Outline around shapes",
|
|
2429
2429
|
"filter-reflection": "Water reflection with waves",
|
|
2430
2430
|
"filter-convolution": "Custom 3×3 convolution kernel"
|
|
2431
|
-
},
|
|
2431
|
+
}, Pr = new Set([
|
|
2432
2432
|
"drift",
|
|
2433
2433
|
"iridescent",
|
|
2434
2434
|
"softforms",
|
|
2435
2435
|
"mesh"
|
|
2436
|
-
]),
|
|
2436
|
+
]), Fr = new Set([
|
|
2437
2437
|
"scene",
|
|
2438
2438
|
"forms",
|
|
2439
2439
|
"environment",
|
|
2440
2440
|
"ribbon"
|
|
2441
2441
|
]);
|
|
2442
|
-
function Fr(e, t = !1) {
|
|
2443
|
-
return t ? e.pixi || /^filter-/.test(e.id) ? "WebGL shader (PixiJS)" : e.kind === "engine" || /^gl-/.test(e.id) ? "WebGL shader" : "canvas 2D" : e.group === "field" && e.id !== "halftone" || e.id === "optic-moire" ? "WebGL shader" : Pr.has(e.engine) ? "three.js" : e.engine === "softforms3d" ? "WebGL shader (ray-marched)" : Nr.has(e.engine) ? "WebGL shader" : "canvas 2D";
|
|
2444
|
-
}
|
|
2445
2442
|
function Ir(e, t = !1) {
|
|
2443
|
+
return t ? e.pixi || /^filter-/.test(e.id) ? "WebGL shader (PixiJS)" : e.kind === "engine" || /^gl-/.test(e.id) ? "WebGL shader" : "canvas 2D" : e.group === "field" && e.id !== "halftone" || e.id === "optic-moire" ? "WebGL shader" : Fr.has(e.engine) ? "three.js" : e.engine === "softforms3d" ? "WebGL shader (ray-marched)" : Pr.has(e.engine) ? "WebGL shader" : "canvas 2D";
|
|
2444
|
+
}
|
|
2445
|
+
function Lr(e, t = !1) {
|
|
2446
2446
|
if (!e) return null;
|
|
2447
2447
|
let n = e.about ?? {};
|
|
2448
2448
|
return {
|
|
2449
2449
|
kind: n.kind ?? (t ? "effect" : "generative"),
|
|
2450
|
-
basis: n.basis ??
|
|
2451
|
-
engine: n.engine ??
|
|
2450
|
+
basis: n.basis ?? Nr[e.id] ?? null,
|
|
2451
|
+
engine: n.engine ?? Ir(e, t),
|
|
2452
2452
|
dimension: n.dimension ?? (e.is3D ? "3D" : "2D")
|
|
2453
2453
|
};
|
|
2454
2454
|
}
|
|
2455
2455
|
//#endregion
|
|
2456
2456
|
//#region src/editor/compose/inspectors/AboutLine.jsx
|
|
2457
|
-
function
|
|
2458
|
-
let n =
|
|
2457
|
+
function Rr({ def: e, isFilter: t = !1 }) {
|
|
2458
|
+
let n = cn(), r = l(), i = Lr(e, t);
|
|
2459
2459
|
return i ? /* @__PURE__ */ F(N, { children: [/* @__PURE__ */ P(j, {
|
|
2460
2460
|
size: r,
|
|
2461
2461
|
iconOnly: "info",
|
|
@@ -2482,12 +2482,12 @@ function Lr({ def: e, isFilter: t = !1 }) {
|
|
|
2482
2482
|
}
|
|
2483
2483
|
//#endregion
|
|
2484
2484
|
//#region src/loops/theme.js
|
|
2485
|
-
function
|
|
2485
|
+
function zr(e, t, r, i) {
|
|
2486
2486
|
return Ce(e, t, n(g(r, i)));
|
|
2487
2487
|
}
|
|
2488
2488
|
//#endregion
|
|
2489
2489
|
//#region src/editor/compose/inspectors/LoopFields.jsx
|
|
2490
|
-
var
|
|
2490
|
+
var Br = fn.flatMap((e) => e.groups), Vr = (e, t) => {
|
|
2491
2491
|
let n = e.map((e) => ({
|
|
2492
2492
|
value: e.id,
|
|
2493
2493
|
label: e.label
|
|
@@ -2508,48 +2508,48 @@ function R({ inline: e, label: t, align: n = "fill", children: r }) {
|
|
|
2508
2508
|
children: r
|
|
2509
2509
|
});
|
|
2510
2510
|
}
|
|
2511
|
-
var
|
|
2511
|
+
var Hr = [{
|
|
2512
2512
|
value: "off",
|
|
2513
2513
|
label: "Off"
|
|
2514
2514
|
}, {
|
|
2515
2515
|
value: "on",
|
|
2516
2516
|
label: "On"
|
|
2517
2517
|
}];
|
|
2518
|
-
function
|
|
2518
|
+
function Ur({ inline: e, cs: t, on: n, onChange: r }) {
|
|
2519
2519
|
return e ? /* @__PURE__ */ P(xe, {
|
|
2520
2520
|
layout: "joined",
|
|
2521
2521
|
tone: "sunken",
|
|
2522
2522
|
size: t,
|
|
2523
2523
|
className: `w-full ${o(t) ?? ""}`,
|
|
2524
|
-
options:
|
|
2524
|
+
options: Hr,
|
|
2525
2525
|
value: n ? "on" : "off",
|
|
2526
2526
|
onChange: (e) => r(e === "on")
|
|
2527
2527
|
}) : /* @__PURE__ */ P(we, {
|
|
2528
2528
|
size: t,
|
|
2529
|
-
options:
|
|
2529
|
+
options: Hr,
|
|
2530
2530
|
viewMode: n ? "on" : "off",
|
|
2531
2531
|
onViewChange: (e) => r(e === "on")
|
|
2532
2532
|
});
|
|
2533
2533
|
}
|
|
2534
|
-
function
|
|
2534
|
+
function Wr({ layer: e, setProp: t, patch: n, updateLayer: r, palette: i, renderAnimate: a, tab: o, tabStrip: s, tree: u, picker: d = !0, inline: f = !1, showSeed: p = !f, onReset: h }) {
|
|
2535
2535
|
let g = l(), v = ot(e.loopId), y = c(), b = (v?.params ?? []).some((e) => e.key === "orbit"), x = (e) => {
|
|
2536
2536
|
ke("orbit", e), e && !y.grab && _("grab", !0);
|
|
2537
2537
|
}, C = v?.params ?? [], w = e.themeId ?? "kol", D = !!e.themeInvert, ee = (t) => r(e.id, {
|
|
2538
2538
|
themeId: t,
|
|
2539
|
-
...
|
|
2539
|
+
...zr(e, v?.params, t, D)
|
|
2540
2540
|
}), te = (t) => r(e.id, {
|
|
2541
2541
|
themeInvert: t,
|
|
2542
|
-
...
|
|
2542
|
+
...zr(e, v?.params, w, t)
|
|
2543
2543
|
}), ne = e._paletteRelation ?? "analogous", k = (v?.params ?? []).filter((e) => e.type === "color"), re = new Set(e._rollKeep ?? []), ce = (t = ne, n = {}) => {
|
|
2544
2544
|
let i = m(O(de()), t), a = Ce(e, v?.params, i, { rotate: !0 });
|
|
2545
2545
|
r(e.id, {
|
|
2546
2546
|
...n,
|
|
2547
2547
|
...Object.fromEntries(k.filter((e) => !re.has(e.key)).map((e) => [e.key, a[e.key]]))
|
|
2548
2548
|
});
|
|
2549
|
-
}, ue = (e) => t("_rollKeep", re.has(e) ? [...re].filter((t) => t !== e) : [...re, e]), fe =
|
|
2549
|
+
}, ue = (e) => t("_rollKeep", re.has(e) ? [...re].filter((t) => t !== e) : [...re, e]), fe = Xn(e.loopId), pe = fe ? Object.keys(fe).map((e) => ({
|
|
2550
2550
|
id: e,
|
|
2551
2551
|
label: e
|
|
2552
|
-
})) : null, me = fe ? new Set(Object.values(fe).flatMap((e) => Object.keys(e))) : null, he = T(e), ge = be(le(C, e), se(C, e)), ve =
|
|
2552
|
+
})) : null, me = fe ? new Set(Object.values(fe).flatMap((e) => Object.keys(e))) : null, he = T(e), ge = be(le(C, e), se(C, e)), ve = qn(e.loopId, e), [ye, xe] = M(!1), we = (t, n, i) => {
|
|
2553
2553
|
let a = S(e, t, he.take(), {
|
|
2554
2554
|
stripNoRandom: !!n?.motion,
|
|
2555
2555
|
...i
|
|
@@ -2562,7 +2562,7 @@ function Ur({ layer: e, setProp: t, patch: n, updateLayer: r, palette: i, render
|
|
|
2562
2562
|
t !== void 0 && (i[e.key] = t);
|
|
2563
2563
|
}
|
|
2564
2564
|
r(e.id, i);
|
|
2565
|
-
}, De = ve ?
|
|
2565
|
+
}, De = ve ? Jn(ve.frame) : null, Oe = ve ? Jn(ve.form) : null, ke = (e, t) => {
|
|
2566
2566
|
let r = {};
|
|
2567
2567
|
De?.has(e) && (r._framePreset = "custom"), Oe?.has(e) && (r._formPreset = "custom"), me?.has(e) && (r._lookPreset = "custom"), n({
|
|
2568
2568
|
[e]: t,
|
|
@@ -2591,19 +2591,19 @@ function Ur({ layer: e, setProp: t, patch: n, updateLayer: r, palette: i, render
|
|
|
2591
2591
|
s,
|
|
2592
2592
|
d && (f ? o === "generate" && /* @__PURE__ */ P(ae, {
|
|
2593
2593
|
divided: !0,
|
|
2594
|
-
children: /* @__PURE__ */ P(
|
|
2594
|
+
children: /* @__PURE__ */ P(Mn, {
|
|
2595
2595
|
layer: e,
|
|
2596
2596
|
tree: u,
|
|
2597
2597
|
inline: !0,
|
|
2598
|
-
about: /* @__PURE__ */ P(
|
|
2598
|
+
about: /* @__PURE__ */ P(Rr, { def: v })
|
|
2599
2599
|
})
|
|
2600
|
-
}) : /* @__PURE__ */ P(
|
|
2600
|
+
}) : /* @__PURE__ */ P(Mn, {
|
|
2601
2601
|
layer: e,
|
|
2602
2602
|
tree: u,
|
|
2603
|
-
about: /* @__PURE__ */ P(
|
|
2603
|
+
about: /* @__PURE__ */ P(Rr, { def: v })
|
|
2604
2604
|
})),
|
|
2605
2605
|
(o === "generate" || o === "labs-effect") && /* @__PURE__ */ F(N, { children: [
|
|
2606
|
-
(e.loopId === "softforms" || e.loopId === "softforms3d") && /* @__PURE__ */ P(
|
|
2606
|
+
(e.loopId === "softforms" || e.loopId === "softforms3d") && /* @__PURE__ */ P(kr, { layer: e }),
|
|
2607
2607
|
fe && !f && /* @__PURE__ */ P(R, {
|
|
2608
2608
|
inline: f,
|
|
2609
2609
|
label: "Look",
|
|
@@ -2611,7 +2611,7 @@ function Ur({ layer: e, setProp: t, patch: n, updateLayer: r, palette: i, render
|
|
|
2611
2611
|
variant: "subtle",
|
|
2612
2612
|
size: g,
|
|
2613
2613
|
className: "w-full",
|
|
2614
|
-
options:
|
|
2614
|
+
options: Vr(pe, e._lookPreset),
|
|
2615
2615
|
value: e._lookPreset ?? "custom",
|
|
2616
2616
|
onChange: Ne
|
|
2617
2617
|
})
|
|
@@ -2626,7 +2626,7 @@ function Ur({ layer: e, setProp: t, patch: n, updateLayer: r, palette: i, render
|
|
|
2626
2626
|
variant: "subtle",
|
|
2627
2627
|
size: g,
|
|
2628
2628
|
className: "w-full",
|
|
2629
|
-
options:
|
|
2629
|
+
options: Vr(pe, e._lookPreset),
|
|
2630
2630
|
value: e._lookPreset ?? "custom",
|
|
2631
2631
|
onChange: Ne
|
|
2632
2632
|
})
|
|
@@ -2646,7 +2646,7 @@ function Ur({ layer: e, setProp: t, patch: n, updateLayer: r, palette: i, render
|
|
|
2646
2646
|
/* @__PURE__ */ P(R, {
|
|
2647
2647
|
inline: !0,
|
|
2648
2648
|
label: "Invert",
|
|
2649
|
-
children: /* @__PURE__ */ P(
|
|
2649
|
+
children: /* @__PURE__ */ P(Ur, {
|
|
2650
2650
|
inline: !0,
|
|
2651
2651
|
cs: g,
|
|
2652
2652
|
on: D,
|
|
@@ -2707,7 +2707,7 @@ function Ur({ layer: e, setProp: t, patch: n, updateLayer: r, palette: i, render
|
|
|
2707
2707
|
Ie(v) && /* @__PURE__ */ P(R, {
|
|
2708
2708
|
inline: !0,
|
|
2709
2709
|
label: "Background",
|
|
2710
|
-
children: /* @__PURE__ */ P(
|
|
2710
|
+
children: /* @__PURE__ */ P(Ur, {
|
|
2711
2711
|
inline: !0,
|
|
2712
2712
|
cs: g,
|
|
2713
2713
|
on: e.bgOn !== !1,
|
|
@@ -2735,7 +2735,7 @@ function Ur({ layer: e, setProp: t, patch: n, updateLayer: r, palette: i, render
|
|
|
2735
2735
|
/* @__PURE__ */ P(R, {
|
|
2736
2736
|
inline: !1,
|
|
2737
2737
|
label: "Invert",
|
|
2738
|
-
children: /* @__PURE__ */ P(
|
|
2738
|
+
children: /* @__PURE__ */ P(Ur, {
|
|
2739
2739
|
inline: !1,
|
|
2740
2740
|
cs: g,
|
|
2741
2741
|
on: D,
|
|
@@ -2745,7 +2745,7 @@ function Ur({ layer: e, setProp: t, patch: n, updateLayer: r, palette: i, render
|
|
|
2745
2745
|
Ie(v) && /* @__PURE__ */ P(R, {
|
|
2746
2746
|
inline: !1,
|
|
2747
2747
|
label: "Background",
|
|
2748
|
-
children: /* @__PURE__ */ P(
|
|
2748
|
+
children: /* @__PURE__ */ P(Ur, {
|
|
2749
2749
|
inline: !1,
|
|
2750
2750
|
cs: g,
|
|
2751
2751
|
on: e.bgOn !== !1,
|
|
@@ -2772,13 +2772,13 @@ function Ur({ layer: e, setProp: t, patch: n, updateLayer: r, palette: i, render
|
|
|
2772
2772
|
["type", "Type"],
|
|
2773
2773
|
["category", "Category"],
|
|
2774
2774
|
["preset", "Preset"]
|
|
2775
|
-
].filter(([t]) =>
|
|
2775
|
+
].filter(([t]) => wn(e, t, Br)).map(([t, n]) => /* @__PURE__ */ P(A, {
|
|
2776
2776
|
tone: "primary",
|
|
2777
2777
|
size: g,
|
|
2778
2778
|
className: "flex-1 min-w-0",
|
|
2779
2779
|
"aria-label": `Randomize ${n.toLowerCase()}`,
|
|
2780
2780
|
onClick: () => {
|
|
2781
|
-
let n = he.take(), i =
|
|
2781
|
+
let n = he.take(), i = Tn(e, t, O(n >>> 0), Br);
|
|
2782
2782
|
i && r(e.id, {
|
|
2783
2783
|
...i,
|
|
2784
2784
|
_rollSeed: n
|
|
@@ -2795,7 +2795,7 @@ function Ur({ layer: e, setProp: t, patch: n, updateLayer: r, palette: i, render
|
|
|
2795
2795
|
if (t.altKey) return Te(se(C, e));
|
|
2796
2796
|
let n = he.take();
|
|
2797
2797
|
r(e.id, {
|
|
2798
|
-
...
|
|
2798
|
+
...En(e, se(C, e), O(n >>> 0)),
|
|
2799
2799
|
_rollSeed: n
|
|
2800
2800
|
});
|
|
2801
2801
|
},
|
|
@@ -2823,7 +2823,7 @@ function Ur({ layer: e, setProp: t, patch: n, updateLayer: r, palette: i, render
|
|
|
2823
2823
|
})
|
|
2824
2824
|
]
|
|
2825
2825
|
}),
|
|
2826
|
-
/* @__PURE__ */ P(
|
|
2826
|
+
/* @__PURE__ */ P(Nn, {
|
|
2827
2827
|
open: ye,
|
|
2828
2828
|
onClose: () => xe(!1),
|
|
2829
2829
|
schema: C,
|
|
@@ -2855,7 +2855,7 @@ function Ur({ layer: e, setProp: t, patch: n, updateLayer: r, palette: i, render
|
|
|
2855
2855
|
seed: he,
|
|
2856
2856
|
inline: f
|
|
2857
2857
|
}),
|
|
2858
|
-
e.loopId === "pattern-rules" && (e.render ?? "tiles") === "tiles" && /* @__PURE__ */ P(
|
|
2858
|
+
e.loopId === "pattern-rules" && (e.render ?? "tiles") === "tiles" && /* @__PURE__ */ P(lr, {
|
|
2859
2859
|
layer: e,
|
|
2860
2860
|
patch: n,
|
|
2861
2861
|
seed: he
|
|
@@ -2871,16 +2871,16 @@ function Ur({ layer: e, setProp: t, patch: n, updateLayer: r, palette: i, render
|
|
|
2871
2871
|
tab: "style",
|
|
2872
2872
|
inline: f
|
|
2873
2873
|
}),
|
|
2874
|
-
v?.group === "penrose" && e.loopId?.startsWith("penrose-") && /* @__PURE__ */ P(
|
|
2874
|
+
v?.group === "penrose" && e.loopId?.startsWith("penrose-") && /* @__PURE__ */ P(Mr, {
|
|
2875
2875
|
layer: e,
|
|
2876
2876
|
setProp: ke,
|
|
2877
2877
|
patch: n
|
|
2878
2878
|
}),
|
|
2879
|
-
e.loopId === "pattern-rules" && /* @__PURE__ */ P(
|
|
2879
|
+
e.loopId === "pattern-rules" && /* @__PURE__ */ P(pr, {
|
|
2880
2880
|
layer: e,
|
|
2881
2881
|
patch: n
|
|
2882
2882
|
}),
|
|
2883
|
-
e.loopId === "math-curves" && /* @__PURE__ */ P(
|
|
2883
|
+
e.loopId === "math-curves" && /* @__PURE__ */ P(mr, {
|
|
2884
2884
|
layer: e,
|
|
2885
2885
|
patch: n
|
|
2886
2886
|
}),
|
|
@@ -2910,7 +2910,7 @@ function Ur({ layer: e, setProp: t, patch: n, updateLayer: r, palette: i, render
|
|
|
2910
2910
|
variant: "subtle",
|
|
2911
2911
|
size: g,
|
|
2912
2912
|
className: "w-full",
|
|
2913
|
-
options:
|
|
2913
|
+
options: Vr(ve.frame, e._framePreset),
|
|
2914
2914
|
value: e._framePreset ?? "custom",
|
|
2915
2915
|
onChange: Me("_framePreset", ve.frame)
|
|
2916
2916
|
})
|
|
@@ -2921,7 +2921,7 @@ function Ur({ layer: e, setProp: t, patch: n, updateLayer: r, palette: i, render
|
|
|
2921
2921
|
variant: "subtle",
|
|
2922
2922
|
size: g,
|
|
2923
2923
|
className: "w-full",
|
|
2924
|
-
options:
|
|
2924
|
+
options: Vr(ve.form, e._formPreset),
|
|
2925
2925
|
value: e._formPreset ?? "custom",
|
|
2926
2926
|
onChange: Me("_formPreset", ve.form)
|
|
2927
2927
|
})
|
|
@@ -2938,7 +2938,7 @@ function Ur({ layer: e, setProp: t, patch: n, updateLayer: r, palette: i, render
|
|
|
2938
2938
|
children: /* @__PURE__ */ P(R, {
|
|
2939
2939
|
inline: f,
|
|
2940
2940
|
label: "Drag (C)",
|
|
2941
|
-
children: /* @__PURE__ */ P(
|
|
2941
|
+
children: /* @__PURE__ */ P(Ur, {
|
|
2942
2942
|
inline: f,
|
|
2943
2943
|
cs: g,
|
|
2944
2944
|
on: !!y.grab && e.orbit !== !1,
|
|
@@ -2952,7 +2952,7 @@ function Ur({ layer: e, setProp: t, patch: n, updateLayer: r, palette: i, render
|
|
|
2952
2952
|
children: [/* @__PURE__ */ P(R, {
|
|
2953
2953
|
inline: f,
|
|
2954
2954
|
label: "Orbit (C)",
|
|
2955
|
-
children: /* @__PURE__ */ P(
|
|
2955
|
+
children: /* @__PURE__ */ P(Ur, {
|
|
2956
2956
|
inline: f,
|
|
2957
2957
|
cs: g,
|
|
2958
2958
|
on: !!y.grab && e.orbit !== !1,
|
|
@@ -2977,7 +2977,7 @@ function Ur({ layer: e, setProp: t, patch: n, updateLayer: r, palette: i, render
|
|
|
2977
2977
|
tab: "anim",
|
|
2978
2978
|
inline: f
|
|
2979
2979
|
}),
|
|
2980
|
-
Be && /* @__PURE__ */ P(
|
|
2980
|
+
Be && /* @__PURE__ */ P(sr, {
|
|
2981
2981
|
layer: e,
|
|
2982
2982
|
patch: n,
|
|
2983
2983
|
defaultDuration: v?.duration ?? 8
|
|
@@ -2990,7 +2990,7 @@ function Ur({ layer: e, setProp: t, patch: n, updateLayer: r, palette: i, render
|
|
|
2990
2990
|
renderAnimate: a,
|
|
2991
2991
|
inline: f
|
|
2992
2992
|
}),
|
|
2993
|
-
ze && /* @__PURE__ */ P(
|
|
2993
|
+
ze && /* @__PURE__ */ P(cr, {
|
|
2994
2994
|
layer: e,
|
|
2995
2995
|
patch: n,
|
|
2996
2996
|
camParams: Fe,
|
|
@@ -2998,7 +2998,7 @@ function Ur({ layer: e, setProp: t, patch: n, updateLayer: r, palette: i, render
|
|
|
2998
2998
|
showHeader: !Pe
|
|
2999
2999
|
})
|
|
3000
3000
|
] }),
|
|
3001
|
-
/* @__PURE__ */ P(
|
|
3001
|
+
/* @__PURE__ */ P(hr, {
|
|
3002
3002
|
layer: e,
|
|
3003
3003
|
patch: n,
|
|
3004
3004
|
renderAnimate: a,
|
|
@@ -3008,8 +3008,8 @@ function Ur({ layer: e, setProp: t, patch: n, updateLayer: r, palette: i, render
|
|
|
3008
3008
|
}
|
|
3009
3009
|
//#endregion
|
|
3010
3010
|
//#region src/editor/labs/useLabsLayer.js
|
|
3011
|
-
function
|
|
3012
|
-
let { layers: e, addLayer: t, removeLayer: n, updateLayer: r, select: i, beginTransaction: a, commitTransaction: o } = s(), c =
|
|
3011
|
+
function Gr() {
|
|
3012
|
+
let { layers: e, addLayer: t, removeLayer: n, updateLayer: r, select: i, beginTransaction: a, commitTransaction: o } = s(), c = on((s, c) => {
|
|
3013
3013
|
let [l, ...u] = e;
|
|
3014
3014
|
a();
|
|
3015
3015
|
for (let e of u) n(e.id);
|
|
@@ -3031,7 +3031,7 @@ function Wr() {
|
|
|
3031
3031
|
}
|
|
3032
3032
|
//#endregion
|
|
3033
3033
|
//#region src/editor/morph/StepPicker.jsx
|
|
3034
|
-
function
|
|
3034
|
+
function Kr(e) {
|
|
3035
3035
|
let t = it(e.id), n = ot(e.loop)?.params ?? [];
|
|
3036
3036
|
return {
|
|
3037
3037
|
loopId: e.loop,
|
|
@@ -3046,7 +3046,7 @@ function Gr(e) {
|
|
|
3046
3046
|
}
|
|
3047
3047
|
};
|
|
3048
3048
|
}
|
|
3049
|
-
function
|
|
3049
|
+
function qr(e, t) {
|
|
3050
3050
|
let n = t ? yt(e, t) : (e.layers ?? []).find((e) => e?.type === "loop");
|
|
3051
3051
|
if (!n) return null;
|
|
3052
3052
|
let r = ot(n.loopId)?.params ?? [];
|
|
@@ -3063,7 +3063,7 @@ function Kr(e, t) {
|
|
|
3063
3063
|
}
|
|
3064
3064
|
};
|
|
3065
3065
|
}
|
|
3066
|
-
function
|
|
3066
|
+
function Jr(e) {
|
|
3067
3067
|
let t = ot(e.loopId)?.params ?? [];
|
|
3068
3068
|
return {
|
|
3069
3069
|
loopId: e.loopId,
|
|
@@ -3077,8 +3077,8 @@ function qr(e) {
|
|
|
3077
3077
|
}
|
|
3078
3078
|
};
|
|
3079
3079
|
}
|
|
3080
|
-
function
|
|
3081
|
-
let e = Ct(), { layer: t, setOnly: n } =
|
|
3080
|
+
function Yr() {
|
|
3081
|
+
let e = Ct(), { layer: t, setOnly: n } = Gr(), r = !!e.picker, i = e.mode === "blend" ? e.loopId : null, [a, o] = M(""), s = t?.type === "loop" && (e.steps.length < 2 || e.editing != null), { rows: c, make: l } = ln(() => {
|
|
3082
3082
|
let e = [], n = /* @__PURE__ */ new Map();
|
|
3083
3083
|
if (!r) return {
|
|
3084
3084
|
rows: e,
|
|
@@ -3089,7 +3089,7 @@ function Jr() {
|
|
|
3089
3089
|
label: t.presetLabel || "Current stage",
|
|
3090
3090
|
group: "Current stage",
|
|
3091
3091
|
hint: Pe(t.loopGroup)?.label
|
|
3092
|
-
}), n.set("stage", () =>
|
|
3092
|
+
}), n.set("stage", () => Jr(t)));
|
|
3093
3093
|
for (let t of (ht().preset ?? []).filter((e) => !e.shipped)) {
|
|
3094
3094
|
if (t.mode === "morph" || !(i ? yt(t, i) : (t.layers ?? []).some((e) => e?.type === "loop"))) continue;
|
|
3095
3095
|
let r = `file:${t.id}`;
|
|
@@ -3097,7 +3097,7 @@ function Jr() {
|
|
|
3097
3097
|
id: r,
|
|
3098
3098
|
label: t.name || "Untitled",
|
|
3099
3099
|
group: "My files"
|
|
3100
|
-
}), n.set(r, () =>
|
|
3100
|
+
}), n.set(r, () => qr(t, i));
|
|
3101
3101
|
}
|
|
3102
3102
|
for (let t of He) {
|
|
3103
3103
|
if (st(t) || i && t.loop !== i) continue;
|
|
@@ -3107,7 +3107,7 @@ function Jr() {
|
|
|
3107
3107
|
label: t.label,
|
|
3108
3108
|
group: Pe(it(t.id))?.label ?? t.loop,
|
|
3109
3109
|
hint: t.sub
|
|
3110
|
-
}), n.set(r, () =>
|
|
3110
|
+
}), n.set(r, () => Kr(t));
|
|
3111
3111
|
}
|
|
3112
3112
|
return {
|
|
3113
3113
|
rows: e,
|
|
@@ -3118,7 +3118,7 @@ function Jr() {
|
|
|
3118
3118
|
i,
|
|
3119
3119
|
s,
|
|
3120
3120
|
t
|
|
3121
|
-
]), [u, d] = M(null), f =
|
|
3121
|
+
]), [u, d] = M(null), f = ln(() => {
|
|
3122
3122
|
if (u) return [{
|
|
3123
3123
|
id: "back",
|
|
3124
3124
|
label: "All categories",
|
|
@@ -3174,21 +3174,21 @@ function Jr() {
|
|
|
3174
3174
|
}
|
|
3175
3175
|
//#endregion
|
|
3176
3176
|
//#region src/generate/field.js
|
|
3177
|
-
var z = (e) => e < 0 ? 0 : e > 1 ? 1 : e,
|
|
3178
|
-
function
|
|
3177
|
+
var z = (e) => e < 0 ? 0 : e > 1 ? 1 : e, Xr = (e) => e * e * (3 - 2 * e);
|
|
3178
|
+
function Zr(e, t, n) {
|
|
3179
3179
|
let r = e * 374761393 + t * 668265263 + n * 2147483647 | 0;
|
|
3180
3180
|
return r = Math.imul(r ^ r >>> 13, 1274126177), ((r ^ r >>> 16) >>> 0) / 4294967295;
|
|
3181
3181
|
}
|
|
3182
|
-
function
|
|
3183
|
-
let r = Math.floor(e), i = Math.floor(t), a =
|
|
3182
|
+
function Qr(e, t, n = 1) {
|
|
3183
|
+
let r = Math.floor(e), i = Math.floor(t), a = Xr(e - r), o = Xr(t - i), s = Zr(r, i, n), c = Zr(r + 1, i, n), l = Zr(r, i + 1, n), u = Zr(r + 1, i + 1, n);
|
|
3184
3184
|
return s + (c - s) * a + (l - s) * o + (s - c - l + u) * a * o;
|
|
3185
3185
|
}
|
|
3186
|
-
function
|
|
3186
|
+
function $r(e, t, n = 1, r = 3) {
|
|
3187
3187
|
let i = 0, a = .5, o = 0;
|
|
3188
|
-
for (let s = 0; s < r; s++) i += a *
|
|
3188
|
+
for (let s = 0; s < r; s++) i += a * Qr(e, t, n + s * 17), o += a, e *= 2, t *= 2, a *= .5;
|
|
3189
3189
|
return i / o;
|
|
3190
3190
|
}
|
|
3191
|
-
function
|
|
3191
|
+
function ei(e, t, n, r = null) {
|
|
3192
3192
|
let i = e[`${t}Kind`] ?? "flat", a = e[`${t}X`] ?? .5, o = e[`${t}Y`] ?? .5, s = (e[`${t}Angle`] ?? 0) * Math.PI / 180, c = e[`${t}Freq`] ?? 1, l = (e[`${t}Phase`] ?? 0) * Math.PI / 180, u = e[`${t}Rx`] ?? .5, d = e[`${t}Ry`] ?? .5, f = Math.cos(s), p = Math.sin(s);
|
|
3193
3193
|
switch (i) {
|
|
3194
3194
|
case "linear": return (n, r) => {
|
|
@@ -3211,7 +3211,7 @@ function $r(e, t, n, r = null) {
|
|
|
3211
3211
|
case "sine": return (e, t) => .5 + .5 * Math.sin(((e - .5) * f + (t - .5) * p) * c * 2 * Math.PI + l);
|
|
3212
3212
|
case "ridge": return (e, t) => Math.abs(Math.sin(((e - .5) * f + (t - .5) * p) * c * Math.PI + l));
|
|
3213
3213
|
case "waves": return (n, r) => .5 + .5 * Math.sin(n * c * 2 * Math.PI + l) * Math.sin(r * (e[`${t}Freq2`] ?? c) * 2 * Math.PI);
|
|
3214
|
-
case "noise": return (r, i) =>
|
|
3214
|
+
case "noise": return (r, i) => $r(r * c * n, i * (e[`${t}Freq2`] ?? c), e[`${t}Seed`] ?? 1, 3);
|
|
3215
3215
|
case "ribbon": return (n, r) => {
|
|
3216
3216
|
let i = e[`${t}Amp`] ?? .25, a = (n - .5) * f + (r - .5) * p, o = -(n - .5) * p + (r - .5) * f, s = i * Math.sin(a * c * 2 * Math.PI + l), d = u * Math.max(.05, 1 + Math.abs(a) * 2 * (e[`${t}Flare`] ?? 0));
|
|
3217
3217
|
return z(1 - Math.abs(o - s) / d);
|
|
@@ -3256,7 +3256,7 @@ function $r(e, t, n, r = null) {
|
|
|
3256
3256
|
return .5 + .5 * Math.cos(2 * Math.PI * c * (d - f) + l);
|
|
3257
3257
|
};
|
|
3258
3258
|
case "surface": {
|
|
3259
|
-
let n =
|
|
3259
|
+
let n = ti(e[`${t}Surface`]);
|
|
3260
3260
|
return (e, t) => z(n(e, t));
|
|
3261
3261
|
}
|
|
3262
3262
|
case "poly": {
|
|
@@ -3269,46 +3269,46 @@ function $r(e, t, n, r = null) {
|
|
|
3269
3269
|
}).filter((e) => e.pts.length >= 3 && Number.isFinite(e.val));
|
|
3270
3270
|
return n.length ? (e, t) => {
|
|
3271
3271
|
let r = 0;
|
|
3272
|
-
for (let i of n)
|
|
3272
|
+
for (let i of n) oi([i.pts], e, t) && (r = i.val);
|
|
3273
3273
|
return r;
|
|
3274
3274
|
} : () => 0;
|
|
3275
3275
|
}
|
|
3276
3276
|
case "mesh": {
|
|
3277
|
-
let n =
|
|
3277
|
+
let n = ni(e[`${t}Mesh`]);
|
|
3278
3278
|
return (e, t) => z(n(e, t));
|
|
3279
3279
|
}
|
|
3280
3280
|
case "image": return r ? (e, t) => z(r(e, t)) : () => 0;
|
|
3281
3281
|
default: return () => e[`${t}Value`] ?? 1;
|
|
3282
3282
|
}
|
|
3283
3283
|
}
|
|
3284
|
-
var
|
|
3284
|
+
var ti = (e) => {
|
|
3285
3285
|
let t = String(e ?? "").split(",").map(Number), n = (e) => Number.isFinite(t[e]) ? t[e] : 0;
|
|
3286
3286
|
return (e, t) => n(0) + n(1) * e + n(2) * t + n(3) * e * e + n(4) * t * t + n(5) * e * t + n(6) * e * e * e + n(7) * t * t * t + n(8) * e * e * t + n(9) * e * t * t;
|
|
3287
|
-
},
|
|
3287
|
+
}, ni = (e, t = 1) => {
|
|
3288
3288
|
let n = String(e ?? "").split("|"), [r, i] = (n[0] || "").split("x").map(Number), a = (n[t] || "").split(",").map(Number);
|
|
3289
3289
|
return !(r >= 2 && i >= 2) || a.length < r * i ? () => 0 : (e, t) => {
|
|
3290
3290
|
let n = Math.min(Math.max(e, 0), 1) * (r - 1), o = Math.min(Math.max(t, 0), 1) * (i - 1), s = Math.min(Math.floor(n), r - 2), c = Math.min(Math.floor(o), i - 2), l = n - s, u = o - c;
|
|
3291
3291
|
return (1 - l) * (1 - u) * a[c * r + s] + l * (1 - u) * a[c * r + s + 1] + (1 - l) * u * a[(c + 1) * r + s] + l * u * a[(c + 1) * r + s + 1];
|
|
3292
3292
|
};
|
|
3293
|
-
},
|
|
3293
|
+
}, ri = {
|
|
3294
3294
|
add: (e, t) => e + t,
|
|
3295
3295
|
multiply: (e, t) => e * t,
|
|
3296
3296
|
max: (e, t) => Math.max(e, t),
|
|
3297
3297
|
min: (e, t) => Math.min(e, t),
|
|
3298
3298
|
screen: (e, t) => 1 - (1 - e) * (1 - t),
|
|
3299
3299
|
diff: (e, t) => Math.abs(e - t)
|
|
3300
|
-
},
|
|
3301
|
-
let i =
|
|
3300
|
+
}, ii = (e, t, n, r) => {
|
|
3301
|
+
let i = ei(e, t, n, r);
|
|
3302
3302
|
return e[`${t}Inv`] ? (e, t) => 1 - i(e, t) : i;
|
|
3303
3303
|
};
|
|
3304
|
-
function
|
|
3305
|
-
let r =
|
|
3304
|
+
function ai(e, t = 1, n = null) {
|
|
3305
|
+
let r = ii(e, "f", t, n), i = e.gKind && e.gKind !== "none" ? ii(e, "g", t, n) : null, a = ri[e.fOp ?? "max"] ?? ri.max, o = e.gWeight ?? 1, s = e.fLo ?? 0, c = e.fHi ?? 1, l = e.fContrast ?? 1, u = e.fGamma ?? 1, d = e.fFrom ?? 0, f = e.fTo ?? 1, p = Math.round(e.fSteps ?? 0), m = !!e.fInvert, h = e.fSplit ?? 0;
|
|
3306
3306
|
return (e, t) => {
|
|
3307
3307
|
let n = r(e, t);
|
|
3308
3308
|
return i && (n = a(n, i(e, t) * o)), h > 0 && t > h && (n = 1 - n), (d !== 0 || f !== 1) && (n = z((n - d) / (f - d || 1e-6))), n = z((n - .5) * l + .5), u !== 1 && (n **= +u), m && (n = 1 - n), p >= 2 && (n = Math.min(p - 1, Math.floor(n * p)) / (p - 1)), s + (c - s) * z(n);
|
|
3309
3309
|
};
|
|
3310
3310
|
}
|
|
3311
|
-
function
|
|
3311
|
+
function oi(e, t, n) {
|
|
3312
3312
|
let r = !1;
|
|
3313
3313
|
for (let i of e) for (let e = 0, a = i.length - 1; e < i.length; a = e++) {
|
|
3314
3314
|
let [o, s] = i[e], [c, l] = i[a];
|
|
@@ -3316,9 +3316,9 @@ function ai(e, t, n) {
|
|
|
3316
3316
|
}
|
|
3317
3317
|
return r;
|
|
3318
3318
|
}
|
|
3319
|
-
var B = 512,
|
|
3320
|
-
function
|
|
3321
|
-
if (
|
|
3319
|
+
var B = 512, si = /* @__PURE__ */ new WeakMap();
|
|
3320
|
+
function ci(e) {
|
|
3321
|
+
if (si.has(e)) return si.get(e);
|
|
3322
3322
|
let t = new Uint8Array(B * B), n = [];
|
|
3323
3323
|
for (let t of e) for (let e = 0, r = t.length - 1; e < t.length; r = e++) {
|
|
3324
3324
|
let [i, a] = t[e], [o, s] = t[r];
|
|
@@ -3341,9 +3341,9 @@ function si(e) {
|
|
|
3341
3341
|
for (let n = 0; n + 1 < o.length; n += 2) for (let r = Math.max(0, Math.ceil(o[n] * B - .5)); r <= Math.min(B - 1, Math.floor(o[n + 1] * B - .5)); r++) t[e * B + r] = 1;
|
|
3342
3342
|
}
|
|
3343
3343
|
let a = (e, n) => e >= 0 && e < 1 && n >= 0 && n < 1 && t[Math.floor(n * B) * B + Math.floor(e * B)] === 1;
|
|
3344
|
-
return
|
|
3344
|
+
return si.set(e, a), a;
|
|
3345
3345
|
}
|
|
3346
|
-
function
|
|
3346
|
+
function li(e, t = 1, n = null) {
|
|
3347
3347
|
let r = e.mKind ?? "none", i = e.mSize ?? 1;
|
|
3348
3348
|
switch (r) {
|
|
3349
3349
|
case "rect": {
|
|
@@ -3366,18 +3366,18 @@ function ci(e, t = 1, n = null) {
|
|
|
3366
3366
|
};
|
|
3367
3367
|
case "arch": return (e, t) => t <= .5 || ((e - .5) / .5) ** 2 + ((t - .5) / .5) ** 2 <= 1;
|
|
3368
3368
|
case "letter":
|
|
3369
|
-
case "layer": return n?.length ?
|
|
3369
|
+
case "layer": return n?.length ? ci(n) : () => !0;
|
|
3370
3370
|
default: return () => !0;
|
|
3371
3371
|
}
|
|
3372
3372
|
}
|
|
3373
|
-
function
|
|
3374
|
-
let r =
|
|
3373
|
+
function ui(e, t = 1, n = null) {
|
|
3374
|
+
let r = di(e, t, n);
|
|
3375
3375
|
return !r || !e.wPin ? r : (e, t) => {
|
|
3376
3376
|
let [n, i] = r(e, t), a = Math.sin(Math.PI * Math.min(1, Math.max(0, e))) * Math.sin(Math.PI * Math.min(1, Math.max(0, t)));
|
|
3377
3377
|
return [e + (n - e) * a, t + (i - t) * a];
|
|
3378
3378
|
};
|
|
3379
3379
|
}
|
|
3380
|
-
function
|
|
3380
|
+
function di(e, t, n) {
|
|
3381
3381
|
let r = e.wKind ?? "none", i = e.wAmt ?? 0;
|
|
3382
3382
|
if (r === "none" || !i) return null;
|
|
3383
3383
|
if (r === "field") {
|
|
@@ -3389,11 +3389,11 @@ function ui(e, t, n) {
|
|
|
3389
3389
|
};
|
|
3390
3390
|
}
|
|
3391
3391
|
if (r === "mesh") {
|
|
3392
|
-
let t =
|
|
3392
|
+
let t = ni(e.wMesh, 1), n = ni(e.wMesh, 2);
|
|
3393
3393
|
return (e, r) => [e + i * t(e, r), r + i * n(e, r)];
|
|
3394
3394
|
}
|
|
3395
3395
|
if (r === "surface") {
|
|
3396
|
-
let t =
|
|
3396
|
+
let t = ti(e.wSurfX), n = ti(e.wSurfY);
|
|
3397
3397
|
return (e, r) => [e + i * t(e, r), r + i * n(e, r)];
|
|
3398
3398
|
}
|
|
3399
3399
|
let a = e.wFreq ?? 1, o = e.wSeed ?? 3, s = e.wX ?? .5, c = e.wY ?? .5;
|
|
@@ -3411,15 +3411,15 @@ function ui(e, t, n) {
|
|
|
3411
3411
|
let r = (e - s) * t, o = n - c, l = i * Math.exp(-((Math.hypot(r, o) * 3 * a) ** 2)), u = Math.cos(l), d = Math.sin(l);
|
|
3412
3412
|
return [s + (r * u - o * d) / t, c + r * d + o * u];
|
|
3413
3413
|
};
|
|
3414
|
-
case "noise": return (e, t) => [e + i * (
|
|
3414
|
+
case "noise": return (e, t) => [e + i * ($r(e * a * 3, t * a * 3, o) - .5), t + i * ($r(e * a * 3 + 9, t * a * 3, o + 5) - .5)];
|
|
3415
3415
|
case "flow": return (e, t) => {
|
|
3416
|
-
let n =
|
|
3416
|
+
let n = $r(e * a, t * a, o) * Math.PI * 4, r = $r(e * a + 5, t * a + 5, o + 2);
|
|
3417
3417
|
return [e + i * r * Math.cos(n), t + i * r * Math.sin(n)];
|
|
3418
3418
|
};
|
|
3419
3419
|
default: return null;
|
|
3420
3420
|
}
|
|
3421
3421
|
}
|
|
3422
|
-
var
|
|
3422
|
+
var fi = [
|
|
3423
3423
|
"flat",
|
|
3424
3424
|
"image",
|
|
3425
3425
|
"linear",
|
|
@@ -3441,16 +3441,16 @@ var di = [
|
|
|
3441
3441
|
].map((e) => ({
|
|
3442
3442
|
value: e,
|
|
3443
3443
|
label: e[0].toUpperCase() + e.slice(1)
|
|
3444
|
-
})),
|
|
3444
|
+
})), pi = (e) => e === "g", mi = (e, t) => [
|
|
3445
3445
|
{
|
|
3446
3446
|
key: `${e}Kind`,
|
|
3447
|
-
label:
|
|
3447
|
+
label: pi(e) ? "Second" : "Source",
|
|
3448
3448
|
type: "select",
|
|
3449
|
-
default:
|
|
3450
|
-
options:
|
|
3449
|
+
default: pi(e) ? "none" : "radial",
|
|
3450
|
+
options: pi(e) ? [{
|
|
3451
3451
|
value: "none",
|
|
3452
3452
|
label: "None"
|
|
3453
|
-
}, ...
|
|
3453
|
+
}, ...fi] : fi,
|
|
3454
3454
|
section: t
|
|
3455
3455
|
},
|
|
3456
3456
|
{
|
|
@@ -3805,9 +3805,9 @@ var di = [
|
|
|
3805
3805
|
section: t,
|
|
3806
3806
|
when: (t) => t[`${e}Kind`] === "noise"
|
|
3807
3807
|
}
|
|
3808
|
-
],
|
|
3809
|
-
...
|
|
3810
|
-
...
|
|
3808
|
+
], hi = [
|
|
3809
|
+
...mi("f", "Field"),
|
|
3810
|
+
...mi("g", "Field"),
|
|
3811
3811
|
{
|
|
3812
3812
|
key: "gInv",
|
|
3813
3813
|
label: "Invert second",
|
|
@@ -3904,7 +3904,7 @@ var di = [
|
|
|
3904
3904
|
format: (e) => e ? `${Math.round(e * 100)}%` : "Off",
|
|
3905
3905
|
section: "Field"
|
|
3906
3906
|
}
|
|
3907
|
-
],
|
|
3907
|
+
], gi = [
|
|
3908
3908
|
{
|
|
3909
3909
|
key: "mKind",
|
|
3910
3910
|
label: "Mask",
|
|
@@ -4046,7 +4046,7 @@ var di = [
|
|
|
4046
4046
|
section: "Mask",
|
|
4047
4047
|
when: (e) => e.mKind === "hourglass"
|
|
4048
4048
|
}
|
|
4049
|
-
],
|
|
4049
|
+
], _i = [
|
|
4050
4050
|
{
|
|
4051
4051
|
key: "wKind",
|
|
4052
4052
|
label: "Warp",
|
|
@@ -4187,7 +4187,7 @@ var di = [
|
|
|
4187
4187
|
section: "Warp",
|
|
4188
4188
|
when: (e) => ["bulge", "swirl"].includes(e.wKind)
|
|
4189
4189
|
}
|
|
4190
|
-
],
|
|
4190
|
+
], vi = {
|
|
4191
4191
|
id: "lineScreen",
|
|
4192
4192
|
label: "Line screen",
|
|
4193
4193
|
about: "Line screen — parallel lines whose width follows a field, cut by a mask",
|
|
@@ -4407,7 +4407,7 @@ var di = [
|
|
|
4407
4407
|
}
|
|
4408
4408
|
}
|
|
4409
4409
|
}
|
|
4410
|
-
},
|
|
4410
|
+
}, yi = {
|
|
4411
4411
|
id: "dotScreen",
|
|
4412
4412
|
label: "Dot screen",
|
|
4413
4413
|
about: "Dot screen — a grid of dots sized by a field, the grid bent by a warp",
|
|
@@ -4550,7 +4550,7 @@ var di = [
|
|
|
4550
4550
|
}
|
|
4551
4551
|
}
|
|
4552
4552
|
}
|
|
4553
|
-
},
|
|
4553
|
+
}, bi = {
|
|
4554
4554
|
linear: (e) => e,
|
|
4555
4555
|
ease: (e) => e * e * (3 - 2 * e),
|
|
4556
4556
|
in: (e) => e * e,
|
|
@@ -4561,10 +4561,10 @@ var di = [
|
|
|
4561
4561
|
sine: (e) => .5 + .5 * Math.sin(2 * Math.PI * e),
|
|
4562
4562
|
bell: (e) => Math.exp(-(((e - .5) / .22) ** 2)),
|
|
4563
4563
|
last: (e) => +(e >= 1)
|
|
4564
|
-
},
|
|
4564
|
+
}, xi = Object.keys(bi).map((e) => ({
|
|
4565
4565
|
value: e,
|
|
4566
4566
|
label: e[0].toUpperCase() + e.slice(1)
|
|
4567
|
-
})),
|
|
4567
|
+
})), Si = (e, t, n, r, i, a, o, s = {}) => [
|
|
4568
4568
|
{
|
|
4569
4569
|
key: `${e}A`,
|
|
4570
4570
|
label: `${t} A`,
|
|
@@ -4592,14 +4592,14 @@ var di = [
|
|
|
4592
4592
|
label: `${t} curve`,
|
|
4593
4593
|
type: "select",
|
|
4594
4594
|
default: "linear",
|
|
4595
|
-
options:
|
|
4595
|
+
options: xi,
|
|
4596
4596
|
section: o,
|
|
4597
4597
|
...s
|
|
4598
4598
|
}
|
|
4599
|
-
],
|
|
4599
|
+
], Ci = (e, t, n) => {
|
|
4600
4600
|
let r = e[`${t}A`] ?? 0;
|
|
4601
|
-
return r + ((e[`${t}B`] ?? r) - r) * (
|
|
4602
|
-
},
|
|
4601
|
+
return r + ((e[`${t}B`] ?? r) - r) * (bi[e[`${t}C`]] ?? bi.linear)(n);
|
|
4602
|
+
}, wi = {
|
|
4603
4603
|
id: "stripeArray",
|
|
4604
4604
|
label: "Stripe array",
|
|
4605
4605
|
about: "Stripe array — strips whose width, gap, length, shear, wave and bend ramp from first to last",
|
|
@@ -4664,11 +4664,11 @@ var di = [
|
|
|
4664
4664
|
format: (e) => `${e}×`,
|
|
4665
4665
|
section: "Strips"
|
|
4666
4666
|
},
|
|
4667
|
-
...
|
|
4668
|
-
...
|
|
4669
|
-
...
|
|
4670
|
-
...
|
|
4671
|
-
...
|
|
4667
|
+
...Si("w", "Width", 0, 1, .5, .5, "Strips", { format: (e) => e > 1 ? `${+e.toFixed(2)}` : `${Math.round(e * 100)}%` }),
|
|
4668
|
+
...Si("s", "Start", -.5, 1, 0, 0, "Length"),
|
|
4669
|
+
...Si("e", "End", 0, 1.5, 1, 1, "Length"),
|
|
4670
|
+
...Si("k", "Shear", -3, 3, 0, 0, "Length"),
|
|
4671
|
+
...Si("a", "Wave", 0, .3, 0, 0, "Wave"),
|
|
4672
4672
|
{
|
|
4673
4673
|
key: "freq",
|
|
4674
4674
|
label: "Waves",
|
|
@@ -4679,8 +4679,8 @@ var di = [
|
|
|
4679
4679
|
default: 3,
|
|
4680
4680
|
section: "Wave"
|
|
4681
4681
|
},
|
|
4682
|
-
...
|
|
4683
|
-
...
|
|
4682
|
+
...Si("ph", "Phase", -1, 1, 0, 0, "Wave"),
|
|
4683
|
+
...Si("b", "Bend", -.6, .6, 0, 0, "Bend"),
|
|
4684
4684
|
{
|
|
4685
4685
|
key: "dash",
|
|
4686
4686
|
label: "Dash",
|
|
@@ -4788,7 +4788,7 @@ var di = [
|
|
|
4788
4788
|
section: "Strips",
|
|
4789
4789
|
when: (e) => e.spread === "units"
|
|
4790
4790
|
},
|
|
4791
|
-
...
|
|
4791
|
+
...Si("g", "Gap", 0, 400, .5, .5, "Strips", {
|
|
4792
4792
|
rMin: 0,
|
|
4793
4793
|
rMax: .6,
|
|
4794
4794
|
when: (e) => e.spread === "packed" || e.spread === "units"
|
|
@@ -4800,14 +4800,14 @@ var di = [
|
|
|
4800
4800
|
y: n.y + n.h / 2 - a / 2,
|
|
4801
4801
|
w: a,
|
|
4802
4802
|
h: a
|
|
4803
|
-
} : n, s = r ? o.w : o.h, c = r ? o.h : o.w, l = Math.max(1, Math.round(t.count ?? 16)), u = s / l, d = Math.round(t.period ?? 0) || l, f = t.lead ?? 1, p = (e) => d > 1 ? e % d / (d - 1) : 0, m = (e) => Math.max(0,
|
|
4803
|
+
} : n, s = r ? o.w : o.h, c = r ? o.h : o.w, l = Math.max(1, Math.round(t.count ?? 16)), u = s / l, d = Math.round(t.period ?? 0) || l, f = t.lead ?? 1, p = (e) => d > 1 ? e % d / (d - 1) : 0, m = (e) => Math.max(0, Ci(t, "w", p(e))) * (e % d === 0 ? f : 1), h, g;
|
|
4804
4804
|
if (t.spread === "packed" || t.spread === "units") {
|
|
4805
|
-
let e = Array.from({ length: l }, (e, t) => m(t)), r = Array.from({ length: l }, (e, n) => Math.max(0,
|
|
4805
|
+
let e = Array.from({ length: l }, (e, t) => m(t)), r = Array.from({ length: l }, (e, n) => Math.max(0, Ci(t, "g", p(n)))), i = t.spread === "units" ? Math.min(n.w, n.h) / 800 : s / (e.reduce((e, t) => e + t, 0) + r.slice(0, -1).reduce((e, t) => e + t, 0) || 1), a = t.spread === "units" ? (t.offset ?? 0) * s : 0;
|
|
4806
4806
|
h = [], g = [];
|
|
4807
4807
|
for (let t = 0; t < l; t++) g.push(e[t] * i), h.push(a + e[t] * i / 2), a += (e[t] + r[t]) * i;
|
|
4808
4808
|
} else {
|
|
4809
4809
|
g = Array.from({ length: l }, (e, t) => m(t) * u);
|
|
4810
|
-
let e = Math.max(...Array.from({ length: l }, (e, n) => Math.abs(
|
|
4810
|
+
let e = Math.max(...Array.from({ length: l }, (e, n) => Math.abs(Ci(t, "a", p(n))))) * s, n = g[0] / 2 + e, r = s - g[l - 1] / 2 - e;
|
|
4811
4811
|
h = g.map((e, t) => l > 1 ? n + (r - n) * t / (l - 1) : s / 2);
|
|
4812
4812
|
}
|
|
4813
4813
|
let _ = n.x + n.w / 2, v = n.y + n.h / 2, y = Math.cos(i), b = Math.sin(i), x = (e, t) => {
|
|
@@ -4821,14 +4821,14 @@ var di = [
|
|
|
4821
4821
|
for (let e = 0; e < l; e++) {
|
|
4822
4822
|
let n = p(e), r = g[e];
|
|
4823
4823
|
if (r <= .05) continue;
|
|
4824
|
-
let i =
|
|
4824
|
+
let i = Ci(t, "s", n) * c, a = Ci(t, "e", n) * c;
|
|
4825
4825
|
if (a - i <= .5) continue;
|
|
4826
|
-
let o =
|
|
4826
|
+
let o = Ci(t, "k", n), l = Ci(t, "a", n) * s, u = Ci(t, "ph", n), d = Ci(t, "b", n) * s, f = t.freq ?? 3, m = (t) => {
|
|
4827
4827
|
let n = t / c;
|
|
4828
4828
|
return h[e] + l * Math.sin(2 * Math.PI * (n * f + u)) + d * 4 * (n - .5) * (n - .5);
|
|
4829
4829
|
}, _ = [], v = (t.dash ?? 0) * c, y = (t.gap ?? .05) * c, b = String(t.edges ?? "").split(";").map((e) => e.split(":").map(Number)).filter((e) => e.length >= 1 && Number.isFinite(e[0])), C = t.edgeNoise ?? 0;
|
|
4830
4830
|
if (b.length >= 2) {
|
|
4831
|
-
let e = b.map(([e, r = 0, i = 0, a = 0], o) => (e + r * Math.sin(2 * Math.PI * i * n + a * Math.PI / 180) + (C ? C * (
|
|
4831
|
+
let e = b.map(([e, r = 0, i = 0, a = 0], o) => (e + r * Math.sin(2 * Math.PI * i * n + a * Math.PI / 180) + (C ? C * ($r(n * (t.edgeNoiseFreq ?? 3), o * 7.3, t.edgeSeed ?? 1) - .5) * 2 : 0)) * c);
|
|
4832
4832
|
for (let t = 0; t + 1 < e.length; t += 2) _.push([Math.max(i, Math.min(e[t], e[t + 1])), Math.min(a, Math.max(e[t], e[t + 1]))]);
|
|
4833
4833
|
} else if (v > 0) {
|
|
4834
4834
|
let e = (u % 1 + 1) % 1 * (v + y);
|
|
@@ -4853,17 +4853,17 @@ var di = [
|
|
|
4853
4853
|
}
|
|
4854
4854
|
}
|
|
4855
4855
|
}
|
|
4856
|
-
},
|
|
4856
|
+
}, Ti = {
|
|
4857
4857
|
linear: (e) => e,
|
|
4858
4858
|
ease: (e) => e * e * (3 - 2 * e),
|
|
4859
4859
|
in: (e) => e * e,
|
|
4860
4860
|
out: (e) => 1 - (1 - e) * (1 - e),
|
|
4861
4861
|
hump: (e) => Math.sin(Math.PI * e),
|
|
4862
4862
|
alt: (e, t) => t % 2
|
|
4863
|
-
},
|
|
4863
|
+
}, Ei = Object.keys(Ti).map((e) => ({
|
|
4864
4864
|
value: e,
|
|
4865
4865
|
label: { alt: "Alternate" }[e] ?? e[0].toUpperCase() + e.slice(1)
|
|
4866
|
-
})),
|
|
4866
|
+
})), Di = (e, t, n, r, i, a, o, s = {}) => [
|
|
4867
4867
|
{
|
|
4868
4868
|
key: `${e}A`,
|
|
4869
4869
|
label: `${t} A`,
|
|
@@ -4891,14 +4891,14 @@ var di = [
|
|
|
4891
4891
|
label: `${t} curve`,
|
|
4892
4892
|
type: "select",
|
|
4893
4893
|
default: "linear",
|
|
4894
|
-
options:
|
|
4894
|
+
options: Ei,
|
|
4895
4895
|
section: o,
|
|
4896
4896
|
...s
|
|
4897
4897
|
}
|
|
4898
|
-
],
|
|
4898
|
+
], Oi = (e, t, n, r) => {
|
|
4899
4899
|
let i = e[`${t}A`] ?? 0;
|
|
4900
|
-
return i + ((e[`${t}B`] ?? i) - i) * (
|
|
4901
|
-
},
|
|
4900
|
+
return i + ((e[`${t}B`] ?? i) - i) * (Ti[e[`${t}C`]] ?? Ti.linear)(n, r);
|
|
4901
|
+
}, ki = (e) => e.mode === "rings", Ai = {
|
|
4902
4902
|
id: "radialArray",
|
|
4903
4903
|
label: "Radial array",
|
|
4904
4904
|
about: "Radial array — rays or rings around a centre, each ramping in length, width and turn",
|
|
@@ -4983,7 +4983,7 @@ var di = [
|
|
|
4983
4983
|
type: "toggle",
|
|
4984
4984
|
default: !1,
|
|
4985
4985
|
section: "Rays",
|
|
4986
|
-
when: (e) => !
|
|
4986
|
+
when: (e) => !ki(e)
|
|
4987
4987
|
},
|
|
4988
4988
|
{
|
|
4989
4989
|
key: "raySample",
|
|
@@ -4995,7 +4995,7 @@ var di = [
|
|
|
4995
4995
|
default: 4,
|
|
4996
4996
|
format: (e) => `${e}px`,
|
|
4997
4997
|
section: "Rays",
|
|
4998
|
-
when: (e) => !
|
|
4998
|
+
when: (e) => !ki(e) && !!e.byField
|
|
4999
4999
|
},
|
|
5000
5000
|
{
|
|
5001
5001
|
key: "shape",
|
|
@@ -5003,7 +5003,7 @@ var di = [
|
|
|
5003
5003
|
type: "segmented",
|
|
5004
5004
|
default: "bar",
|
|
5005
5005
|
section: "Rays",
|
|
5006
|
-
when: (e) => !
|
|
5006
|
+
when: (e) => !ki(e),
|
|
5007
5007
|
options: [
|
|
5008
5008
|
{
|
|
5009
5009
|
value: "bar",
|
|
@@ -5019,16 +5019,16 @@ var di = [
|
|
|
5019
5019
|
}
|
|
5020
5020
|
]
|
|
5021
5021
|
},
|
|
5022
|
-
...
|
|
5022
|
+
...Di("r0", "Inner", 0, 4, .2, .2, "Radii", {
|
|
5023
5023
|
rMin: 0,
|
|
5024
5024
|
rMax: .5
|
|
5025
5025
|
}),
|
|
5026
|
-
...
|
|
5026
|
+
...Di("r1", "Outer", 0, 12, 1, 1, "Radii", {
|
|
5027
5027
|
rMin: .6,
|
|
5028
5028
|
rMax: 1.6
|
|
5029
5029
|
}),
|
|
5030
|
-
...
|
|
5031
|
-
...
|
|
5030
|
+
...Di("w", "Width", 0, 1, .5, .5, "Width", { format: (e) => `${Math.round(e * 100)}%` }),
|
|
5031
|
+
...Di("rot", "Turn", -180, 180, 0, 0, "Turn", { format: (e) => `${Math.round(e)}°` }),
|
|
5032
5032
|
{
|
|
5033
5033
|
key: "segments",
|
|
5034
5034
|
label: "Segments",
|
|
@@ -5038,7 +5038,7 @@ var di = [
|
|
|
5038
5038
|
step: 1,
|
|
5039
5039
|
default: 1,
|
|
5040
5040
|
section: "Rings",
|
|
5041
|
-
when:
|
|
5041
|
+
when: ki
|
|
5042
5042
|
},
|
|
5043
5043
|
{
|
|
5044
5044
|
key: "segGap",
|
|
@@ -5049,7 +5049,7 @@ var di = [
|
|
|
5049
5049
|
step: .01,
|
|
5050
5050
|
default: .1,
|
|
5051
5051
|
section: "Rings",
|
|
5052
|
-
when: (e) =>
|
|
5052
|
+
when: (e) => ki(e) && (e.segments ?? 1) > 1
|
|
5053
5053
|
},
|
|
5054
5054
|
{
|
|
5055
5055
|
key: "taper",
|
|
@@ -5060,7 +5060,7 @@ var di = [
|
|
|
5060
5060
|
step: .01,
|
|
5061
5061
|
default: 0,
|
|
5062
5062
|
section: "Rings",
|
|
5063
|
-
when:
|
|
5063
|
+
when: ki
|
|
5064
5064
|
},
|
|
5065
5065
|
{
|
|
5066
5066
|
key: "taperPow",
|
|
@@ -5071,7 +5071,7 @@ var di = [
|
|
|
5071
5071
|
step: .05,
|
|
5072
5072
|
default: 1,
|
|
5073
5073
|
section: "Rings",
|
|
5074
|
-
when:
|
|
5074
|
+
when: ki
|
|
5075
5075
|
},
|
|
5076
5076
|
{
|
|
5077
5077
|
key: "taperAlign",
|
|
@@ -5079,7 +5079,7 @@ var di = [
|
|
|
5079
5079
|
type: "segmented",
|
|
5080
5080
|
default: "centre",
|
|
5081
5081
|
section: "Rings",
|
|
5082
|
-
when:
|
|
5082
|
+
when: ki,
|
|
5083
5083
|
options: [
|
|
5084
5084
|
{
|
|
5085
5085
|
value: "centre",
|
|
@@ -5104,7 +5104,7 @@ var di = [
|
|
|
5104
5104
|
step: .01,
|
|
5105
5105
|
default: 0,
|
|
5106
5106
|
section: "Rings",
|
|
5107
|
-
when:
|
|
5107
|
+
when: ki
|
|
5108
5108
|
},
|
|
5109
5109
|
{
|
|
5110
5110
|
key: "zigN",
|
|
@@ -5115,7 +5115,7 @@ var di = [
|
|
|
5115
5115
|
step: 1,
|
|
5116
5116
|
default: 8,
|
|
5117
5117
|
section: "Rings",
|
|
5118
|
-
when: (e) =>
|
|
5118
|
+
when: (e) => ki(e) && (e.zig ?? 0) > 0
|
|
5119
5119
|
}
|
|
5120
5120
|
],
|
|
5121
5121
|
draw(e, t, n, { field: r, mask: i }) {
|
|
@@ -5123,9 +5123,9 @@ var di = [
|
|
|
5123
5123
|
if (t.mode === "rings") {
|
|
5124
5124
|
let e = Math.max(1, Math.round(t.segments ?? 1)), n = t.segGap ?? .1, r = t.zig ?? 0, i = Math.round(t.zigN ?? 8), h = (e) => 4 * Math.abs((e % 1 + 1) % 1 - .5) - 1;
|
|
5125
5125
|
for (let g = 0; g < a; g++) {
|
|
5126
|
-
let a = m(g), _ =
|
|
5126
|
+
let a = m(g), _ = Oi(t, "r1", a, g) * o, v = Oi(t, "w", a, g) * o;
|
|
5127
5127
|
if (v <= .05 || _ <= 0) continue;
|
|
5128
|
-
let y =
|
|
5128
|
+
let y = Oi(t, "rot", a, g) * Math.PI / 180, b = u / e;
|
|
5129
5129
|
for (let a = 0; a < e; a++) {
|
|
5130
5130
|
let u = l + y + a * b + (e > 1 ? b * n / 2 : 0), m = l + y + (a + 1) * b - (e > 1 ? b * n / 2 : 0), g = Math.max(8, Math.ceil((m - u) * _ / 6)) * (r ? 4 : 1), x = [], S = [];
|
|
5131
5131
|
for (let e = 0; e <= g; e++) {
|
|
@@ -5149,9 +5149,9 @@ var di = [
|
|
|
5149
5149
|
}
|
|
5150
5150
|
let h = d ? u / a : u / Math.max(1, a - 1);
|
|
5151
5151
|
for (let e = 0; e < a; e++) {
|
|
5152
|
-
let a = m(e), u = l + e * h +
|
|
5152
|
+
let a = m(e), u = l + e * h + Oi(t, "rot", a, e) * Math.PI / 180, d = Oi(t, "r0", a, e) * o, g = Oi(t, "r1", a, e) * o;
|
|
5153
5153
|
if (g - d <= .3) continue;
|
|
5154
|
-
let _ =
|
|
5154
|
+
let _ = Oi(t, "w", a, e);
|
|
5155
5155
|
if (!(_ <= 0)) if (t.byField && r) {
|
|
5156
5156
|
let e = Math.max(1, t.raySample ?? 4), a = Math.abs(h) * g * _ / 2, o = Math.cos(u), l = Math.sin(u), p = -l, m = o, v = [], y = () => {
|
|
5157
5157
|
if (v.length) {
|
|
@@ -5195,10 +5195,10 @@ var di = [
|
|
|
5195
5195
|
}
|
|
5196
5196
|
}
|
|
5197
5197
|
}
|
|
5198
|
-
},
|
|
5198
|
+
}, ji = (e, t) => {
|
|
5199
5199
|
let n = Math.imul(e + 1, 2654435761) ^ Math.imul(t + 7, 40503);
|
|
5200
5200
|
return n = Math.imul(n ^ n >>> 15, 2246822519), n ^= n >>> 13, (n >>> 0) / 4294967296;
|
|
5201
|
-
},
|
|
5201
|
+
}, Mi = (e, t, n, r, i, a) => {
|
|
5202
5202
|
let o = r - t, s = i - n, c = Math.hypot(o, s) || 1, l = -s / c * (a / 2), u = o / c * (a / 2);
|
|
5203
5203
|
k(e, [
|
|
5204
5204
|
[t + l, n + u],
|
|
@@ -5206,14 +5206,14 @@ var di = [
|
|
|
5206
5206
|
[r - l, i - u],
|
|
5207
5207
|
[t - l, n - u]
|
|
5208
5208
|
]);
|
|
5209
|
-
},
|
|
5209
|
+
}, Ni = (e, t, n, r, i) => {
|
|
5210
5210
|
let a = [], o = [];
|
|
5211
5211
|
for (let e = 0; e < 24; e++) {
|
|
5212
5212
|
let s = e / 24 * 2 * Math.PI;
|
|
5213
5213
|
a.push([t + Math.cos(s) * r, n + Math.sin(s) * r]), o.push([t + Math.cos(s) * (r - i), n + Math.sin(s) * (r - i)]);
|
|
5214
5214
|
}
|
|
5215
5215
|
ye(e, [a, o]);
|
|
5216
|
-
},
|
|
5216
|
+
}, Pi = (e, t, n, r, i, a) => ye(e, [[
|
|
5217
5217
|
[t - r, n - i],
|
|
5218
5218
|
[t + r, n - i],
|
|
5219
5219
|
[t + r, n + i],
|
|
@@ -5224,7 +5224,7 @@ var di = [
|
|
|
5224
5224
|
[t + r - a, n + i - a],
|
|
5225
5225
|
[t - r + a, n + i - a]
|
|
5226
5226
|
]]);
|
|
5227
|
-
function
|
|
5227
|
+
function Fi(t, n, r, i, a, o, s, c) {
|
|
5228
5228
|
let l = Math.min(a, o);
|
|
5229
5229
|
switch (n) {
|
|
5230
5230
|
case "|": {
|
|
@@ -5236,13 +5236,13 @@ function Pi(t, n, r, i, a, o, s, c) {
|
|
|
5236
5236
|
e(t, r, i, l * .12);
|
|
5237
5237
|
break;
|
|
5238
5238
|
case "o":
|
|
5239
|
-
|
|
5239
|
+
Ni(t, r, i, l * .22, c);
|
|
5240
5240
|
break;
|
|
5241
5241
|
case "x":
|
|
5242
|
-
|
|
5242
|
+
Mi(t, r - l * .2, i - l * .2, r + l * .2, i + l * .2, c), Mi(t, r - l * .2, i + l * .2, r + l * .2, i - l * .2, c);
|
|
5243
5243
|
break;
|
|
5244
5244
|
case "/":
|
|
5245
|
-
|
|
5245
|
+
Mi(t, r - l * .3, i + l * .3, r + l * .3, i - l * .3, c);
|
|
5246
5246
|
break;
|
|
5247
5247
|
case "-":
|
|
5248
5248
|
C(t, r - a * .35, i - c / 2, a * .7, c);
|
|
@@ -5251,15 +5251,15 @@ function Pi(t, n, r, i, a, o, s, c) {
|
|
|
5251
5251
|
C(t, r - a * .3, i - o * .18, a * .6, o * .36);
|
|
5252
5252
|
break;
|
|
5253
5253
|
case "[":
|
|
5254
|
-
|
|
5254
|
+
Pi(t, r, i, a * .35, o * .25, c);
|
|
5255
5255
|
break;
|
|
5256
5256
|
case "^":
|
|
5257
|
-
|
|
5257
|
+
Mi(t, r - a * .45, i + l * .25, r + a * .3, i + l * .25, c), Mi(t, r + a * .3, i + l * .25, r + a * .45, i - l * .25, c);
|
|
5258
5258
|
break;
|
|
5259
5259
|
default: break;
|
|
5260
5260
|
}
|
|
5261
5261
|
}
|
|
5262
|
-
var
|
|
5262
|
+
var Ii = {
|
|
5263
5263
|
id: "symbolGrid",
|
|
5264
5264
|
label: "Symbol grid",
|
|
5265
5265
|
about: "Symbol grid — small symbols in a grid, picked and sized by a field, with tracks, accents and plots",
|
|
@@ -5605,7 +5605,7 @@ var Fi = {
|
|
|
5605
5605
|
let a = n[`c${i}A`] ?? .2, s = n[`c${i}F`] ?? 1, c = (n[`c${i}P`] ?? 0) * Math.PI / 180, l = n[`c${i}Y`] ?? .5, d = n[`c${i}D`] ?? 3, f = Math.max(1, Math.round(n[`c${i}N`] ?? 40)), p = (e) => r.y + r.h * (l - a * Math.sin(2 * Math.PI * e * s + c)), m = null, h = o * 4;
|
|
5606
5606
|
for (let e = 0; e <= h; e++) {
|
|
5607
5607
|
let n = e / h, i = r.x + n * r.w, a = p(n);
|
|
5608
|
-
m &&
|
|
5608
|
+
m && Mi(t, m[0], m[1], i, a, u), m = [i, a];
|
|
5609
5609
|
}
|
|
5610
5610
|
for (let n = 0; n <= f; n++) {
|
|
5611
5611
|
let i = n / f;
|
|
@@ -5616,14 +5616,14 @@ var Fi = {
|
|
|
5616
5616
|
}
|
|
5617
5617
|
let f = (n.set || "|").replace(/\s+/g, "").split(""), p = n.empty ?? .05, m = (n.wave ?? 0) * l, h = n.track ?? 0, g = n.ragged ?? 0, _ = (n.grain ?? 0) * l, v = n.widthBy ?? 0;
|
|
5618
5618
|
for (let e = 0; e < s; e++) {
|
|
5619
|
-
let y = e * .07 + (n.waveDesync ?? 0) *
|
|
5619
|
+
let y = e * .07 + (n.waveDesync ?? 0) * ji(e + 701, d), b = g * ji(e + 801, d), x = 1 - g * ji(e + 901, d);
|
|
5620
5620
|
for (let g = 0; g < o; g++) {
|
|
5621
5621
|
let S = e * o + g, w = (g + .5) / o;
|
|
5622
5622
|
if (w < b || w > x) continue;
|
|
5623
|
-
let T = (m ? m * Math.sin(2 * Math.PI * (w * (n.waveFreq ?? 2) + y)) : 0) + (_ ? _ * (
|
|
5623
|
+
let T = (m ? m * Math.sin(2 * Math.PI * (w * (n.waveFreq ?? 2) + y)) : 0) + (_ ? _ * (ji(S + 1001, d) - .5) : 0), E = r.x + (g + .5) * c, D = r.y + (e + .5) * l + T, ee = (D - r.y) / r.h;
|
|
5624
5624
|
if (!a(w, ee)) continue;
|
|
5625
5625
|
let O = i(w, ee);
|
|
5626
|
-
if ((n.accent ?? 0) > 0 &&
|
|
5626
|
+
if ((n.accent ?? 0) > 0 && ji(S + 31, d) < n.accent) {
|
|
5627
5627
|
let e = Math.round(n.accentLen ?? 3);
|
|
5628
5628
|
C(t, E - c * .45, D - l * .18, c * (e - .1), l * .36), g += e - 1;
|
|
5629
5629
|
continue;
|
|
@@ -5631,22 +5631,22 @@ var Fi = {
|
|
|
5631
5631
|
if (h > 0) {
|
|
5632
5632
|
let e = .5 + h * Math.sin(2 * Math.PI * (w * (n.trackFreq ?? 1) + (n.trackPhase ?? 0)));
|
|
5633
5633
|
if (Math.abs(e - ee) * s < .5) {
|
|
5634
|
-
|
|
5634
|
+
Pi(t, E, D, Math.min(c, l) * .35, Math.min(c, l) * .35, u);
|
|
5635
5635
|
continue;
|
|
5636
5636
|
}
|
|
5637
5637
|
}
|
|
5638
|
-
O < p ||
|
|
5638
|
+
O < p || Fi(t, n.pick === "random" ? f[Math.floor(ji(S, d) * f.length)] : n.pick === "row" ? f[e % f.length] : f[Math.min(f.length - 1, Math.floor(O * f.length))], E, D, c, l, O, v ? u * (1 - v + v * O) : u);
|
|
5639
5639
|
}
|
|
5640
5640
|
}
|
|
5641
5641
|
for (let e = 0; e < Math.round(n.rules ?? 0); e++) {
|
|
5642
|
-
let n =
|
|
5642
|
+
let n = ji(e + 101, d) < .5, i = r.x + Math.floor(ji(e + 201, d) * o) * c, a = r.y + Math.floor(ji(e + 301, d) * s) * l, f = (3 + Math.floor(ji(e + 401, d) * 12)) * (n ? l : c);
|
|
5643
5643
|
n ? C(t, i - u / 4, a, u / 2, Math.min(f, r.y + r.h - a)) : C(t, i, a - u / 4, Math.min(f, r.x + r.w - i), u / 2);
|
|
5644
5644
|
}
|
|
5645
5645
|
}
|
|
5646
|
-
},
|
|
5646
|
+
}, Li = (e, t) => {
|
|
5647
5647
|
let n = Math.imul(e + 1, 2654435761) ^ Math.imul(t + 3, 40503);
|
|
5648
5648
|
return n = Math.imul(n ^ n >>> 15, 2246822519), n ^= n >>> 13, (n >>> 0) / 4294967296;
|
|
5649
|
-
},
|
|
5649
|
+
}, Ri = [
|
|
5650
5650
|
"solid",
|
|
5651
5651
|
"dots",
|
|
5652
5652
|
"lines",
|
|
@@ -5656,7 +5656,7 @@ var Fi = {
|
|
|
5656
5656
|
value: e,
|
|
5657
5657
|
label: { hlines: "Rows of lines" }[e] ?? e[0].toUpperCase() + e.slice(1)
|
|
5658
5658
|
}));
|
|
5659
|
-
function
|
|
5659
|
+
function zi(t, n, r, i, a, o, s, c) {
|
|
5660
5660
|
if (!(a <= 0 || o <= 0)) {
|
|
5661
5661
|
if (n === "solid") C(t, r, i, a, o);
|
|
5662
5662
|
else if (n === "dots") for (let n = i + s / 2; n < i + o; n += s) for (let i = r + s / 2; i < r + a; i += s) e(t, i, n, c * s * .5);
|
|
@@ -5664,7 +5664,7 @@ function Ri(t, n, r, i, a, o, s, c) {
|
|
|
5664
5664
|
else if (n === "hlines") for (let e = i; e < i + o - .1; e += s) C(t, r, e, a, Math.min(c * s, i + o - e));
|
|
5665
5665
|
}
|
|
5666
5666
|
}
|
|
5667
|
-
var
|
|
5667
|
+
var Bi = {
|
|
5668
5668
|
id: "tiling",
|
|
5669
5669
|
label: "Tiling",
|
|
5670
5670
|
about: "Tiling — bricks, a checker, columns or a maze, each cell solid or textured",
|
|
@@ -5751,7 +5751,7 @@ var zi = {
|
|
|
5751
5751
|
label: "Fill A",
|
|
5752
5752
|
type: "select",
|
|
5753
5753
|
default: "solid",
|
|
5754
|
-
options:
|
|
5754
|
+
options: Ri,
|
|
5755
5755
|
section: "Fill"
|
|
5756
5756
|
},
|
|
5757
5757
|
{
|
|
@@ -5759,7 +5759,7 @@ var zi = {
|
|
|
5759
5759
|
label: "Fill B",
|
|
5760
5760
|
type: "select",
|
|
5761
5761
|
default: "dots",
|
|
5762
|
-
options:
|
|
5762
|
+
options: Ri,
|
|
5763
5763
|
section: "Fill"
|
|
5764
5764
|
},
|
|
5765
5765
|
{
|
|
@@ -5822,7 +5822,7 @@ var zi = {
|
|
|
5822
5822
|
}
|
|
5823
5823
|
],
|
|
5824
5824
|
draw(e, t, n) {
|
|
5825
|
-
let r = Math.max(1, Math.round(t.cols ?? 4)), i = Math.max(1, Math.round(t.rows ?? 6)), a = t.seed ?? 1, o = t.tex ?? 8, s = t.texSize ?? .45, c = (e, n, r) => (t.alt === "row" ? n % 2 : t.alt === "col" ? e % 2 : t.alt === "random" ?
|
|
5825
|
+
let r = Math.max(1, Math.round(t.cols ?? 4)), i = Math.max(1, Math.round(t.rows ?? 6)), a = t.seed ?? 1, o = t.tex ?? 8, s = t.texSize ?? .45, c = (e, n, r) => (t.alt === "row" ? n % 2 : t.alt === "col" ? e % 2 : t.alt === "random" ? Li(r, a) < .5 : (e + n) % 2) ? t.fillB ?? "dots" : t.fillA ?? "solid", l = n, u = (t.frame ?? 0) * Math.min(n.w, n.h);
|
|
5826
5826
|
u > 0 && (ye(e, [[
|
|
5827
5827
|
[n.x, n.y],
|
|
5828
5828
|
[n.x + n.w, n.y],
|
|
@@ -5854,7 +5854,7 @@ var zi = {
|
|
|
5854
5854
|
[c - t, u - t],
|
|
5855
5855
|
[n + t, u - t]
|
|
5856
5856
|
]]);
|
|
5857
|
-
let s = Math.min(c - n, u - r) / (i - o + 1), l =
|
|
5857
|
+
let s = Math.min(c - n, u - r) / (i - o + 1), l = Li(o, a);
|
|
5858
5858
|
n += s * (l < .5 ? 1 : .4), r += s * (l < .25 || l > .75 ? 1 : .5), c -= s * (l >= .5 ? 1 : .4), u -= s * (l >= .25 && l <= .75 ? 1 : .5);
|
|
5859
5859
|
}
|
|
5860
5860
|
return;
|
|
@@ -5864,8 +5864,8 @@ var zi = {
|
|
|
5864
5864
|
if (m === "bricks") {
|
|
5865
5865
|
let r = l.x - (n % 2 ? d / 2 : 0), i = 0;
|
|
5866
5866
|
for (; r < l.x + l.w;) {
|
|
5867
|
-
let u = d * (1 + (t.vary ?? .4) * (
|
|
5868
|
-
|
|
5867
|
+
let u = d * (1 + (t.vary ?? .4) * (Li(h * 7 + n, a) * 2 - 1)), m = Math.max(l.x, r), g = Math.min(l.x + l.w, r + u);
|
|
5868
|
+
zi(e, c(i, n, h), m + p / 2, l.y + n * f + p / 2, g - m - p, f - p, o, s), r += u, i++, h++;
|
|
5869
5869
|
}
|
|
5870
5870
|
continue;
|
|
5871
5871
|
}
|
|
@@ -5873,23 +5873,23 @@ var zi = {
|
|
|
5873
5873
|
let r = m === "columns" && i % 2 ? (t.shift ?? 0) * f : 0, a = l.x + i * d, u = l.y + n * f + r;
|
|
5874
5874
|
if (r && u + f > l.y + l.h + .01) {
|
|
5875
5875
|
let r = c(0, n + i % 2, h), p = d * (t.gap ?? .04) / 2, m = u + f - (l.y + l.h);
|
|
5876
|
-
|
|
5876
|
+
zi(e, r, a + p, u, d - 2 * p, f - m, o, s), zi(e, r, a + p, l.y, d - 2 * p, m, o, s);
|
|
5877
5877
|
continue;
|
|
5878
5878
|
}
|
|
5879
5879
|
let g = m === "columns" ? c(0, n + i % 2, h) : c(i, n, h), _ = m === "columns" ? d * (t.gap ?? .04) / 2 : p / 2;
|
|
5880
|
-
|
|
5880
|
+
zi(e, g, a + _, u + (m === "columns" ? 0 : p / 2), d - 2 * _, f - (m === "columns" ? 0 : p), o, s);
|
|
5881
5881
|
}
|
|
5882
5882
|
}
|
|
5883
5883
|
}
|
|
5884
5884
|
};
|
|
5885
5885
|
//#endregion
|
|
5886
5886
|
//#region src/generate/path.js
|
|
5887
|
-
function
|
|
5887
|
+
function Vi(e) {
|
|
5888
5888
|
let t = [], n = /([MLHVCSQTAZmlhvcsqtaz])|(-?(?:\d+\.?\d*|\.\d+)(?:e[-+]?\d+)?)/g, r;
|
|
5889
5889
|
for (; r = n.exec(e);) t.push(r[1] ?? Number(r[2]));
|
|
5890
5890
|
return t;
|
|
5891
5891
|
}
|
|
5892
|
-
function
|
|
5892
|
+
function Hi(e, t, n, r, i, a, o, s, c, l) {
|
|
5893
5893
|
if (!n || !r) return [[s, c]];
|
|
5894
5894
|
let u = Math.cos(i), d = Math.sin(i), f = (e - s) / 2, p = (t - c) / 2, m = u * f + d * p, h = -d * f + u * p;
|
|
5895
5895
|
n = Math.abs(n), r = Math.abs(r);
|
|
@@ -5904,8 +5904,8 @@ function Vi(e, t, n, r, i, a, o, s, c, l) {
|
|
|
5904
5904
|
}
|
|
5905
5905
|
return E;
|
|
5906
5906
|
}
|
|
5907
|
-
function
|
|
5908
|
-
let n =
|
|
5907
|
+
function Ui(e, t = 8) {
|
|
5908
|
+
let n = Vi(e), r = [], i = null, a = 0, o = 0, s = 0, c = 0, l = "M", u = 0, d = null, f = () => {
|
|
5909
5909
|
i && i.length >= 3 && r.push(i), i = null;
|
|
5910
5910
|
}, p = () => n[u++];
|
|
5911
5911
|
for (; u < n.length;) {
|
|
@@ -5942,12 +5942,12 @@ function Hi(e, t = 8) {
|
|
|
5942
5942
|
d = [e, n], a = s, o = c;
|
|
5943
5943
|
} else if (r === "A") {
|
|
5944
5944
|
let e = p(), n = p(), r = p() * Math.PI / 180, s = p(), c = p(), l = m + p(), u = h + p();
|
|
5945
|
-
i.push(...
|
|
5945
|
+
i.push(...Hi(a, o, e, n, r, s, c, l, u, t * 2)), a = l, o = u, d = null;
|
|
5946
5946
|
} else u++;
|
|
5947
5947
|
}
|
|
5948
5948
|
return f(), r;
|
|
5949
5949
|
}
|
|
5950
|
-
function
|
|
5950
|
+
function Wi(e) {
|
|
5951
5951
|
let t = Infinity, n = Infinity, r = -Infinity, i = -Infinity;
|
|
5952
5952
|
for (let a of e) for (let [e, o] of a) t = Math.min(t, e), n = Math.min(n, o), r = Math.max(r, e), i = Math.max(i, o);
|
|
5953
5953
|
return {
|
|
@@ -5959,7 +5959,7 @@ function Ui(e) {
|
|
|
5959
5959
|
}
|
|
5960
5960
|
//#endregion
|
|
5961
5961
|
//#region src/generate/glyphs.js
|
|
5962
|
-
var
|
|
5962
|
+
var Gi = {
|
|
5963
5963
|
A: [
|
|
5964
5964
|
".###.",
|
|
5965
5965
|
"#...#",
|
|
@@ -6402,8 +6402,8 @@ var Wi = {
|
|
|
6402
6402
|
".###."
|
|
6403
6403
|
]
|
|
6404
6404
|
};
|
|
6405
|
-
function
|
|
6406
|
-
let t =
|
|
6405
|
+
function Ki(e) {
|
|
6406
|
+
let t = Gi[e] ?? Gi[e?.toUpperCase?.()] ?? Gi[e?.toLowerCase?.()];
|
|
6407
6407
|
if (!t) return [];
|
|
6408
6408
|
let n = [];
|
|
6409
6409
|
return t.forEach((e, t) => {
|
|
@@ -6425,41 +6425,41 @@ function Gi(e) {
|
|
|
6425
6425
|
}
|
|
6426
6426
|
}), n;
|
|
6427
6427
|
}
|
|
6428
|
-
var
|
|
6429
|
-
function
|
|
6430
|
-
|
|
6431
|
-
for (let t of [...
|
|
6428
|
+
var qi = Object.fromEntries(rt.params.map((e) => [e.key, e.default])), Ji = /* @__PURE__ */ new Map(), Yi = /* @__PURE__ */ new Map();
|
|
6429
|
+
function Xi(e, t) {
|
|
6430
|
+
Ji.set(e, t);
|
|
6431
|
+
for (let t of [...Yi.keys()]) t.startsWith(`${e}|`) && Yi.delete(t);
|
|
6432
6432
|
}
|
|
6433
|
-
var
|
|
6434
|
-
function
|
|
6433
|
+
var Zi = (e) => Ji.has(e);
|
|
6434
|
+
function Qi(e, t) {
|
|
6435
6435
|
let n = `${e}|${t}`;
|
|
6436
|
-
if (
|
|
6437
|
-
let r =
|
|
6436
|
+
if (Yi.has(n)) return Yi.get(n);
|
|
6437
|
+
let r = Ji.get(e), i;
|
|
6438
6438
|
if (!r || e === "pixel") i = {
|
|
6439
|
-
rings:
|
|
6439
|
+
rings: Ki(t),
|
|
6440
6440
|
advance: 5 / 7
|
|
6441
6441
|
};
|
|
6442
6442
|
else {
|
|
6443
6443
|
let e = r.unitsPerEm, n = r.ascender, a = -r.descender, o = r.charToGlyph(t), s = o.getPath(0, n, e).toPathData(2), c = n + a;
|
|
6444
6444
|
i = {
|
|
6445
|
-
rings:
|
|
6445
|
+
rings: Ui(s, 4).map((e) => e.map(([e, t]) => [e / c, t / c])),
|
|
6446
6446
|
advance: (o.advanceWidth || e * .6) / c
|
|
6447
6447
|
};
|
|
6448
6448
|
}
|
|
6449
|
-
return
|
|
6449
|
+
return Yi.set(n, i), i;
|
|
6450
6450
|
}
|
|
6451
6451
|
//#endregion
|
|
6452
6452
|
//#region src/generate/styles/ascii.js
|
|
6453
|
-
var
|
|
6453
|
+
var $i = (e, t) => {
|
|
6454
6454
|
let n = Math.imul(e + 1, 2654435761) ^ Math.imul(t + 5, 40503);
|
|
6455
6455
|
return n = Math.imul(n ^ n >>> 15, 2246822519), n ^= n >>> 13, (n >>> 0) / 4294967296;
|
|
6456
|
-
},
|
|
6456
|
+
}, ea = {
|
|
6457
6457
|
classic: " .:-=+*#%@",
|
|
6458
6458
|
blocks: " .:░▒▓█",
|
|
6459
6459
|
dots: " .·•●",
|
|
6460
6460
|
data: " .-|=#",
|
|
6461
6461
|
glyphs: " ·+x*#"
|
|
6462
|
-
},
|
|
6462
|
+
}, ta = (e, t) => e[Math.min(e.length - 1, Math.max(0, Math.floor(t * e.length)))], na = {
|
|
6463
6463
|
id: "ascii",
|
|
6464
6464
|
label: "ASCII",
|
|
6465
6465
|
about: "ASCII — a character grid; each cell’s glyph is picked from a ramp by the field’s brightness",
|
|
@@ -6507,7 +6507,7 @@ var Qi = (e, t) => {
|
|
|
6507
6507
|
key: "ramp",
|
|
6508
6508
|
label: "Ramp",
|
|
6509
6509
|
type: "text",
|
|
6510
|
-
default:
|
|
6510
|
+
default: ea.classic,
|
|
6511
6511
|
placeholder: "dark → bright",
|
|
6512
6512
|
section: "Characters"
|
|
6513
6513
|
},
|
|
@@ -6520,7 +6520,7 @@ var Qi = (e, t) => {
|
|
|
6520
6520
|
options: [{
|
|
6521
6521
|
value: "",
|
|
6522
6522
|
label: "Custom"
|
|
6523
|
-
}, ...Object.entries(
|
|
6523
|
+
}, ...Object.entries(ea).map(([e, t]) => ({
|
|
6524
6524
|
value: e,
|
|
6525
6525
|
label: `${e} ${t.trim()}`
|
|
6526
6526
|
}))]
|
|
@@ -6641,7 +6641,7 @@ var Qi = (e, t) => {
|
|
|
6641
6641
|
}
|
|
6642
6642
|
],
|
|
6643
6643
|
draw(e, t, n, { field: r, mask: i, warp: a }) {
|
|
6644
|
-
let o = Math.max(1, Math.round(t.cols ?? 60)), s = n.w / o, c = s * (t.cell ?? 1.4), l = Math.max(1, Math.floor(n.h / c)), u = (n.h - l * c) / 2, d = [
|
|
6644
|
+
let o = Math.max(1, Math.round(t.cols ?? 60)), s = n.w / o, c = s * (t.cell ?? 1.4), l = Math.max(1, Math.floor(n.h / c)), u = (n.h - l * c) / 2, d = [...ea[t.rampPreset] ?? t.ramp ?? ea.classic];
|
|
6645
6645
|
t.reverse && (d = d.reverse());
|
|
6646
6646
|
let f = t.font ?? "pixel", p = [...t.text ?? ""], m = [...t.letters ?? ""], h = Math.round(t.word ?? 0), g = t.textBelow ?? 0, _ = t.seed ?? 1, v = t.scale ?? 1;
|
|
6647
6647
|
for (let y = 0; y < l; y++) for (let l = 0; l < o; l++) {
|
|
@@ -6654,24 +6654,24 @@ var Qi = (e, t) => {
|
|
|
6654
6654
|
let T = r(C, w), E;
|
|
6655
6655
|
if ((p.length || m.length) && T < g) {
|
|
6656
6656
|
if (h > 0 && l % (h + 1) === h) continue;
|
|
6657
|
-
E = p.length ? p[b % p.length] : m[Math.floor(
|
|
6657
|
+
E = p.length ? p[b % p.length] : m[Math.floor($i(b, _) * m.length)];
|
|
6658
6658
|
} else {
|
|
6659
6659
|
let e = g > 0 && (p.length || m.length) ? (T - g) / (1 - g) : T;
|
|
6660
|
-
E = t.sizeBy ? d[d.length - 1] :
|
|
6660
|
+
E = t.sizeBy ? d[d.length - 1] : ta(d, e);
|
|
6661
6661
|
}
|
|
6662
6662
|
if (!E || E === " ") continue;
|
|
6663
|
-
let D =
|
|
6663
|
+
let D = Qi(f, E);
|
|
6664
6664
|
if (!D.rings.length) continue;
|
|
6665
6665
|
let ee = (t.sizeBy ? (t.sizeMin ?? .2) + (1 - (t.sizeMin ?? .2)) * T : 1) * v, O = c * ee, te = t.fitCell ? s * ee : D.advance * O, ne = t.fitCell ? te / Math.max(1e-6, D.advance) : O, k = n.x + x * n.w - te / 2, re = n.y + S * n.h - O / 2;
|
|
6666
6666
|
ye(e, D.rings.map((e) => e.map(([e, t]) => [k + e * ne, re + t * O])));
|
|
6667
6667
|
}
|
|
6668
6668
|
}
|
|
6669
|
-
},
|
|
6669
|
+
}, ra = (e) => {
|
|
6670
6670
|
let t = e * 2654435761 >>> 0 || 1;
|
|
6671
6671
|
return () => (t ^= t << 13, t ^= t >>> 17, t ^= t << 5, (t >>> 0) % 1e9 / 1e9);
|
|
6672
6672
|
};
|
|
6673
|
-
function
|
|
6674
|
-
let a =
|
|
6673
|
+
function ia(e, t, n, r, i = 20) {
|
|
6674
|
+
let a = ra(r), o = n / Math.SQRT2, s = Math.ceil(e / o), c = Math.ceil(t / o), l = new Int32Array(s * c).fill(-1), u = [], d = [], f = (e, t) => {
|
|
6675
6675
|
u.push([e, t]), d.push(u.length - 1), l[Math.floor(t / o) * s + Math.floor(e / o)] = u.length - 1;
|
|
6676
6676
|
};
|
|
6677
6677
|
for (f(a() * e, a() * t); d.length;) {
|
|
@@ -6696,7 +6696,7 @@ function ra(e, t, n, r, i = 20) {
|
|
|
6696
6696
|
}
|
|
6697
6697
|
return u;
|
|
6698
6698
|
}
|
|
6699
|
-
var
|
|
6699
|
+
var aa = {
|
|
6700
6700
|
id: "stipple",
|
|
6701
6701
|
label: "Stipple",
|
|
6702
6702
|
about: "Stipple — blue-noise dots, their density (and size) following a field",
|
|
@@ -6754,8 +6754,8 @@ var ia = {
|
|
|
6754
6754
|
}
|
|
6755
6755
|
],
|
|
6756
6756
|
draw(t, n, r, { field: i, mask: a, warp: o }) {
|
|
6757
|
-
let s = Math.max(2, n.spacing ?? 8), c = n.seed ?? 1, l =
|
|
6758
|
-
for (let [u, d] of
|
|
6757
|
+
let s = Math.max(2, n.spacing ?? 8), c = n.seed ?? 1, l = ra(c + 101);
|
|
6758
|
+
for (let [u, d] of ia(r.w, r.h, s, c)) {
|
|
6759
6759
|
let c = u / r.w, f = d / r.h, p = c, m = f;
|
|
6760
6760
|
if (o) {
|
|
6761
6761
|
let [e, t] = o(c, f);
|
|
@@ -6768,7 +6768,7 @@ var ia = {
|
|
|
6768
6768
|
e(t, r.x + c * r.w, r.y + f * r.h, g);
|
|
6769
6769
|
}
|
|
6770
6770
|
}
|
|
6771
|
-
},
|
|
6771
|
+
}, oa = {
|
|
6772
6772
|
id: "mosaic",
|
|
6773
6773
|
label: "Mosaic",
|
|
6774
6774
|
about: "Mosaic — hex or square tiles, each scaled by a field",
|
|
@@ -6850,7 +6850,7 @@ var ia = {
|
|
|
6850
6850
|
inset: 128,
|
|
6851
6851
|
color: "#FFFFFF",
|
|
6852
6852
|
bg: "#000000"
|
|
6853
|
-
}, H = [1056, 1056], U = [1456, 1056], W = [1056, 1456],
|
|
6853
|
+
}, H = [1056, 1056], U = [1456, 1056], W = [1056, 1456], sa = [
|
|
6854
6854
|
{
|
|
6855
6855
|
id: "eclipse",
|
|
6856
6856
|
style: "lineScreen",
|
|
@@ -8136,13 +8136,13 @@ var ia = {
|
|
|
8136
8136
|
seed: 30
|
|
8137
8137
|
}
|
|
8138
8138
|
}
|
|
8139
|
-
],
|
|
8140
|
-
|
|
8139
|
+
], ca = (e) => sa.find((t) => t.id === e).params;
|
|
8140
|
+
sa.push({
|
|
8141
8141
|
id: "eclipse-o",
|
|
8142
8142
|
style: "lineScreen",
|
|
8143
8143
|
label: "Eclipse on O",
|
|
8144
8144
|
params: {
|
|
8145
|
-
...
|
|
8145
|
+
...ca("eclipse"),
|
|
8146
8146
|
mKind: "letter",
|
|
8147
8147
|
mChar: "O",
|
|
8148
8148
|
mCut: "base",
|
|
@@ -8154,7 +8154,7 @@ oa.push({
|
|
|
8154
8154
|
style: "dotScreen",
|
|
8155
8155
|
label: "Warp on S",
|
|
8156
8156
|
params: {
|
|
8157
|
-
...
|
|
8157
|
+
...ca("warp"),
|
|
8158
8158
|
mKind: "letter",
|
|
8159
8159
|
mChar: "S",
|
|
8160
8160
|
mCut: "base",
|
|
@@ -8166,14 +8166,14 @@ oa.push({
|
|
|
8166
8166
|
style: "lineScreen",
|
|
8167
8167
|
label: "Confluence on A",
|
|
8168
8168
|
params: {
|
|
8169
|
-
...
|
|
8169
|
+
...ca("confluence"),
|
|
8170
8170
|
mKind: "letter",
|
|
8171
8171
|
mChar: "A",
|
|
8172
8172
|
mCut: "Wide",
|
|
8173
8173
|
mWeight: 900,
|
|
8174
8174
|
mFit: .95
|
|
8175
8175
|
}
|
|
8176
|
-
}),
|
|
8176
|
+
}), sa.push({
|
|
8177
8177
|
id: "stipple-glow",
|
|
8178
8178
|
style: "stipple",
|
|
8179
8179
|
label: "Glow",
|
|
@@ -8201,17 +8201,17 @@ oa.push({
|
|
|
8201
8201
|
});
|
|
8202
8202
|
//#endregion
|
|
8203
8203
|
//#region src/generate/index.js
|
|
8204
|
-
var
|
|
8205
|
-
_i,
|
|
8204
|
+
var la = [
|
|
8206
8205
|
vi,
|
|
8207
|
-
|
|
8208
|
-
|
|
8209
|
-
|
|
8210
|
-
|
|
8211
|
-
|
|
8212
|
-
|
|
8213
|
-
aa
|
|
8214
|
-
|
|
8206
|
+
yi,
|
|
8207
|
+
na,
|
|
8208
|
+
wi,
|
|
8209
|
+
Ai,
|
|
8210
|
+
Ii,
|
|
8211
|
+
Bi,
|
|
8212
|
+
aa,
|
|
8213
|
+
oa
|
|
8214
|
+
], ua = (e) => la.find((t) => t.id === e) ?? la[0], da = [
|
|
8215
8215
|
{
|
|
8216
8216
|
key: "jPos",
|
|
8217
8217
|
label: "Jitter position",
|
|
@@ -8255,14 +8255,14 @@ var ca = [
|
|
|
8255
8255
|
default: 1,
|
|
8256
8256
|
section: "Randomness"
|
|
8257
8257
|
}
|
|
8258
|
-
],
|
|
8258
|
+
], fa = (e, t) => {
|
|
8259
8259
|
let n = Math.imul(e + 1, 2654435761) ^ Math.imul(t + 11, 374761393);
|
|
8260
8260
|
return n = Math.imul(n ^ n >>> 15, 2246822519), n ^= n >>> 13, (n >>> 0) / 4294967296;
|
|
8261
8261
|
};
|
|
8262
|
-
function
|
|
8262
|
+
function pa(e, t) {
|
|
8263
8263
|
let n = t.jPos ?? 0, r = t.jSize ?? 0, i = t.jDrop ?? 0, a = t.jSeed ?? 1;
|
|
8264
8264
|
if (!n && !r && !i) return e;
|
|
8265
|
-
let o = 0, s = (e) => [(
|
|
8265
|
+
let o = 0, s = (e) => [(fa(e * 3, a) * 2 - 1) * n, (fa(e * 3 + 1, a) * 2 - 1) * n], c = (e) => 1 + (fa(e * 3 + 2, a) * 2 - 1) * r, l = (e) => fa(e * 7 + 5, a) >= i, u = (e, t) => {
|
|
8266
8266
|
let [n, r] = s(t), i = c(t), a = 0, o = 0;
|
|
8267
8267
|
for (let t of e) a += t[0], o += t[1];
|
|
8268
8268
|
return a /= e.length, o /= e.length, e.map(([e, t]) => [a + (e - a) * i + n, o + (t - o) * i + r]);
|
|
@@ -8284,7 +8284,7 @@ function fa(e, t) {
|
|
|
8284
8284
|
];
|
|
8285
8285
|
}), e;
|
|
8286
8286
|
}
|
|
8287
|
-
function
|
|
8287
|
+
function ma(e, t, n, r) {
|
|
8288
8288
|
if (!t.repOn) return e;
|
|
8289
8289
|
let i = d(t, {
|
|
8290
8290
|
x: 0,
|
|
@@ -8316,7 +8316,7 @@ function pa(e, t, n, r) {
|
|
|
8316
8316
|
}
|
|
8317
8317
|
return a;
|
|
8318
8318
|
}
|
|
8319
|
-
var
|
|
8319
|
+
var ha = [
|
|
8320
8320
|
{
|
|
8321
8321
|
key: "inset",
|
|
8322
8322
|
label: "Inset",
|
|
@@ -8342,21 +8342,21 @@ var ma = [
|
|
|
8342
8342
|
default: "#000000",
|
|
8343
8343
|
section: "Frame"
|
|
8344
8344
|
}
|
|
8345
|
-
],
|
|
8345
|
+
], ga = (e) => e.map((e) => ({
|
|
8346
8346
|
...e,
|
|
8347
8347
|
collapsed: !0
|
|
8348
8348
|
}));
|
|
8349
|
-
function
|
|
8350
|
-
let t =
|
|
8349
|
+
function _a(e) {
|
|
8350
|
+
let t = ua(e);
|
|
8351
8351
|
return [
|
|
8352
8352
|
...t.schema,
|
|
8353
8353
|
...t.sampled ? [
|
|
8354
|
-
...mi,
|
|
8355
8354
|
...hi,
|
|
8356
|
-
...
|
|
8355
|
+
...gi,
|
|
8356
|
+
...t.warp === !1 ? [] : ga(_i)
|
|
8357
8357
|
] : [],
|
|
8358
|
-
...
|
|
8359
|
-
...
|
|
8358
|
+
...ga(da),
|
|
8359
|
+
...ga([
|
|
8360
8360
|
{
|
|
8361
8361
|
key: "repOn",
|
|
8362
8362
|
label: "Repeat",
|
|
@@ -8391,21 +8391,21 @@ function ga(e) {
|
|
|
8391
8391
|
...e,
|
|
8392
8392
|
section: "Repeat"
|
|
8393
8393
|
}))),
|
|
8394
|
-
...ha
|
|
8394
|
+
...ga(ha)
|
|
8395
8395
|
];
|
|
8396
8396
|
}
|
|
8397
|
-
function
|
|
8398
|
-
let n = Object.fromEntries(
|
|
8397
|
+
function va(e, t) {
|
|
8398
|
+
let n = Object.fromEntries(_a(e).filter((e) => e.default !== void 0).map((e) => [e.key, e.default])), r = t ? sa.find((e) => e.id === t) : null;
|
|
8399
8399
|
return {
|
|
8400
8400
|
...n,
|
|
8401
8401
|
...r?.params ?? {},
|
|
8402
8402
|
genStyle: e,
|
|
8403
8403
|
genPreset: r?.id ?? null,
|
|
8404
|
-
genLabel: r?.label ??
|
|
8404
|
+
genLabel: r?.label ?? ua(e).label
|
|
8405
8405
|
};
|
|
8406
8406
|
}
|
|
8407
|
-
var
|
|
8408
|
-
function
|
|
8407
|
+
var ya = (e) => sa.filter((t) => t.style === e);
|
|
8408
|
+
function ba(e, t, n) {
|
|
8409
8409
|
let r = Math.max(0, Math.min(e.inset ?? 0, Math.min(t, n) / 2 - 1));
|
|
8410
8410
|
return {
|
|
8411
8411
|
x: r,
|
|
@@ -8414,17 +8414,17 @@ function ya(e, t, n) {
|
|
|
8414
8414
|
h: n - 2 * r
|
|
8415
8415
|
};
|
|
8416
8416
|
}
|
|
8417
|
-
function
|
|
8418
|
-
let a =
|
|
8417
|
+
function xa(e, t, n, { rings: r = null, image: i = null } = {}) {
|
|
8418
|
+
let a = ua(e.genStyle), o = ce(), s = ba(e, t, n);
|
|
8419
8419
|
if (s.w <= 1 || s.h <= 1) return o;
|
|
8420
8420
|
let c = s.w / s.h, l = { aspect: c };
|
|
8421
|
-
return a.sampled && (l.field =
|
|
8421
|
+
return a.sampled && (l.field = ai(e, c, i), l.mask = li(e, c, r), l.warp = a.warp === !1 ? null : ui(e, c, l.field)), a.draw(o, e, s, l), ma(pa(o, e), e, t, n);
|
|
8422
8422
|
}
|
|
8423
8423
|
//#endregion
|
|
8424
8424
|
//#region src/editor/generate/generateCore.js
|
|
8425
|
-
var
|
|
8426
|
-
function
|
|
8427
|
-
let t =
|
|
8425
|
+
var Sa = /* @__PURE__ */ new Map(), Ca = /* @__PURE__ */ new Map();
|
|
8426
|
+
function wa(e) {
|
|
8427
|
+
let t = _a(e.genStyle).map((e) => e.key);
|
|
8428
8428
|
return JSON.stringify([
|
|
8429
8429
|
e.genStyle,
|
|
8430
8430
|
Math.round(e.w ?? 0),
|
|
@@ -8432,51 +8432,51 @@ function Ca(e) {
|
|
|
8432
8432
|
t.map((t) => e[t])
|
|
8433
8433
|
]);
|
|
8434
8434
|
}
|
|
8435
|
-
function
|
|
8436
|
-
return
|
|
8435
|
+
function Ta(e, t = Sa.get(e.id) ?? null, n = Ca.get(e.id) ?? null) {
|
|
8436
|
+
return xa(e, e.w ?? 0, e.h ?? 0, {
|
|
8437
8437
|
rings: t,
|
|
8438
8438
|
image: n
|
|
8439
8439
|
});
|
|
8440
8440
|
}
|
|
8441
|
-
function
|
|
8441
|
+
function Ea(e, t, n = Ta(e)) {
|
|
8442
8442
|
let r = e.w ?? 0, i = e.h ?? 0, a = t.bg ? `<rect width="${r}" height="${i}" fill="${t.bg}"/>` : "", o = he(n);
|
|
8443
8443
|
return a + (o ? `<path d="${o}" fill="${t.ink ?? "#FFFFFF"}"/>` : "");
|
|
8444
8444
|
}
|
|
8445
8445
|
//#endregion
|
|
8446
8446
|
//#region src/editor/generate/rings.js
|
|
8447
|
-
function
|
|
8447
|
+
function Da(e) {
|
|
8448
8448
|
if (!e) return null;
|
|
8449
8449
|
let t = e.x ?? 0, n = e.y ?? 0, r = (e) => e.map((e) => e.map(([e, r]) => [e + t, r + n]));
|
|
8450
|
-
if (e.type === "shape") return r(
|
|
8451
|
-
if (e.type === "path") return r(
|
|
8450
|
+
if (e.type === "shape") return r(Ui(h(e) || "", 8));
|
|
8451
|
+
if (e.type === "path") return r(Ui([e.nodes ?? [], ...e.holes ?? []].map((e) => u(e, !0)).join(" "), 8));
|
|
8452
8452
|
if (e.type === "misc" && e.loopId === "paratype-glyph") {
|
|
8453
|
-
let r = { ...
|
|
8454
|
-
for (let t of Object.keys(
|
|
8453
|
+
let r = { ...qi };
|
|
8454
|
+
for (let t of Object.keys(qi)) e[t] != null && typeof e[t] != "object" && (r[t] = e[t]);
|
|
8455
8455
|
let i = [];
|
|
8456
|
-
for (let a of Xe(r, Math.max(1, e.w ?? 480), Math.max(1, e.h ?? 480))) for (let e of a.g.paths) for (let r of
|
|
8456
|
+
for (let a of Xe(r, Math.max(1, e.w ?? 480), Math.max(1, e.h ?? 480))) for (let e of a.g.paths) for (let r of Ui(e.d, 6)) i.push(r.map(([e, r]) => [t + a.tx + e * a.s, n + a.ty - r * a.s]));
|
|
8457
8457
|
return i;
|
|
8458
8458
|
}
|
|
8459
8459
|
return null;
|
|
8460
8460
|
}
|
|
8461
|
-
function
|
|
8461
|
+
function Oa(e, t) {
|
|
8462
8462
|
if (!e?.length) return null;
|
|
8463
|
-
let n =
|
|
8463
|
+
let n = ba(t, t.w ?? 0, t.h ?? 0), r = (t.x ?? 0) + n.x, i = (t.y ?? 0) + n.y;
|
|
8464
8464
|
return e.map((e) => e.map(([e, t]) => [(e - r) / n.w, (t - i) / n.h]));
|
|
8465
8465
|
}
|
|
8466
|
-
function
|
|
8466
|
+
function ka(e, t, n = .9) {
|
|
8467
8467
|
if (!e?.length) return null;
|
|
8468
|
-
let r =
|
|
8468
|
+
let r = ba(t, t.w ?? 0, t.h ?? 0), i = Wi(e), a = Math.min(r.w * n / (i.w || 1), r.h * n / (i.h || 1));
|
|
8469
8469
|
return e.map((e) => e.map(([e, t]) => [(r.w / 2 + (e - i.x - i.w / 2) * a) / r.w, (r.h / 2 + (t - i.y - i.h / 2) * a) / r.h]));
|
|
8470
8470
|
}
|
|
8471
|
-
async function
|
|
8472
|
-
return
|
|
8471
|
+
async function Aa(e, t = "base", n = 700) {
|
|
8472
|
+
return Ui((await me(t, n, !1)).getPath(e || "A", 0, 0, 1e3).toPathData(2), 8);
|
|
8473
8473
|
}
|
|
8474
|
-
function
|
|
8474
|
+
function ja(e) {
|
|
8475
8475
|
let { layers: t } = s(), n = e.mKind, [r, i] = M(null), a = e.mChar, o = e.mCut, c = e.mWeight;
|
|
8476
|
-
|
|
8476
|
+
sn(() => {
|
|
8477
8477
|
if (n !== "letter") return;
|
|
8478
8478
|
let e = !0;
|
|
8479
|
-
return
|
|
8479
|
+
return Aa(a, o, c).then((t) => {
|
|
8480
8480
|
e && i(t);
|
|
8481
8481
|
}).catch(() => {
|
|
8482
8482
|
e && i(null);
|
|
@@ -8496,7 +8496,7 @@ function Aa(e) {
|
|
|
8496
8496
|
e.h,
|
|
8497
8497
|
e.inset
|
|
8498
8498
|
], d = e.mFit ?? .9;
|
|
8499
|
-
return
|
|
8499
|
+
return ln(() => n === "letter" ? ka(r, e, d) : n === "layer" ? Oa(Da(l), e) : null, [
|
|
8500
8500
|
n,
|
|
8501
8501
|
r,
|
|
8502
8502
|
l,
|
|
@@ -8506,13 +8506,13 @@ function Aa(e) {
|
|
|
8506
8506
|
}
|
|
8507
8507
|
//#endregion
|
|
8508
8508
|
//#region src/editor/generate/useGenerateFont.js
|
|
8509
|
-
function
|
|
8509
|
+
function Ma(e) {
|
|
8510
8510
|
let t = e.genStyle === "ascii" ? e.font ?? "pixel" : null, [n, r] = M(0);
|
|
8511
|
-
return
|
|
8512
|
-
if (!t || t === "pixel" ||
|
|
8511
|
+
return sn(() => {
|
|
8512
|
+
if (!t || t === "pixel" || Zi(t)) return;
|
|
8513
8513
|
let [, e, n] = t.split("-"), i = !0;
|
|
8514
8514
|
return me(e, Number(n)).then((e) => {
|
|
8515
|
-
|
|
8515
|
+
Xi(t, e), i && r((e) => e + 1);
|
|
8516
8516
|
}).catch(() => {}), () => {
|
|
8517
8517
|
i = !1;
|
|
8518
8518
|
};
|
|
@@ -8520,9 +8520,9 @@ function ja(e) {
|
|
|
8520
8520
|
}
|
|
8521
8521
|
//#endregion
|
|
8522
8522
|
//#region src/editor/generate/useGenerateImage.js
|
|
8523
|
-
var
|
|
8524
|
-
function
|
|
8525
|
-
return
|
|
8523
|
+
var Na = /* @__PURE__ */ new Map();
|
|
8524
|
+
function Pa(e) {
|
|
8525
|
+
return Na.has(e) ? Promise.resolve(Na.get(e)) : new Promise((t, n) => {
|
|
8526
8526
|
let r = new Image();
|
|
8527
8527
|
r.crossOrigin = "anonymous", r.onload = () => {
|
|
8528
8528
|
let n = Math.min(1, 512 / Math.max(r.naturalWidth, r.naturalHeight)), i = Math.max(1, Math.round(r.naturalWidth * n)), a = Math.max(1, Math.round(r.naturalHeight * n)), o = document.createElement("canvas");
|
|
@@ -8538,12 +8538,12 @@ function Na(e) {
|
|
|
8538
8538
|
nw: r.naturalWidth,
|
|
8539
8539
|
nh: r.naturalHeight
|
|
8540
8540
|
};
|
|
8541
|
-
|
|
8541
|
+
Na.set(e, u), t(u);
|
|
8542
8542
|
}, r.onerror = n, r.src = e;
|
|
8543
8543
|
});
|
|
8544
8544
|
}
|
|
8545
|
-
function
|
|
8546
|
-
let r =
|
|
8545
|
+
function Fa(e, t, n) {
|
|
8546
|
+
let r = ba(e, e.w ?? 0, e.h ?? 0), i = (e.x ?? 0) + r.x, a = (e.y ?? 0) + r.y, o, s, c, l;
|
|
8547
8547
|
if (t.imgW != null) o = t.imgX ?? 0, s = t.imgY ?? 0, c = t.imgW, l = t.imgH;
|
|
8548
8548
|
else {
|
|
8549
8549
|
let e = Math.max(t.w / n.nw, t.h / n.nh);
|
|
@@ -8554,22 +8554,22 @@ function Pa(e, t, n) {
|
|
|
8554
8554
|
return d < 0 || d >= 1 || f < 0 || f >= 1 ? 0 : n.data[Math.floor(f * n.h) * n.w + Math.floor(d * n.w)];
|
|
8555
8555
|
};
|
|
8556
8556
|
}
|
|
8557
|
-
function
|
|
8557
|
+
function Ia(e) {
|
|
8558
8558
|
let { layers: t } = s(), n = (e.fKind === "image" || e.gKind === "image") && e.fImgLayer ? p(t, e.fImgLayer) : null, r = n?.type === "photo" ? n.src : null, [i, a] = M(null);
|
|
8559
|
-
return
|
|
8559
|
+
return sn(() => {
|
|
8560
8560
|
if (!r) {
|
|
8561
8561
|
a(null);
|
|
8562
8562
|
return;
|
|
8563
8563
|
}
|
|
8564
8564
|
let e = !0;
|
|
8565
|
-
return
|
|
8565
|
+
return Pa(r).then((t) => {
|
|
8566
8566
|
e && a(t);
|
|
8567
8567
|
}).catch(() => {
|
|
8568
8568
|
e && a(null);
|
|
8569
8569
|
}), () => {
|
|
8570
8570
|
e = !1;
|
|
8571
8571
|
};
|
|
8572
|
-
}, [r]),
|
|
8572
|
+
}, [r]), ln(() => n && i ? Fa(e, n, i) : null, [
|
|
8573
8573
|
n,
|
|
8574
8574
|
i,
|
|
8575
8575
|
e.x,
|
|
@@ -8581,9 +8581,9 @@ function Fa(e) {
|
|
|
8581
8581
|
}
|
|
8582
8582
|
//#endregion
|
|
8583
8583
|
//#region src/editor/generate/GenerateLayer.jsx
|
|
8584
|
-
function
|
|
8585
|
-
let r =
|
|
8586
|
-
|
|
8584
|
+
function La({ layer: e, palette: t, layerStyle: n }) {
|
|
8585
|
+
let r = ja(e), i = Ma(e), a = Ia(e), o = ln(() => (Sa.set(e.id, r), Ca.set(e.id, a), he(Ta(e, r, a))), [
|
|
8586
|
+
wa(e),
|
|
8587
8587
|
r,
|
|
8588
8588
|
i,
|
|
8589
8589
|
a
|
|
@@ -8613,7 +8613,7 @@ function Ia({ layer: e, palette: t, layerStyle: n }) {
|
|
|
8613
8613
|
}
|
|
8614
8614
|
//#endregion
|
|
8615
8615
|
//#region src/editor/generate/windows.js
|
|
8616
|
-
var
|
|
8616
|
+
var Ra = (...e) => e.map((e) => typeof e == "string" ? {
|
|
8617
8617
|
value: e.toLowerCase(),
|
|
8618
8618
|
label: e
|
|
8619
8619
|
} : e), G = (e) => (t, n = {}, r = {}) => ({
|
|
@@ -8627,30 +8627,30 @@ var La = (...e) => e.map((e) => typeof e == "string" ? {
|
|
|
8627
8627
|
max: n,
|
|
8628
8628
|
step: r.step ?? (n - t <= 4 ? .01 : 1),
|
|
8629
8629
|
def: r.def ?? t
|
|
8630
|
-
}, r),
|
|
8630
|
+
}, r), za = (e, t, n, r = {}) => G("range")(e, {
|
|
8631
8631
|
min: t,
|
|
8632
8632
|
max: n,
|
|
8633
8633
|
step: r.step ?? .01,
|
|
8634
8634
|
def: r.def ?? [t, n]
|
|
8635
|
-
}, r),
|
|
8636
|
-
options:
|
|
8637
|
-
def: n.def ??
|
|
8638
|
-
}, n),
|
|
8639
|
-
options:
|
|
8640
|
-
def: n.def ??
|
|
8641
|
-
}, n),
|
|
8635
|
+
}, r), Ba = (e, t, n = {}) => G("segmented")(e, {
|
|
8636
|
+
options: Ra(...t),
|
|
8637
|
+
def: n.def ?? Ra(...t)[0].value
|
|
8638
|
+
}, n), q = (e, t, n = {}) => G("select")(e, {
|
|
8639
|
+
options: Ra(...t),
|
|
8640
|
+
def: n.def ?? Ra(...t)[0].value
|
|
8641
|
+
}, n), Va = (e, t = {}) => G("toggle")(e, { def: t.def ?? !1 }, t), Ha = (e, t, n, r = {}) => G("point")(e, {
|
|
8642
8642
|
min: t,
|
|
8643
8643
|
max: n,
|
|
8644
8644
|
def: r.def ?? [.5, .5]
|
|
8645
|
-
}, r),
|
|
8645
|
+
}, r), Ua = (e, t = {}) => G("color")(e, { def: t.def ?? "#e8e4dc" }, t), Wa = (e, t = {}) => G("text")(e, { def: t.def ?? "" }, t), Ga = (e, t = {}) => G("button")(e, {}, t), Ka = (e, t = {}) => G("picker")(e, { def: null }, t), qa = (e, t = {}) => G("lights")(e, { def: t.def ?? [{
|
|
8646
8646
|
x: .35,
|
|
8647
8647
|
y: .4,
|
|
8648
8648
|
radius: .3,
|
|
8649
8649
|
intensity: 1
|
|
8650
|
-
}] }, t),
|
|
8650
|
+
}] }, t), Ja = Ra("Linear", "Ease", "In", "Out", "Hump", "Dip", "Wave", "Sine", "Bell", "Last"), Ya = Ra("Linear", "Ease", "In", "Out", "Hump", {
|
|
8651
8651
|
value: "alt",
|
|
8652
8652
|
label: "Alternate"
|
|
8653
|
-
}),
|
|
8653
|
+
}), J = (e, t, n, r = {}) => G("ramp")(e, {
|
|
8654
8654
|
min: t,
|
|
8655
8655
|
max: n,
|
|
8656
8656
|
def: r.def ?? {
|
|
@@ -8658,16 +8658,16 @@ var La = (...e) => e.map((e) => typeof e == "string" ? {
|
|
|
8658
8658
|
b: n,
|
|
8659
8659
|
curve: "linear"
|
|
8660
8660
|
}
|
|
8661
|
-
}, r),
|
|
8661
|
+
}, r), Y = (e) => `${Math.round(e * 100)}%`, Xa = (e) => (t) => Number(t).toFixed(e), Za = (e) => `${Math.round(e)}°`, X = (e) => `${Math.round(e)} px`, Z = (e, t = (e) => e, n = (e) => e) => ({
|
|
8662
8662
|
get: (t) => t[e] === void 0 ? void 0 : n(t[e], t),
|
|
8663
8663
|
set: (n, r) => ({ [e]: t(n, r) })
|
|
8664
|
-
}),
|
|
8664
|
+
}), Qa = (e, t) => ({
|
|
8665
8665
|
get: (n) => n[e] === void 0 ? void 0 : [n[e], n[t]],
|
|
8666
8666
|
set: (n) => ({
|
|
8667
8667
|
[e]: n[0],
|
|
8668
8668
|
[t]: n[1]
|
|
8669
8669
|
})
|
|
8670
|
-
}),
|
|
8670
|
+
}), Q = (e) => ({
|
|
8671
8671
|
get: (t) => t[`${e}A`] === void 0 ? void 0 : {
|
|
8672
8672
|
a: t[`${e}A`],
|
|
8673
8673
|
b: t[`${e}B`],
|
|
@@ -8678,7 +8678,7 @@ var La = (...e) => e.map((e) => typeof e == "string" ? {
|
|
|
8678
8678
|
[`${e}B`]: t.b,
|
|
8679
8679
|
[`${e}C`]: t.curve
|
|
8680
8680
|
})
|
|
8681
|
-
}),
|
|
8681
|
+
}), $ = (e, t) => Z(e, (e) => (t.find(([t]) => t === e) ?? [e, e])[1], (e) => (t.find(([, t]) => t === e) ?? [e])[0]), $a = [
|
|
8682
8682
|
["line screen", "lineScreen"],
|
|
8683
8683
|
["dot screen", "dotScreen"],
|
|
8684
8684
|
["ascii", "ascii"],
|
|
@@ -8687,7 +8687,7 @@ var La = (...e) => e.map((e) => typeof e == "string" ? {
|
|
|
8687
8687
|
["tiling", "tiling"],
|
|
8688
8688
|
["stipple", "stipple"],
|
|
8689
8689
|
["stipple", "mosaic"]
|
|
8690
|
-
],
|
|
8690
|
+
], eo = (e) => ($a.find(([t]) => t === e) ?? $a[3])[1], to = (e) => ($a.find(([, t]) => t === e) ?? $a[3])[0], no = (e, t = ya(e)[0]?.id ?? null) => va(e, t), ro = (e) => e.genStyle === "mosaic", io = 1080, ao = [
|
|
8691
8691
|
{
|
|
8692
8692
|
value: "line screen",
|
|
8693
8693
|
label: "Line Screen"
|
|
@@ -8716,74 +8716,74 @@ var La = (...e) => e.map((e) => typeof e == "string" ? {
|
|
|
8716
8716
|
value: "stipple",
|
|
8717
8717
|
label: "Stipple / Mosaic"
|
|
8718
8718
|
}
|
|
8719
|
-
],
|
|
8719
|
+
], oo = Ra("Linear", "Radial", "Conic", "Diamond", "Ellipse", "Blob", "Lights", "Sine", "Ridge", "Waves", "Noise", "Ribbon", "Image"), so = {
|
|
8720
8720
|
key: "field",
|
|
8721
8721
|
label: "Field",
|
|
8722
|
-
state: (e) =>
|
|
8722
|
+
state: (e) => oo.find((t) => t.value === e.fKind)?.label ?? "—",
|
|
8723
8723
|
groups: [
|
|
8724
8724
|
{
|
|
8725
8725
|
title: "Source",
|
|
8726
8726
|
note: "The gradient the style reads",
|
|
8727
8727
|
controls: [
|
|
8728
|
-
|
|
8728
|
+
q("Type", oo, {
|
|
8729
8729
|
def: "radial",
|
|
8730
|
-
bind:
|
|
8730
|
+
bind: Z("fKind")
|
|
8731
8731
|
}),
|
|
8732
|
-
|
|
8732
|
+
Ha("Centre", -.5, 1.5, { bind: Qa("fX", "fY") }),
|
|
8733
8733
|
K("Radius X", .02, 2, {
|
|
8734
8734
|
def: .6,
|
|
8735
|
-
bind:
|
|
8735
|
+
bind: Z("fRx")
|
|
8736
8736
|
}),
|
|
8737
8737
|
K("Radius Y", .02, 2, {
|
|
8738
8738
|
def: .6,
|
|
8739
|
-
bind:
|
|
8739
|
+
bind: Z("fRy")
|
|
8740
8740
|
}),
|
|
8741
8741
|
K("Angle", -180, 180, {
|
|
8742
8742
|
def: 0,
|
|
8743
|
-
format:
|
|
8743
|
+
format: Za,
|
|
8744
8744
|
id: "field-angle",
|
|
8745
|
-
bind:
|
|
8745
|
+
bind: Z("fAngle")
|
|
8746
8746
|
}),
|
|
8747
8747
|
K("Frequency X", .1, 24, {
|
|
8748
8748
|
def: 4,
|
|
8749
8749
|
step: .1,
|
|
8750
|
-
bind:
|
|
8750
|
+
bind: Z("fFreq")
|
|
8751
8751
|
}),
|
|
8752
8752
|
K("Frequency Y", .1, 24, {
|
|
8753
8753
|
def: 4,
|
|
8754
8754
|
step: .1,
|
|
8755
|
-
bind:
|
|
8755
|
+
bind: Z("fFreq2")
|
|
8756
8756
|
}),
|
|
8757
8757
|
K("Phase", -180, 180, {
|
|
8758
8758
|
def: 0,
|
|
8759
|
-
format:
|
|
8760
|
-
bind:
|
|
8759
|
+
format: Za,
|
|
8760
|
+
bind: Z("fPhase")
|
|
8761
8761
|
}),
|
|
8762
8762
|
K("Bend", -2, 2, {
|
|
8763
8763
|
def: 0,
|
|
8764
|
-
bind:
|
|
8764
|
+
bind: Z("fBend")
|
|
8765
8765
|
}),
|
|
8766
8766
|
K("Span", .2, 6, {
|
|
8767
8767
|
def: 1,
|
|
8768
8768
|
step: .1,
|
|
8769
|
-
bind:
|
|
8769
|
+
bind: Z("fSpan")
|
|
8770
8770
|
}),
|
|
8771
8771
|
K("Offset", -1, 1, {
|
|
8772
8772
|
def: 0,
|
|
8773
8773
|
id: "field-offset",
|
|
8774
|
-
bind:
|
|
8774
|
+
bind: Z("fOffset")
|
|
8775
8775
|
}),
|
|
8776
8776
|
K("Seed", 1, 99, {
|
|
8777
8777
|
def: 7,
|
|
8778
8778
|
id: "field-seed",
|
|
8779
|
-
bind:
|
|
8779
|
+
bind: Z("fSeed")
|
|
8780
8780
|
})
|
|
8781
8781
|
]
|
|
8782
8782
|
},
|
|
8783
8783
|
{
|
|
8784
8784
|
title: "Lights",
|
|
8785
8785
|
note: "Points of light",
|
|
8786
|
-
controls: [
|
|
8786
|
+
controls: [qa("Lights", { bind: {
|
|
8787
8787
|
get: (e) => e.fLightN === void 0 ? void 0 : Array.from({ length: Math.max(1, Math.min(8, e.fLightN)) }, (t, n) => ({
|
|
8788
8788
|
x: e[`fL${n + 1}x`] ?? .5,
|
|
8789
8789
|
y: e[`fL${n + 1}y`] ?? .5,
|
|
@@ -8801,12 +8801,12 @@ var La = (...e) => e.map((e) => typeof e == "string" ? {
|
|
|
8801
8801
|
{
|
|
8802
8802
|
title: "Image",
|
|
8803
8803
|
note: "A photo layer as the field",
|
|
8804
|
-
controls: [
|
|
8805
|
-
bind:
|
|
8804
|
+
controls: [Ka("Photo layer", {
|
|
8805
|
+
bind: Z("fImgLayer", (e) => e || null),
|
|
8806
8806
|
kinds: ["photo"]
|
|
8807
|
-
}),
|
|
8807
|
+
}), za("Levels", 0, 1, {
|
|
8808
8808
|
def: [0, 1],
|
|
8809
|
-
format:
|
|
8809
|
+
format: Xa(2),
|
|
8810
8810
|
bind: {
|
|
8811
8811
|
get: (e) => [e.fLo ?? 0, e.fHi ?? 1],
|
|
8812
8812
|
set: (e) => ({
|
|
@@ -8821,22 +8821,22 @@ var La = (...e) => e.map((e) => typeof e == "string" ? {
|
|
|
8821
8821
|
title: "Second source",
|
|
8822
8822
|
note: "Combined with the first",
|
|
8823
8823
|
controls: [
|
|
8824
|
-
|
|
8824
|
+
q("Type", ["None", ...oo], {
|
|
8825
8825
|
id: "second-type",
|
|
8826
8826
|
def: "none",
|
|
8827
|
-
bind:
|
|
8827
|
+
bind: Z("gKind")
|
|
8828
8828
|
}),
|
|
8829
|
-
|
|
8829
|
+
q("Combine", [
|
|
8830
8830
|
"Max",
|
|
8831
8831
|
"Min",
|
|
8832
8832
|
"Add",
|
|
8833
8833
|
"Multiply",
|
|
8834
8834
|
"Screen",
|
|
8835
8835
|
"Difference"
|
|
8836
|
-
], { bind:
|
|
8836
|
+
], { bind: $("fOp", [["difference", "diff"]]) }),
|
|
8837
8837
|
K("Weight", 0, 1, {
|
|
8838
8838
|
def: .5,
|
|
8839
|
-
format:
|
|
8839
|
+
format: Y,
|
|
8840
8840
|
bind: {
|
|
8841
8841
|
get: (e) => e.gWeight ?? 1,
|
|
8842
8842
|
set: (e) => ({ gWeight: e })
|
|
@@ -8845,7 +8845,7 @@ var La = (...e) => e.map((e) => typeof e == "string" ? {
|
|
|
8845
8845
|
]
|
|
8846
8846
|
}
|
|
8847
8847
|
]
|
|
8848
|
-
},
|
|
8848
|
+
}, co = {
|
|
8849
8849
|
key: "ramp",
|
|
8850
8850
|
label: "Ramp",
|
|
8851
8851
|
state: (e) => e.fSteps > 1 ? `${e.fSteps} steps` : "Continuous",
|
|
@@ -8853,35 +8853,35 @@ var La = (...e) => e.map((e) => typeof e == "string" ? {
|
|
|
8853
8853
|
title: "Ramp",
|
|
8854
8854
|
note: "Shapes the gradient",
|
|
8855
8855
|
controls: [
|
|
8856
|
-
|
|
8856
|
+
za("From / To", 0, 1, {
|
|
8857
8857
|
def: [0, 1],
|
|
8858
|
-
format:
|
|
8858
|
+
format: Xa(2),
|
|
8859
8859
|
id: "from-to",
|
|
8860
|
-
bind:
|
|
8860
|
+
bind: Qa("fFrom", "fTo")
|
|
8861
8861
|
}),
|
|
8862
8862
|
K("Contrast", .2, 4, {
|
|
8863
8863
|
def: 1,
|
|
8864
|
-
bind:
|
|
8864
|
+
bind: Z("fContrast")
|
|
8865
8865
|
}),
|
|
8866
8866
|
K("Gamma", .2, 4, {
|
|
8867
8867
|
def: 1,
|
|
8868
|
-
bind:
|
|
8868
|
+
bind: Z("fGamma")
|
|
8869
8869
|
}),
|
|
8870
8870
|
K("Steps", 1, 12, {
|
|
8871
8871
|
def: 1,
|
|
8872
8872
|
step: 1,
|
|
8873
8873
|
format: (e) => e > 1 ? String(e) : "Smooth",
|
|
8874
|
-
bind:
|
|
8874
|
+
bind: Z("fSteps", (e) => e > 1 ? e : 0, (e) => e > 1 ? e : 1)
|
|
8875
8875
|
}),
|
|
8876
|
-
|
|
8876
|
+
Va("Invert", { bind: Z("fInvert") }),
|
|
8877
8877
|
K("Split at", 0, 1, {
|
|
8878
8878
|
def: 0,
|
|
8879
|
-
format: (e) => e ?
|
|
8880
|
-
bind:
|
|
8879
|
+
format: (e) => e ? Y(e) : "Off",
|
|
8880
|
+
bind: Z("fSplit")
|
|
8881
8881
|
})
|
|
8882
8882
|
]
|
|
8883
8883
|
}]
|
|
8884
|
-
},
|
|
8884
|
+
}, lo = [
|
|
8885
8885
|
["compressed", "Tight"],
|
|
8886
8886
|
["condensed", "Compact"],
|
|
8887
8887
|
["narrow", "Narrow"],
|
|
@@ -8889,7 +8889,7 @@ var La = (...e) => e.map((e) => typeof e == "string" ? {
|
|
|
8889
8889
|
["wide", "Wide"],
|
|
8890
8890
|
["extended", "Spatial"],
|
|
8891
8891
|
["expanded", "Tall"]
|
|
8892
|
-
],
|
|
8892
|
+
], uo = [
|
|
8893
8893
|
["fine", 100],
|
|
8894
8894
|
["thin", 100],
|
|
8895
8895
|
["light", 300],
|
|
@@ -8897,31 +8897,31 @@ var La = (...e) => e.map((e) => typeof e == "string" ? {
|
|
|
8897
8897
|
["medium", 500],
|
|
8898
8898
|
["bold", 700],
|
|
8899
8899
|
["black", 900]
|
|
8900
|
-
],
|
|
8900
|
+
], fo = {
|
|
8901
8901
|
key: "mask",
|
|
8902
8902
|
label: "Mask",
|
|
8903
|
-
state: (e) =>
|
|
8903
|
+
state: (e) => mo.find((t) => t.value === (e.mKind === "layer" ? "linked" : e.mKind))?.label ?? "None",
|
|
8904
8904
|
groups: [
|
|
8905
8905
|
{
|
|
8906
8906
|
title: "Shape",
|
|
8907
8907
|
note: "Where the style draws",
|
|
8908
8908
|
controls: [
|
|
8909
|
-
|
|
8909
|
+
q("Shape", po(), {
|
|
8910
8910
|
def: "none",
|
|
8911
|
-
bind:
|
|
8911
|
+
bind: $("mKind", [["linked", "layer"]])
|
|
8912
8912
|
}),
|
|
8913
8913
|
K("Size", .2, 1.5, {
|
|
8914
8914
|
def: 1,
|
|
8915
|
-
bind:
|
|
8915
|
+
bind: Z("mSize")
|
|
8916
8916
|
}),
|
|
8917
|
-
|
|
8918
|
-
|
|
8917
|
+
Ha("Rect position", 0, 1, { bind: Qa("mX", "mY") }),
|
|
8918
|
+
Ha("Rect size", 0, 1, {
|
|
8919
8919
|
def: [1, 1],
|
|
8920
|
-
bind:
|
|
8920
|
+
bind: Qa("mW", "mH")
|
|
8921
8921
|
}),
|
|
8922
8922
|
K("Waist", 0, .5, {
|
|
8923
8923
|
def: .2,
|
|
8924
|
-
bind:
|
|
8924
|
+
bind: Z("mWaist")
|
|
8925
8925
|
})
|
|
8926
8926
|
]
|
|
8927
8927
|
},
|
|
@@ -8929,11 +8929,11 @@ var La = (...e) => e.map((e) => typeof e == "string" ? {
|
|
|
8929
8929
|
title: "Letter",
|
|
8930
8930
|
note: "One character as the mask",
|
|
8931
8931
|
controls: [
|
|
8932
|
-
|
|
8932
|
+
Wa("Letter", {
|
|
8933
8933
|
def: "A",
|
|
8934
|
-
bind:
|
|
8934
|
+
bind: Z("mChar", (e) => [...String(e ?? "")].slice(-1).join("") || "A")
|
|
8935
8935
|
}),
|
|
8936
|
-
|
|
8936
|
+
q("Cut", [
|
|
8937
8937
|
"Compressed",
|
|
8938
8938
|
"Condensed",
|
|
8939
8939
|
"Narrow",
|
|
@@ -8943,9 +8943,9 @@ var La = (...e) => e.map((e) => typeof e == "string" ? {
|
|
|
8943
8943
|
"Expanded"
|
|
8944
8944
|
], {
|
|
8945
8945
|
def: "normal",
|
|
8946
|
-
bind:
|
|
8946
|
+
bind: $("mCut", lo)
|
|
8947
8947
|
}),
|
|
8948
|
-
|
|
8948
|
+
q("Weight", [
|
|
8949
8949
|
"Fine",
|
|
8950
8950
|
"Thin",
|
|
8951
8951
|
"Light",
|
|
@@ -8957,34 +8957,34 @@ var La = (...e) => e.map((e) => typeof e == "string" ? {
|
|
|
8957
8957
|
def: "regular",
|
|
8958
8958
|
id: "letter-weight",
|
|
8959
8959
|
bind: {
|
|
8960
|
-
get: (e) => e.mWeight === void 0 ? void 0 : (
|
|
8961
|
-
set: (e) => ({ mWeight: (
|
|
8960
|
+
get: (e) => e.mWeight === void 0 ? void 0 : (uo.find(([, t]) => t === Number(e.mWeight)) ?? ["bold"])[0],
|
|
8961
|
+
set: (e) => ({ mWeight: (uo.find(([t]) => t === e) ?? [0, 700])[1] })
|
|
8962
8962
|
}
|
|
8963
8963
|
}),
|
|
8964
8964
|
K("Fit", .2, 1.2, {
|
|
8965
8965
|
def: .8,
|
|
8966
|
-
format:
|
|
8967
|
-
bind:
|
|
8966
|
+
format: Y,
|
|
8967
|
+
bind: Z("mFit")
|
|
8968
8968
|
})
|
|
8969
8969
|
]
|
|
8970
8970
|
},
|
|
8971
8971
|
{
|
|
8972
8972
|
title: "Linked layer",
|
|
8973
|
-
controls: [
|
|
8974
|
-
bind:
|
|
8973
|
+
controls: [Ka("Linked layer", {
|
|
8974
|
+
bind: Z("mLayer", (e) => e || null),
|
|
8975
8975
|
kinds: [
|
|
8976
8976
|
"shape",
|
|
8977
8977
|
"path",
|
|
8978
8978
|
"misc"
|
|
8979
8979
|
]
|
|
8980
|
-
}),
|
|
8980
|
+
}), Ga("Letter…", {
|
|
8981
8981
|
id: "open-type-window",
|
|
8982
8982
|
act: "open-type"
|
|
8983
8983
|
})]
|
|
8984
8984
|
}
|
|
8985
8985
|
]
|
|
8986
8986
|
};
|
|
8987
|
-
function
|
|
8987
|
+
function po() {
|
|
8988
8988
|
return [
|
|
8989
8989
|
"None",
|
|
8990
8990
|
"Rect",
|
|
@@ -9001,15 +9001,15 @@ function fo() {
|
|
|
9001
9001
|
}
|
|
9002
9002
|
];
|
|
9003
9003
|
}
|
|
9004
|
-
var
|
|
9004
|
+
var mo = Ra(...po()), ho = Ra("None", "Pinch", "Bulge", "Wave", "Swirl", "Noise", "Flow"), go = {
|
|
9005
9005
|
key: "warp",
|
|
9006
9006
|
label: "Warp",
|
|
9007
|
-
state: (e) => !e.wKind || e.wKind === "none" ? "Off" :
|
|
9007
|
+
state: (e) => !e.wKind || e.wKind === "none" ? "Off" : ho.find((t) => t.value === e.wKind)?.label ?? e.wKind,
|
|
9008
9008
|
groups: [{
|
|
9009
9009
|
title: "Warp",
|
|
9010
9010
|
note: "Bends the grid or the field",
|
|
9011
9011
|
controls: [
|
|
9012
|
-
|
|
9012
|
+
q("Kind", [
|
|
9013
9013
|
"None",
|
|
9014
9014
|
"Pinch",
|
|
9015
9015
|
"Bulge",
|
|
@@ -9019,22 +9019,22 @@ var po = La(...fo()), mo = La("None", "Pinch", "Bulge", "Wave", "Swirl", "Noise"
|
|
|
9019
9019
|
"Flow"
|
|
9020
9020
|
], {
|
|
9021
9021
|
def: "none",
|
|
9022
|
-
bind:
|
|
9022
|
+
bind: Z("wKind")
|
|
9023
9023
|
}),
|
|
9024
|
-
|
|
9025
|
-
|
|
9024
|
+
Ba("Bends", ["Grid", "Field"], { bind: Z("wTarget") }),
|
|
9025
|
+
Va("Pin edges", { bind: Z("wPin") }),
|
|
9026
9026
|
K("Amount", -1, 1, {
|
|
9027
9027
|
def: .2,
|
|
9028
9028
|
id: "warp-amount",
|
|
9029
|
-
bind:
|
|
9029
|
+
bind: Z("wAmt")
|
|
9030
9030
|
}),
|
|
9031
9031
|
K("Frequency", .2, 8, {
|
|
9032
9032
|
def: 1,
|
|
9033
9033
|
id: "warp-frequency",
|
|
9034
9034
|
step: .05,
|
|
9035
|
-
bind:
|
|
9035
|
+
bind: Z("wFreq")
|
|
9036
9036
|
}),
|
|
9037
|
-
|
|
9037
|
+
Ha("Centre", 0, 1, {
|
|
9038
9038
|
id: "warp-centre",
|
|
9039
9039
|
bind: {
|
|
9040
9040
|
get: (e) => [e.wX ?? .5, e.wY ?? .5],
|
|
@@ -9046,7 +9046,7 @@ var po = La(...fo()), mo = La("None", "Pinch", "Bulge", "Wave", "Swirl", "Noise"
|
|
|
9046
9046
|
})
|
|
9047
9047
|
]
|
|
9048
9048
|
}]
|
|
9049
|
-
},
|
|
9049
|
+
}, _o = {
|
|
9050
9050
|
key: "random",
|
|
9051
9051
|
label: "Randomness",
|
|
9052
9052
|
state: (e) => e.jPos || e.jSize || e.jDrop ? "On" : "Off",
|
|
@@ -9057,27 +9057,27 @@ var po = La(...fo()), mo = La("None", "Pinch", "Bulge", "Wave", "Swirl", "Noise"
|
|
|
9057
9057
|
K("Jitter position", 0, 40, {
|
|
9058
9058
|
def: 0,
|
|
9059
9059
|
step: .5,
|
|
9060
|
-
format:
|
|
9061
|
-
bind:
|
|
9060
|
+
format: X,
|
|
9061
|
+
bind: Z("jPos")
|
|
9062
9062
|
}),
|
|
9063
9063
|
K("Jitter size", 0, 1, {
|
|
9064
9064
|
def: 0,
|
|
9065
|
-
format:
|
|
9066
|
-
bind:
|
|
9065
|
+
format: Y,
|
|
9066
|
+
bind: Z("jSize")
|
|
9067
9067
|
}),
|
|
9068
9068
|
K("Drop-out", 0, 1, {
|
|
9069
9069
|
def: 0,
|
|
9070
|
-
format:
|
|
9071
|
-
bind:
|
|
9070
|
+
format: Y,
|
|
9071
|
+
bind: Z("jDrop")
|
|
9072
9072
|
}),
|
|
9073
9073
|
K("Seed", 1, 99, {
|
|
9074
9074
|
def: 1,
|
|
9075
9075
|
id: "random-seed",
|
|
9076
|
-
bind:
|
|
9076
|
+
bind: Z("jSeed")
|
|
9077
9077
|
})
|
|
9078
9078
|
]
|
|
9079
9079
|
}]
|
|
9080
|
-
},
|
|
9080
|
+
}, vo = {
|
|
9081
9081
|
key: "frame",
|
|
9082
9082
|
label: "Frame",
|
|
9083
9083
|
state: (e) => e.inset ? `${e.inset} px inset` : "Full bleed",
|
|
@@ -9087,68 +9087,68 @@ var po = La(...fo()), mo = La("None", "Pinch", "Bulge", "Wave", "Swirl", "Noise"
|
|
|
9087
9087
|
controls: [
|
|
9088
9088
|
K("Inset", 0, 400, {
|
|
9089
9089
|
def: 0,
|
|
9090
|
-
format:
|
|
9091
|
-
bind:
|
|
9090
|
+
format: X,
|
|
9091
|
+
bind: Z("inset")
|
|
9092
9092
|
}),
|
|
9093
|
-
|
|
9093
|
+
Ua("Ink", {
|
|
9094
9094
|
def: "#FFFFFF",
|
|
9095
|
-
bind:
|
|
9095
|
+
bind: Z("color")
|
|
9096
9096
|
}),
|
|
9097
|
-
|
|
9097
|
+
Ua("Ground", {
|
|
9098
9098
|
def: "#000000",
|
|
9099
|
-
bind:
|
|
9099
|
+
bind: Z("bg", (e) => e || null, (e) => e ?? "")
|
|
9100
9100
|
})
|
|
9101
9101
|
]
|
|
9102
9102
|
}]
|
|
9103
|
-
},
|
|
9103
|
+
}, yo = {
|
|
9104
9104
|
to: (e) => .2 * 20 ** (1 - e),
|
|
9105
9105
|
from: (e) => 1 - Math.log((e ?? 1) / .2) / Math.log(20)
|
|
9106
|
-
},
|
|
9106
|
+
}, bo = [
|
|
9107
9107
|
K("Density", 0, 1, {
|
|
9108
9108
|
def: .5,
|
|
9109
|
-
format:
|
|
9109
|
+
format: Y,
|
|
9110
9110
|
bind: {
|
|
9111
|
-
get: (e) =>
|
|
9112
|
-
set: (e, t) =>
|
|
9111
|
+
get: (e) => ro(e) ? ((e.cols ?? 40) - 3) / 157 : yo.from(e.gamma),
|
|
9112
|
+
set: (e, t) => ro(t) ? { cols: Math.round(3 + e * 157) } : { gamma: Math.max(.2, Math.min(4, yo.to(e))) }
|
|
9113
9113
|
}
|
|
9114
9114
|
}),
|
|
9115
9115
|
K("Min spacing", 2, 60, {
|
|
9116
9116
|
def: 8,
|
|
9117
9117
|
step: .5,
|
|
9118
|
-
format:
|
|
9118
|
+
format: X,
|
|
9119
9119
|
bind: {
|
|
9120
|
-
get: (e) =>
|
|
9121
|
-
set: (e, t) =>
|
|
9120
|
+
get: (e) => ro(e) ? Math.max(2, (e.gap ?? .08) * 100) : e.spacing,
|
|
9121
|
+
set: (e, t) => ro(t) ? { gap: Math.min(.6, e / 100) } : { spacing: e }
|
|
9122
9122
|
}
|
|
9123
9123
|
}),
|
|
9124
|
-
|
|
9124
|
+
za("Dot size range", .05, 1, {
|
|
9125
9125
|
def: [.35, .35],
|
|
9126
|
-
format:
|
|
9126
|
+
format: Xa(2),
|
|
9127
9127
|
bind: {
|
|
9128
|
-
get: (e) =>
|
|
9129
|
-
set: (e, t) =>
|
|
9128
|
+
get: (e) => ro(e) ? [e.min ?? .05, 1] : [e.sizeBy ? (e.dot ?? .35) * .3 : e.dot ?? .35, e.dot ?? .35],
|
|
9129
|
+
set: (e, t) => ro(t) ? { min: e[0] } : {
|
|
9130
9130
|
dot: e[1],
|
|
9131
9131
|
sizeBy: e[0] < e[1] - .01
|
|
9132
9132
|
}
|
|
9133
9133
|
}
|
|
9134
9134
|
}),
|
|
9135
|
-
|
|
9135
|
+
Ba("Mosaic cell shape", [
|
|
9136
9136
|
"None",
|
|
9137
9137
|
"Hex",
|
|
9138
9138
|
"Square"
|
|
9139
9139
|
], { bind: {
|
|
9140
|
-
get: (e) =>
|
|
9141
|
-
set: (e, t) => e === "none" ?
|
|
9142
|
-
...
|
|
9140
|
+
get: (e) => ro(e) ? e.tile ?? "hex" : "none",
|
|
9141
|
+
set: (e, t) => e === "none" ? ro(t) ? no("stipple") : {} : {
|
|
9142
|
+
...ro(t) ? {} : no("mosaic"),
|
|
9143
9143
|
tile: e
|
|
9144
9144
|
}
|
|
9145
9145
|
} }),
|
|
9146
9146
|
K("Seed", 1, 99, {
|
|
9147
9147
|
def: 5,
|
|
9148
9148
|
id: "stipple-seed",
|
|
9149
|
-
bind:
|
|
9149
|
+
bind: Z("seed")
|
|
9150
9150
|
})
|
|
9151
|
-
],
|
|
9151
|
+
], xo = {
|
|
9152
9152
|
"line screen": {
|
|
9153
9153
|
label: "Line Screen",
|
|
9154
9154
|
state: (e) => `${e.count} ${e.orient === "v" ? "columns" : "rows"}`,
|
|
@@ -9156,48 +9156,48 @@ var po = La(...fo()), mo = La("None", "Pinch", "Bulge", "Wave", "Swirl", "Noise"
|
|
|
9156
9156
|
title: "Lines",
|
|
9157
9157
|
note: "One line per row",
|
|
9158
9158
|
controls: [
|
|
9159
|
-
|
|
9159
|
+
Ba("Rows / Columns", ["Rows", "Columns"], {
|
|
9160
9160
|
id: "orientation",
|
|
9161
|
-
bind:
|
|
9161
|
+
bind: $("orient", [["rows", "h"], ["columns", "v"]])
|
|
9162
9162
|
}),
|
|
9163
9163
|
K("Count", 2, 200, {
|
|
9164
9164
|
def: 48,
|
|
9165
9165
|
id: "line-count",
|
|
9166
|
-
bind:
|
|
9166
|
+
bind: Z("count")
|
|
9167
9167
|
}),
|
|
9168
9168
|
K("Fill", .05, 1, {
|
|
9169
9169
|
def: .6,
|
|
9170
|
-
format:
|
|
9171
|
-
bind:
|
|
9170
|
+
format: Y,
|
|
9171
|
+
bind: Z("fill")
|
|
9172
9172
|
}),
|
|
9173
9173
|
K("Hairline", 0, 8, {
|
|
9174
9174
|
def: 0,
|
|
9175
9175
|
step: .1,
|
|
9176
|
-
format:
|
|
9177
|
-
bind:
|
|
9176
|
+
format: X,
|
|
9177
|
+
bind: Z("hair")
|
|
9178
9178
|
}),
|
|
9179
9179
|
K("Cut below", 0, 1, {
|
|
9180
9180
|
def: 0,
|
|
9181
|
-
bind:
|
|
9181
|
+
bind: Z("cut")
|
|
9182
9182
|
}),
|
|
9183
|
-
|
|
9183
|
+
Ba("Edge", ["Stepped", "Tapered"], { bind: $("edge", [["stepped", "step"], ["tapered", "taper"]]) }),
|
|
9184
9184
|
K("Sample", .5, 40, {
|
|
9185
9185
|
def: 4,
|
|
9186
9186
|
step: .5,
|
|
9187
|
-
format:
|
|
9188
|
-
bind:
|
|
9187
|
+
format: X,
|
|
9188
|
+
bind: Z("sample")
|
|
9189
9189
|
}),
|
|
9190
9190
|
K("Angle", -90, 90, {
|
|
9191
9191
|
def: 0,
|
|
9192
|
-
format:
|
|
9192
|
+
format: Za,
|
|
9193
9193
|
id: "line-angle"
|
|
9194
9194
|
}),
|
|
9195
9195
|
K("Smoothing", 0, 12, {
|
|
9196
9196
|
def: 0,
|
|
9197
|
-
bind:
|
|
9197
|
+
bind: Z("smooth")
|
|
9198
9198
|
}),
|
|
9199
|
-
|
|
9200
|
-
|
|
9199
|
+
Va("Round ends", { bind: Z("round") }),
|
|
9200
|
+
J("Flare", 0, 2, { def: {
|
|
9201
9201
|
a: 1,
|
|
9202
9202
|
b: 1,
|
|
9203
9203
|
curve: "linear"
|
|
@@ -9214,45 +9214,45 @@ var po = La(...fo()), mo = La("None", "Pinch", "Bulge", "Wave", "Swirl", "Noise"
|
|
|
9214
9214
|
controls: [
|
|
9215
9215
|
K("Columns", 4, 160, {
|
|
9216
9216
|
def: 40,
|
|
9217
|
-
bind:
|
|
9217
|
+
bind: Z("cols")
|
|
9218
9218
|
}),
|
|
9219
9219
|
K("Rows", 1, 200, {
|
|
9220
9220
|
def: 1,
|
|
9221
9221
|
format: (e) => e > 1 ? String(e) : "Square",
|
|
9222
9222
|
id: "dot-rows",
|
|
9223
|
-
bind:
|
|
9223
|
+
bind: Z("rows", (e) => e > 1 ? e : 0, (e) => e > 1 ? e : 1)
|
|
9224
9224
|
}),
|
|
9225
9225
|
K("Size", .05, 1.8, {
|
|
9226
9226
|
def: 1,
|
|
9227
|
-
format:
|
|
9227
|
+
format: Y,
|
|
9228
9228
|
id: "dot-size",
|
|
9229
|
-
bind:
|
|
9229
|
+
bind: Z("size")
|
|
9230
9230
|
}),
|
|
9231
9231
|
K("Smallest", 0, 1, {
|
|
9232
9232
|
def: 0,
|
|
9233
|
-
format:
|
|
9234
|
-
bind:
|
|
9233
|
+
format: Y,
|
|
9234
|
+
bind: Z("min")
|
|
9235
9235
|
}),
|
|
9236
9236
|
K("Floor", 0, .6, {
|
|
9237
9237
|
def: 0,
|
|
9238
|
-
format:
|
|
9239
|
-
bind:
|
|
9238
|
+
format: Y,
|
|
9239
|
+
bind: Z("floor")
|
|
9240
9240
|
}),
|
|
9241
|
-
|
|
9241
|
+
Ba("Shape", [
|
|
9242
9242
|
"Circle",
|
|
9243
9243
|
"Square",
|
|
9244
9244
|
"Diamond"
|
|
9245
9245
|
], {
|
|
9246
9246
|
id: "dot-shape",
|
|
9247
|
-
bind:
|
|
9247
|
+
bind: Z("shape")
|
|
9248
9248
|
}),
|
|
9249
9249
|
K("Stretch", .2, 5, {
|
|
9250
9250
|
def: 1,
|
|
9251
9251
|
step: .1,
|
|
9252
9252
|
format: (e) => `${e}×`,
|
|
9253
|
-
bind:
|
|
9253
|
+
bind: Z("stretch")
|
|
9254
9254
|
}),
|
|
9255
|
-
|
|
9255
|
+
Va("Stagger", { bind: Z("stagger") })
|
|
9256
9256
|
]
|
|
9257
9257
|
}]
|
|
9258
9258
|
},
|
|
@@ -9265,53 +9265,53 @@ var po = La(...fo()), mo = La("None", "Pinch", "Bulge", "Wave", "Swirl", "Noise"
|
|
|
9265
9265
|
controls: [
|
|
9266
9266
|
K("Cell size", 4, 64, {
|
|
9267
9267
|
def: 12,
|
|
9268
|
-
format:
|
|
9269
|
-
bind:
|
|
9268
|
+
format: X,
|
|
9269
|
+
bind: Z("cols", (e) => Math.max(4, Math.min(240, Math.round(io / e))), (e) => Math.round(io / Math.max(1, e)))
|
|
9270
9270
|
}),
|
|
9271
9271
|
K("Cell aspect", .3, 2, {
|
|
9272
9272
|
def: .6,
|
|
9273
|
-
bind:
|
|
9273
|
+
bind: Z("cell", (e) => Math.max(.5, Math.min(3, 1 / e)), (e) => 1 / e)
|
|
9274
9274
|
}),
|
|
9275
|
-
|
|
9275
|
+
q("Font", [
|
|
9276
9276
|
{
|
|
9277
9277
|
value: "grotesk",
|
|
9278
9278
|
label: "Right Grotesk cut"
|
|
9279
9279
|
},
|
|
9280
9280
|
"Mono",
|
|
9281
9281
|
"Pixel"
|
|
9282
|
-
], { bind:
|
|
9282
|
+
], { bind: $("font", [["grotesk", "rg-base-900"], ["pixel", "pixel"]]) }),
|
|
9283
9283
|
K("Glyph scale", .2, 2, {
|
|
9284
9284
|
def: 1,
|
|
9285
|
-
bind:
|
|
9285
|
+
bind: Z("scale")
|
|
9286
9286
|
})
|
|
9287
9287
|
]
|
|
9288
9288
|
}, {
|
|
9289
9289
|
title: "Ramp",
|
|
9290
9290
|
note: "Dark to light",
|
|
9291
9291
|
controls: [
|
|
9292
|
-
|
|
9292
|
+
Wa("Ramp", {
|
|
9293
9293
|
def: " .:-=+*#%@",
|
|
9294
9294
|
id: "ramp-text",
|
|
9295
9295
|
bind: {
|
|
9296
|
-
get: (e) => e.rampPreset ?
|
|
9296
|
+
get: (e) => e.rampPreset ? ea[e.rampPreset] : e.ramp,
|
|
9297
9297
|
set: (e) => ({
|
|
9298
9298
|
ramp: e,
|
|
9299
9299
|
rampPreset: ""
|
|
9300
9300
|
})
|
|
9301
9301
|
}
|
|
9302
9302
|
}),
|
|
9303
|
-
|
|
9303
|
+
q("Ramp presets", [
|
|
9304
9304
|
"Standard",
|
|
9305
9305
|
"Blocks",
|
|
9306
9306
|
"Dense",
|
|
9307
9307
|
"Minimal"
|
|
9308
|
-
], { bind:
|
|
9308
|
+
], { bind: $("rampPreset", [
|
|
9309
9309
|
["standard", "classic"],
|
|
9310
9310
|
["blocks", "blocks"],
|
|
9311
9311
|
["dense", "data"],
|
|
9312
9312
|
["minimal", "dots"]
|
|
9313
9313
|
]) }),
|
|
9314
|
-
|
|
9314
|
+
Va("Reverse ramp", { bind: Z("reverse") })
|
|
9315
9315
|
]
|
|
9316
9316
|
}]
|
|
9317
9317
|
},
|
|
@@ -9323,31 +9323,31 @@ var po = La(...fo()), mo = La("None", "Pinch", "Bulge", "Wave", "Swirl", "Noise"
|
|
|
9323
9323
|
title: "Layout",
|
|
9324
9324
|
note: "Placement and rhythm",
|
|
9325
9325
|
controls: [
|
|
9326
|
-
|
|
9326
|
+
Ba("Direction", ["Rows", "Columns"], { bind: $("orient", [["rows", "h"], ["columns", "v"]]) }),
|
|
9327
9327
|
K("Count", 1, 120, {
|
|
9328
9328
|
def: 48,
|
|
9329
|
-
bind:
|
|
9329
|
+
bind: Z("count")
|
|
9330
9330
|
}),
|
|
9331
9331
|
K("Angle", -90, 90, {
|
|
9332
9332
|
def: 0,
|
|
9333
|
-
format:
|
|
9334
|
-
bind:
|
|
9333
|
+
format: Za,
|
|
9334
|
+
bind: Z("angle")
|
|
9335
9335
|
}),
|
|
9336
|
-
|
|
9336
|
+
q("Spacing", [
|
|
9337
9337
|
"Even",
|
|
9338
9338
|
"Packed",
|
|
9339
9339
|
"Units"
|
|
9340
|
-
], { bind:
|
|
9340
|
+
], { bind: Z("spread") }),
|
|
9341
9341
|
K("Period", 0, 40, {
|
|
9342
9342
|
def: 12,
|
|
9343
9343
|
format: (e) => e ? String(Math.round(e)) : "All",
|
|
9344
|
-
bind:
|
|
9344
|
+
bind: Z("period")
|
|
9345
9345
|
}),
|
|
9346
9346
|
K("Lead", .2, 60, {
|
|
9347
9347
|
def: .5,
|
|
9348
9348
|
step: .01,
|
|
9349
|
-
format:
|
|
9350
|
-
bind:
|
|
9349
|
+
format: Xa(2),
|
|
9350
|
+
bind: Z("lead")
|
|
9351
9351
|
})
|
|
9352
9352
|
]
|
|
9353
9353
|
},
|
|
@@ -9356,45 +9356,45 @@ var po = La(...fo()), mo = La("None", "Pinch", "Bulge", "Wave", "Swirl", "Noise"
|
|
|
9356
9356
|
title: "Shape ramps",
|
|
9357
9357
|
note: "Interpolate from A to B",
|
|
9358
9358
|
controls: [
|
|
9359
|
-
|
|
9359
|
+
J("Width", 0, 1, {
|
|
9360
9360
|
def: {
|
|
9361
9361
|
a: .5,
|
|
9362
9362
|
b: .5,
|
|
9363
9363
|
curve: "linear"
|
|
9364
9364
|
},
|
|
9365
|
-
bind:
|
|
9365
|
+
bind: Q("w")
|
|
9366
9366
|
}),
|
|
9367
|
-
|
|
9367
|
+
J("Gap", 0, 400, {
|
|
9368
9368
|
def: {
|
|
9369
9369
|
a: .5,
|
|
9370
9370
|
b: .5,
|
|
9371
9371
|
curve: "linear"
|
|
9372
9372
|
},
|
|
9373
|
-
bind:
|
|
9373
|
+
bind: Q("g")
|
|
9374
9374
|
}),
|
|
9375
|
-
|
|
9375
|
+
J("Start", -.5, 1, {
|
|
9376
9376
|
def: {
|
|
9377
9377
|
a: 0,
|
|
9378
9378
|
b: 0,
|
|
9379
9379
|
curve: "linear"
|
|
9380
9380
|
},
|
|
9381
|
-
bind:
|
|
9381
|
+
bind: Q("s")
|
|
9382
9382
|
}),
|
|
9383
|
-
|
|
9383
|
+
J("End", 0, 1.5, {
|
|
9384
9384
|
def: {
|
|
9385
9385
|
a: 1,
|
|
9386
9386
|
b: 1,
|
|
9387
9387
|
curve: "linear"
|
|
9388
9388
|
},
|
|
9389
|
-
bind:
|
|
9389
|
+
bind: Q("e")
|
|
9390
9390
|
}),
|
|
9391
|
-
|
|
9391
|
+
J("Shear", -3, 3, {
|
|
9392
9392
|
def: {
|
|
9393
9393
|
a: 0,
|
|
9394
9394
|
b: 0,
|
|
9395
9395
|
curve: "linear"
|
|
9396
9396
|
},
|
|
9397
|
-
bind:
|
|
9397
|
+
bind: Q("k")
|
|
9398
9398
|
})
|
|
9399
9399
|
]
|
|
9400
9400
|
},
|
|
@@ -9403,56 +9403,56 @@ var po = La(...fo()), mo = La("None", "Pinch", "Bulge", "Wave", "Swirl", "Noise"
|
|
|
9403
9403
|
title: "More geometry",
|
|
9404
9404
|
note: "Waves, dash & offsets",
|
|
9405
9405
|
controls: [
|
|
9406
|
-
|
|
9406
|
+
J("Wave height", 0, .3, {
|
|
9407
9407
|
def: {
|
|
9408
9408
|
a: 0,
|
|
9409
9409
|
b: 0,
|
|
9410
9410
|
curve: "linear"
|
|
9411
9411
|
},
|
|
9412
|
-
bind:
|
|
9412
|
+
bind: Q("a")
|
|
9413
9413
|
}),
|
|
9414
|
-
|
|
9414
|
+
J("Wave phase", -1, 1, {
|
|
9415
9415
|
def: {
|
|
9416
9416
|
a: 0,
|
|
9417
9417
|
b: 0,
|
|
9418
9418
|
curve: "linear"
|
|
9419
9419
|
},
|
|
9420
|
-
bind:
|
|
9420
|
+
bind: Q("ph")
|
|
9421
9421
|
}),
|
|
9422
|
-
|
|
9422
|
+
J("Bend", -.6, .6, {
|
|
9423
9423
|
def: {
|
|
9424
9424
|
a: 0,
|
|
9425
9425
|
b: 0,
|
|
9426
9426
|
curve: "linear"
|
|
9427
9427
|
},
|
|
9428
9428
|
id: "stripe-bend",
|
|
9429
|
-
bind:
|
|
9429
|
+
bind: Q("b")
|
|
9430
9430
|
}),
|
|
9431
9431
|
K("Waves", 0, 12, {
|
|
9432
9432
|
def: 3,
|
|
9433
9433
|
step: .1,
|
|
9434
|
-
bind:
|
|
9434
|
+
bind: Z("freq")
|
|
9435
9435
|
}),
|
|
9436
9436
|
K("Dash", 0, 1, {
|
|
9437
9437
|
def: 0,
|
|
9438
|
-
format: (e) => e ?
|
|
9439
|
-
bind:
|
|
9438
|
+
format: (e) => e ? Y(e) : "Off",
|
|
9439
|
+
bind: Z("dash")
|
|
9440
9440
|
}),
|
|
9441
9441
|
K("Dash gap", 0, 1, {
|
|
9442
9442
|
def: .05,
|
|
9443
|
-
format:
|
|
9444
|
-
bind:
|
|
9443
|
+
format: Y,
|
|
9444
|
+
bind: Z("gap")
|
|
9445
9445
|
}),
|
|
9446
9446
|
K("Link hairline", 0, 8, {
|
|
9447
9447
|
def: 0,
|
|
9448
9448
|
step: .1,
|
|
9449
|
-
format:
|
|
9450
|
-
bind:
|
|
9449
|
+
format: X,
|
|
9450
|
+
bind: Z("link")
|
|
9451
9451
|
}),
|
|
9452
9452
|
K("Offset", -1, 1, {
|
|
9453
9453
|
def: 0,
|
|
9454
9454
|
id: "stripe-offset",
|
|
9455
|
-
bind:
|
|
9455
|
+
bind: Z("offset")
|
|
9456
9456
|
})
|
|
9457
9457
|
]
|
|
9458
9458
|
}
|
|
@@ -9466,33 +9466,33 @@ var po = La(...fo()), mo = La("None", "Pinch", "Bulge", "Wave", "Swirl", "Noise"
|
|
|
9466
9466
|
title: "Layout",
|
|
9467
9467
|
note: "Rays or rings round a centre",
|
|
9468
9468
|
controls: [
|
|
9469
|
-
|
|
9469
|
+
Ba("Draw", ["Rays", "Rings"], { bind: Z("mode") }),
|
|
9470
9470
|
K("Count", 1, 240, {
|
|
9471
9471
|
def: 36,
|
|
9472
9472
|
id: "radial-count",
|
|
9473
|
-
bind:
|
|
9473
|
+
bind: Z("count")
|
|
9474
9474
|
}),
|
|
9475
|
-
|
|
9475
|
+
Ha("Centre", -2, 3, {
|
|
9476
9476
|
id: "radial-centre",
|
|
9477
|
-
bind:
|
|
9477
|
+
bind: Qa("cx", "cy")
|
|
9478
9478
|
}),
|
|
9479
9479
|
K("Start", -180, 180, {
|
|
9480
9480
|
def: -90,
|
|
9481
|
-
format:
|
|
9481
|
+
format: Za,
|
|
9482
9482
|
id: "radial-start",
|
|
9483
|
-
bind:
|
|
9483
|
+
bind: Z("start")
|
|
9484
9484
|
}),
|
|
9485
9485
|
K("Span", 1, 360, {
|
|
9486
9486
|
def: 360,
|
|
9487
|
-
format:
|
|
9487
|
+
format: Za,
|
|
9488
9488
|
id: "radial-span",
|
|
9489
|
-
bind:
|
|
9489
|
+
bind: Z("span")
|
|
9490
9490
|
}),
|
|
9491
|
-
|
|
9491
|
+
Ba("Ray shape", [
|
|
9492
9492
|
"Bar",
|
|
9493
9493
|
"Wedge",
|
|
9494
9494
|
"Spike"
|
|
9495
|
-
], { bind:
|
|
9495
|
+
], { bind: Z("shape") })
|
|
9496
9496
|
]
|
|
9497
9497
|
},
|
|
9498
9498
|
{
|
|
@@ -9500,42 +9500,42 @@ var po = La(...fo()), mo = La("None", "Pinch", "Bulge", "Wave", "Swirl", "Noise"
|
|
|
9500
9500
|
title: "Shape ramps",
|
|
9501
9501
|
note: "Interpolate from A to B",
|
|
9502
9502
|
controls: [
|
|
9503
|
-
|
|
9503
|
+
J("Inner radius", 0, 4, {
|
|
9504
9504
|
def: {
|
|
9505
9505
|
a: .2,
|
|
9506
9506
|
b: .2,
|
|
9507
9507
|
curve: "linear"
|
|
9508
9508
|
},
|
|
9509
|
-
bind:
|
|
9510
|
-
curves:
|
|
9509
|
+
bind: Q("r0"),
|
|
9510
|
+
curves: Ya
|
|
9511
9511
|
}),
|
|
9512
|
-
|
|
9512
|
+
J("Outer radius", 0, 12, {
|
|
9513
9513
|
def: {
|
|
9514
9514
|
a: 1,
|
|
9515
9515
|
b: 1,
|
|
9516
9516
|
curve: "linear"
|
|
9517
9517
|
},
|
|
9518
|
-
bind:
|
|
9519
|
-
curves:
|
|
9518
|
+
bind: Q("r1"),
|
|
9519
|
+
curves: Ya
|
|
9520
9520
|
}),
|
|
9521
|
-
|
|
9521
|
+
J("Width", 0, 1, {
|
|
9522
9522
|
def: {
|
|
9523
9523
|
a: .5,
|
|
9524
9524
|
b: .5,
|
|
9525
9525
|
curve: "linear"
|
|
9526
9526
|
},
|
|
9527
9527
|
id: "radial-width",
|
|
9528
|
-
bind:
|
|
9529
|
-
curves:
|
|
9528
|
+
bind: Q("w"),
|
|
9529
|
+
curves: Ya
|
|
9530
9530
|
}),
|
|
9531
|
-
|
|
9531
|
+
J("Turn", -180, 180, {
|
|
9532
9532
|
def: {
|
|
9533
9533
|
a: 0,
|
|
9534
9534
|
b: 0,
|
|
9535
9535
|
curve: "linear"
|
|
9536
9536
|
},
|
|
9537
|
-
bind:
|
|
9538
|
-
curves:
|
|
9537
|
+
bind: Q("rot"),
|
|
9538
|
+
curves: Ya
|
|
9539
9539
|
})
|
|
9540
9540
|
]
|
|
9541
9541
|
},
|
|
@@ -9546,24 +9546,24 @@ var po = La(...fo()), mo = La("None", "Pinch", "Bulge", "Wave", "Swirl", "Noise"
|
|
|
9546
9546
|
controls: [
|
|
9547
9547
|
K("Segments", 1, 24, {
|
|
9548
9548
|
def: 1,
|
|
9549
|
-
bind:
|
|
9549
|
+
bind: Z("segments")
|
|
9550
9550
|
}),
|
|
9551
9551
|
K("Segment gap", 0, .9, {
|
|
9552
9552
|
def: .1,
|
|
9553
|
-
format:
|
|
9554
|
-
bind:
|
|
9553
|
+
format: Y,
|
|
9554
|
+
bind: Z("segGap")
|
|
9555
9555
|
}),
|
|
9556
9556
|
K("Taper", -1, 1, {
|
|
9557
9557
|
def: 0,
|
|
9558
|
-
bind:
|
|
9558
|
+
bind: Z("taper")
|
|
9559
9559
|
}),
|
|
9560
9560
|
K("Zigzag", 0, 1, {
|
|
9561
9561
|
def: 0,
|
|
9562
|
-
bind:
|
|
9562
|
+
bind: Z("zig")
|
|
9563
9563
|
}),
|
|
9564
9564
|
K("Zigzag points", 2, 32, {
|
|
9565
9565
|
def: 8,
|
|
9566
|
-
bind:
|
|
9566
|
+
bind: Z("zigN")
|
|
9567
9567
|
})
|
|
9568
9568
|
]
|
|
9569
9569
|
}
|
|
@@ -9576,35 +9576,35 @@ var po = La(...fo()), mo = La("None", "Pinch", "Bulge", "Wave", "Swirl", "Noise"
|
|
|
9576
9576
|
title: "Layout",
|
|
9577
9577
|
note: "Cells and their fills",
|
|
9578
9578
|
controls: [
|
|
9579
|
-
|
|
9579
|
+
q("Layout", [
|
|
9580
9580
|
"Bricks",
|
|
9581
9581
|
"Checker",
|
|
9582
9582
|
"Columns",
|
|
9583
9583
|
"Maze"
|
|
9584
|
-
], { bind:
|
|
9584
|
+
], { bind: Z("layout") }),
|
|
9585
9585
|
K("Columns", 1, 40, {
|
|
9586
9586
|
def: 4,
|
|
9587
9587
|
id: "tile-columns",
|
|
9588
|
-
bind:
|
|
9588
|
+
bind: Z("cols")
|
|
9589
9589
|
}),
|
|
9590
9590
|
K("Rows", 1, 60, {
|
|
9591
9591
|
def: 6,
|
|
9592
9592
|
id: "tile-rows",
|
|
9593
|
-
bind:
|
|
9593
|
+
bind: Z("rows")
|
|
9594
9594
|
}),
|
|
9595
9595
|
K("Gap", 0, .4, {
|
|
9596
9596
|
def: .04,
|
|
9597
|
-
format:
|
|
9597
|
+
format: Y,
|
|
9598
9598
|
id: "tile-gap",
|
|
9599
|
-
bind:
|
|
9599
|
+
bind: Z("gap")
|
|
9600
9600
|
}),
|
|
9601
9601
|
K("Vary length", 0, .9, {
|
|
9602
9602
|
def: .4,
|
|
9603
|
-
format:
|
|
9604
|
-
bind:
|
|
9603
|
+
format: Y,
|
|
9604
|
+
bind: Z("vary")
|
|
9605
9605
|
}),
|
|
9606
|
-
|
|
9607
|
-
|
|
9606
|
+
Va("Shift odd columns", { bind: Z("shift", (e) => e ? .5 : 0, (e) => e > 0) }),
|
|
9607
|
+
q("Fill A", [
|
|
9608
9608
|
"Solid",
|
|
9609
9609
|
"Dots",
|
|
9610
9610
|
"Lines",
|
|
@@ -9613,8 +9613,8 @@ var po = La(...fo()), mo = La("None", "Pinch", "Bulge", "Wave", "Swirl", "Noise"
|
|
|
9613
9613
|
label: "Rows of lines"
|
|
9614
9614
|
},
|
|
9615
9615
|
"None"
|
|
9616
|
-
], { bind:
|
|
9617
|
-
|
|
9616
|
+
], { bind: $("fillA", [["rows", "hlines"]]) }),
|
|
9617
|
+
q("Fill B", [
|
|
9618
9618
|
"Solid",
|
|
9619
9619
|
"Dots",
|
|
9620
9620
|
"Lines",
|
|
@@ -9625,116 +9625,116 @@ var po = La(...fo()), mo = La("None", "Pinch", "Bulge", "Wave", "Swirl", "Noise"
|
|
|
9625
9625
|
"None"
|
|
9626
9626
|
], {
|
|
9627
9627
|
def: "dots",
|
|
9628
|
-
bind:
|
|
9628
|
+
bind: $("fillB", [["rows", "hlines"]])
|
|
9629
9629
|
}),
|
|
9630
|
-
|
|
9630
|
+
q("Alternate", [
|
|
9631
9631
|
"Checker",
|
|
9632
9632
|
"Row",
|
|
9633
9633
|
"Column",
|
|
9634
9634
|
"Random"
|
|
9635
|
-
], { bind:
|
|
9635
|
+
], { bind: $("alt", [["column", "col"]]) }),
|
|
9636
9636
|
K("Texture pitch", 2, 40, {
|
|
9637
9637
|
def: 8,
|
|
9638
|
-
format:
|
|
9639
|
-
bind:
|
|
9638
|
+
format: X,
|
|
9639
|
+
bind: Z("tex")
|
|
9640
9640
|
}),
|
|
9641
9641
|
K("Texture size", .05, 1, {
|
|
9642
9642
|
def: .45,
|
|
9643
|
-
format:
|
|
9644
|
-
bind:
|
|
9643
|
+
format: Y,
|
|
9644
|
+
bind: Z("texSize")
|
|
9645
9645
|
}),
|
|
9646
9646
|
K("Frame", 0, .1, {
|
|
9647
9647
|
def: 0,
|
|
9648
9648
|
step: .005,
|
|
9649
|
-
format:
|
|
9649
|
+
format: Y,
|
|
9650
9650
|
id: "tile-frame",
|
|
9651
|
-
bind:
|
|
9651
|
+
bind: Z("frame")
|
|
9652
9652
|
}),
|
|
9653
9653
|
K("Seed", 1, 99, {
|
|
9654
9654
|
def: 1,
|
|
9655
9655
|
id: "tile-seed",
|
|
9656
|
-
bind:
|
|
9656
|
+
bind: Z("seed")
|
|
9657
9657
|
})
|
|
9658
9658
|
]
|
|
9659
9659
|
}]
|
|
9660
9660
|
},
|
|
9661
9661
|
stipple: {
|
|
9662
9662
|
label: "Stipple / Mosaic",
|
|
9663
|
-
state: (e) =>
|
|
9663
|
+
state: (e) => ro(e) ? `${e.cols} columns` : `${e.spacing} px spacing`,
|
|
9664
9664
|
groups: [{
|
|
9665
9665
|
title: "Stipple",
|
|
9666
9666
|
note: "Dots by the field",
|
|
9667
|
-
controls:
|
|
9667
|
+
controls: bo
|
|
9668
9668
|
}]
|
|
9669
9669
|
}
|
|
9670
|
-
},
|
|
9670
|
+
}, So = { stripeArray: "Rows of bands whose width, gap and ends ramp from A to B." }, Co = {
|
|
9671
9671
|
id: "generate",
|
|
9672
9672
|
kind: "Generate",
|
|
9673
|
-
title: (e) =>
|
|
9674
|
-
init: () =>
|
|
9673
|
+
title: (e) => ao.find((t) => t.value === to(e.genStyle))?.label,
|
|
9674
|
+
init: () => no("stripeArray"),
|
|
9675
9675
|
header: [
|
|
9676
|
-
|
|
9676
|
+
q("Style", ao, {
|
|
9677
9677
|
def: "stripe array",
|
|
9678
9678
|
bind: {
|
|
9679
|
-
get: (e) =>
|
|
9680
|
-
set: (e) =>
|
|
9679
|
+
get: (e) => to(e.genStyle),
|
|
9680
|
+
set: (e) => no(eo(e))
|
|
9681
9681
|
}
|
|
9682
9682
|
}),
|
|
9683
|
-
|
|
9684
|
-
|
|
9685
|
-
def:
|
|
9683
|
+
q("Preset", ["Custom"], { def: "custom" }),
|
|
9684
|
+
Wa("Description", {
|
|
9685
|
+
def: So.stripeArray,
|
|
9686
9686
|
bind: {
|
|
9687
|
-
get: (e) =>
|
|
9687
|
+
get: (e) => So[e.genStyle] ?? ua(e.genStyle).about,
|
|
9688
9688
|
set: () => ({})
|
|
9689
9689
|
}
|
|
9690
9690
|
}),
|
|
9691
|
-
|
|
9691
|
+
Ga("Expand", { act: "expand" })
|
|
9692
9692
|
],
|
|
9693
9693
|
sections: (e) => [
|
|
9694
|
-
oo,
|
|
9695
9694
|
so,
|
|
9695
|
+
co,
|
|
9696
9696
|
{
|
|
9697
9697
|
key: "style",
|
|
9698
|
-
...
|
|
9698
|
+
...xo[to(e.genStyle)]
|
|
9699
9699
|
},
|
|
9700
|
-
|
|
9701
|
-
ho,
|
|
9700
|
+
fo,
|
|
9702
9701
|
go,
|
|
9703
|
-
_o
|
|
9702
|
+
_o,
|
|
9703
|
+
vo
|
|
9704
9704
|
],
|
|
9705
9705
|
allSections: () => [
|
|
9706
|
-
oo,
|
|
9707
9706
|
so,
|
|
9708
|
-
|
|
9707
|
+
co,
|
|
9708
|
+
...Object.entries(xo).map(([e, t]) => ({
|
|
9709
9709
|
key: `style:${e}`,
|
|
9710
9710
|
...t
|
|
9711
9711
|
})),
|
|
9712
|
-
|
|
9713
|
-
ho,
|
|
9712
|
+
fo,
|
|
9714
9713
|
go,
|
|
9715
|
-
_o
|
|
9714
|
+
_o,
|
|
9715
|
+
vo
|
|
9716
9716
|
],
|
|
9717
9717
|
fieldMap: (e) => {
|
|
9718
9718
|
let t = e.fX ?? .5, n = e.fY ?? .5, r = e.fKind, i = "var(--kol-oq-16), var(--kol-fg-96), var(--kol-oq-16)";
|
|
9719
9719
|
return {
|
|
9720
9720
|
background: r === "linear" ? `linear-gradient(${90 + (e.fAngle ?? 0)}deg, var(--kol-oq-16), var(--kol-fg-96))` : r === "conic" ? `conic-gradient(from ${e.fAngle ?? 0}deg, ${i})` : r === "sine" || r === "waves" || r === "ridge" ? `repeating-linear-gradient(90deg, ${i} ${Math.max(4, 100 / (e.fFreq || 1))}%)` : `linear-gradient(90deg, var(--kol-oq-16) 0%, var(--kol-fg-96) ${t * 100}%, var(--kol-oq-16) 100%)`,
|
|
9721
|
-
left:
|
|
9721
|
+
left: oo.find((e) => e.value === r)?.label,
|
|
9722
9722
|
right: `Centre ${Number(t).toFixed(2)} / ${Number(n).toFixed(2)}`
|
|
9723
9723
|
};
|
|
9724
9724
|
}
|
|
9725
|
-
},
|
|
9725
|
+
}, wo = {
|
|
9726
9726
|
radial: "Radial",
|
|
9727
9727
|
grid: "Grid",
|
|
9728
9728
|
mirror: "Mirror"
|
|
9729
|
-
},
|
|
9730
|
-
|
|
9729
|
+
}, To = () => [
|
|
9730
|
+
Ba("Mode", [
|
|
9731
9731
|
"Radial",
|
|
9732
9732
|
"Grid",
|
|
9733
9733
|
"Mirror"
|
|
9734
|
-
], { bind:
|
|
9735
|
-
|
|
9736
|
-
|
|
9737
|
-
],
|
|
9734
|
+
], { bind: Z("repMode") }),
|
|
9735
|
+
Ka("Source", { bind: Z("sourceId", (e) => e || null) }),
|
|
9736
|
+
Va("Reverse overlap", { bind: Z("repReverse") })
|
|
9737
|
+
], Eo = {
|
|
9738
9738
|
id: "repeat",
|
|
9739
9739
|
kind: "Repeat",
|
|
9740
9740
|
title: () => "Repeat",
|
|
@@ -9742,29 +9742,29 @@ var po = La(...fo()), mo = La("None", "Pinch", "Bulge", "Wave", "Swirl", "Noise"
|
|
|
9742
9742
|
...y,
|
|
9743
9743
|
sourceId: null
|
|
9744
9744
|
}),
|
|
9745
|
-
header: [
|
|
9745
|
+
header: [Ga("Expand", { act: "expand" })],
|
|
9746
9746
|
sections: (e) => [{
|
|
9747
9747
|
key: "common",
|
|
9748
9748
|
label: "Common",
|
|
9749
|
-
state: () =>
|
|
9749
|
+
state: () => wo[e.repMode ?? "radial"],
|
|
9750
9750
|
groups: [{
|
|
9751
9751
|
title: "Repeat",
|
|
9752
9752
|
note: "Copies of a linked layer",
|
|
9753
|
-
controls:
|
|
9753
|
+
controls: To()
|
|
9754
9754
|
}]
|
|
9755
9755
|
}, {
|
|
9756
9756
|
key: "mode",
|
|
9757
|
-
...
|
|
9757
|
+
...Do[e.repMode ?? "radial"]
|
|
9758
9758
|
}],
|
|
9759
9759
|
allSections: () => [{
|
|
9760
9760
|
key: "common",
|
|
9761
9761
|
label: "Common",
|
|
9762
|
-
groups: [{ controls:
|
|
9763
|
-
}, ...Object.entries(
|
|
9762
|
+
groups: [{ controls: To() }]
|
|
9763
|
+
}, ...Object.entries(Do).map(([e, t]) => ({
|
|
9764
9764
|
key: `mode:${e}`,
|
|
9765
9765
|
...t
|
|
9766
9766
|
}))]
|
|
9767
|
-
},
|
|
9767
|
+
}, Do = {
|
|
9768
9768
|
radial: {
|
|
9769
9769
|
label: "Radial",
|
|
9770
9770
|
state: (e) => `${e.repCount} copies`,
|
|
@@ -9775,37 +9775,37 @@ var po = La(...fo()), mo = La("None", "Pinch", "Bulge", "Wave", "Swirl", "Noise"
|
|
|
9775
9775
|
K("Count", 2, 64, {
|
|
9776
9776
|
def: 8,
|
|
9777
9777
|
id: "repeat-count",
|
|
9778
|
-
bind:
|
|
9778
|
+
bind: Z("repCount")
|
|
9779
9779
|
}),
|
|
9780
9780
|
K("Radius", 0, 2e3, {
|
|
9781
9781
|
def: 200,
|
|
9782
|
-
format:
|
|
9782
|
+
format: X,
|
|
9783
9783
|
id: "repeat-radius",
|
|
9784
|
-
bind:
|
|
9784
|
+
bind: Z("repRadius")
|
|
9785
9785
|
}),
|
|
9786
9786
|
K("Start angle", -180, 180, {
|
|
9787
9787
|
def: 90,
|
|
9788
|
-
format:
|
|
9789
|
-
bind:
|
|
9788
|
+
format: Za,
|
|
9789
|
+
bind: Z("repPivotAngle")
|
|
9790
9790
|
}),
|
|
9791
9791
|
K("Span", 1, 360, {
|
|
9792
9792
|
def: 360,
|
|
9793
|
-
format:
|
|
9793
|
+
format: Za,
|
|
9794
9794
|
id: "repeat-span",
|
|
9795
|
-
bind:
|
|
9795
|
+
bind: Z("repSpan")
|
|
9796
9796
|
}),
|
|
9797
9797
|
K("Rotate per step", -180, 180, {
|
|
9798
9798
|
def: 0,
|
|
9799
|
-
format:
|
|
9800
|
-
bind:
|
|
9799
|
+
format: Za,
|
|
9800
|
+
bind: Z("repRotate")
|
|
9801
9801
|
}),
|
|
9802
9802
|
K("Scale per step", .5, 1.5, {
|
|
9803
9803
|
def: 1,
|
|
9804
9804
|
step: .005,
|
|
9805
|
-
format:
|
|
9806
|
-
bind:
|
|
9805
|
+
format: Y,
|
|
9806
|
+
bind: Z("repScale")
|
|
9807
9807
|
}),
|
|
9808
|
-
|
|
9808
|
+
Va("Align to path")
|
|
9809
9809
|
]
|
|
9810
9810
|
}]
|
|
9811
9811
|
},
|
|
@@ -9819,45 +9819,45 @@ var po = La(...fo()), mo = La("None", "Pinch", "Bulge", "Wave", "Swirl", "Noise"
|
|
|
9819
9819
|
K("Columns", 1, 40, {
|
|
9820
9820
|
def: 3,
|
|
9821
9821
|
id: "grid-columns",
|
|
9822
|
-
bind:
|
|
9822
|
+
bind: Z("repCols")
|
|
9823
9823
|
}),
|
|
9824
9824
|
K("Rows", 1, 40, {
|
|
9825
9825
|
def: 3,
|
|
9826
9826
|
id: "grid-rows",
|
|
9827
|
-
bind:
|
|
9827
|
+
bind: Z("repRows")
|
|
9828
9828
|
}),
|
|
9829
9829
|
K("Gap X", -1e3, 1e3, {
|
|
9830
9830
|
def: 20,
|
|
9831
|
-
format:
|
|
9832
|
-
bind:
|
|
9831
|
+
format: X,
|
|
9832
|
+
bind: Z("repGapX")
|
|
9833
9833
|
}),
|
|
9834
9834
|
K("Gap Y", -1e3, 1e3, {
|
|
9835
9835
|
def: 20,
|
|
9836
|
-
format:
|
|
9837
|
-
bind:
|
|
9836
|
+
format: X,
|
|
9837
|
+
bind: Z("repGapY")
|
|
9838
9838
|
}),
|
|
9839
9839
|
K("Row offset", -1e3, 1e3, {
|
|
9840
9840
|
def: 0,
|
|
9841
|
-
format:
|
|
9842
|
-
bind:
|
|
9841
|
+
format: X,
|
|
9842
|
+
bind: Z("repRowShift")
|
|
9843
9843
|
}),
|
|
9844
9844
|
K("Column offset", -1e3, 1e3, {
|
|
9845
9845
|
def: 0,
|
|
9846
|
-
format:
|
|
9847
|
-
bind:
|
|
9846
|
+
format: X,
|
|
9847
|
+
bind: Z("repColShift")
|
|
9848
9848
|
}),
|
|
9849
9849
|
K("Rotate per step", -180, 180, {
|
|
9850
9850
|
def: 0,
|
|
9851
|
-
format:
|
|
9851
|
+
format: Za,
|
|
9852
9852
|
id: "grid-rotate",
|
|
9853
|
-
bind:
|
|
9853
|
+
bind: Z("repRotate")
|
|
9854
9854
|
}),
|
|
9855
9855
|
K("Scale per step", .5, 1.5, {
|
|
9856
9856
|
def: 1,
|
|
9857
9857
|
step: .005,
|
|
9858
|
-
format:
|
|
9858
|
+
format: Y,
|
|
9859
9859
|
id: "grid-scale",
|
|
9860
|
-
bind:
|
|
9860
|
+
bind: Z("repScale")
|
|
9861
9861
|
})
|
|
9862
9862
|
]
|
|
9863
9863
|
}]
|
|
@@ -9871,18 +9871,18 @@ var po = La(...fo()), mo = La("None", "Pinch", "Bulge", "Wave", "Swirl", "Noise"
|
|
|
9871
9871
|
controls: [
|
|
9872
9872
|
K("Axis angle", -180, 180, {
|
|
9873
9873
|
def: 90,
|
|
9874
|
-
format:
|
|
9875
|
-
bind:
|
|
9874
|
+
format: Za,
|
|
9875
|
+
bind: Z("repAxisAngle")
|
|
9876
9876
|
}),
|
|
9877
|
-
|
|
9877
|
+
Ha("Axis offset", -2e3, 2e3, {
|
|
9878
9878
|
def: [0, 0],
|
|
9879
|
-
bind:
|
|
9879
|
+
bind: Qa("repAxisX", "repAxisY")
|
|
9880
9880
|
}),
|
|
9881
|
-
|
|
9881
|
+
Va("Point mirror", { bind: Z("repPoint") })
|
|
9882
9882
|
]
|
|
9883
9883
|
}]
|
|
9884
9884
|
}
|
|
9885
|
-
},
|
|
9885
|
+
}, Oo = [
|
|
9886
9886
|
"o",
|
|
9887
9887
|
"c",
|
|
9888
9888
|
"e",
|
|
@@ -9896,15 +9896,15 @@ var po = La(...fo()), mo = La("None", "Pinch", "Bulge", "Wave", "Swirl", "Noise"
|
|
|
9896
9896
|
"p",
|
|
9897
9897
|
"q",
|
|
9898
9898
|
"t"
|
|
9899
|
-
],
|
|
9899
|
+
], ko = {
|
|
9900
9900
|
id: "type",
|
|
9901
9901
|
kind: "Type",
|
|
9902
9902
|
title: () => "Paratype letter",
|
|
9903
9903
|
loop: "paratype-glyph",
|
|
9904
|
-
header: [
|
|
9905
|
-
sections: () =>
|
|
9906
|
-
allSections: () =>
|
|
9907
|
-
},
|
|
9904
|
+
header: [Ga("Expand", { act: "expand" })],
|
|
9905
|
+
sections: () => Ao,
|
|
9906
|
+
allSections: () => Ao
|
|
9907
|
+
}, Ao = [
|
|
9908
9908
|
{
|
|
9909
9909
|
key: "glyph",
|
|
9910
9910
|
label: "Glyph",
|
|
@@ -9913,15 +9913,15 @@ var po = La(...fo()), mo = La("None", "Pinch", "Bulge", "Wave", "Swirl", "Noise"
|
|
|
9913
9913
|
title: "Glyph",
|
|
9914
9914
|
note: "The letter and its engine",
|
|
9915
9915
|
controls: [
|
|
9916
|
-
|
|
9916
|
+
q("Glyph", Oo.map((e) => ({
|
|
9917
9917
|
value: e,
|
|
9918
9918
|
label: e
|
|
9919
9919
|
})), {
|
|
9920
9920
|
def: "o",
|
|
9921
|
-
bind:
|
|
9921
|
+
bind: Z("glyph")
|
|
9922
9922
|
}),
|
|
9923
|
-
|
|
9924
|
-
|
|
9923
|
+
Ba("Engine", ["Classic", "Skeleton"], { bind: Z("engine") }),
|
|
9924
|
+
Ba("Layout", ["Single", "Specimen"], { bind: Z("layout") })
|
|
9925
9925
|
]
|
|
9926
9926
|
}]
|
|
9927
9927
|
},
|
|
@@ -9935,19 +9935,19 @@ var po = La(...fo()), mo = La("None", "Pinch", "Bulge", "Wave", "Swirl", "Noise"
|
|
|
9935
9935
|
controls: [
|
|
9936
9936
|
K("X-height", 40, 220, {
|
|
9937
9937
|
def: 100,
|
|
9938
|
-
bind:
|
|
9938
|
+
bind: Z("xHeight")
|
|
9939
9939
|
}),
|
|
9940
9940
|
K("Ascender", 60, 260, {
|
|
9941
9941
|
def: 150,
|
|
9942
|
-
bind:
|
|
9942
|
+
bind: Z("ascender")
|
|
9943
9943
|
}),
|
|
9944
9944
|
K("Descender", 5, 100, {
|
|
9945
9945
|
def: 40,
|
|
9946
|
-
bind:
|
|
9946
|
+
bind: Z("descender")
|
|
9947
9947
|
}),
|
|
9948
9948
|
K("Overshoot", 0, 20, {
|
|
9949
9949
|
def: 4,
|
|
9950
|
-
bind:
|
|
9950
|
+
bind: Z("overshoot")
|
|
9951
9951
|
})
|
|
9952
9952
|
]
|
|
9953
9953
|
}]
|
|
@@ -9962,20 +9962,20 @@ var po = La(...fo()), mo = La("None", "Pinch", "Bulge", "Wave", "Swirl", "Noise"
|
|
|
9962
9962
|
controls: [
|
|
9963
9963
|
K("Stem width", 2, 60, {
|
|
9964
9964
|
def: 18,
|
|
9965
|
-
bind:
|
|
9965
|
+
bind: Z("stemWidth")
|
|
9966
9966
|
}),
|
|
9967
9967
|
K("Round width", 30, 220, {
|
|
9968
9968
|
def: 95,
|
|
9969
|
-
bind:
|
|
9969
|
+
bind: Z("oWidth")
|
|
9970
9970
|
}),
|
|
9971
9971
|
K("Bowl width", 30, 220, {
|
|
9972
9972
|
def: 88,
|
|
9973
|
-
bind:
|
|
9973
|
+
bind: Z("bowlWidth")
|
|
9974
9974
|
}),
|
|
9975
9975
|
K("Hairline", .5, 30, {
|
|
9976
9976
|
def: 6,
|
|
9977
9977
|
step: .5,
|
|
9978
|
-
bind:
|
|
9978
|
+
bind: Z("hairWidth"),
|
|
9979
9979
|
id: "type-hairline"
|
|
9980
9980
|
})
|
|
9981
9981
|
]
|
|
@@ -9991,64 +9991,64 @@ var po = La(...fo()), mo = La("None", "Pinch", "Bulge", "Wave", "Swirl", "Noise"
|
|
|
9991
9991
|
controls: [
|
|
9992
9992
|
K("Aperture", .1, 1, {
|
|
9993
9993
|
def: .7,
|
|
9994
|
-
bind:
|
|
9994
|
+
bind: Z("aperture")
|
|
9995
9995
|
}),
|
|
9996
9996
|
K("Arch height", .5, 1.05, {
|
|
9997
9997
|
def: .92,
|
|
9998
|
-
bind:
|
|
9998
|
+
bind: Z("archHeight")
|
|
9999
9999
|
}),
|
|
10000
10000
|
K("Shoulder", 0, .4, {
|
|
10001
10001
|
def: .12,
|
|
10002
|
-
bind:
|
|
10002
|
+
bind: Z("shoulder")
|
|
10003
10003
|
}),
|
|
10004
10004
|
K("Superness", .1, 1.5, {
|
|
10005
10005
|
def: .5,
|
|
10006
|
-
bind:
|
|
10006
|
+
bind: Z("superness")
|
|
10007
10007
|
}),
|
|
10008
10008
|
K("Serif", 0, 1, {
|
|
10009
10009
|
def: 0,
|
|
10010
|
-
bind:
|
|
10010
|
+
bind: Z("serif")
|
|
10011
10011
|
}),
|
|
10012
10012
|
K("Jut length", 0, 1, {
|
|
10013
10013
|
def: 0,
|
|
10014
|
-
bind:
|
|
10014
|
+
bind: Z("jut")
|
|
10015
10015
|
}),
|
|
10016
10016
|
K("Segments", 6, 200, {
|
|
10017
10017
|
def: 48,
|
|
10018
|
-
bind:
|
|
10018
|
+
bind: Z("segments")
|
|
10019
10019
|
})
|
|
10020
10020
|
]
|
|
10021
10021
|
}]
|
|
10022
10022
|
}
|
|
10023
|
-
],
|
|
10024
|
-
generate:
|
|
10025
|
-
repeat:
|
|
10026
|
-
type:
|
|
10027
|
-
},
|
|
10023
|
+
], jo = {
|
|
10024
|
+
generate: Co,
|
|
10025
|
+
repeat: Eo,
|
|
10026
|
+
type: ko
|
|
10027
|
+
}, Mo = (e, t) => {
|
|
10028
10028
|
let n = e.bind?.get(t);
|
|
10029
10029
|
return n === void 0 ? e.def : n;
|
|
10030
|
-
},
|
|
10030
|
+
}, No = (e, t, n, r) => ({
|
|
10031
10031
|
...t.bind.set(n, r),
|
|
10032
10032
|
...e.id === "generate" && t.id !== "style" ? { genPreset: null } : {}
|
|
10033
|
-
}),
|
|
10033
|
+
}), Po = (e) => !!(e.bind || e.act), Fo = (e) => e.flatMap((e) => [e, ...e.children ? Fo(e.children) : []]), Io = {
|
|
10034
10034
|
photo: (e) => e.type === "photo",
|
|
10035
10035
|
shape: (e) => e.type === "shape",
|
|
10036
10036
|
path: (e) => e.type === "path",
|
|
10037
10037
|
misc: (e) => e.type === "misc" && e.loopId === "paratype-glyph"
|
|
10038
10038
|
};
|
|
10039
|
-
function
|
|
10040
|
-
let t =
|
|
10039
|
+
function Lo(e) {
|
|
10040
|
+
let t = jo[e], n = D("generators"), r = s(), i = () => n ? n.presetParams({
|
|
10041
10041
|
id: "type",
|
|
10042
10042
|
loop: t.loop,
|
|
10043
10043
|
params: {}
|
|
10044
10044
|
}) : {}, { params: a, layerId: o, live: c } = ft(e, t.init ?? i), l = (t) => vt(e, (e) => ({ params: t(e.params) })), u = (e) => (n) => l((r) => ({
|
|
10045
10045
|
...r,
|
|
10046
|
-
...
|
|
10047
|
-
})), d = t.sections(a), f =
|
|
10046
|
+
...No(t, e, n, r)
|
|
10047
|
+
})), d = t.sections(a), f = Fo(r.layers ?? []), m = (e) => e.name || e.genLabel || e.presetLabel || e.kind || e.type, h = (e) => f.filter((t) => t.type !== "background" && t.id !== o && (e.kinds ? e.kinds.some((e) => Io[e]?.(t)) : t.type !== "repeat" && t.w != null)).map((e) => ({
|
|
10048
10048
|
value: e.id,
|
|
10049
10049
|
label: m(e)
|
|
10050
10050
|
}));
|
|
10051
|
-
|
|
10051
|
+
sn(() => {
|
|
10052
10052
|
if (e !== "repeat" || a.sourceId) return;
|
|
10053
10053
|
let t = r.selectedId && r.selectedId !== "canvas" ? p(r.layers, r.selectedId) : null;
|
|
10054
10054
|
t && t.type !== "repeat" && t.w != null && l((e) => ({
|
|
@@ -10063,11 +10063,11 @@ function Io(e) {
|
|
|
10063
10063
|
let g = e === "generate" ? [...a.genPreset ? [] : [{
|
|
10064
10064
|
value: "custom",
|
|
10065
10065
|
label: "Custom"
|
|
10066
|
-
}], ...
|
|
10066
|
+
}], ...ya(a.genStyle).map((e) => ({
|
|
10067
10067
|
value: e.id,
|
|
10068
10068
|
label: e.label
|
|
10069
10069
|
}))] : null, _ = (e) => {
|
|
10070
|
-
e !== "custom" && l(() =>
|
|
10070
|
+
e !== "custom" && l(() => no(a.genStyle, e));
|
|
10071
10071
|
}, v = o ? p(r.layers ?? [], o) : null, y = e === "repeat" ? !!a.sourceId : e === "type" ? !!n : !0, b = () => {
|
|
10072
10072
|
if (!y) return null;
|
|
10073
10073
|
if (e === "type") {
|
|
@@ -10119,12 +10119,12 @@ function Io(e) {
|
|
|
10119
10119
|
setLive: (t) => vt(e, { live: t }),
|
|
10120
10120
|
canApply: y,
|
|
10121
10121
|
target: v,
|
|
10122
|
-
valueOf: (e) =>
|
|
10123
|
-
isLive:
|
|
10122
|
+
valueOf: (e) => Mo(e, a),
|
|
10123
|
+
isLive: Po
|
|
10124
10124
|
};
|
|
10125
10125
|
}
|
|
10126
|
-
function
|
|
10127
|
-
let { params: r, state: i, live: a } = e, o = t, s = Math.round(t / (i.canvasRatio || 1)), c =
|
|
10126
|
+
function Ro({ t: e, className: n = "" }) {
|
|
10127
|
+
let { params: r, state: i, live: a } = e, o = t, s = Math.round(t / (i.canvasRatio || 1)), c = ln(() => ({
|
|
10128
10128
|
...r,
|
|
10129
10129
|
id: "__generator-preview",
|
|
10130
10130
|
x: 0,
|
|
@@ -10135,10 +10135,10 @@ function Lo({ t: e, className: n = "" }) {
|
|
|
10135
10135
|
r,
|
|
10136
10136
|
o,
|
|
10137
10137
|
s
|
|
10138
|
-
]), l =
|
|
10138
|
+
]), l = ja(c), u = Ma(c), d = Ia(c), f = un(""), p = ln(() => {
|
|
10139
10139
|
if (!a) return f.current;
|
|
10140
10140
|
try {
|
|
10141
|
-
f.current = he(
|
|
10141
|
+
f.current = he(xa(c, o, s, {
|
|
10142
10142
|
rings: l,
|
|
10143
10143
|
image: d
|
|
10144
10144
|
}));
|
|
@@ -10168,7 +10168,7 @@ function Lo({ t: e, className: n = "" }) {
|
|
|
10168
10168
|
})]
|
|
10169
10169
|
});
|
|
10170
10170
|
}
|
|
10171
|
-
function
|
|
10171
|
+
function zo({ t: e, className: t = "" }) {
|
|
10172
10172
|
let { params: n, state: r } = e, i = n.sourceId ? p(r.layers ?? [], n.sourceId) : null, a = i && i.w != null ? {
|
|
10173
10173
|
x: i.x ?? 0,
|
|
10174
10174
|
y: i.y ?? 0,
|
|
@@ -10213,9 +10213,9 @@ function Ro({ t: e, className: t = "" }) {
|
|
|
10213
10213
|
})]
|
|
10214
10214
|
});
|
|
10215
10215
|
}
|
|
10216
|
-
function
|
|
10217
|
-
let r =
|
|
10218
|
-
return
|
|
10216
|
+
function Bo({ t: e, size: t = 512, className: n = "" }) {
|
|
10217
|
+
let r = un(null), { gen: i, win: a, params: o, live: s } = e;
|
|
10218
|
+
return sn(() => {
|
|
10219
10219
|
if (!s || !r.current || !i) return;
|
|
10220
10220
|
let e = r.current.getContext("2d");
|
|
10221
10221
|
e.clearRect(0, 0, t, t);
|
|
@@ -10236,28 +10236,33 @@ function zo({ t: e, size: t = 512, className: n = "" }) {
|
|
|
10236
10236
|
"data-preview": !0
|
|
10237
10237
|
});
|
|
10238
10238
|
}
|
|
10239
|
-
var
|
|
10239
|
+
var Vo = ({ t: e, className: t }) => e.id === "generate" ? /* @__PURE__ */ P(Ro, {
|
|
10240
10240
|
t: e,
|
|
10241
10241
|
className: t
|
|
10242
|
-
}) : e.id === "repeat" ? /* @__PURE__ */ P(
|
|
10242
|
+
}) : e.id === "repeat" ? /* @__PURE__ */ P(zo, {
|
|
10243
10243
|
t: e,
|
|
10244
10244
|
className: t
|
|
10245
|
-
}) : /* @__PURE__ */ P(
|
|
10245
|
+
}) : /* @__PURE__ */ P(Bo, {
|
|
10246
10246
|
t: e,
|
|
10247
10247
|
className: t
|
|
10248
|
-
}),
|
|
10248
|
+
}), Ho = {
|
|
10249
10249
|
Lights: "Lights / Point editor",
|
|
10250
10250
|
Image: "Image / Layer source"
|
|
10251
|
-
}, Uo = "[--kol-slider-float-run:var(--kol-accent-primary)]", Wo = "h-7 !rounded-md"
|
|
10252
|
-
function
|
|
10253
|
-
let [i, a] = M(null)
|
|
10251
|
+
}, Uo = "[--kol-slider-float-run:var(--kol-accent-primary)]", Wo = "h-7 !rounded-md", Go = (e, t = !1) => `calc(${e}ch + ${t ? 38 : 22}px)`;
|
|
10252
|
+
function Ko({ x: e, value: t, set: n, disabled: r }) {
|
|
10253
|
+
let [i, a] = M(null), o = (t) => e.format ? e.format(t) : String(t), s = i ?? o(t), c = Math.max(3, ...[
|
|
10254
|
+
e.min,
|
|
10255
|
+
e.max,
|
|
10256
|
+
t
|
|
10257
|
+
].map((e) => String(o(e)).length));
|
|
10254
10258
|
return /* @__PURE__ */ P(At, {
|
|
10255
10259
|
variant: "float",
|
|
10256
10260
|
size: "sm",
|
|
10257
|
-
value:
|
|
10261
|
+
value: s,
|
|
10258
10262
|
disabled: r,
|
|
10259
10263
|
"aria-label": `${e.name} value`,
|
|
10260
|
-
|
|
10264
|
+
width: Go(c),
|
|
10265
|
+
className: `shrink-0 !px-2 [&_input]:text-[11px] ${Wo}`,
|
|
10261
10266
|
onFocus: () => a(String(t)),
|
|
10262
10267
|
onChange: (e) => a(e.target.value),
|
|
10263
10268
|
onBlur: () => {
|
|
@@ -10267,7 +10272,7 @@ function Go({ x: e, value: t, set: n, disabled: r }) {
|
|
|
10267
10272
|
onKeyDown: (e) => e.key === "Enter" && e.currentTarget.blur()
|
|
10268
10273
|
});
|
|
10269
10274
|
}
|
|
10270
|
-
var
|
|
10275
|
+
var qo = (e, t, n, r, i) => /* @__PURE__ */ P(Ot, {
|
|
10271
10276
|
variant: "float",
|
|
10272
10277
|
size: "sm",
|
|
10273
10278
|
options: e,
|
|
@@ -10277,7 +10282,7 @@ var Ko = (e, t, n, r, i) => /* @__PURE__ */ P(Ot, {
|
|
|
10277
10282
|
disabled: i,
|
|
10278
10283
|
className: "w-full [&_.kol-dd-trigger]:w-full [&_.kol-dd-trigger]:!h-7 [&_.kol-dd-trigger]:justify-between [&_.kol-dd-trigger]:!text-[11px] [&_.kol-dd-trigger]:!font-normal"
|
|
10279
10284
|
});
|
|
10280
|
-
function
|
|
10285
|
+
function Jo({ x: e, t }) {
|
|
10281
10286
|
let n = t.valueOf(e), r = e.bind ? t.set(e) : () => {}, i = !t.isLive(e);
|
|
10282
10287
|
switch (e.type) {
|
|
10283
10288
|
case "slider": return /* @__PURE__ */ F(N, { children: [/* @__PURE__ */ P(Qt, {
|
|
@@ -10291,7 +10296,7 @@ function qo({ x: e, t }) {
|
|
|
10291
10296
|
disabled: i,
|
|
10292
10297
|
"aria-label": e.name,
|
|
10293
10298
|
className: "flex-1 min-w-0"
|
|
10294
|
-
}), /* @__PURE__ */ P(
|
|
10299
|
+
}), /* @__PURE__ */ P(Ko, {
|
|
10295
10300
|
x: e,
|
|
10296
10301
|
value: n,
|
|
10297
10302
|
set: r,
|
|
@@ -10332,7 +10337,7 @@ function qo({ x: e, t }) {
|
|
|
10332
10337
|
Number.isFinite(t) && r(a ? [n[0], t] : [t, n[1]]);
|
|
10333
10338
|
}
|
|
10334
10339
|
}, t));
|
|
10335
|
-
case "select": return
|
|
10340
|
+
case "select": return qo(e.options, n, r, e.name, i);
|
|
10336
10341
|
case "segmented": return /* @__PURE__ */ P(en, {
|
|
10337
10342
|
variant: "float",
|
|
10338
10343
|
size: "xs",
|
|
@@ -10362,7 +10367,7 @@ function qo({ x: e, t }) {
|
|
|
10362
10367
|
className: `w-full ${Wo}`,
|
|
10363
10368
|
onChange: (e) => r(e.target.value)
|
|
10364
10369
|
});
|
|
10365
|
-
case "picker": return
|
|
10370
|
+
case "picker": return qo([{
|
|
10366
10371
|
value: "",
|
|
10367
10372
|
label: e.kinds?.includes("photo") ? "Choose photo layer…" : "None"
|
|
10368
10373
|
}, ...t.layersFor(e)], n ?? "", r, e.name, i);
|
|
@@ -10380,7 +10385,8 @@ function qo({ x: e, t }) {
|
|
|
10380
10385
|
variant: "float",
|
|
10381
10386
|
size: "sm",
|
|
10382
10387
|
"aria-label": `${e.name} A`,
|
|
10383
|
-
|
|
10388
|
+
width: Go(5),
|
|
10389
|
+
className: `shrink-0 !px-2 [&_input]:text-[11px] ${Wo}`,
|
|
10384
10390
|
disabled: i,
|
|
10385
10391
|
value: String(+Number(n.a).toFixed(3)),
|
|
10386
10392
|
onChange: (e) => {
|
|
@@ -10392,8 +10398,8 @@ function qo({ x: e, t }) {
|
|
|
10392
10398
|
}
|
|
10393
10399
|
}),
|
|
10394
10400
|
/* @__PURE__ */ P("div", {
|
|
10395
|
-
className: "
|
|
10396
|
-
children:
|
|
10401
|
+
className: "flex-1 min-w-0",
|
|
10402
|
+
children: qo(e.curves ?? Ja, n.curve, (e) => r({
|
|
10397
10403
|
...n,
|
|
10398
10404
|
curve: e
|
|
10399
10405
|
}), `${e.name} curve`, i)
|
|
@@ -10402,7 +10408,8 @@ function qo({ x: e, t }) {
|
|
|
10402
10408
|
variant: "float",
|
|
10403
10409
|
size: "sm",
|
|
10404
10410
|
"aria-label": `${e.name} B`,
|
|
10405
|
-
|
|
10411
|
+
width: Go(5),
|
|
10412
|
+
className: `shrink-0 !px-2 [&_input]:text-[11px] ${Wo}`,
|
|
10406
10413
|
disabled: i,
|
|
10407
10414
|
value: String(+Number(n.b).toFixed(3)),
|
|
10408
10415
|
onChange: (e) => {
|
|
@@ -10417,7 +10424,8 @@ function qo({ x: e, t }) {
|
|
|
10417
10424
|
default: return null;
|
|
10418
10425
|
}
|
|
10419
10426
|
}
|
|
10420
|
-
|
|
10427
|
+
var Yo = `12px ${Go(4, !0)} ${Go(4, !0)} ${Go(4)} minmax(0,1fr) 3ch auto`;
|
|
10428
|
+
function Xo({ x: e, t }) {
|
|
10421
10429
|
let n = t.valueOf(e), r = t.set(e), i = (e, t, i) => r(n.map((n, r) => r === e ? {
|
|
10422
10430
|
...n,
|
|
10423
10431
|
[t]: i
|
|
@@ -10426,7 +10434,7 @@ function Jo({ x: e, t }) {
|
|
|
10426
10434
|
size: "sm",
|
|
10427
10435
|
prefix: r,
|
|
10428
10436
|
"aria-label": `Light ${e + 1} ${r ?? t}`,
|
|
10429
|
-
className:
|
|
10437
|
+
className: `w-full !px-2 !gap-1 [&_input]:text-[11px] ${Wo}`,
|
|
10430
10438
|
value: Number(n[e][t]).toFixed(2),
|
|
10431
10439
|
onChange: (n) => {
|
|
10432
10440
|
let r = parseFloat(n.target.value);
|
|
@@ -10438,24 +10446,30 @@ function Jo({ x: e, t }) {
|
|
|
10438
10446
|
"data-control": "Lights",
|
|
10439
10447
|
children: [
|
|
10440
10448
|
/* @__PURE__ */ F("div", {
|
|
10441
|
-
className: "
|
|
10449
|
+
className: "grid items-center gap-x-1.5 kol-mono-12 text-oq-64",
|
|
10450
|
+
style: { gridTemplateColumns: Yo },
|
|
10442
10451
|
children: [
|
|
10452
|
+
/* @__PURE__ */ P("span", {}),
|
|
10443
10453
|
/* @__PURE__ */ P("span", {
|
|
10444
|
-
className: "
|
|
10454
|
+
className: "col-span-2 kol-float-label",
|
|
10445
10455
|
children: "Position"
|
|
10446
10456
|
}),
|
|
10447
10457
|
/* @__PURE__ */ P("span", {
|
|
10448
|
-
className: "
|
|
10458
|
+
className: "kol-float-label",
|
|
10449
10459
|
children: "Radius"
|
|
10450
10460
|
}),
|
|
10451
|
-
/* @__PURE__ */ P("span", {
|
|
10461
|
+
/* @__PURE__ */ P("span", {
|
|
10462
|
+
className: "col-span-3 kol-float-label",
|
|
10463
|
+
children: "Intensity"
|
|
10464
|
+
})
|
|
10452
10465
|
]
|
|
10453
10466
|
}),
|
|
10454
|
-
|
|
10455
|
-
className: "
|
|
10456
|
-
|
|
10467
|
+
/* @__PURE__ */ P("div", {
|
|
10468
|
+
className: "grid items-center gap-x-1.5 gap-y-2 kol-mono-12",
|
|
10469
|
+
style: { gridTemplateColumns: Yo },
|
|
10470
|
+
children: n.map((e, t) => /* @__PURE__ */ F(an, { children: [
|
|
10457
10471
|
/* @__PURE__ */ P("span", {
|
|
10458
|
-
className: "
|
|
10472
|
+
className: "text-oq-48 select-none",
|
|
10459
10473
|
"aria-hidden": !0,
|
|
10460
10474
|
children: "⠿"
|
|
10461
10475
|
}),
|
|
@@ -10464,17 +10478,16 @@ function Jo({ x: e, t }) {
|
|
|
10464
10478
|
a(t, "radius"),
|
|
10465
10479
|
/* @__PURE__ */ P(Qt, {
|
|
10466
10480
|
variant: "float",
|
|
10467
|
-
readout: "none",
|
|
10468
10481
|
value: e.intensity,
|
|
10469
10482
|
min: 0,
|
|
10470
10483
|
max: 2,
|
|
10471
10484
|
step: .01,
|
|
10472
10485
|
onChange: (e) => i(t, "intensity", e),
|
|
10473
10486
|
"aria-label": `Light ${t + 1} intensity`,
|
|
10474
|
-
className: "
|
|
10487
|
+
className: "w-full min-w-0"
|
|
10475
10488
|
}),
|
|
10476
10489
|
/* @__PURE__ */ P("span", {
|
|
10477
|
-
className: "kol-float-timecode text-fg-emphasis text-[11px]
|
|
10490
|
+
className: "kol-float-timecode text-fg-emphasis text-[11px] text-right",
|
|
10478
10491
|
children: e.intensity.toFixed(1)
|
|
10479
10492
|
}),
|
|
10480
10493
|
/* @__PURE__ */ P(j, {
|
|
@@ -10486,8 +10499,8 @@ function Jo({ x: e, t }) {
|
|
|
10486
10499
|
disabled: n.length < 2,
|
|
10487
10500
|
onClick: () => r(n.filter((e, n) => n !== t))
|
|
10488
10501
|
})
|
|
10489
|
-
]
|
|
10490
|
-
}
|
|
10502
|
+
] }, t))
|
|
10503
|
+
}),
|
|
10491
10504
|
/* @__PURE__ */ P(j, {
|
|
10492
10505
|
variant: "float",
|
|
10493
10506
|
tone: "ghost",
|
|
@@ -10506,7 +10519,7 @@ function Jo({ x: e, t }) {
|
|
|
10506
10519
|
]
|
|
10507
10520
|
});
|
|
10508
10521
|
}
|
|
10509
|
-
function
|
|
10522
|
+
function Zo({ x: e, t }) {
|
|
10510
10523
|
let n = t.valueOf(e), r = n ? p(t.state.layers ?? [], n) : null;
|
|
10511
10524
|
return /* @__PURE__ */ F("div", {
|
|
10512
10525
|
className: "flex items-center gap-2",
|
|
@@ -10516,21 +10529,21 @@ function Yo({ x: e, t }) {
|
|
|
10516
10529
|
style: r?.src ? { backgroundImage: `url(${r.src})` } : void 0
|
|
10517
10530
|
}), /* @__PURE__ */ P("div", {
|
|
10518
10531
|
className: "flex-1 min-w-0",
|
|
10519
|
-
children: /* @__PURE__ */ P(
|
|
10532
|
+
children: /* @__PURE__ */ P(Jo, {
|
|
10520
10533
|
x: e,
|
|
10521
10534
|
t
|
|
10522
10535
|
})
|
|
10523
10536
|
})]
|
|
10524
10537
|
});
|
|
10525
10538
|
}
|
|
10526
|
-
function
|
|
10527
|
-
let t =
|
|
10528
|
-
return
|
|
10539
|
+
function Qo({ t: e }) {
|
|
10540
|
+
let t = un(null);
|
|
10541
|
+
return sn(() => {
|
|
10529
10542
|
let n = t.current;
|
|
10530
10543
|
if (!n || !e.live) return;
|
|
10531
10544
|
let r = n.width, i = n.height, a = n.getContext("2d"), o = a.createImageData(r, i), s;
|
|
10532
10545
|
try {
|
|
10533
|
-
s =
|
|
10546
|
+
s = ai(e.params, r / i);
|
|
10534
10547
|
} catch {
|
|
10535
10548
|
return;
|
|
10536
10549
|
}
|
|
@@ -10547,9 +10560,9 @@ function Xo({ t: e }) {
|
|
|
10547
10560
|
"data-field-map": !0
|
|
10548
10561
|
});
|
|
10549
10562
|
}
|
|
10550
|
-
var
|
|
10563
|
+
var $o = (e, t) => e.type === "lights" ? {
|
|
10551
10564
|
id: e.id,
|
|
10552
|
-
render: () => /* @__PURE__ */ P(
|
|
10565
|
+
render: () => /* @__PURE__ */ P(Xo, {
|
|
10553
10566
|
x: e,
|
|
10554
10567
|
t
|
|
10555
10568
|
}, e.id)
|
|
@@ -10557,14 +10570,14 @@ var Zo = (e, t) => e.type === "lights" ? {
|
|
|
10557
10570
|
id: e.id,
|
|
10558
10571
|
render: () => /* @__PURE__ */ P("div", {
|
|
10559
10572
|
"data-control": e.name,
|
|
10560
|
-
children: /* @__PURE__ */ P(
|
|
10573
|
+
children: /* @__PURE__ */ P(Jo, {
|
|
10561
10574
|
x: e,
|
|
10562
10575
|
t
|
|
10563
10576
|
})
|
|
10564
10577
|
}, e.id)
|
|
10565
10578
|
} : e.type === "picker" && e.kinds?.includes("photo") ? {
|
|
10566
10579
|
id: e.id,
|
|
10567
|
-
render: () => /* @__PURE__ */ P(
|
|
10580
|
+
render: () => /* @__PURE__ */ P(Zo, {
|
|
10568
10581
|
x: e,
|
|
10569
10582
|
t
|
|
10570
10583
|
}, e.id)
|
|
@@ -10572,12 +10585,12 @@ var Zo = (e, t) => e.type === "lights" ? {
|
|
|
10572
10585
|
type: "labeled",
|
|
10573
10586
|
id: e.id,
|
|
10574
10587
|
label: e.name,
|
|
10575
|
-
render: () => /* @__PURE__ */ P(
|
|
10588
|
+
render: () => /* @__PURE__ */ P(Jo, {
|
|
10576
10589
|
x: e,
|
|
10577
10590
|
t
|
|
10578
10591
|
})
|
|
10579
10592
|
};
|
|
10580
|
-
function
|
|
10593
|
+
function es(e, t) {
|
|
10581
10594
|
let n = [];
|
|
10582
10595
|
for (let r = 0; r < e.length; r++) {
|
|
10583
10596
|
let i = e[r], a = e[r + 1], o = i.name.match(/^(.*) X$/);
|
|
@@ -10597,16 +10610,16 @@ function Qo(e, t) {
|
|
|
10597
10610
|
Number.isFinite(r) && t.set(e)(r);
|
|
10598
10611
|
}
|
|
10599
10612
|
}, e.id))
|
|
10600
|
-
}), r++) : n.push(
|
|
10613
|
+
}), r++) : n.push($o(i, t));
|
|
10601
10614
|
}
|
|
10602
10615
|
return n;
|
|
10603
10616
|
}
|
|
10604
|
-
function
|
|
10605
|
-
let r =
|
|
10617
|
+
function ts({ id: e, onClose: t, className: n = "" }) {
|
|
10618
|
+
let r = Lo(e), { win: i, params: a } = r, [o, s] = M({}), c = (e, t = !0) => o[e] ?? t, l = (e) => (t) => s((n) => ({
|
|
10606
10619
|
...n,
|
|
10607
10620
|
[e]: t
|
|
10608
|
-
})), u =
|
|
10609
|
-
|
|
10621
|
+
})), u = un(a);
|
|
10622
|
+
sn(() => {
|
|
10610
10623
|
u.current !== a && (u.current = a, (r.target || e === "repeat" && a.sourceId || e === "type") && r.apply());
|
|
10611
10624
|
}, [a]);
|
|
10612
10625
|
let f = (e, { key: t = e.key, label: n = e.label, meta: i, def: a = !0, extra: o = [] } = {}) => ({
|
|
@@ -10627,24 +10640,32 @@ function $o({ id: e, onClose: t, className: n = "" }) {
|
|
|
10627
10640
|
id: `${t}-rampcols`,
|
|
10628
10641
|
label: "",
|
|
10629
10642
|
render: () => /* @__PURE__ */ F("div", {
|
|
10630
|
-
className: "flex w-full kol-
|
|
10643
|
+
className: "flex w-full gap-1.5 kol-mono-12 text-oq-64",
|
|
10631
10644
|
children: [
|
|
10632
10645
|
/* @__PURE__ */ P("span", {
|
|
10633
|
-
className: "
|
|
10634
|
-
|
|
10646
|
+
className: "shrink-0",
|
|
10647
|
+
style: { width: Go(5) },
|
|
10648
|
+
children: /* @__PURE__ */ P("span", {
|
|
10649
|
+
className: "kol-float-label",
|
|
10650
|
+
children: "Value A"
|
|
10651
|
+
})
|
|
10635
10652
|
}),
|
|
10636
10653
|
/* @__PURE__ */ P("span", {
|
|
10637
|
-
className: "
|
|
10654
|
+
className: "flex-1 kol-float-label",
|
|
10638
10655
|
children: "Curve"
|
|
10639
10656
|
}),
|
|
10640
10657
|
/* @__PURE__ */ P("span", {
|
|
10641
|
-
className: "
|
|
10642
|
-
|
|
10658
|
+
className: "shrink-0",
|
|
10659
|
+
style: { width: Go(5) },
|
|
10660
|
+
children: /* @__PURE__ */ P("span", {
|
|
10661
|
+
className: "kol-float-label",
|
|
10662
|
+
children: "Value B"
|
|
10663
|
+
})
|
|
10643
10664
|
})
|
|
10644
10665
|
]
|
|
10645
10666
|
})
|
|
10646
10667
|
}] : [],
|
|
10647
|
-
...
|
|
10668
|
+
...es(e.controls, r)
|
|
10648
10669
|
]), ...o]
|
|
10649
10670
|
}), m, h, g = /* @__PURE__ */ F("span", {
|
|
10650
10671
|
className: "flex items-center gap-2 kol-float-label text-oq-64",
|
|
@@ -10664,7 +10685,7 @@ function $o({ id: e, onClose: t, className: n = "" }) {
|
|
|
10664
10685
|
type: "labeled",
|
|
10665
10686
|
id: "preset",
|
|
10666
10687
|
label: "Preset",
|
|
10667
|
-
render: () =>
|
|
10688
|
+
render: () => qo(r.presets, a.genPreset ?? "custom", r.setPreset, "Preset")
|
|
10668
10689
|
} : e.id === "description" ? {
|
|
10669
10690
|
type: "labeled",
|
|
10670
10691
|
id: "description",
|
|
@@ -10674,7 +10695,7 @@ function $o({ id: e, onClose: t, className: n = "" }) {
|
|
|
10674
10695
|
title: r.valueOf(e),
|
|
10675
10696
|
children: r.valueOf(e)
|
|
10676
10697
|
})
|
|
10677
|
-
} :
|
|
10698
|
+
} : $o(e, r))
|
|
10678
10699
|
},
|
|
10679
10700
|
f(t("field"), {
|
|
10680
10701
|
meta: "01 / SOURCE",
|
|
@@ -10685,7 +10706,7 @@ function $o({ id: e, onClose: t, className: n = "" }) {
|
|
|
10685
10706
|
meta: r.live ? "LIVE" : "PAUSED"
|
|
10686
10707
|
}, {
|
|
10687
10708
|
id: "field-map-strip",
|
|
10688
|
-
render: () => /* @__PURE__ */ P(
|
|
10709
|
+
render: () => /* @__PURE__ */ P(Qo, { t: r })
|
|
10689
10710
|
}]
|
|
10690
10711
|
}),
|
|
10691
10712
|
f(t("ramp")),
|
|
@@ -10727,14 +10748,14 @@ function $o({ id: e, onClose: t, className: n = "" }) {
|
|
|
10727
10748
|
}).length + 1, i = a.sourceId ? p(r.state.layers ?? [], a.sourceId) : null;
|
|
10728
10749
|
m = [{
|
|
10729
10750
|
id: "head",
|
|
10730
|
-
rows:
|
|
10751
|
+
rows: es(e.groups[0].controls, r)
|
|
10731
10752
|
}, f(t, {
|
|
10732
10753
|
meta: `${n} COPIES`,
|
|
10733
10754
|
extra: [{
|
|
10734
10755
|
id: "copy-grid",
|
|
10735
10756
|
render: () => /* @__PURE__ */ P("div", {
|
|
10736
10757
|
className: "h-[110px] rounded-md bg-(--kol-float-well) p-3 flex",
|
|
10737
|
-
children: /* @__PURE__ */ P(
|
|
10758
|
+
children: /* @__PURE__ */ P(zo, {
|
|
10738
10759
|
t: r,
|
|
10739
10760
|
className: "w-full h-full"
|
|
10740
10761
|
})
|
|
@@ -10769,7 +10790,7 @@ function $o({ id: e, onClose: t, className: n = "" }) {
|
|
|
10769
10790
|
className: "absolute right-3 top-[72%] -translate-y-full kol-float-label text-oq-48",
|
|
10770
10791
|
children: "baseline"
|
|
10771
10792
|
}),
|
|
10772
|
-
/* @__PURE__ */ P(
|
|
10793
|
+
/* @__PURE__ */ P(Bo, {
|
|
10773
10794
|
t: r,
|
|
10774
10795
|
size: 256,
|
|
10775
10796
|
className: "h-full aspect-square"
|
|
@@ -10787,9 +10808,9 @@ function $o({ id: e, onClose: t, className: n = "" }) {
|
|
|
10787
10808
|
})]
|
|
10788
10809
|
});
|
|
10789
10810
|
}
|
|
10790
|
-
return /* @__PURE__ */ P(
|
|
10811
|
+
return /* @__PURE__ */ P(dn, {
|
|
10791
10812
|
title: i.id === "type" ? "Paratype Letter" : i.kind,
|
|
10792
|
-
|
|
10813
|
+
wide: !0,
|
|
10793
10814
|
density: "compact",
|
|
10794
10815
|
sections: m,
|
|
10795
10816
|
footer: h,
|
|
@@ -10801,8 +10822,8 @@ function $o({ id: e, onClose: t, className: n = "" }) {
|
|
|
10801
10822
|
}
|
|
10802
10823
|
//#endregion
|
|
10803
10824
|
//#region src/editor/generate/GeneratorWindow.jsx
|
|
10804
|
-
var
|
|
10805
|
-
function
|
|
10825
|
+
var ns = "!h-[30px] !px-0 justify-center !rounded-md !text-[11px] !font-medium !normal-case !tracking-normal font-(family-name:--kol-font-family-float)";
|
|
10826
|
+
function rs({ x: e, t }) {
|
|
10806
10827
|
let n = t.valueOf(e), r = e.bind ? t.set(e) : () => {}, i = !t.isLive(e), a = e.name;
|
|
10807
10828
|
switch (e.type) {
|
|
10808
10829
|
case "slider": return /* @__PURE__ */ P(Jt, {
|
|
@@ -10891,14 +10912,14 @@ function ts({ x: e, t }) {
|
|
|
10891
10912
|
default: return null;
|
|
10892
10913
|
}
|
|
10893
10914
|
}
|
|
10894
|
-
function
|
|
10915
|
+
function is({ g: e, t, more: n, setMore: r }) {
|
|
10895
10916
|
let i = e.controls.filter((e) => e.type === "ramp"), a = e.controls.filter((e) => e.type !== "ramp"), o = i.length > 0 && /* @__PURE__ */ F("div", {
|
|
10896
10917
|
className: "flex flex-col gap-1",
|
|
10897
10918
|
children: [/* @__PURE__ */ P(Ut, {}), i.map((e) => /* @__PURE__ */ P(Ht, {
|
|
10898
10919
|
label: e.name,
|
|
10899
10920
|
value: t.valueOf(e),
|
|
10900
10921
|
onChange: e.bind ? t.set(e) : () => {},
|
|
10901
|
-
curves: e.curves ??
|
|
10922
|
+
curves: e.curves ?? Ja,
|
|
10902
10923
|
disabled: !t.isLive(e),
|
|
10903
10924
|
"data-control": e.name
|
|
10904
10925
|
}, e.id))]
|
|
@@ -10907,7 +10928,7 @@ function ns({ g: e, t, more: n, setMore: r }) {
|
|
|
10907
10928
|
span: e.type === "lights" ? 2 : 1,
|
|
10908
10929
|
disabled: !t.isLive(e),
|
|
10909
10930
|
"data-control": e.name,
|
|
10910
|
-
children: /* @__PURE__ */ P(
|
|
10931
|
+
children: /* @__PURE__ */ P(rs, {
|
|
10911
10932
|
x: e,
|
|
10912
10933
|
t
|
|
10913
10934
|
})
|
|
@@ -10933,7 +10954,7 @@ function ns({ g: e, t, more: n, setMore: r }) {
|
|
|
10933
10954
|
})]
|
|
10934
10955
|
});
|
|
10935
10956
|
}
|
|
10936
|
-
function
|
|
10957
|
+
function as({ t: e, caption: t }) {
|
|
10937
10958
|
return /* @__PURE__ */ F("div", {
|
|
10938
10959
|
className: "flex flex-col",
|
|
10939
10960
|
children: [
|
|
@@ -10949,7 +10970,7 @@ function rs({ t: e, caption: t }) {
|
|
|
10949
10970
|
}),
|
|
10950
10971
|
/* @__PURE__ */ P("div", {
|
|
10951
10972
|
className: "size-[248px] rounded-md border border-oq-16 bg-surface-primary overflow-hidden flex items-center justify-center",
|
|
10952
|
-
children: /* @__PURE__ */ P(
|
|
10973
|
+
children: /* @__PURE__ */ P(Vo, {
|
|
10953
10974
|
t: e,
|
|
10954
10975
|
className: "size-full"
|
|
10955
10976
|
})
|
|
@@ -10967,8 +10988,8 @@ function rs({ t: e, caption: t }) {
|
|
|
10967
10988
|
]
|
|
10968
10989
|
});
|
|
10969
10990
|
}
|
|
10970
|
-
function
|
|
10971
|
-
let r =
|
|
10991
|
+
function os({ id: e, open: t, onClose: n }) {
|
|
10992
|
+
let r = Lo(e), { win: i, params: a, sections: o } = r, [s, c] = M(o[0].key), [l, u] = M({}), d = o.find((e) => e.key === s) ?? o[0], f = i.header.find((e) => e.id === "style"), p = i.header.find((e) => e.id === "description"), m = i.header.find((e) => e.id === "expand"), h = i.fieldMap?.(a);
|
|
10972
10993
|
return /* @__PURE__ */ P(Et, {
|
|
10973
10994
|
variant: "settings",
|
|
10974
10995
|
open: t,
|
|
@@ -11028,7 +11049,7 @@ function is({ id: e, open: t, onClose: n }) {
|
|
|
11028
11049
|
aside: /* @__PURE__ */ F("div", {
|
|
11029
11050
|
className: "flex flex-col",
|
|
11030
11051
|
children: [
|
|
11031
|
-
/* @__PURE__ */ P(
|
|
11052
|
+
/* @__PURE__ */ P(as, {
|
|
11032
11053
|
t: r,
|
|
11033
11054
|
caption: d.state?.(a) ?? ""
|
|
11034
11055
|
}),
|
|
@@ -11065,7 +11086,7 @@ function is({ id: e, open: t, onClose: n }) {
|
|
|
11065
11086
|
size: "sm",
|
|
11066
11087
|
tone: "secondary",
|
|
11067
11088
|
onClick: r.reset,
|
|
11068
|
-
className: `${
|
|
11089
|
+
className: `${ns} w-16 [--kol-tone-bg:var(--kol-oq-08)] [--kol-tone-border:var(--kol-oq-16)] [--kol-tone-fg:var(--kol-fg-96)]`,
|
|
11069
11090
|
children: "Reset"
|
|
11070
11091
|
}),
|
|
11071
11092
|
/* @__PURE__ */ P("span", { className: "flex-1" }),
|
|
@@ -11073,7 +11094,7 @@ function is({ id: e, open: t, onClose: n }) {
|
|
|
11073
11094
|
size: "sm",
|
|
11074
11095
|
tone: "secondary",
|
|
11075
11096
|
onClick: n,
|
|
11076
|
-
className: `${
|
|
11097
|
+
className: `${ns} w-20 [--kol-tone-bg:var(--kol-oq-08)] [--kol-tone-border:var(--kol-oq-16)] [--kol-tone-fg:var(--kol-fg-96)]`,
|
|
11077
11098
|
children: "Cancel"
|
|
11078
11099
|
}),
|
|
11079
11100
|
/* @__PURE__ */ P(j, {
|
|
@@ -11083,13 +11104,13 @@ function is({ id: e, open: t, onClose: n }) {
|
|
|
11083
11104
|
r.apply(), n();
|
|
11084
11105
|
},
|
|
11085
11106
|
disabled: !r.canApply,
|
|
11086
|
-
className: `${
|
|
11107
|
+
className: `${ns} w-[106px] [--kol-tone-bg:var(--kol-fg-96)] [--kol-tone-fg:var(--kol-surface-primary)]`,
|
|
11087
11108
|
children: "Apply"
|
|
11088
11109
|
})
|
|
11089
11110
|
] }),
|
|
11090
11111
|
children: /* @__PURE__ */ P("div", {
|
|
11091
11112
|
"data-section-body": d.key,
|
|
11092
|
-
children: d.groups.map((e, t) => /* @__PURE__ */ P(
|
|
11113
|
+
children: d.groups.map((e, t) => /* @__PURE__ */ P(is, {
|
|
11093
11114
|
g: e,
|
|
11094
11115
|
t: r,
|
|
11095
11116
|
more: l,
|
|
@@ -11098,12 +11119,12 @@ function is({ id: e, open: t, onClose: n }) {
|
|
|
11098
11119
|
})
|
|
11099
11120
|
});
|
|
11100
11121
|
}
|
|
11101
|
-
function
|
|
11122
|
+
function ss() {
|
|
11102
11123
|
let { dialog: e } = _t();
|
|
11103
|
-
return
|
|
11124
|
+
return sn(() => {
|
|
11104
11125
|
let e = (e) => gt(e.detail?.window ?? "generate", e.detail?.form ?? "rail");
|
|
11105
11126
|
return window.addEventListener("kol:open-generator-window", e), () => window.removeEventListener("kol:open-generator-window", e);
|
|
11106
|
-
}, []), e ? /* @__PURE__ */ P(
|
|
11127
|
+
}, []), e ? /* @__PURE__ */ P(os, {
|
|
11107
11128
|
id: e,
|
|
11108
11129
|
open: !0,
|
|
11109
11130
|
onClose: () => mt({ dialog: null })
|
|
@@ -11111,7 +11132,7 @@ function as() {
|
|
|
11111
11132
|
}
|
|
11112
11133
|
//#endregion
|
|
11113
11134
|
//#region src/packs/generators.js
|
|
11114
|
-
var
|
|
11135
|
+
var cs = {
|
|
11115
11136
|
layerTypes: [
|
|
11116
11137
|
"loop",
|
|
11117
11138
|
"misc",
|
|
@@ -11130,21 +11151,21 @@ var os = {
|
|
|
11130
11151
|
isToolPreset: st,
|
|
11131
11152
|
groupById: Pe,
|
|
11132
11153
|
drawLoopFrame: Te,
|
|
11133
|
-
GENERATIVE_TREE:
|
|
11134
|
-
MISC_TREE:
|
|
11154
|
+
GENERATIVE_TREE: fn,
|
|
11155
|
+
MISC_TREE: pn,
|
|
11135
11156
|
THEME_OPTIONS: Se,
|
|
11136
|
-
buildParatypeFlattenGroup:
|
|
11137
|
-
LoopPicker:
|
|
11138
|
-
LoopFields:
|
|
11139
|
-
stepFromPreset:
|
|
11140
|
-
generateParamsFor:
|
|
11141
|
-
generateMarks:
|
|
11142
|
-
generateBody:
|
|
11143
|
-
GenerateLayer:
|
|
11144
|
-
GeneratorRail:
|
|
11145
|
-
GeneratorWindows:
|
|
11146
|
-
loadGlHost: () => import("./host-
|
|
11157
|
+
buildParatypeFlattenGroup: bn,
|
|
11158
|
+
LoopPicker: Mn,
|
|
11159
|
+
LoopFields: Wr,
|
|
11160
|
+
stepFromPreset: Kr,
|
|
11161
|
+
generateParamsFor: va,
|
|
11162
|
+
generateMarks: Ta,
|
|
11163
|
+
generateBody: Ea,
|
|
11164
|
+
GenerateLayer: La,
|
|
11165
|
+
GeneratorRail: ts,
|
|
11166
|
+
GeneratorWindows: ss,
|
|
11167
|
+
loadGlHost: () => import("./host-BCPL5xi5.js")
|
|
11147
11168
|
};
|
|
11148
|
-
ve("generators",
|
|
11169
|
+
ve("generators", cs);
|
|
11149
11170
|
//#endregion
|
|
11150
|
-
export {
|
|
11171
|
+
export { An as _, Gr as a, pn as b, ar as c, rr as d, Nn as f, kn as g, En as h, Kr as i, or as l, jn as m, Yr as n, Wr as o, Cn as p, Jr as r, Rr as s, cs as t, ir as u, Sn as v, fn as y };
|