@wave3d/core 0.3.0 → 0.5.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/config/model.d.ts +62 -1
- package/dist/config/model.js +45 -1
- package/dist/config/model.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/renderer/WaveRenderer.d.ts +85 -12
- package/dist/renderer/WaveRenderer.js +299 -16
- package/dist/renderer/WaveRenderer.js.map +1 -1
- package/dist/renderer/index.d.ts +2 -2
- package/dist/renderer/index.js +2 -2
- package/dist/renderer/shaders.js +213 -6
- package/dist/renderer/shaders.js.map +1 -1
- package/dist/standalone/wave3d.standalone.js +446 -248
- package/dist/standalone.d.ts +2 -2
- package/dist/standalone.js +2 -2
- package/dist/studio/StudioWaveRenderer.d.ts +4 -0
- package/dist/studio/StudioWaveRenderer.js +10 -3
- package/dist/studio/StudioWaveRenderer.js.map +1 -1
- package/dist/studio/index.d.ts +2 -2
- package/dist/studio/index.js +2 -2
- package/dist/studio/randomize.d.ts +4 -1
- package/dist/studio/randomize.js +48 -1
- package/dist/studio/randomize.js.map +1 -1
- package/package.json +1 -1
- package/skills/wave3d/SKILL.md +40 -4
|
@@ -11490,9 +11490,27 @@ function wl() {
|
|
|
11490
11490
|
z: 0
|
|
11491
11491
|
},
|
|
11492
11492
|
cameraZoom: 1,
|
|
11493
|
+
cameraFit: "cover",
|
|
11494
|
+
cameraMinVisibleWidth: 0,
|
|
11493
11495
|
grain: 1.1,
|
|
11494
11496
|
blur: .02,
|
|
11495
11497
|
blurSamples: 6,
|
|
11498
|
+
dither: 0,
|
|
11499
|
+
ditherScale: 2,
|
|
11500
|
+
ditherSteps: 4,
|
|
11501
|
+
innerLight: 0,
|
|
11502
|
+
innerLightDensity: .5,
|
|
11503
|
+
innerLightDecay: .95,
|
|
11504
|
+
innerLightX: .5,
|
|
11505
|
+
innerLightY: .15,
|
|
11506
|
+
halftone: 0,
|
|
11507
|
+
halftoneCell: 6,
|
|
11508
|
+
halftoneAngle: .4,
|
|
11509
|
+
heatmap: 0,
|
|
11510
|
+
paperTexture: 0,
|
|
11511
|
+
paperTextureScale: 2,
|
|
11512
|
+
halftoneCmyk: 0,
|
|
11513
|
+
halftoneCmykCell: 6,
|
|
11496
11514
|
ambient: .45,
|
|
11497
11515
|
lights: [],
|
|
11498
11516
|
mirrorH: !1,
|
|
@@ -11549,7 +11567,7 @@ function Dl(e) {
|
|
|
11549
11567
|
x: 0,
|
|
11550
11568
|
y: 0,
|
|
11551
11569
|
z: 0
|
|
11552
|
-
}, typeof e.cameraZoom != "number" && (e.cameraZoom = 1);
|
|
11570
|
+
}, typeof e.cameraZoom != "number" && (e.cameraZoom = 1), Vl.includes(e.cameraFit) || (e.cameraFit = "cover"), e.cameraMinVisibleWidth = typeof e.cameraMinVisibleWidth == "number" ? pl(e.cameraMinVisibleWidth, 0, 1) : 0;
|
|
11553
11571
|
}
|
|
11554
11572
|
function Ol(e) {
|
|
11555
11573
|
Tl(e), typeof e.gradientAngle != "number" && (e.gradientAngle = 90), typeof e.gradientShift != "number" && (e.gradientShift = .15), typeof e.usePaletteTexture != "boolean" && (e.usePaletteTexture = !0), typeof e.paletteSource != "string" && (e.paletteSource = "hero"), typeof e.paletteEdgeColor != "string" && (e.paletteEdgeColor = "#8e9dff"), typeof e.paletteEdgeAmount != "number" && (e.paletteEdgeAmount = .3), typeof e.paletteDriftX != "number" && (e.paletteDriftX = 0), typeof e.paletteDriftY != "number" && (e.paletteDriftY = 0), typeof e.hueShift != "number" && (e.hueShift = 0), typeof e.colorContrast != "number" && (e.colorContrast = 1), typeof e.colorSaturation != "number" && (e.colorSaturation = 1), typeof e.fiberCount != "number" && (e.fiberCount = 600), typeof e.fiberStrength != "number" && (e.fiberStrength = .2), Array.isArray(e.noiseBands) || (e.noiseBands = []), typeof e.texture != "number" && (e.texture = 0), typeof e.creaseLight != "number" && (e.creaseLight = .6), typeof e.creaseSharpness != "number" && (e.creaseSharpness = .589), typeof e.creaseSoftness != "number" && (e.creaseSoftness = 1), typeof e.sheen != "number" && (e.sheen = 0), typeof e.roundness != "number" && (e.roundness = 0), typeof e.iridescence != "number" && (e.iridescence = 0), typeof e.edgeFade != "number" && (e.edgeFade = .04), typeof e.edgeFeather != "number" && (e.edgeFeather = .1), typeof e.depthTint != "number" && (e.depthTint = 0), typeof e.depthTintColor != "string" && (e.depthTintColor = "#0a2540"), e.displaceFrequency ||= {
|
|
@@ -11578,14 +11596,14 @@ function Ol(e) {
|
|
|
11578
11596
|
}, typeof e.blendMode != "string" && (e.blendMode = "squared"), typeof e.speed != "number" && (e.speed = .04), typeof e.opacity != "number" && (e.opacity = 1), typeof e.seed != "number" && (e.seed = 0), e.interaction && Nl(e);
|
|
11579
11597
|
}
|
|
11580
11598
|
function kl(e) {
|
|
11581
|
-
El(e), Dl(e), typeof e.ambient != "number" && (e.ambient = .45), Array.isArray(e.lights) || (e.lights = []), typeof e.quality != "number" && (e.quality = 1), typeof e.dprMax != "number" && (e.dprMax = 2), typeof e.grain != "number" && (e.grain = 1.1), typeof e.blur != "number" && (e.blur = .02), typeof e.blurSamples != "number" && (e.blurSamples = 6), typeof e.bloomStrength != "number" && (e.bloomStrength = 0), typeof e.bloomRadius != "number" && (e.bloomRadius = .4), typeof e.bloomThreshold != "number" && (e.bloomThreshold = .85), typeof e.showCameraRig != "boolean" && (e.showCameraRig = !1), typeof e.paused != "boolean" && (e.paused = !1), typeof e.loopSeconds != "number" && (e.loopSeconds = 0), typeof e.mirrorH != "boolean" && (e.mirrorH = !1), typeof e.mirrorV != "boolean" && (e.mirrorV = !1);
|
|
11599
|
+
El(e), Dl(e), typeof e.ambient != "number" && (e.ambient = .45), Array.isArray(e.lights) || (e.lights = []), typeof e.quality != "number" && (e.quality = 1), typeof e.dprMax != "number" && (e.dprMax = 2), typeof e.grain != "number" && (e.grain = 1.1), typeof e.blur != "number" && (e.blur = .02), typeof e.blurSamples != "number" && (e.blurSamples = 6), typeof e.bloomStrength != "number" && (e.bloomStrength = 0), typeof e.bloomRadius != "number" && (e.bloomRadius = .4), typeof e.bloomThreshold != "number" && (e.bloomThreshold = .85), typeof e.dither != "number" && (e.dither = 0), typeof e.ditherScale != "number" && (e.ditherScale = 2), typeof e.ditherSteps != "number" && (e.ditherSteps = 4), typeof e.innerLight != "number" && (e.innerLight = 0), typeof e.innerLightDensity != "number" && (e.innerLightDensity = .5), typeof e.innerLightDecay != "number" && (e.innerLightDecay = .95), typeof e.innerLightX != "number" && (e.innerLightX = .5), typeof e.innerLightY != "number" && (e.innerLightY = .15), typeof e.halftone != "number" && (e.halftone = 0), typeof e.halftoneCell != "number" && (e.halftoneCell = 6), typeof e.halftoneAngle != "number" && (e.halftoneAngle = .4), typeof e.heatmap != "number" && (e.heatmap = 0), typeof e.paperTexture != "number" && (e.paperTexture = 0), typeof e.paperTextureScale != "number" && (e.paperTextureScale = 2), typeof e.halftoneCmyk != "number" && (e.halftoneCmyk = 0), typeof e.halftoneCmykCell != "number" && (e.halftoneCmykCell = 6), typeof e.showCameraRig != "boolean" && (e.showCameraRig = !1), typeof e.paused != "boolean" && (e.paused = !1), typeof e.loopSeconds != "number" && (e.loopSeconds = 0), typeof e.mirrorH != "boolean" && (e.mirrorH = !1), typeof e.mirrorV != "boolean" && (e.mirrorV = !1);
|
|
11582
11600
|
}
|
|
11583
11601
|
function Al(e, t, n, r) {
|
|
11584
11602
|
let i = Number(e);
|
|
11585
11603
|
return Number.isFinite(i) ? pl(i, t, n) : r;
|
|
11586
11604
|
}
|
|
11587
11605
|
function jl(e) {
|
|
11588
|
-
return typeof e == "string" && (
|
|
11606
|
+
return typeof e == "string" && (Ul.includes(e) || e.startsWith("custom:") && e.length > 7);
|
|
11589
11607
|
}
|
|
11590
11608
|
function Ml(e, t) {
|
|
11591
11609
|
let n = [];
|
|
@@ -11613,22 +11631,27 @@ function Nl(e) {
|
|
|
11613
11631
|
let t = e.interaction;
|
|
11614
11632
|
if (!t) return;
|
|
11615
11633
|
let n = t.hover;
|
|
11616
|
-
n && (n.agitate !== void 0 && (n.agitate = Al(n.agitate, 0, 60, 0)), n.push !== void 0 && (n.push = Al(n.push, -40, 40, 0)), n.wake !== void 0 && (n.wake = Al(n.wake, 0, 40, 0)), n.thin !== void 0 && (n.thin = Al(n.thin, 0, 1, 0)), n.hueShift !== void 0 && (n.hueShift = Al(n.hueShift, -360, 360, 0)), n.lighten !== void 0 && (n.lighten = Al(n.lighten, -1, 1, 0)), n.smoothing !== void 0 && (n.smoothing = Al(n.smoothing, 0, 2, .12))), t.press && t.press.ripple !== void 0 && (t.press.ripple = Al(t.press.ripple, 0, 60, 0)), t.bindings !== void 0 && (t.bindings = Ml(t.bindings,
|
|
11634
|
+
n && (n.agitate !== void 0 && (n.agitate = Al(n.agitate, 0, 60, 0)), n.push !== void 0 && (n.push = Al(n.push, -40, 40, 0)), n.wake !== void 0 && (n.wake = Al(n.wake, 0, 40, 0)), n.thin !== void 0 && (n.thin = Al(n.thin, 0, 1, 0)), n.hueShift !== void 0 && (n.hueShift = Al(n.hueShift, -360, 360, 0)), n.lighten !== void 0 && (n.lighten = Al(n.lighten, -1, 1, 0)), n.smoothing !== void 0 && (n.smoothing = Al(n.smoothing, 0, 2, .12))), t.press && t.press.ripple !== void 0 && (t.press.ripple = Al(t.press.ripple, 0, 60, 0)), t.bindings !== void 0 && (t.bindings = Ml(t.bindings, Wl));
|
|
11617
11635
|
}
|
|
11618
11636
|
function Pl(e) {
|
|
11619
11637
|
let t = e.interaction;
|
|
11620
|
-
t && (t.radius !== void 0 && (t.radius = Al(t.radius, .02, 2, .3)), t.bindings !== void 0 && (t.bindings = Ml(t.bindings,
|
|
11638
|
+
t && (t.radius !== void 0 && (t.radius = Al(t.radius, .02, 2, .3)), t.ribbonFlow !== void 0 && (t.ribbonFlow = Al(t.ribbonFlow, 0, 1, .8)), t.bindings !== void 0 && (t.bindings = Ml(t.bindings, Gl)));
|
|
11621
11639
|
}
|
|
11622
11640
|
function Fl(e) {
|
|
11623
11641
|
let t = e;
|
|
11624
11642
|
return kl(t), (!Array.isArray(t.waves) || t.waves.length === 0) && (t.waves = [Sl()]), t.waves.forEach(Ol), t.waveCount = t.waves.length, t.interaction && Pl(t), t;
|
|
11625
11643
|
}
|
|
11626
|
-
var Il, Ll, Rl, zl, Bl, Vl, Hl, Ul, Wl, Gl = t((() => {
|
|
11627
|
-
hl(), Il = 8, Ll = 8, Rl = 8, zl = 4, Bl = 6, Vl =
|
|
11644
|
+
var Il, Ll, Rl, zl, Bl, Vl, Hl, Ul, Wl, Gl, Kl = t((() => {
|
|
11645
|
+
hl(), Il = 8, Ll = 8, Rl = 8, zl = 4, Bl = 6, Vl = [
|
|
11646
|
+
"cover",
|
|
11647
|
+
"contain",
|
|
11648
|
+
"width",
|
|
11649
|
+
"height"
|
|
11650
|
+
], Hl = {
|
|
11628
11651
|
x: 800,
|
|
11629
11652
|
y: 900,
|
|
11630
11653
|
z: 1100
|
|
11631
|
-
},
|
|
11654
|
+
}, Ul = [
|
|
11632
11655
|
"scroll",
|
|
11633
11656
|
"hover",
|
|
11634
11657
|
"pointerX",
|
|
@@ -11637,7 +11660,7 @@ var Il, Ll, Rl, zl, Bl, Vl, Hl, Ul, Wl, Gl = t((() => {
|
|
|
11637
11660
|
"press",
|
|
11638
11661
|
"scrollVelocity",
|
|
11639
11662
|
"appear"
|
|
11640
|
-
],
|
|
11663
|
+
], Wl = [
|
|
11641
11664
|
"displaceAmount",
|
|
11642
11665
|
"detailAmount",
|
|
11643
11666
|
"twistPowerX",
|
|
@@ -11657,15 +11680,15 @@ var Il, Ll, Rl, zl, Bl, Vl, Hl, Ul, Wl, Gl = t((() => {
|
|
|
11657
11680
|
"iridescence",
|
|
11658
11681
|
"positionX",
|
|
11659
11682
|
"positionY"
|
|
11660
|
-
],
|
|
11683
|
+
], Gl = [
|
|
11661
11684
|
"timeOffset",
|
|
11662
11685
|
"cameraZoom",
|
|
11663
11686
|
"blur",
|
|
11664
11687
|
"grain"
|
|
11665
11688
|
];
|
|
11666
|
-
})),
|
|
11667
|
-
|
|
11668
|
-
${
|
|
11689
|
+
})), ql, Jl, Yl, Xl, Zl, Ql, $l, eu, tu, nu, ru, iu, au, ou, su = t((() => {
|
|
11690
|
+
Kl(), ql = "\nfloat xxhash(vec2 x){\n uvec2 t = floatBitsToUint(x);\n uint h = 0xc2b2ae3du * t.x + 0x165667b9u;\n h = (h << 17u | h >> 15u) * 0x27d4eb2fu;\n h += 0xc2b2ae3du * t.y;\n h = (h << 17u | h >> 15u) * 0x27d4eb2fu;\n h ^= h >> 15u;\n h *= 0x85ebca77u;\n h ^= h >> 13u;\n h *= 0xc2b2ae3du;\n h ^= h >> 16u;\n return uintBitsToFloat(h >> 9u | 0x3f800000u) - 1.0;\n}\nvec2 hash(vec2 x){\n float k = 6.283185307 * xxhash(x);\n return vec2(cos(k), sin(k));\n}\nfloat simplexNoise(in vec2 p){\n const float K1 = 0.366025404; // (sqrt(3)-1)/2\n const float K2 = 0.211324865; // (3-sqrt(3))/6\n vec2 i = floor(p + (p.x + p.y) * K1);\n vec2 a = p - i + (i.x + i.y) * K2;\n float m = step(a.y, a.x);\n vec2 o = vec2(m, 1.0 - m);\n vec2 b = a - o + K2;\n vec2 c = a - 1.0 + 2.0 * K2;\n vec3 h = max(0.5 - vec3(dot(a, a), dot(b, b), dot(c, c)), 0.0);\n vec3 n = h * h * h * vec3(dot(a, hash(i + 0.0)), dot(b, hash(i + o)), dot(c, hash(i + 1.0)));\n return dot(n, vec3(32.99)); // analytic factor (= 2916*sqrt(2)/125)\n}\n", Jl = "\nuniform vec3 uColors[MAX_COLORS];\nuniform float uColorPos[MAX_COLORS];\nuniform int uColorCount;\nuniform int uGradType;\nuniform float uGradAngle;\nuniform float uGradShift;\nuniform vec2 uMeshPointPos[MAX_MESH_POINTS];\nuniform vec3 uMeshPointColor[MAX_MESH_POINTS];\nuniform float uMeshPointInfluence[MAX_MESH_POINTS];\nuniform int uMeshPointCount;\nuniform float uMeshSoftness;\nuniform sampler2D uPalette; // baked 2D palette texture\nuniform float uUsePalette; // >0.5 = sample the texture; else procedural grad()\nuniform float uPaletteRaw; // >0.5 = sample palette by raw (uv.x,uv.y), not gradCoord\nuniform vec2 uPaletteScale;\nuniform vec2 uPaletteOffset;\nuniform float uPaletteRotation;\nuniform float uHueShift;\nuniform float uContrast;\nuniform float uSaturation;\nuniform float uOpacity;\nuniform float uSquared; // 1 = square the output colour (the deep \"squared\" hero look)\n", Yl = "\nvec3 contrastFn(vec3 v, float a){ return (v - 0.5) * a + 0.5; }\nvec3 desaturate(vec3 color, float factor){\n vec3 gray = vec3(dot(vec3(0.299, 0.587, 0.114), color));\n return mix(color, gray, factor);\n}\nvec3 hueShift(vec3 color, float shift){\n vec3 g = vec3(0.57735);\n vec3 proj = g * dot(g, color);\n vec3 U = color - proj;\n vec3 W = cross(g, U);\n return U * cos(shift) + W * sin(shift) + proj;\n}\n\n// Our gradient: interpolate stops by their positions (uColorPos sorted ascending).\nvec3 grad(float u){\n u = clamp(u, 0.0, 1.0);\n vec3 col = uColors[0];\n for (int i = 0; i < MAX_COLORS - 1; i++){\n if (i >= uColorCount - 1) break;\n float p0 = uColorPos[i];\n float p1 = uColorPos[i + 1];\n if (u >= p0){\n float t = clamp((u - p0) / max(p1 - p0, 1e-5), 0.0, 1.0);\n col = mix(uColors[i], uColors[i + 1], t);\n }\n }\n return col;\n}\n\n// iOS-style 2D colour field. Each control point contributes an inverse-distance\n// weight; normalising the sum fills the whole surface without dark seams.\nvec3 meshGradient(vec2 uv){\n vec3 colorSum = vec3(0.0);\n float weightSum = 0.0;\n float exponent = mix(4.8, 1.35, clamp(uMeshSoftness, 0.0, 1.0));\n for (int i = 0; i < MAX_MESH_POINTS; i++){\n if (i >= uMeshPointCount) break;\n float influence = max(uMeshPointInfluence[i], 0.05);\n float distanceFromPoint = length(uv - uMeshPointPos[i]) / influence;\n float weight = 1.0 / (pow(max(distanceFromPoint, 0.012), exponent) + 0.002);\n colorSum += uMeshPointColor[i] * weight;\n weightSum += weight;\n }\n return colorSum / max(weightSum, 0.0001);\n}\n\n// Map a surface uv to the 0–1 gradient coordinate per gradient type. uGradShift\n// adds a low-frequency simplex warp so the colour varies in 2D (along the length\n// as well as across the width) — a 2D palette feel instead\n// of flat 1-D bands.\nfloat gradCoord(vec2 uv){\n float warp = uGradShift * simplexNoise(uv * 1.6 + 4.0);\n if (uGradType == 1){ return clamp(length(uv - 0.5) * 2.0 + warp, 0.0, 1.0); } // radial\n if (uGradType == 2){ return fract(atan(uv.y - 0.5, uv.x - 0.5) / (2.0 * PI) + 0.5 + warp); } // conic\n vec2 dir = vec2(sin(uGradAngle), cos(uGradAngle)); // linear, angled\n return clamp(dot(uv - 0.5, dir) + 0.5 + warp, 0.0, 1.0);\n}\n\n// One base-colour sample for the whole surface: rotate/scale/offset the raw-palette uv,\n// then pick the mesh field / baked 2D texture / procedural stops by mode. The raw palette\n// is sampled by (uv.x, uv.y) directly; the stops-generated texture is sampled via\n// gradCoord so its angle/type/warp still apply.\nvec3 waveBaseColor(vec2 uv){\n float gc = gradCoord(uv);\n vec2 mediaUv = uv - 0.5;\n float mediaCos = cos(uPaletteRotation);\n float mediaSin = sin(uPaletteRotation);\n mediaUv = vec2(\n mediaCos * mediaUv.x + mediaSin * mediaUv.y,\n -mediaSin * mediaUv.x + mediaCos * mediaUv.y\n );\n mediaUv = mediaUv * uPaletteScale + 0.5 + uPaletteOffset;\n vec2 puv = uPaletteRaw > 0.5\n ? clamp(mediaUv, 0.0, 1.0)\n : vec2(gc, clamp(uv.y, 0.0, 1.0));\n return uGradType == 3\n ? meshGradient(uv)\n : (uUsePalette > 0.5 ? texture2D(uPalette, puv).rgb : grad(gc));\n}\n\n// The shared colour grade: contrast → desaturate → hue rotate (degrees).\nvec3 applyColorGrade(vec3 c){\n c = contrastFn(c, uContrast);\n c = desaturate(c, 1.0 - uSaturation);\n return hueShift(c, radians(uHueShift));\n}\n", Xl = `
|
|
11691
|
+
${ql}
|
|
11669
11692
|
|
|
11670
11693
|
uniform float uTime, uSpeed, uSeed;
|
|
11671
11694
|
uniform float uDispFreqX, uDispFreqZ, uDispAmount;
|
|
@@ -11690,6 +11713,9 @@ uniform float uPointerAgitate;
|
|
|
11690
11713
|
uniform float uPointerPush; // signed membrane dome at the cursor (+ repel / − attract)
|
|
11691
11714
|
uniform float uPointerWake; // drag-wake trough amplitude (behind the moving cursor)
|
|
11692
11715
|
uniform vec2 uPointerVel; // smoothed pointer velocity, NDC/s (drag-wake direction)
|
|
11716
|
+
// Ribbon flow: stretch the falloff along the strip's length axis so the field reaches ALONG the
|
|
11717
|
+
// ribbon rather than as a screen disc. 0 = the plain circular smoothstep (byte-identical when off).
|
|
11718
|
+
uniform float uShapeFlow;
|
|
11693
11719
|
varying float vPointerFall; // falloff × presence — consumed by both fragment themes
|
|
11694
11720
|
#ifdef POINTER_RIPPLES
|
|
11695
11721
|
uniform vec2 uRippleOrigin[4]; // NDC
|
|
@@ -11783,11 +11809,35 @@ void main(){
|
|
|
11783
11809
|
pos = (vec4(pos, 1.0) * rotC).xyz;
|
|
11784
11810
|
|
|
11785
11811
|
#ifdef POINTER_FX
|
|
11786
|
-
// Pointer field: displace along the wave's own (post-twist) up-axis, weighted by a
|
|
11787
|
-
//
|
|
11788
|
-
// the shared path above/below is untouched and
|
|
11789
|
-
|
|
11790
|
-
|
|
11812
|
+
// Pointer field: displace along the wave's own (post-twist) up-axis, weighted by a screen-space
|
|
11813
|
+
// falloff around the smoothed cursor — a circle at uShapeFlow 0, stretched along the ribbon as it
|
|
11814
|
+
// rises. Everything here is ADDITIVE and fenced, so the shared path above/below is untouched and
|
|
11815
|
+
// byte-identical when POINTER_FX is off.
|
|
11816
|
+
// Shared clip-space transform, computed once and reused for the cursor metric and the ribbon
|
|
11817
|
+
// tangent (the compiler is not guaranteed to CSE the triple product otherwise). Associativity is
|
|
11818
|
+
// unchanged, so preClip is bit-for-bit what the plain P*V*M*v product produced.
|
|
11819
|
+
mat4 mvp = projectionMatrix * viewMatrix * modelMatrix;
|
|
11820
|
+
vec4 preClip = mvp * vec4(pos, 1.0);
|
|
11821
|
+
// Screen-space offset from the cursor (aspect-corrected → round in pixels). The DEFAULT metric.
|
|
11822
|
+
vec2 ndcHere = preClip.xy / max(preClip.w, 1.0e-6);
|
|
11823
|
+
vec2 dp = (ndcHere - uPointer) * vec2(uPointerAspect, 1.0);
|
|
11824
|
+
// Ribbon flow: stretch the metric along the strip's own LENGTH axis so the field reaches ALONG the
|
|
11825
|
+
// ribbon and stays tight across it — the "flows with the material" feel, per-vertex (so it follows
|
|
11826
|
+
// the strip's curve) with no CPU surface pick. The length axis is local +X (uv.x runs with x)
|
|
11827
|
+
// carried through the SAME twist as the surface. The camera is orthographic (affine, w=1), so the
|
|
11828
|
+
// axis's screen image is the linear map of the DIRECTION (w=0): one mat·dir, no second
|
|
11829
|
+
// point-projection and no perspective divide. (A true per-pixel uv would need GPU picking — the
|
|
11830
|
+
// visible surface is shader-displaced, so a CPU raycast of the base geometry misses.)
|
|
11831
|
+
if (uShapeFlow > 0.0) {
|
|
11832
|
+
vec3 tangentLocal = (((vec4(1.0, 0.0, 0.0, 0.0) * rotA) * rotB) * rotC).xyz;
|
|
11833
|
+
vec2 tang = (mvp * vec4(tangentLocal, 0.0)).xy * vec2(uPointerAspect, 1.0);
|
|
11834
|
+
float tl = length(tang);
|
|
11835
|
+
if (tl > 1.0e-6) {
|
|
11836
|
+
tang /= tl;
|
|
11837
|
+
vec2 nrm = vec2(-tang.y, tang.x);
|
|
11838
|
+
dp = vec2(dot(dp, tang) / (1.0 + uShapeFlow * 2.5), dot(dp, nrm)); // up to 3.5× reach along length
|
|
11839
|
+
}
|
|
11840
|
+
}
|
|
11791
11841
|
float fall = smoothstep(uPointerRadius, 0.0, length(dp));
|
|
11792
11842
|
vPointerFall = fall * uPointerActive;
|
|
11793
11843
|
// Displacement axis = local +Y carried through the SAME three twist rotations as pos (row-vector
|
|
@@ -11841,16 +11891,16 @@ void main(){
|
|
|
11841
11891
|
gl_Position = projectionMatrix * viewMatrix * world;
|
|
11842
11892
|
vClipPosition = gl_Position;
|
|
11843
11893
|
}
|
|
11844
|
-
`,
|
|
11894
|
+
`, Zl = `
|
|
11845
11895
|
#define MAX_COLORS 8
|
|
11846
11896
|
#define MAX_MESH_POINTS 8
|
|
11847
11897
|
#define MAX_LIGHTS 8
|
|
11848
11898
|
#define MAX_NOISE_BANDS 4
|
|
11849
11899
|
#define PI 3.14159265359
|
|
11850
11900
|
|
|
11851
|
-
${Kl}
|
|
11852
|
-
|
|
11853
11901
|
${ql}
|
|
11902
|
+
|
|
11903
|
+
${Jl}
|
|
11854
11904
|
uniform float uDebug; // dev: 1 = show crease, 2 = show derivative normal
|
|
11855
11905
|
uniform float uSheen; // white-lift on the flat (low-crease) areas (1 = full)
|
|
11856
11906
|
uniform float uRoundness; // pose-robust normal-based roundness/thickness strength
|
|
@@ -11897,7 +11947,7 @@ float grainHash(vec2 p){ return fract(sin(dot(p, vec2(12.9898, 78.233))) * 43758
|
|
|
11897
11947
|
float parabola(float x, float k){ return pow(4.0 * x * (1.0 - x), k); }
|
|
11898
11948
|
float mapLinear(float v, float a, float b, float c, float d){ return c + (v - a) * (d - c) / (b - a); }
|
|
11899
11949
|
|
|
11900
|
-
${
|
|
11950
|
+
${Yl}
|
|
11901
11951
|
|
|
11902
11952
|
// Striations: a subtle high-frequency simplex-noise grain ADDED to the
|
|
11903
11953
|
// colour — colour-matched (weaker where blue is high), only near folds (crease), and
|
|
@@ -12046,14 +12096,14 @@ void main(){
|
|
|
12046
12096
|
gl_FragColor.rgb *= gl_FragColor.a;
|
|
12047
12097
|
#endif
|
|
12048
12098
|
}
|
|
12049
|
-
`,
|
|
12099
|
+
`, Ql = `
|
|
12050
12100
|
#define MAX_COLORS 8
|
|
12051
12101
|
#define MAX_MESH_POINTS 8
|
|
12052
12102
|
#define PI 3.14159265359
|
|
12053
12103
|
|
|
12054
|
-
${Kl}
|
|
12055
|
-
|
|
12056
12104
|
${ql}
|
|
12105
|
+
|
|
12106
|
+
${Jl}
|
|
12057
12107
|
uniform float uLineAmount; // default 425
|
|
12058
12108
|
uniform float uLineThickness; // default 1
|
|
12059
12109
|
uniform float uLineDerivativePower; // default 0.95
|
|
@@ -12069,7 +12119,7 @@ uniform float uPointerLighten; // -1..1 local brightness lift near the cursor
|
|
|
12069
12119
|
varying float vPointerFall; // falloff × presence, written by the vertex shader
|
|
12070
12120
|
#endif
|
|
12071
12121
|
|
|
12072
|
-
${
|
|
12122
|
+
${Yl}
|
|
12073
12123
|
|
|
12074
12124
|
void main(){
|
|
12075
12125
|
// Same 2D palette sample + colour ops as the solid theme.
|
|
@@ -12102,9 +12152,9 @@ void main(){
|
|
|
12102
12152
|
gl_FragColor.rgb *= gl_FragColor.a;
|
|
12103
12153
|
#endif
|
|
12104
12154
|
}
|
|
12105
|
-
`,
|
|
12106
|
-
})),
|
|
12107
|
-
Vc(),
|
|
12155
|
+
`, $l = "\nvarying vec2 vUv;\nvoid main(){\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n", eu = "\nuniform sampler2D tDiffuse;\nuniform vec2 uResolution;\nuniform float uBlurAmount;\nuniform int uBlurSamples;\nuniform float uGrainAmount;\nuniform float uTime;\nvarying vec2 vUv;\n\nfloat random2(vec2 st){ return fract(sin(dot(st.xy, vec2(12.9898, 78.233))) * 43758.5453); }\n\n// Angular (spin) blur: rotate the sample coord around the centre and\n// accumulate — a tangential smear that grows toward the edges. Carries alpha so a\n// transparent background survives the post pass.\nvec4 blurAngular(sampler2D tex, vec2 uv, float angle, int samples){\n vec4 total = vec4(0.0);\n vec2 coord = uv - 0.5;\n float dist = 1.0 / float(samples);\n vec2 dir = vec2(cos(angle * dist), sin(angle * dist));\n mat2 rot = mat2(dir.x, dir.y, -dir.y, dir.x);\n for (int i = 0; i < 64; i++){\n if (i >= samples) break;\n total += texture2D(tex, coord + 0.5);\n coord = coord * rot; // row-vector order (coord * rot) sets the spin direction\n }\n return total * dist;\n}\n\nvoid main(){\n vec4 sceneColor = texture2D(tDiffuse, vUv);\n vec4 blurColor = blurAngular(tDiffuse, vUv, uBlurAmount, uBlurSamples);\n // blurPower: keep a sharp band weighted to the middle, blurring toward top & bottom.\n float blurPower = smoothstep(0.0, 0.7, vUv.y) - smoothstep(0.2, 1.0, vUv.y);\n vec4 color = mix(blurColor, sceneColor, blurPower);\n // Static film grain: keyed off gl_FragCoord only (no uTime), so it doesn't flicker.\n color.rgb += mix(uGrainAmount, -uGrainAmount, random2(gl_FragCoord.xy * 0.01)) * (4.0 / 255.0);\n gl_FragColor = color; // preserve alpha → transparent background works\n}\n", tu = "\nuniform sampler2D tDiffuse;\nuniform vec2 uResolution;\nuniform float uDitherStrength; // 0..1 mix back toward the original\nuniform float uDitherScale; // pixel-block size in device px (paper: u_pxSize)\nuniform float uDitherSteps; // quantization levels (paper: u_colorSteps)\nvarying vec2 vUv;\n\nconst int bayer2x2[4] = int[4](0, 2, 3, 1);\nconst int bayer4x4[16] = int[16](0, 8, 2, 10, 12, 4, 14, 6, 3, 11, 1, 9, 15, 7, 13, 5);\nconst int bayer8x8[64] = int[64](\n 0, 32, 8, 40, 2, 34, 10, 42, 48, 16, 56, 24, 50, 18, 58, 26,\n 12, 44, 4, 36, 14, 46, 6, 38, 60, 28, 52, 20, 62, 30, 54, 22,\n 3, 35, 11, 43, 1, 33, 9, 41, 51, 19, 59, 27, 49, 17, 57, 25,\n 15, 47, 7, 39, 13, 45, 5, 37, 63, 31, 55, 23, 61, 29, 53, 21\n);\nfloat getBayerValue(vec2 uv, int size){\n ivec2 pos = ivec2(fract(uv / float(size)) * float(size));\n int index = pos.y * size + pos.x;\n if (size == 2) return float(bayer2x2[index]) / 4.0;\n else if (size == 4) return float(bayer4x4[index]) / 16.0;\n else if (size == 8) return float(bayer8x8[index]) / 64.0;\n return 0.0;\n}\n\nvoid main(){\n float pxSize = max(uDitherScale, 1.0);\n vec2 pxSizeUV = gl_FragCoord.xy / pxSize;\n vec2 sampleUV = (floor(gl_FragCoord.xy / pxSize) + 0.5) * pxSize / max(uResolution, vec2(1.0));\n vec4 image = texture2D(tDiffuse, sampleUV);\n\n float lum = dot(vec3(0.2126, 0.7152, 0.0722), image.rgb);\n float colorSteps = max(floor(uDitherSteps), 1.0);\n\n float dithering = getBayerValue(pxSizeUV, 8) - 0.5; // paper's default 8x8 ordered screen\n float brightness = clamp(lum + dithering / colorSteps, 0.0, 1.0);\n brightness = mix(0.0, brightness, image.a);\n float quantLum = floor(brightness * colorSteps + 0.5) / colorSteps;\n\n // paper's \"original colours\" path: keep the source hue, quantize luminance.\n vec3 color = image.rgb / max(lum, 0.001) * quantLum;\n float quantAlpha = floor(image.a * colorSteps + 0.5) / colorSteps;\n float opacity = mix(quantLum, 1.0, quantAlpha);\n\n gl_FragColor = mix(image, vec4(color, opacity), clamp(uDitherStrength, 0.0, 1.0));\n}\n", nu = "\nuniform sampler2D tDiffuse;\nuniform float uInnerLight; // 0..1 strength of the added light\nuniform float uInnerLightDensity; // ray length / spread\nuniform float uInnerLightDecay; // per-sample falloff (<1)\nuniform vec2 uInnerLightCenter; // light source, UV (0..1)\nvarying vec2 vUv;\n\nconst int LIGHT_SAMPLES = 24;\n\nfloat luma(vec3 c){ return dot(c, vec3(0.2126, 0.7152, 0.0722)); }\n\nvoid main(){\n vec4 src = texture2D(tDiffuse, vUv);\n vec2 delta = (vUv - uInnerLightCenter) * (uInnerLightDensity / float(LIGHT_SAMPLES));\n vec2 coord = vUv;\n float decay = 1.0;\n vec3 rays = vec3(0.0);\n for (int i = 0; i < LIGHT_SAMPLES; i++){\n coord -= delta;\n vec4 s = texture2D(tDiffuse, coord);\n rays += s.rgb * s.a * decay; // only opaque (wave) pixels emit light\n decay *= uInnerLightDecay;\n }\n rays /= float(LIGHT_SAMPLES);\n vec3 outc = src.rgb + rays * uInnerLight;\n float outA = max(src.a, luma(rays) * uInnerLight); // shafts stay visible over the transparent bg\n gl_FragColor = vec4(outc, clamp(outA, 0.0, 1.0));\n}\n", ru = "\nuniform sampler2D tDiffuse;\nuniform vec2 uResolution;\nuniform float uHalftone; // 0..1 mix\nuniform float uHalftoneCell; // dot cell size in device px (paper: u_size)\nuniform float uHalftoneAngle; // screen rotation (radians, paper: u_rotation)\nvarying vec2 vUv;\n\nfloat sigmoid(float x, float k){ return 1.0 / (1.0 + exp(-k * (x - 0.5))); }\n// paper's classic dot: radius grows as the sampled cell darkens (1 - lum), soft edge via fwidth.\nfloat getCircle(vec2 uv, float lum, float baseR){\n float r = mix(0.25 * baseR, 0.0, lum);\n float d = length(uv - 0.5);\n float aa = fwidth(d);\n return 1.0 - smoothstep(r - aa, r + aa, d);\n}\n\nvoid main(){\n float ca = cos(uHalftoneAngle);\n float sa = sin(uHalftoneAngle);\n mat2 rot = mat2(ca, sa, -sa, ca);\n float cell = max(uHalftoneCell, 2.0);\n vec2 gridPx = rot * gl_FragCoord.xy; // rotate the screen into the dot grid\n vec2 cellId = floor(gridPx / cell);\n vec2 inCell = fract(gridPx / cell); // position within the cell (0..1)\n vec2 centrePx = transpose(rot) * ((cellId + 0.5) * cell); // cell centre, back in screen px\n vec4 tex = texture2D(tDiffuse, centrePx / max(uResolution, vec2(1.0)));\n\n float k = 2.0; // sigmoid contrast (paper default)\n vec3 c = vec3(sigmoid(tex.r, k), sigmoid(tex.g, k), sigmoid(tex.b, k));\n float lum = dot(vec3(0.2126, 0.7152, 0.0722), c);\n lum = mix(1.0, lum, tex.a);\n float dot = getCircle(inCell, lum, 1.3); // baseR 1.3 ≈ paper original-colours default\n vec4 dots = vec4(tex.rgb, tex.a * dot); // wave-coloured dots, transparent between\n gl_FragColor = mix(texture2D(tDiffuse, vUv), dots, clamp(uHalftone, 0.0, 1.0));\n}\n", iu = "\nuniform sampler2D tDiffuse;\nuniform float uHeatmap; // 0..1 mix\nvarying vec2 vUv;\nvec3 heat(float t){\n t = clamp(t, 0.0, 1.0);\n vec3 c = mix(vec3(0.0, 0.0, 0.4), vec3(0.0, 0.6, 1.0), smoothstep(0.0, 0.25, t));\n c = mix(c, vec3(0.0, 1.0, 0.4), smoothstep(0.25, 0.5, t));\n c = mix(c, vec3(1.0, 1.0, 0.0), smoothstep(0.5, 0.75, t));\n c = mix(c, vec3(1.0, 0.1, 0.0), smoothstep(0.75, 1.0, t));\n return c;\n}\nvoid main(){\n vec4 src = texture2D(tDiffuse, vUv);\n float l = dot(src.rgb, vec3(0.299, 0.587, 0.114));\n gl_FragColor = vec4(mix(src.rgb, heat(l), clamp(uHeatmap, 0.0, 1.0)), src.a);\n}\n", au = "\nuniform sampler2D tDiffuse;\nuniform float uPaper; // 0..1 strength\nuniform float uPaperScale; // grain scale\nvarying vec2 vUv;\nfloat h21(vec2 p){ return fract(sin(dot(p, vec2(127.1, 311.7))) * 43758.5453); }\nvoid main(){\n vec4 src = texture2D(tDiffuse, vUv);\n vec2 p = gl_FragCoord.xy / max(uPaperScale, 0.5);\n float fiber = h21(floor(p)) * 0.5 + h21(floor(p * vec2(0.3, 3.0))) * 0.5; // directional fibers\n float tex = mix(fiber, h21(gl_FragCoord.xy), 0.3); // + fine speckle\n float shade = 1.0 - (tex - 0.5) * 0.35;\n gl_FragColor = vec4(src.rgb * mix(1.0, shade, clamp(uPaper, 0.0, 1.0)), src.a);\n}\n", ou = "\nuniform sampler2D tDiffuse;\nuniform float uHalftoneCmyk; // 0..1 mix\nuniform float uHalftoneCmykCell; // dot cell size in device px\nvarying vec2 vUv;\n// One rotated halftone dot screen for a channel value.\nfloat dotScreen(vec2 coord, float value, float angle, float cell){\n float ca = cos(angle);\n float sa = sin(angle);\n vec2 r = mat2(ca, sa, -sa, ca) * coord;\n vec2 c = fract(r / max(cell, 2.0)) - 0.5;\n float radius = sqrt(clamp(value, 0.0, 1.0)) * 0.5;\n return smoothstep(radius, radius - 0.06, length(c));\n}\nvoid main(){\n vec4 src = texture2D(tDiffuse, vUv);\n float k = 1.0 - max(max(src.r, src.g), src.b); // RGB → CMYK\n float invK = max(1.0 - k, 1e-3);\n float cyan = (1.0 - src.r - k) / invK;\n float mag = (1.0 - src.g - k) / invK;\n float yel = (1.0 - src.b - k) / invK;\n vec2 coord = gl_FragCoord.xy;\n float cell = uHalftoneCmykCell;\n float dc = dotScreen(coord, cyan, 1.309, cell); // 75°\n float dm = dotScreen(coord, mag, 0.262, cell); // 15°\n float dy = dotScreen(coord, yel, 0.0, cell); // 0°\n float dk = dotScreen(coord, k, 0.785, cell); // 45°\n // Subtractive: cyan ink absorbs red, magenta absorbs green, yellow absorbs blue, black absorbs all.\n vec3 outc = vec3(1.0) - vec3(dc, 0.0, 0.0) - vec3(0.0, dm, 0.0) - vec3(0.0, 0.0, dy) - vec3(dk);\n outc = clamp(outc, 0.0, 1.0);\n gl_FragColor = vec4(mix(src.rgb, outc, clamp(uHalftoneCmyk, 0.0, 1.0)), src.a);\n}\n";
|
|
12156
|
+
})), cu, lu, uu, du, fu, pu, mu = t((() => {
|
|
12157
|
+
Vc(), cu = 400, lu = 16, uu = cu / 4, du = new K(1, 0, 0), fu = new K(0, 1, 0), pu = class {
|
|
12108
12158
|
geometry;
|
|
12109
12159
|
segments = -1;
|
|
12110
12160
|
constructor(e) {
|
|
@@ -12113,11 +12163,11 @@ void main(){
|
|
|
12113
12163
|
resize(e) {
|
|
12114
12164
|
if (e === this.segments) return;
|
|
12115
12165
|
this.segments = e;
|
|
12116
|
-
let t = Gt.clamp(Math.round(e), 48, 200), n = t * 2, r = new wi(
|
|
12166
|
+
let t = Gt.clamp(Math.round(e), 48, 200), n = t * 2, r = new wi(cu, cu, t, n), i = r.attributes.position, a = r.attributes.uv, o = new K();
|
|
12117
12167
|
for (let e = 0; e < i.count; e++) {
|
|
12118
12168
|
o.fromBufferAttribute(i, e);
|
|
12119
12169
|
let t = a.getY(e), n = 4 - 2 * (4 * t * (1 - t)) ** 9.5;
|
|
12120
|
-
o.x < -16 ? o.z += n : o.x <
|
|
12170
|
+
o.x < -16 ? o.z += n : o.x < lu ? (o.z = Math.cos(Gt.mapLinear(o.x, -16, lu, 0, Math.PI)) * n, o.x = Math.cos(Gt.mapLinear(o.x, -16, lu, -Math.PI / 2, Math.PI / 2)) * n - lu) : (o.z -= n, o.x = -o.x), o.x += uu, o.applyAxisAngle(du, -Math.PI / 2), o.applyAxisAngle(fu, -Math.PI / 2), i.setXYZ(e, o.x, o.y, o.z);
|
|
12121
12171
|
}
|
|
12122
12172
|
i.needsUpdate = !0;
|
|
12123
12173
|
let s = t + 1, c = r.getIndex(), l = c ? Array.from(c.array) : [];
|
|
@@ -12138,115 +12188,115 @@ void main(){
|
|
|
12138
12188
|
}));
|
|
12139
12189
|
//#endregion
|
|
12140
12190
|
//#region src/renderer/interaction.ts
|
|
12141
|
-
function
|
|
12191
|
+
function hu(e, t) {
|
|
12142
12192
|
return e > 0 ? 1 - Math.exp(-t / e) : 1;
|
|
12143
12193
|
}
|
|
12144
|
-
function
|
|
12194
|
+
function gu(e, t, n, r, i, a) {
|
|
12145
12195
|
if (a <= 0) return;
|
|
12146
|
-
let o = a >
|
|
12196
|
+
let o = a > Mu ? Math.min(Math.ceil(a / Mu), Nu) : 1, s = a / o, c = r * r, l = 2 * i * r;
|
|
12147
12197
|
for (let r = 0; r < o; r++) t.x += (c * (n.x - e.x) - l * t.x) * s, t.y += (c * (n.y - e.y) - l * t.y) * s, e.x += t.x * s, e.y += t.y * s;
|
|
12148
12198
|
}
|
|
12149
|
-
function
|
|
12199
|
+
function _u(e) {
|
|
12150
12200
|
return e.interaction?.enabled !== !1;
|
|
12151
12201
|
}
|
|
12152
|
-
function
|
|
12202
|
+
function vu(e) {
|
|
12153
12203
|
let t = e.interaction;
|
|
12154
12204
|
return !!t && (!!t.hover || (t.press?.ripple ?? 0) > 0);
|
|
12155
12205
|
}
|
|
12156
|
-
function
|
|
12157
|
-
return
|
|
12206
|
+
function yu(e, t) {
|
|
12207
|
+
return _u(e) && vu(t);
|
|
12158
12208
|
}
|
|
12159
|
-
function
|
|
12160
|
-
return
|
|
12209
|
+
function bu(e, t) {
|
|
12210
|
+
return _u(e) && (t.interaction?.press?.ripple ?? 0) > 0;
|
|
12161
12211
|
}
|
|
12162
|
-
function
|
|
12163
|
-
return
|
|
12212
|
+
function xu(e) {
|
|
12213
|
+
return _u(e) && e.waves.some(vu);
|
|
12164
12214
|
}
|
|
12165
|
-
function
|
|
12166
|
-
return
|
|
12215
|
+
function Su(e) {
|
|
12216
|
+
return _u(e) ? (e.interaction?.bindings?.length ?? 0) > 0 ? !0 : e.waves.some((e) => {
|
|
12167
12217
|
let t = e.interaction;
|
|
12168
12218
|
return !!t && (!!t.hover || (t.press?.ripple ?? 0) > 0 || (t.bindings?.length ?? 0) > 0);
|
|
12169
12219
|
}) : !1;
|
|
12170
12220
|
}
|
|
12171
|
-
var
|
|
12172
|
-
Vc(), hl(),
|
|
12221
|
+
var Cu, wu, Tu, Eu, Du, Ou, ku, Au, ju, Mu, Nu, Pu, Fu, Iu, Lu, Ru, zu = t((() => {
|
|
12222
|
+
Vc(), hl(), Cu = 1.5, wu = .08, Tu = 4, Eu = 2, Du = .15, Ou = .12, ku = .25, Au = .7, ju = .02, Mu = 1 / 120, Nu = 6, Pu = (e, t) => ({
|
|
12173
12223
|
base: e,
|
|
12174
12224
|
apply: t
|
|
12175
|
-
}),
|
|
12225
|
+
}), Fu = (e, t) => ({
|
|
12176
12226
|
base: e,
|
|
12177
12227
|
apply: t
|
|
12178
|
-
}),
|
|
12179
|
-
displaceAmount:
|
|
12228
|
+
}), Iu = {
|
|
12229
|
+
displaceAmount: Pu((e) => e.displaceAmount, (e, t) => {
|
|
12180
12230
|
t.u.uDispAmount.value = e;
|
|
12181
12231
|
}),
|
|
12182
|
-
detailAmount:
|
|
12232
|
+
detailAmount: Pu((e) => e.detailAmount ?? 0, (e, t) => {
|
|
12183
12233
|
t.u.uDetailAmount.value = e;
|
|
12184
12234
|
}),
|
|
12185
|
-
twistPowerX:
|
|
12235
|
+
twistPowerX: Pu((e) => e.twistPower.x, (e, t) => {
|
|
12186
12236
|
t.u.uTwPowX.value = e;
|
|
12187
12237
|
}),
|
|
12188
|
-
twistPowerY:
|
|
12238
|
+
twistPowerY: Pu((e) => e.twistPower.y, (e, t) => {
|
|
12189
12239
|
t.u.uTwPowY.value = e;
|
|
12190
12240
|
}),
|
|
12191
|
-
twistPowerZ:
|
|
12241
|
+
twistPowerZ: Pu((e) => e.twistPower.z, (e, t) => {
|
|
12192
12242
|
t.u.uTwPowZ.value = e;
|
|
12193
12243
|
}),
|
|
12194
|
-
twistFrequencyX:
|
|
12244
|
+
twistFrequencyX: Pu((e) => e.twistFrequency.x, (e, t) => {
|
|
12195
12245
|
t.u.uTwFreqX.value = e;
|
|
12196
12246
|
}),
|
|
12197
|
-
twistFrequencyY:
|
|
12247
|
+
twistFrequencyY: Pu((e) => e.twistFrequency.y, (e, t) => {
|
|
12198
12248
|
t.u.uTwFreqY.value = e;
|
|
12199
12249
|
}),
|
|
12200
|
-
twistFrequencyZ:
|
|
12250
|
+
twistFrequencyZ: Pu((e) => e.twistFrequency.z, (e, t) => {
|
|
12201
12251
|
t.u.uTwFreqZ.value = e;
|
|
12202
12252
|
}),
|
|
12203
|
-
hueShift:
|
|
12253
|
+
hueShift: Pu((e) => e.hueShift, (e, t) => {
|
|
12204
12254
|
t.u.uHueShift.value = e;
|
|
12205
12255
|
}),
|
|
12206
|
-
gradientShift:
|
|
12256
|
+
gradientShift: Pu((e) => e.gradientShift ?? 0, (e, t) => {
|
|
12207
12257
|
t.u.uGradShift.value = e;
|
|
12208
12258
|
}),
|
|
12209
|
-
colorSaturation:
|
|
12259
|
+
colorSaturation: Pu((e) => e.colorSaturation, (e, t) => {
|
|
12210
12260
|
t.u.uSaturation.value = e;
|
|
12211
12261
|
}),
|
|
12212
|
-
opacity:
|
|
12262
|
+
opacity: Pu((e) => e.opacity, (e, t) => {
|
|
12213
12263
|
t.u.uOpacity.value = e;
|
|
12214
12264
|
}),
|
|
12215
|
-
lineThickness:
|
|
12265
|
+
lineThickness: Pu((e) => e.lineThickness ?? 1, (e, t) => {
|
|
12216
12266
|
t.u.uLineThickness.value = e;
|
|
12217
12267
|
}),
|
|
12218
|
-
lineAmount:
|
|
12268
|
+
lineAmount: Pu((e) => e.lineAmount ?? 425, (e, t) => {
|
|
12219
12269
|
t.u.uLineAmount.value = e;
|
|
12220
12270
|
}),
|
|
12221
|
-
fiberStrength:
|
|
12271
|
+
fiberStrength: Pu((e) => e.fiberStrength, (e, t) => {
|
|
12222
12272
|
t.u.uFiberStrength.value = e;
|
|
12223
12273
|
}),
|
|
12224
|
-
sheen:
|
|
12274
|
+
sheen: Pu((e) => e.sheen ?? 1, (e, t) => {
|
|
12225
12275
|
t.u.uSheen.value = e;
|
|
12226
12276
|
}),
|
|
12227
|
-
iridescence:
|
|
12277
|
+
iridescence: Pu((e) => e.iridescence ?? 0, (e, t) => {
|
|
12228
12278
|
t.u.uIridescence.value = e;
|
|
12229
12279
|
}),
|
|
12230
|
-
positionX:
|
|
12280
|
+
positionX: Pu((e) => e.position.x, (e, t) => {
|
|
12231
12281
|
t.mesh.position.x = e;
|
|
12232
12282
|
}),
|
|
12233
|
-
positionY:
|
|
12283
|
+
positionY: Pu((e) => e.position.y, (e, t) => {
|
|
12234
12284
|
t.mesh.position.y = e;
|
|
12235
12285
|
})
|
|
12236
|
-
},
|
|
12237
|
-
timeOffset:
|
|
12286
|
+
}, Lu = {
|
|
12287
|
+
timeOffset: Fu((e) => e.timeOffset ?? 0, (e, t) => {
|
|
12238
12288
|
t.out.timeOffset = e;
|
|
12239
12289
|
}),
|
|
12240
|
-
cameraZoom:
|
|
12290
|
+
cameraZoom: Fu((e) => e.cameraZoom ?? 1, (e, t) => {
|
|
12241
12291
|
t.out.zoom = e;
|
|
12242
12292
|
}),
|
|
12243
|
-
blur:
|
|
12293
|
+
blur: Fu((e) => e.blur, (e, t) => {
|
|
12244
12294
|
t.post.uBlurAmount.value = e;
|
|
12245
12295
|
}),
|
|
12246
|
-
grain:
|
|
12296
|
+
grain: Fu((e) => e.grain, (e, t) => {
|
|
12247
12297
|
t.post.uGrainAmount.value = e;
|
|
12248
12298
|
})
|
|
12249
|
-
},
|
|
12299
|
+
}, Ru = class {
|
|
12250
12300
|
container;
|
|
12251
12301
|
cfg;
|
|
12252
12302
|
scrollOverride = null;
|
|
@@ -12324,12 +12374,12 @@ var gu, _u, vu, yu, bu, xu, Su, Cu, wu, Tu, Eu, Du, Ou, ku, Au, ju, Mu = t((() =
|
|
|
12324
12374
|
update(e) {
|
|
12325
12375
|
let t = this.cfg();
|
|
12326
12376
|
if (!t) return;
|
|
12327
|
-
let n = Math.max(e, 0), r =
|
|
12377
|
+
let n = Math.max(e, 0), r = hu(Ou, n);
|
|
12328
12378
|
if (this.ndcPrev.copy(this.ndc), this.ndc.lerp(this.ndcTarget, r), this.presence += (this.presenceTarget - this.presence) * r, this.press += (this.pressTarget - this.press) * r, n > 1e-5) {
|
|
12329
|
-
let e =
|
|
12379
|
+
let e = hu(wu, n);
|
|
12330
12380
|
this.velNdc.x += ((this.ndc.x - this.ndcPrev.x) / n - this.velNdc.x) * e, this.velNdc.y += ((this.ndc.y - this.ndcPrev.y) / n - this.velNdc.y) * e;
|
|
12331
12381
|
}
|
|
12332
|
-
this.pointerSpeed = this.presence * ml(this.velNdc.length() /
|
|
12382
|
+
this.pointerSpeed = this.presence * ml(this.velNdc.length() / Tu);
|
|
12333
12383
|
let i = t.waves;
|
|
12334
12384
|
this.fields.length > i.length && (this.fields.length = i.length);
|
|
12335
12385
|
for (let e = 0; e < i.length; e++) {
|
|
@@ -12339,19 +12389,19 @@ var gu, _u, vu, yu, bu, xu, Su, Cu, wu, Tu, Eu, Du, Ou, ku, Au, ju, Mu = t((() =
|
|
|
12339
12389
|
vel: new G(),
|
|
12340
12390
|
presence: this.presenceTarget
|
|
12341
12391
|
}, this.fields[e] = t);
|
|
12342
|
-
let r = Math.max(i[e].interaction?.hover?.smoothing ??
|
|
12343
|
-
|
|
12392
|
+
let r = Math.max(i[e].interaction?.hover?.smoothing ?? Ou, ju);
|
|
12393
|
+
gu(t.ndc, t.vel, this.ndcTarget, 1 / r, Au, n), t.presence += (this.presenceTarget - t.presence) * hu(r, n);
|
|
12344
12394
|
}
|
|
12345
12395
|
let a = this.scrollOverride ?? this.computeScroll();
|
|
12346
12396
|
if (n > 1e-5) {
|
|
12347
12397
|
let e = Math.abs(a - this.scrollPrev) / n;
|
|
12348
|
-
this.scrollVel += (e - this.scrollVel) *
|
|
12398
|
+
this.scrollVel += (e - this.scrollVel) * hu(Du, n);
|
|
12349
12399
|
}
|
|
12350
12400
|
this.scrollPrev = a, this.scroll = a, this.appearLatched = !0;
|
|
12351
12401
|
for (let e of this.ripples) {
|
|
12352
12402
|
if (!e.active) continue;
|
|
12353
12403
|
e.age += n;
|
|
12354
|
-
let t = Math.max(0, 1 - e.age /
|
|
12404
|
+
let t = Math.max(0, 1 - e.age / Cu);
|
|
12355
12405
|
e.amp = t * t, e.amp <= 0 && (e.active = !1);
|
|
12356
12406
|
}
|
|
12357
12407
|
this.updateBindings(t, n);
|
|
@@ -12373,7 +12423,7 @@ var gu, _u, vu, yu, bu, xu, Su, Cu, wu, Tu, Eu, Du, Ou, ku, Au, ju, Mu = t((() =
|
|
|
12373
12423
|
(!r || r.source !== e.source) && (r = {
|
|
12374
12424
|
value: e.source === "appear" ? 0 : n,
|
|
12375
12425
|
source: e.source
|
|
12376
|
-
}, this.bindingState.set(e, r)), r.value += (n - r.value) *
|
|
12426
|
+
}, this.bindingState.set(e, r)), r.value += (n - r.value) * hu(e.smoothing ?? ku, t);
|
|
12377
12427
|
}
|
|
12378
12428
|
bindingValue(e) {
|
|
12379
12429
|
return this.bindingState.get(e)?.value ?? 0;
|
|
@@ -12386,7 +12436,7 @@ var gu, _u, vu, yu, bu, xu, Su, Cu, wu, Tu, Eu, Du, Ou, ku, Au, ju, Mu = t((() =
|
|
|
12386
12436
|
case "pointerY": return (this.ndc.y + 1) * .5;
|
|
12387
12437
|
case "pointerSpeed": return this.pointerSpeed;
|
|
12388
12438
|
case "press": return this.press;
|
|
12389
|
-
case "scrollVelocity": return ml(this.scrollVel /
|
|
12439
|
+
case "scrollVelocity": return ml(this.scrollVel / Eu);
|
|
12390
12440
|
case "appear": return +!!this.appearLatched;
|
|
12391
12441
|
default: return this.customInputs.get(e.slice(7)) ?? 0;
|
|
12392
12442
|
}
|
|
@@ -12451,42 +12501,42 @@ var gu, _u, vu, yu, bu, xu, Su, Cu, wu, Tu, Eu, Du, Ou, ku, Au, ju, Mu = t((() =
|
|
|
12451
12501
|
}));
|
|
12452
12502
|
//#endregion
|
|
12453
12503
|
//#region src/renderer/palette.ts
|
|
12454
|
-
function
|
|
12504
|
+
function Bu(e) {
|
|
12455
12505
|
return e * e * (3 - 2 * e);
|
|
12456
12506
|
}
|
|
12457
|
-
function
|
|
12507
|
+
function Vu(e, t) {
|
|
12458
12508
|
let n = new X(e).clone().convertLinearToSRGB();
|
|
12459
12509
|
return `rgba(${Math.round(n.r * 255)}, ${Math.round(n.g * 255)}, ${Math.round(n.b * 255)}, ${t})`;
|
|
12460
12510
|
}
|
|
12461
|
-
function
|
|
12511
|
+
function Hu(e) {
|
|
12462
12512
|
let t = document.createElement("canvas");
|
|
12463
|
-
t.width =
|
|
12513
|
+
t.width = sd, t.height = cd;
|
|
12464
12514
|
let n = t.getContext("2d");
|
|
12465
12515
|
if (!n) return t;
|
|
12466
|
-
let r = [...e.stops].sort((e, t) => e.pos - t.pos), i = n.createLinearGradient(0, 0,
|
|
12516
|
+
let r = [...e.stops].sort((e, t) => e.pos - t.pos), i = n.createLinearGradient(0, 0, sd, 0);
|
|
12467
12517
|
if (r.length === 0) i.addColorStop(0, "#ffffff");
|
|
12468
12518
|
else for (let e of r) i.addColorStop(ml(e.pos), e.color);
|
|
12469
|
-
n.fillStyle = i, n.fillRect(0, 0,
|
|
12519
|
+
n.fillStyle = i, n.fillRect(0, 0, sd, cd);
|
|
12470
12520
|
let a = ml(e.edgeAmount);
|
|
12471
12521
|
if (a > .001) {
|
|
12472
|
-
let t = n.createLinearGradient(0, 0, 0,
|
|
12473
|
-
t.addColorStop(0,
|
|
12522
|
+
let t = n.createLinearGradient(0, 0, 0, cd);
|
|
12523
|
+
t.addColorStop(0, Vu(e.edgeColor, a)), t.addColorStop(.5, Vu(e.edgeColor, 0)), t.addColorStop(1, Vu(e.edgeColor, a)), n.fillStyle = t, n.fillRect(0, 0, sd, cd);
|
|
12474
12524
|
}
|
|
12475
12525
|
return t;
|
|
12476
12526
|
}
|
|
12477
|
-
function
|
|
12527
|
+
function Uu(e) {
|
|
12478
12528
|
return `${e.stops.map((e) => `${e.color}@${e.pos.toFixed(3)}`).join(",")}|${e.edgeColor}|${e.edgeAmount.toFixed(3)}`;
|
|
12479
12529
|
}
|
|
12480
|
-
function
|
|
12530
|
+
function Wu(e) {
|
|
12481
12531
|
return e.colorSpace = At, e.minFilter = z, e.magFilter = z, e.wrapS = he, e.wrapT = he, e.generateMipmaps = !1, e;
|
|
12482
12532
|
}
|
|
12483
|
-
function
|
|
12484
|
-
return
|
|
12533
|
+
function Gu(e) {
|
|
12534
|
+
return Wu(new yi(e));
|
|
12485
12535
|
}
|
|
12486
|
-
function
|
|
12487
|
-
return
|
|
12536
|
+
function Ku(e) {
|
|
12537
|
+
return Gu(Hu(e));
|
|
12488
12538
|
}
|
|
12489
|
-
function
|
|
12539
|
+
function qu(e) {
|
|
12490
12540
|
let t = document.createElement("canvas");
|
|
12491
12541
|
t.width = Math.max(1, Math.round(e.width)), t.height = Math.max(1, Math.round(e.height));
|
|
12492
12542
|
let n = t.getContext("2d");
|
|
@@ -12503,11 +12553,11 @@ function Bu(e) {
|
|
|
12503
12553
|
else for (let e of l) c.addColorStop(ml(e.pos), e.color);
|
|
12504
12554
|
return n.fillStyle = c, n.fillRect(0, 0, r, i), t;
|
|
12505
12555
|
}
|
|
12506
|
-
function
|
|
12556
|
+
function Ju(e) {
|
|
12507
12557
|
let t = ml(e), n = t <= .0031308 ? t * 12.92 : 1.055 * t ** (1 / 2.4) - .055;
|
|
12508
12558
|
return Math.round(ml(n) * 255);
|
|
12509
12559
|
}
|
|
12510
|
-
function
|
|
12560
|
+
function Yu(e, t, n, r) {
|
|
12511
12561
|
let i = Math.max(1, Math.round(n)), a = Math.max(1, Math.round(r)), o = new ImageData(i, a), s = o.data, c = e.length >= 2 ? e : yl(), l = c.map((e) => new X(e.color)), u = 4.8 + -3.4499999999999997 * ml(t);
|
|
12512
12562
|
for (let e = 0; e < a; e++) {
|
|
12513
12563
|
let t = 1 - e / Math.max(1, a - 1);
|
|
@@ -12518,12 +12568,12 @@ function Hu(e, t, n, r) {
|
|
|
12518
12568
|
a += l[e].r * s, o += l[e].g * s, d += l[e].b * s, f += s;
|
|
12519
12569
|
}
|
|
12520
12570
|
let p = Math.max(f, 1e-4), m = (e * i + n) * 4;
|
|
12521
|
-
s[m] =
|
|
12571
|
+
s[m] = Ju(a / p), s[m + 1] = Ju(o / p), s[m + 2] = Ju(d / p), s[m + 3] = 255;
|
|
12522
12572
|
}
|
|
12523
12573
|
}
|
|
12524
12574
|
return o;
|
|
12525
12575
|
}
|
|
12526
|
-
function
|
|
12576
|
+
function Xu(e, t, n, r) {
|
|
12527
12577
|
let i = document.createElement("canvas");
|
|
12528
12578
|
i.width = Math.max(1, Math.round(n)), i.height = Math.max(1, Math.round(r));
|
|
12529
12579
|
let a = i.getContext("2d");
|
|
@@ -12531,42 +12581,42 @@ function Uu(e, t, n, r) {
|
|
|
12531
12581
|
let o = Math.min(1, 320 / Math.max(i.width, i.height)), s = Math.max(2, Math.round(i.width * o)), c = Math.max(2, Math.round(i.height * o)), l = document.createElement("canvas");
|
|
12532
12582
|
l.width = s, l.height = c;
|
|
12533
12583
|
let u = l.getContext("2d");
|
|
12534
|
-
return u ? (u.putImageData(
|
|
12584
|
+
return u ? (u.putImageData(Yu(e, t, s, c), 0, 0), a.imageSmoothingEnabled = !0, a.imageSmoothingQuality = "high", a.drawImage(l, 0, 0, s, c, 0, 0, i.width, i.height), i) : i;
|
|
12535
12585
|
}
|
|
12536
|
-
function
|
|
12586
|
+
function Zu(e, t, n, r, i, a, o, s = 1, c = 0, l = 0) {
|
|
12537
12587
|
let u = document.createElement("canvas");
|
|
12538
|
-
return u.width = Math.max(1, Math.round(r)), u.height = Math.max(1, Math.round(i)),
|
|
12588
|
+
return u.width = Math.max(1, Math.round(r)), u.height = Math.max(1, Math.round(i)), Qu(u, e, t, n, a, o, s, c, l), u;
|
|
12539
12589
|
}
|
|
12540
|
-
function
|
|
12590
|
+
function Qu(e, t, n, r, i, a, o = 1, s = 0, c = 0) {
|
|
12541
12591
|
let l = e.getContext("2d");
|
|
12542
12592
|
if (!l) return;
|
|
12543
12593
|
l.fillStyle = a, l.fillRect(0, 0, e.width, e.height);
|
|
12544
12594
|
let u = Math.max(.1, o), d = i === "stretch" ? e.width : n * (i === "contain" ? Math.min(e.width / n, e.height / r) : Math.max(e.width / n, e.height / r)), f = i === "stretch" ? e.height : r * (i === "contain" ? Math.min(e.width / n, e.height / r) : Math.max(e.width / n, e.height / r)), p = d * u, m = f * u, h = s / 100 * e.width, g = c / 100 * e.height;
|
|
12545
12595
|
l.drawImage(t, (e.width - p) / 2 + h, (e.height - m) / 2 + g, p, m);
|
|
12546
12596
|
}
|
|
12547
|
-
function
|
|
12597
|
+
function $u(e) {
|
|
12548
12598
|
let t = (t, n) => {
|
|
12549
12599
|
let r = t * 374761393 + n * 668265263 + e * 1442695041 | 0;
|
|
12550
12600
|
return r = Math.imul(r ^ r >>> 13, 1274126177), ((r ^ r >>> 16) >>> 0) / 4294967295;
|
|
12551
12601
|
};
|
|
12552
12602
|
return (e, n) => {
|
|
12553
|
-
let r = Math.floor(e), i = Math.floor(n), a =
|
|
12603
|
+
let r = Math.floor(e), i = Math.floor(n), a = Bu(e - r), o = Bu(n - i), s = t(r, i), c = t(r + 1, i), l = t(r, i + 1), u = t(r + 1, i + 1);
|
|
12554
12604
|
return s * (1 - a) * (1 - o) + c * a * (1 - o) + l * (1 - a) * o + u * a * o;
|
|
12555
12605
|
};
|
|
12556
12606
|
}
|
|
12557
|
-
function
|
|
12607
|
+
function ed(e, t, n, r) {
|
|
12558
12608
|
let i = 0, a = .5, o = 1, s = 0;
|
|
12559
12609
|
for (let c = 0; c < r; c++) i += a * e(t * o, n * o), s += a, o *= 2, a *= .5;
|
|
12560
12610
|
return i / s;
|
|
12561
12611
|
}
|
|
12562
|
-
function
|
|
12563
|
-
let t = Math.max(64, Math.min(1280, Math.round(e))), n =
|
|
12612
|
+
function td(e = 220) {
|
|
12613
|
+
let t = Math.max(64, Math.min(1280, Math.round(e))), n = ud.get(t);
|
|
12564
12614
|
if (n) return n;
|
|
12565
12615
|
let r = document.createElement("canvas");
|
|
12566
12616
|
r.width = t, r.height = t;
|
|
12567
12617
|
let i = r.getContext("2d");
|
|
12568
12618
|
if (!i) return r;
|
|
12569
|
-
let a = i.createImageData(t, t), o =
|
|
12619
|
+
let a = i.createImageData(t, t), o = $u(11), s = $u(91), c = $u(47), l = [
|
|
12570
12620
|
[0, [
|
|
12571
12621
|
34,
|
|
12572
12622
|
26,
|
|
@@ -12610,24 +12660,24 @@ function Ju(e = 220) {
|
|
|
12610
12660
|
return l[l.length - 1][1];
|
|
12611
12661
|
};
|
|
12612
12662
|
for (let e = 0; e < t; e++) for (let n = 0; n < t; n++) {
|
|
12613
|
-
let r = n / t * 3, i = e / t * 3, l = r + .7 * s(r * .7 + 5, i * .7), d = i + .7 * s(r * .7, i * .7 + 9), [f, p, m] = u(
|
|
12663
|
+
let r = n / t * 3, i = e / t * 3, l = r + .7 * s(r * .7 + 5, i * .7), d = i + .7 * s(r * .7, i * .7 + 9), [f, p, m] = u(ed(o, l, d, 4)), h = Math.max(0, ed(c, l * 1.6 + 3, d * 1.6, 3) - .55) * 1.7;
|
|
12614
12664
|
f = f * (1 - h) + 70 * h, p = p * (1 - h) + 210 * h, m = m * (1 - h) + 200 * h;
|
|
12615
12665
|
let g = (e * t + n) * 4;
|
|
12616
12666
|
a.data[g] = f, a.data[g + 1] = p, a.data[g + 2] = m, a.data[g + 3] = 255;
|
|
12617
12667
|
}
|
|
12618
|
-
return i.putImageData(a, 0, 0),
|
|
12668
|
+
return i.putImageData(a, 0, 0), ud.set(t, r), r;
|
|
12619
12669
|
}
|
|
12620
|
-
function
|
|
12621
|
-
let i = `${e}|${t}x${n}`, a =
|
|
12670
|
+
function nd(e, t, n, r) {
|
|
12671
|
+
let i = `${e}|${t}x${n}`, a = dd.get(i);
|
|
12622
12672
|
if (a) return a;
|
|
12623
12673
|
let o = document.createElement("canvas");
|
|
12624
12674
|
o.width = t, o.height = n;
|
|
12625
12675
|
let s = o.getContext("2d");
|
|
12626
|
-
return s && r(s, t, n),
|
|
12676
|
+
return s && r(s, t, n), dd.set(i, o), o;
|
|
12627
12677
|
}
|
|
12628
|
-
function
|
|
12678
|
+
function rd(e = 240) {
|
|
12629
12679
|
let t = Math.max(120, Math.min(2048, Math.round(e)));
|
|
12630
|
-
return
|
|
12680
|
+
return nd("vaporwave", t, Math.round(t * 2 / 3), (e, t, n) => {
|
|
12631
12681
|
let r = t / 240, i = e.createLinearGradient(0, 0, 0, n);
|
|
12632
12682
|
i.addColorStop(0, "#120638"), i.addColorStop(.56, "#8e2de2"), i.addColorStop(1, "#ff2fa8"), e.fillStyle = i, e.fillRect(0, 0, t, n);
|
|
12633
12683
|
let a = n * .48, o = n * .28, s = e.createLinearGradient(0, a - o, 0, a + o);
|
|
@@ -12643,9 +12693,9 @@ function Xu(e = 240) {
|
|
|
12643
12693
|
e.globalAlpha = 1;
|
|
12644
12694
|
});
|
|
12645
12695
|
}
|
|
12646
|
-
function
|
|
12696
|
+
function id(e = 220) {
|
|
12647
12697
|
let t = Math.max(110, Math.min(2048, Math.round(e)));
|
|
12648
|
-
return
|
|
12698
|
+
return nd("kaleidoscope", t, t, (e, t, n) => {
|
|
12649
12699
|
let r = t / 220, i = [
|
|
12650
12700
|
"#00e5ff",
|
|
12651
12701
|
"#6c3bff",
|
|
@@ -12661,25 +12711,25 @@ function Zu(e = 220) {
|
|
|
12661
12711
|
for (let t = 1; t <= 4; t++) e.strokeStyle = t % 2 ? "rgba(255,255,255,.55)" : "rgba(8,5,35,.6)", e.lineWidth = 5 * r, e.beginPath(), e.arc(a, o, t * 25 * r, 0, Math.PI * 2), e.stroke();
|
|
12662
12712
|
});
|
|
12663
12713
|
}
|
|
12664
|
-
function
|
|
12665
|
-
return e.build ? e.build(t) :
|
|
12714
|
+
function ad(e, t) {
|
|
12715
|
+
return e.build ? e.build(t) : Hu({
|
|
12666
12716
|
stops: e.stops ?? [],
|
|
12667
12717
|
edgeColor: e.edgeColor ?? "#8e9dff",
|
|
12668
12718
|
edgeAmount: e.edgeAmount ?? 0
|
|
12669
12719
|
});
|
|
12670
12720
|
}
|
|
12671
|
-
function
|
|
12672
|
-
return
|
|
12721
|
+
function od(e) {
|
|
12722
|
+
return Wu(new Zi().load(e));
|
|
12673
12723
|
}
|
|
12674
|
-
var
|
|
12675
|
-
Vc(), hl(),
|
|
12724
|
+
var sd, cd, ld, ud, dd, fd, pd = t((() => {
|
|
12725
|
+
Vc(), hl(), Kl(), sd = 256, cd = 64, ld = (e) => e.map(([e, t]) => ({
|
|
12676
12726
|
color: e,
|
|
12677
12727
|
pos: t
|
|
12678
|
-
})),
|
|
12728
|
+
})), ud = /* @__PURE__ */ new Map(), dd = /* @__PURE__ */ new Map(), fd = {
|
|
12679
12729
|
palestine: {
|
|
12680
12730
|
label: "Palestine",
|
|
12681
12731
|
kind: "gradient",
|
|
12682
|
-
stops:
|
|
12732
|
+
stops: ld([
|
|
12683
12733
|
["#000000", 0],
|
|
12684
12734
|
["#f7f7f2", .34],
|
|
12685
12735
|
["#149954", .67],
|
|
@@ -12691,7 +12741,7 @@ var ed, td, nd, rd, id, ad, od = t((() => {
|
|
|
12691
12741
|
spain: {
|
|
12692
12742
|
label: "Spain",
|
|
12693
12743
|
kind: "gradient",
|
|
12694
|
-
stops:
|
|
12744
|
+
stops: ld([
|
|
12695
12745
|
["#aa151b", 0],
|
|
12696
12746
|
["#aa151b", .24],
|
|
12697
12747
|
["#f1bf00", .34],
|
|
@@ -12705,7 +12755,7 @@ var ed, td, nd, rd, id, ad, od = t((() => {
|
|
|
12705
12755
|
grandLine: {
|
|
12706
12756
|
label: "Grand Line",
|
|
12707
12757
|
kind: "gradient",
|
|
12708
|
-
stops:
|
|
12758
|
+
stops: ld([
|
|
12709
12759
|
["#071b33", 0],
|
|
12710
12760
|
["#087ea4", .22],
|
|
12711
12761
|
["#45d4c5", .4],
|
|
@@ -12720,22 +12770,22 @@ var ed, td, nd, rd, id, ad, od = t((() => {
|
|
|
12720
12770
|
vaporwave: {
|
|
12721
12771
|
label: "Vaporwave Sunset",
|
|
12722
12772
|
kind: "image",
|
|
12723
|
-
build:
|
|
12773
|
+
build: rd
|
|
12724
12774
|
},
|
|
12725
12775
|
kaleidoscope: {
|
|
12726
12776
|
label: "Kaleidoscope",
|
|
12727
12777
|
kind: "image",
|
|
12728
|
-
build:
|
|
12778
|
+
build: id
|
|
12729
12779
|
},
|
|
12730
12780
|
nebula: {
|
|
12731
12781
|
label: "Nebula (2D)",
|
|
12732
12782
|
kind: "image",
|
|
12733
|
-
build:
|
|
12783
|
+
build: td
|
|
12734
12784
|
},
|
|
12735
12785
|
sunset: {
|
|
12736
12786
|
label: "Sunset",
|
|
12737
12787
|
kind: "gradient",
|
|
12738
|
-
stops:
|
|
12788
|
+
stops: ld([
|
|
12739
12789
|
["#3b1c6b", 0],
|
|
12740
12790
|
["#8b2fa0", .3],
|
|
12741
12791
|
["#e0457a", .56],
|
|
@@ -12748,7 +12798,7 @@ var ed, td, nd, rd, id, ad, od = t((() => {
|
|
|
12748
12798
|
aurora: {
|
|
12749
12799
|
label: "Aurora",
|
|
12750
12800
|
kind: "gradient",
|
|
12751
|
-
stops:
|
|
12801
|
+
stops: ld([
|
|
12752
12802
|
["#0b3d4f", 0],
|
|
12753
12803
|
["#1fb89e", .3],
|
|
12754
12804
|
["#5ee0a0", .52],
|
|
@@ -12761,7 +12811,7 @@ var ed, td, nd, rd, id, ad, od = t((() => {
|
|
|
12761
12811
|
ocean: {
|
|
12762
12812
|
label: "Ocean",
|
|
12763
12813
|
kind: "gradient",
|
|
12764
|
-
stops:
|
|
12814
|
+
stops: ld([
|
|
12765
12815
|
["#0a1f4d", 0],
|
|
12766
12816
|
["#1f6fb8", .36],
|
|
12767
12817
|
["#2bd0d0", .66],
|
|
@@ -12773,7 +12823,7 @@ var ed, td, nd, rd, id, ad, od = t((() => {
|
|
|
12773
12823
|
ember: {
|
|
12774
12824
|
label: "Ember",
|
|
12775
12825
|
kind: "gradient",
|
|
12776
|
-
stops:
|
|
12826
|
+
stops: ld([
|
|
12777
12827
|
["#2a0707", 0],
|
|
12778
12828
|
["#a81e1e", .34],
|
|
12779
12829
|
["#ff5a2e", .64],
|
|
@@ -12785,7 +12835,7 @@ var ed, td, nd, rd, id, ad, od = t((() => {
|
|
|
12785
12835
|
iris: {
|
|
12786
12836
|
label: "Iris",
|
|
12787
12837
|
kind: "gradient",
|
|
12788
|
-
stops:
|
|
12838
|
+
stops: ld([
|
|
12789
12839
|
["#2e1065", 0],
|
|
12790
12840
|
["#7c3aed", .34],
|
|
12791
12841
|
["#db2777", .64],
|
|
@@ -12797,7 +12847,7 @@ var ed, td, nd, rd, id, ad, od = t((() => {
|
|
|
12797
12847
|
mono: {
|
|
12798
12848
|
label: "Mono",
|
|
12799
12849
|
kind: "gradient",
|
|
12800
|
-
stops:
|
|
12850
|
+
stops: ld([
|
|
12801
12851
|
["#16161e", 0],
|
|
12802
12852
|
["#6b7280", .4],
|
|
12803
12853
|
["#c2c8d2", .72],
|
|
@@ -12810,39 +12860,55 @@ var ed, td, nd, rd, id, ad, od = t((() => {
|
|
|
12810
12860
|
}));
|
|
12811
12861
|
//#endregion
|
|
12812
12862
|
//#region src/util/base64.ts
|
|
12813
|
-
function
|
|
12863
|
+
function md(e) {
|
|
12814
12864
|
let t = atob(e.replace(/-/g, "+").replace(/_/g, "/")), n = new Uint8Array(new ArrayBuffer(t.length));
|
|
12815
12865
|
for (let e = 0; e < t.length; e++) n[e] = t.charCodeAt(e);
|
|
12816
12866
|
return n;
|
|
12817
12867
|
}
|
|
12818
|
-
var
|
|
12868
|
+
var hd = t((() => {}));
|
|
12819
12869
|
//#endregion
|
|
12820
12870
|
//#region src/renderer/heroPalette.ts
|
|
12821
|
-
function
|
|
12871
|
+
function gd() {
|
|
12822
12872
|
let e = document.createElement("canvas");
|
|
12823
|
-
e.width =
|
|
12873
|
+
e.width = vd, e.height = vd;
|
|
12824
12874
|
let t = e.getContext("2d");
|
|
12825
12875
|
if (t) {
|
|
12826
|
-
let e =
|
|
12827
|
-
t.putImageData(new ImageData(new Uint8ClampedArray(e.buffer),
|
|
12876
|
+
let e = md(yd);
|
|
12877
|
+
t.putImageData(new ImageData(new Uint8ClampedArray(e.buffer), vd, vd), 0, 0);
|
|
12828
12878
|
}
|
|
12829
12879
|
return e;
|
|
12830
12880
|
}
|
|
12831
|
-
function
|
|
12832
|
-
let e =
|
|
12881
|
+
function _d() {
|
|
12882
|
+
let e = Wu(new ci(md(yd), vd, vd, U, Se));
|
|
12833
12883
|
return e.needsUpdate = !0, e;
|
|
12834
12884
|
}
|
|
12835
|
-
var
|
|
12836
|
-
Vc(),
|
|
12885
|
+
var vd, yd, bd = t((() => {
|
|
12886
|
+
Vc(), hd(), pd(), vd = 32, yd = "7PP//97s///O4/7/xt77/8vc7f/Y1sr/5c2f/+/EcP/2vEX/+rQp//2xGP/+rRv//J5M//uUf//7jp7/+4a3//2Ax//9g83//4vD//2bu//5kpv/83V+//Nbb//3VnT/81Sf/+tdxf/pid3/56Pr/+a58v/q1/P/6On3/+Xy/P/o8f//2ur+/8/j/P/O4ff/1tzc/+PSr//sx4X/879d//i3Of/8siD//rEP//6vD//9nz7//JJ4//uNnP/6h7f//IDJ//yEz//+jMX//Jq8//aOnf/xa3n/9Fxq//dief/1Y5v/8G62/+2K0v/tq+b/6Lby/+rP8v/q5fb/5vH7/+Pv///X6P7/0uT6/9bi8P/h2sf/682R//LCa//3ukn/+rQs//yxGv/+sQ7//q4T//2eRP/8knv/+o2e//eIuf/6g8v/+obR//yMx//6mb3/84uh//Bnef/1YWn/+nVx//lzj//1g6X/8pjC//Gz3f/stO//6cDx/+rf9P/m8fv/3uz//9Xm/f/V4vj/3d/r/+fWtP/xyHT/9r9R//m3N//7siP//bAW//6xDv/+qxr//ZpP//yPf//4jZ//9Yq6//eHzP/4itL/+o/K//iYvv/wiab/7mZ9//Zpbv/7gG///Il+//iYk//1pa//9LTO//Cx5v/qru7/69fy/+fw+v/Y6f7/1eL7/9nb9v/h2Of/7M+n//XCW//5uj3/+7Ur//yxHf/9rhX//q8Q//6mJP/9k1f/+4x///aNnv/zjbr/9Y3N//aR1f/4lM7/+JnC//COrv/ua4f/9m5y//uGc//8k3z/+qKI//aupP/1tMT/8J3b/+iJ6v/qzfD/6O75/9fl/f/Y3vn/3NPz/+TM4P/uxpr/+LxJ//u3MP/8syX//a8c//2sF//+rBb//p8w//2OX//7ioD/9o6e//KQu//zk8//9ZjX//ec0//4nsn/85i7//B3mf/1cHz/+oZ4//uSgf/6oYX/97Kg//Wpvv/vcdH/5W7n/+vG7f/p6vf/1d78/9nX9//fyu3/6MDN//O8fv/6uDv/+7Qr//yxJf/9rB///akd//6oIP/+mz3//oxm//uMg//2kaD/8pW9//Ob0f/2oNj/+aPX//ul1P/4o83/9Iyy//d7kP/6in3/+5OB//qhgv/5rpX/9pyy/+9czf/kZ+D/7L7q/+vk9f/S0/v/2s30/+O+4//ttK3/+LRW//u0Mf/8si7//K8q//2pJv/9pSj//qMu//6WSP/+jWv/+46F//aVo//zmr//9KHS//em2v/8qNr//qra//2q2P/5n8z/+Iuv//uOjP/7loH//KGA//ukjf/5kab/8VjD/+dq2P/tt+b/7t3y/9XJ+P/gwvD/6bPa//Osmf/6sEn/+7E1//ywNf/8ri///agu//2jNf/+nz3//pRT//6Pb//8k4j/95um//Shwv/1p9T/+Krc//yr2//+rdv//q3c//yp2v/5mM3/+pKp//ubhv/8oIH//J6L//yPmv/2a7D/63fL/++z4//w1u7/48D0/+257f/zr9n/96ic//urU//8rT//+689//yyMv/9ry///qk///6jUP/+nGT//pt6//yfj//4pKz/9ajG//at1v/6r9z//azb//+u3f//r93//q7e//ug3P/6lcn/+52g//ujhP/9nIz//ZKb//qJpP/zjrr/8rHc//PN6v/zuO//+7Ts//uw4f/7qK7//KVo//ynTf/7rEb//bU0//27Jv/9tz3//bJj//6weP/+sIj//a+a//mwsv/2scn/+LTY//uz3f/9rtz//7De//6w3//+reL//aXl//ya4P/8nML//KSZ//2cm//9mrD//aGz//uitf/4r87/9sPk//u07f//tO3//rLo//ymwP/8nYL//J9g//unU//8skL//b0v//zBQP/8xHD//saJ//7FlP/9waP/+725//i5y//5u9j/+rjd//yv3f/+r9///q7i//6r5v/9quj//aTp//2e2v/9oLr//aC1//2ouv/+s7b//rSz//ywwP/6uNn//bPs//6z6//+ruP//J7G//uRmv/7knn/+51m//yrUv/9tkb//MBZ//3Lf//+0pP//tSa//7PqP/8yb7/+sLM//vC1v/6v9z/+bHd//io4v/7pej//arp//2x6P/8ren//KHg//2hxf/9p7v//rC3//+4s///u7D//rS5//2x0f//tO3//7Lr//6n3f/8ksL/+oKl//mDkf/5kXz//KNi//2vWP/+vnH//suQ//7Umv/+2Zz//tan//7SwP/9ysn//srO//vF1P/3sdH/7p7b/+2c6P/2o+3/9Kvs//Gn7f/xn+L//KXF//6uuv//sLj//7S1//+5sf/+tLn//q7Q//+z7f//sen//p/W//uEuv/5daf/9ned//aFjv/6l3f//adp//65ff/+ypr//tGh//7Vn//+1af//ta9///Rv///0r///cvD//m1uP/vn8n/5Jff/96b6//Um/H/zZvy/9Wb6v/ypc7//6+8//+xuf//tLb//7mx//22vf/+rtT//q/q//2n4v/9jsr/+3Wy//drqP/0cKL/9H2Z//iOhv/8oHT//rV///7Hnv/+zqf//tGm//7Uqv/+2Ln//9az///Xsv/90bT//MSj//m6r//tqcn/0aDh/76a8v+9m/b/vZn0/9ue4f/8q8L//rO0//+5rv/+vqn//LrB//6v2v/8qef//JnY//x7vv/6Zq3/9mSn//NtpP/ze53/94qN//yceP/+sn3//sWb//7Oqf/+0an//tas//7cuf//27D//96r//7aqv/+1Jz//tSe//rLrP/htc3/waPr/7if9v+ymvn/zJzt//eoxf/+t6D//8WV//7Kmf/8v8L//a/c//yk5f/7jtL/+224//lcqv/2X6b/9Gyj//R8mv/4jIr//J53//6zfv/+xZr//s2o//7Sqf/+2K7//uC8///htf//46z//t2m//7XnP/+2Z///tmh//XLt//Osdr/s6Lx/7Kd9v/Ro+z/9qvH//64mf//y4j//s+S//zBwf/9sNv//aHk//uI0P/7Zbf/+Feq//Vdpv/0bqD/+IKR//uWfv/+qHf//rqI//7Gnv/+zaf//tSp//7bsP/+477//+W4///mrv//3qT//tic//7Yn//+2qH//NWr/967zP+6pOj/waTt/+Gt4P/4r8j//bWi///Hiv/+zpP//cDB//6v2//9oOT/+4bR//pkuf/3WK3/9F+o//Vynf/6jIX//qR1//61fv/+v5H//seg//7Npv/+1an//t2y//7kwP//5rj//+ex///fpv/+2J3//tie//7ZoP/91qb/5r7E/8am3//Yq97/9LbN//qzxf/8sa///r+R//7MlP/9vcL//q7b//yh5f/6iNP/+Gi8//Vdr//0Zan/93qW//yXev/+rXH//rp///6/kf/+xp///s6l//7WrP/+37j//uXE///kuP//57X//+Os//7Znv/+2J3//tme//3Sof/vu7z/4KvW/+6xz//7tsP/+7PC//uruf/9rJ7//bWd//yzxv/+rtv/+6Ll//iM1P/2b77/9GWw//Vvpf/5hoz//KBy//6ya//+unn//r+Q//7HoP/+z6n//tmz//7iwv/+58j//+K2///mt//+5rT//9ui//7Wnv/+057//smg//u5rv/4ssX/+rTF//u0wP/7sL//+p+7//mRrf/5lK3/+qXL//6u2//4o+X/9JDU//R5vf/1cq7/93ud//qQhf/7pW///bJm//67dP/+wY///smj//7Sr//+3Lz//uXK//7ny///37T//+O0//7isv/+0Jb//8WH///AjP/+upf//rSh//2zsf/7tLz/+7S7//yttf/6lbX/94Oz//WEtv/2n8///a7c//Gn5f/wltH/9IO5//h+pv/7h5X/+5WD//ukcP/9smL//r1t//7Dif/+yaD//tOy//7gw//+6M3//ujM///dsv//3q3//tur//7Agf//r2j//6px//+og//+pY3//qiX//ywov/8r6f//Kei//yVo//6hKv/9Ie3//Og0P/8rtz/563k/+mZzv/zibP/+oag//qLlf/5k4n/+6Jx//2zXf/+vWL//sJ5//7Hkv/+0av//uDC//3pyv/96Mz//tux///apf/+1qb//7h+//+lZf//nGf//5dt//+Tc///lXn//qN+//unjP/5nJ3//JWb//2Knv/2i7L/8KLR//uu3P/druT/4ZXN/+2FtP/1g6X/94Wd//iMj//6nXX//a5f//64Xv/+vW3//sKB//7KmP/+2bP//ebE//3nzf/+2bH//tWf//7Vpf/+toX//5xk//+RW///iFj//4Nc//+FYv/+l2j/+599//eQmv/3iKT/94aj/++HtP/tn9H/+q7d/9aq5f/ajND/5Hq7/+13rv/yeaL/9YCU//mPgf/8oW3//q1m//60a//+uHb//sKJ//7Spv/+48D//ufO//7Xsv/+0Zr//tSk//68kv//mGn//4ZP//9+S///elD//oJa//2Qav/5kIT/9YOX//N7pP/ueK7/5nu7/+iX0//5rd3/0aXp/9KB1v/ba8P/5Wa2/+xoqf/yb5v/936M//uUef/9pWz//qxr//6ucf/+u4X//tGl//7jwv/959H//tez//7PmP/+0KL//sWh//6rh//+i2D//3xQ//59VP/+iF///It1//d9j//ybpv/7Wmn/+Zmtv/dasP/447W//es3v/LpO7/yHnd/89czf/bU8H/5VW1/+5dpv/1cJT/+419//6ibf/+pWj//qZt//63hf/+0ar//eTJ//3o1f/+1rX//c2X//3Lof/+x6b//cCh//6dev/+hlz//ohd//6TZP/8iXn/9m2V/+5apv/mVbb/20/B/89YzP/ahdv/9are/8eo8v+/eeX/xFXW/9FIzP/fSML/6VC0//Nlnv/7ioH//qFt//6jaP/+q3H//rqL//3Ssf/95s///efa//7WuP/8y5j//Mik//7FqP/9xan//a6J//6caf/+kmL//ptn//yKe//0X5//6ky2/99Ew//RQcv/wk/V/9CB4f/yq+D/x7L3/76I7f/AZOH/zFXX/9pS0P/mVsb/8Guw//mRkP/8p3z//K15//y4hP/8w5v/+9W7//vm1v/75t///NbC//nMpP/6yq7//Mmy//vIs//7vZv//LWC//yldf/8o3X/+paM//FgtP/kT8n/20zR/8pN1v+9W+D/y4jn//Cs4f/Pw/v/xqL0/8aF6//PeeT/23Xf/+V32P/uhsf/9qWs//i3mv/4v5j/+Meh//jPsv/43Mn/9+jf//fm5v/31tb/9dXB//XWyP/31sr/99XI//fOt//3yqj/98Of//e9nv/2r6//7oXO/+R63f/beeH/z3vl/8aF7P/Soe3/8bHj/w==";
|
|
12837
12887
|
}));
|
|
12838
12888
|
//#endregion
|
|
12839
12889
|
//#region src/renderer/WaveRenderer.ts
|
|
12840
|
-
function
|
|
12841
|
-
let
|
|
12890
|
+
function xd(e, t, n, r = 0) {
|
|
12891
|
+
let i = e / wd, a = t / 750, o;
|
|
12892
|
+
switch (n) {
|
|
12893
|
+
case "contain":
|
|
12894
|
+
o = Math.min(i, a);
|
|
12895
|
+
break;
|
|
12896
|
+
case "width":
|
|
12897
|
+
o = i;
|
|
12898
|
+
break;
|
|
12899
|
+
case "height":
|
|
12900
|
+
o = a;
|
|
12901
|
+
break;
|
|
12902
|
+
default: o = Math.max(i, a);
|
|
12903
|
+
}
|
|
12904
|
+
return r > 0 && (o = Math.min(o, e / (wd * r))), o;
|
|
12905
|
+
}
|
|
12906
|
+
function Sd(e, t) {
|
|
12907
|
+
let n = Ed.set(e);
|
|
12842
12908
|
return t.set(n.r, n.g, n.b);
|
|
12843
12909
|
}
|
|
12844
|
-
var
|
|
12845
|
-
Vc(), nl(), il(), cl(), Zc(), fl(),
|
|
12910
|
+
var Cd, wd, Td, Ed, Dd, Od = t((() => {
|
|
12911
|
+
Vc(), nl(), il(), cl(), Zc(), fl(), su(), mu(), zu(), pd(), bd(), Kl(), Cd = 220, wd = 1333, Td = class {
|
|
12846
12912
|
makeVideo;
|
|
12847
12913
|
onVideoReady;
|
|
12848
12914
|
texture;
|
|
@@ -12855,8 +12921,8 @@ var hd, gd, _d, vd, yd, bd = t((() => {
|
|
|
12855
12921
|
}
|
|
12856
12922
|
apply(e, t) {
|
|
12857
12923
|
let n = e.paletteVideoUrl, r = e.paletteImageUrl, i = e.paletteSource ?? "hero", a, o;
|
|
12858
|
-
if (n) this.ensureVideo(n), this.video?.readyState && this.video.readyState >= 2 ? (a = "video|" + n, o = () =>
|
|
12859
|
-
else if (r) this.clearVideo(), a = "url|" + r, o = () =>
|
|
12924
|
+
if (n) this.ensureVideo(n), this.video?.readyState && this.video.readyState >= 2 ? (a = "video|" + n, o = () => Wu(new _i(this.video))) : (a = "video-loading|" + n, o = () => _d());
|
|
12925
|
+
else if (r) this.clearVideo(), a = "url|" + r, o = () => od(r);
|
|
12860
12926
|
else if (i === "stops") {
|
|
12861
12927
|
this.clearVideo();
|
|
12862
12928
|
let t = {
|
|
@@ -12864,8 +12930,8 @@ var hd, gd, _d, vd, yd, bd = t((() => {
|
|
|
12864
12930
|
edgeColor: e.paletteEdgeColor ?? "#8e9dff",
|
|
12865
12931
|
edgeAmount: e.paletteEdgeAmount ?? .3
|
|
12866
12932
|
};
|
|
12867
|
-
a = "stops|" +
|
|
12868
|
-
} else
|
|
12933
|
+
a = "stops|" + Uu(t), o = () => Ku(t);
|
|
12934
|
+
} else fd[i] ? (this.clearVideo(), a = "map|" + i, o = () => Gu(ad(fd[i]))) : (this.clearVideo(), a = "hero", o = () => _d());
|
|
12869
12935
|
(a !== this.sig || !this.texture) && (this.texture?.dispose(), this.texture = o(), this.sig = a), t.uPalette.value = this.texture, t.uUsePalette.value = e.usePaletteTexture === !1 ? 0 : 1, t.uPaletteRaw.value = 1;
|
|
12870
12936
|
}
|
|
12871
12937
|
syncPlayback(e, t) {
|
|
@@ -12888,7 +12954,7 @@ var hd, gd, _d, vd, yd, bd = t((() => {
|
|
|
12888
12954
|
dispose() {
|
|
12889
12955
|
this.texture?.dispose(), this.texture = void 0, this.clearVideo(), this.failedUrl = "";
|
|
12890
12956
|
}
|
|
12891
|
-
},
|
|
12957
|
+
}, Ed = new X(), Dd = class {
|
|
12892
12958
|
renderer;
|
|
12893
12959
|
scene = new Gn();
|
|
12894
12960
|
camera;
|
|
@@ -12896,6 +12962,12 @@ var hd, gd, _d, vd, yd, bd = t((() => {
|
|
|
12896
12962
|
composer;
|
|
12897
12963
|
postPass;
|
|
12898
12964
|
bloomPass;
|
|
12965
|
+
ditherPass;
|
|
12966
|
+
innerLightPass;
|
|
12967
|
+
halftonePass;
|
|
12968
|
+
heatmapPass;
|
|
12969
|
+
paperTexturePass;
|
|
12970
|
+
halftoneCmykPass;
|
|
12899
12971
|
container;
|
|
12900
12972
|
respectReducedMotion;
|
|
12901
12973
|
skipIntroRamp;
|
|
@@ -12935,6 +13007,9 @@ var hd, gd, _d, vd, yd, bd = t((() => {
|
|
|
12935
13007
|
resizeObserver;
|
|
12936
13008
|
intersectionObserver;
|
|
12937
13009
|
motionQuery;
|
|
13010
|
+
dprQuery;
|
|
13011
|
+
resizeRaf = 0;
|
|
13012
|
+
lastResize;
|
|
12938
13013
|
capturing = !1;
|
|
12939
13014
|
outputSize;
|
|
12940
13015
|
constructor(e, t, n = {}) {
|
|
@@ -12952,15 +13027,15 @@ var hd, gd, _d, vd, yd, bd = t((() => {
|
|
|
12952
13027
|
uGrainAmount: { value: t.grain },
|
|
12953
13028
|
uTime: { value: 0 }
|
|
12954
13029
|
},
|
|
12955
|
-
vertexShader:
|
|
12956
|
-
fragmentShader:
|
|
13030
|
+
vertexShader: $l,
|
|
13031
|
+
fragmentShader: eu
|
|
12957
13032
|
}), this.composer.addPass(this.postPass), this.composer.addPass(new sl()), this.motionQuery = window.matchMedia("(prefers-reduced-motion: reduce)"), this.reducedMotion = this.respectReducedMotion && this.motionQuery.matches, this.motionQuery.addEventListener("change", this.onMotionChange), document.addEventListener("visibilitychange", this.onVisibilityChange), this.intersectionObserver = new IntersectionObserver((e) => {
|
|
12958
13033
|
this.visible = e[0]?.isIntersecting ?? !0, this.updateRunning();
|
|
12959
|
-
}, { rootMargin: "100px" }), this.intersectionObserver.observe(e), this.resizeObserver = new ResizeObserver(this.onResize), this.resizeObserver.observe(e), this.applyBackground(), this.buildWaves(), this.resize();
|
|
13034
|
+
}, { rootMargin: "100px" }), this.intersectionObserver.observe(e), this.resizeObserver = new ResizeObserver(this.onResize), this.resizeObserver.observe(e), this.watchDpr(), this.applyBackground(), this.buildWaves(), this.resize();
|
|
12960
13035
|
}
|
|
12961
13036
|
get segments() {
|
|
12962
13037
|
let e = this.config.quality / Math.sqrt(Math.max(1, this.config.waves.length));
|
|
12963
|
-
return Gt.clamp(Math.round(
|
|
13038
|
+
return Gt.clamp(Math.round(Cd * e), 24, 360);
|
|
12964
13039
|
}
|
|
12965
13040
|
makeUniforms() {
|
|
12966
13041
|
let e = [], t = [];
|
|
@@ -13048,6 +13123,7 @@ var hd, gd, _d, vd, yd, bd = t((() => {
|
|
|
13048
13123
|
uPointerPush: { value: 0 },
|
|
13049
13124
|
uPointerWake: { value: 0 },
|
|
13050
13125
|
uPointerVel: { value: new G(0, 0) },
|
|
13126
|
+
uShapeFlow: { value: 0 },
|
|
13051
13127
|
uPointerThin: { value: 0 },
|
|
13052
13128
|
uPointerHue: { value: 0 },
|
|
13053
13129
|
uPointerLighten: { value: 0 },
|
|
@@ -13061,14 +13137,14 @@ var hd, gd, _d, vd, yd, bd = t((() => {
|
|
|
13061
13137
|
let t = {};
|
|
13062
13138
|
e?.twistMotion && (t.TWIST_MOTION = ""), (this.config.loopSeconds ?? 0) > 0 && (t.LOOP_MOTION = "");
|
|
13063
13139
|
let n = e?.interaction?.bindings?.some((e) => e.target === "detailAmount") ?? !1;
|
|
13064
|
-
return ((e?.detailAmount ?? 0) !== 0 || n) && (t.DETAIL_OCTAVE = ""), (e?.depthTint ?? 0) > 0 && (t.DEPTH_TINT = ""), (e?.edgeFeather ?? .1) !== .1 && (t.EDGE_FEATHER = ""), e &&
|
|
13140
|
+
return ((e?.detailAmount ?? 0) !== 0 || n) && (t.DETAIL_OCTAVE = ""), (e?.depthTint ?? 0) > 0 && (t.DEPTH_TINT = ""), (e?.edgeFeather ?? .1) !== .1 && (t.EDGE_FEATHER = ""), e && yu(this.config, e) && (t.POINTER_FX = "", bu(this.config, e) && (t.POINTER_RIPPLES = "")), t;
|
|
13065
13141
|
}
|
|
13066
13142
|
addWave() {
|
|
13067
|
-
let e = new
|
|
13143
|
+
let e = new pu(this.segments), t = this.config.waves[this.waves.length] ?? this.config.waves[0], n = new Oi({
|
|
13068
13144
|
uniforms: this.makeUniforms(),
|
|
13069
13145
|
defines: this.waveDefines(t),
|
|
13070
|
-
vertexShader:
|
|
13071
|
-
fragmentShader: t?.theme === "wireframe" ?
|
|
13146
|
+
vertexShader: Xl,
|
|
13147
|
+
fragmentShader: t?.theme === "wireframe" ? Ql : Zl,
|
|
13072
13148
|
transparent: !0,
|
|
13073
13149
|
depthTest: !0,
|
|
13074
13150
|
depthWrite: !0,
|
|
@@ -13077,7 +13153,7 @@ var hd, gd, _d, vd, yd, bd = t((() => {
|
|
|
13077
13153
|
this.applyBlendMode(n, t?.blendMode ?? "squared");
|
|
13078
13154
|
let r = new si(e.geometry, n);
|
|
13079
13155
|
r.frustumCulled = !1, this.group.add(r);
|
|
13080
|
-
let i = new
|
|
13156
|
+
let i = new Td((e) => this.createLoopingVideo(e), () => {
|
|
13081
13157
|
this.updatePaletteTextures(), this.syncVideoPlayback(), this.running || this.renderOnce();
|
|
13082
13158
|
});
|
|
13083
13159
|
this.waves.push({
|
|
@@ -13118,7 +13194,7 @@ var hd, gd, _d, vd, yd, bd = t((() => {
|
|
|
13118
13194
|
this.applyBlendMode(e.material, n.blendMode) && (e.material.needsUpdate = !0);
|
|
13119
13195
|
let i = this.waveDefines(n), a = e.material.defines ?? {};
|
|
13120
13196
|
Object.keys(i).sort().join(",") !== Object.keys(a).sort().join(",") && (e.material.defines = i, e.material.needsUpdate = !0);
|
|
13121
|
-
let o = n.theme === "wireframe" ?
|
|
13197
|
+
let o = n.theme === "wireframe" ? Ql : Zl;
|
|
13122
13198
|
e.material.fragmentShader !== o && (e.material.fragmentShader = o, e.material.needsUpdate = !0);
|
|
13123
13199
|
let s = [...n.palette].sort((e, t) => e.pos - t.pos), c = Math.max(1, Math.min(s.length, 8)), l = r.uColors.value, u = r.uColorPos.value;
|
|
13124
13200
|
for (let e = 0; e < 8; e++) {
|
|
@@ -13126,21 +13202,21 @@ var hd, gd, _d, vd, yd, bd = t((() => {
|
|
|
13126
13202
|
color: "#ffffff",
|
|
13127
13203
|
pos: 0
|
|
13128
13204
|
};
|
|
13129
|
-
|
|
13205
|
+
Sd(t.color, l[e]), u[e] = t.pos;
|
|
13130
13206
|
}
|
|
13131
13207
|
r.uColorCount.value = c, r.uGradType.value = n.gradientType === "radial" ? 1 : n.gradientType === "conic" ? 2 : n.gradientType === "mesh" ? 3 : 0, r.uGradAngle.value = (n.gradientAngle ?? 0) * Math.PI / 180, r.uGradShift.value = n.gradientShift ?? 0;
|
|
13132
13208
|
let d = n.meshGradientPoints.slice(0, 8), f = r.uMeshPointPos.value, p = r.uMeshPointColor.value, m = r.uMeshPointInfluence.value;
|
|
13133
13209
|
for (let e = 0; e < 8; e++) {
|
|
13134
13210
|
let t = d[e] ?? d[d.length - 1];
|
|
13135
|
-
t && (f[e].set(t.x, t.y),
|
|
13211
|
+
t && (f[e].set(t.x, t.y), Sd(t.color, p[e]), m[e] = t.influence);
|
|
13136
13212
|
}
|
|
13137
|
-
r.uMeshPointCount.value = d.length, r.uMeshSoftness.value = n.meshGradientSoftness, r.uPaletteScale.value.set(n.paletteTextureScale?.x ?? 1, n.paletteTextureScale?.y ?? 1), r.uPaletteOffset.value.set(n.paletteTextureOffset?.x ?? 0, n.paletteTextureOffset?.y ?? 0), r.uPaletteRotation.value = (n.paletteTextureRotation ?? 0) * Math.PI / 180, r.uHueShift.value = n.hueShift, r.uContrast.value = n.colorContrast, r.uSaturation.value = n.colorSaturation, r.uLineAmount.value = n.lineAmount ?? 425, r.uLineThickness.value = n.lineThickness ?? 1, r.uLineDerivativePower.value = n.lineDerivativePower ?? .95, r.uMaxWidth.value = n.maxWidth ?? 1232,
|
|
13213
|
+
r.uMeshPointCount.value = d.length, r.uMeshSoftness.value = n.meshGradientSoftness, r.uPaletteScale.value.set(n.paletteTextureScale?.x ?? 1, n.paletteTextureScale?.y ?? 1), r.uPaletteOffset.value.set(n.paletteTextureOffset?.x ?? 0, n.paletteTextureOffset?.y ?? 0), r.uPaletteRotation.value = (n.paletteTextureRotation ?? 0) * Math.PI / 180, r.uHueShift.value = n.hueShift, r.uContrast.value = n.colorContrast, r.uSaturation.value = n.colorSaturation, r.uLineAmount.value = n.lineAmount ?? 425, r.uLineThickness.value = n.lineThickness ?? 1, r.uLineDerivativePower.value = n.lineDerivativePower ?? .95, r.uMaxWidth.value = n.maxWidth ?? 1232, Sd(this.config.background, r.uClearColor.value), r.uFiberCount.value = n.fiberCount, r.uFiberStrength.value = n.fiberStrength, r.uTexture.value = n.texture, r.uCreaseLight.value = n.creaseLight, r.uCreaseSharpness.value = n.creaseSharpness, r.uCreaseSoftness.value = n.creaseSoftness, r.uSheen.value = n.sheen ?? 1, r.uRoundness.value = n.roundness ?? .35, r.uIridescence.value = n.iridescence ?? 0, r.uDepthTint.value = n.depthTint ?? 0, Sd(n.depthTintColor ?? "#0a2540", r.uDepthTintColor.value), r.uEdgeFade.value = n.edgeFade, r.uEdgeFeather.value = n.edgeFeather ?? .1;
|
|
13138
13214
|
let h = this.config.lights ?? [];
|
|
13139
13215
|
r.uAmbient.value = this.config.ambient ?? .45, r.uNumLights.value = Math.min(h.length, 8);
|
|
13140
13216
|
let g = r.uLightPos.value, _ = r.uLightColor.value, v = r.uLightIntensity.value;
|
|
13141
13217
|
for (let e = 0; e < 8; e++) {
|
|
13142
13218
|
let t = h[e];
|
|
13143
|
-
t ? (g[e].set(t.position.x, t.position.y, t.position.z),
|
|
13219
|
+
t ? (g[e].set(t.position.x, t.position.y, t.position.z), Sd(t.color, _[e]), v[e] = t.intensity) : v[e] = 0;
|
|
13144
13220
|
}
|
|
13145
13221
|
let y = n.noiseBands ?? [];
|
|
13146
13222
|
r.uNumNoiseBands.value = Math.min(y.length, 4);
|
|
@@ -13151,12 +13227,12 @@ var hd, gd, _d, vd, yd, bd = t((() => {
|
|
|
13151
13227
|
}
|
|
13152
13228
|
r.uSpeed.value = n.speed, r.uSeed.value = n.seed, r.uLoopSeconds.value = this.config.loopSeconds ?? 0, r.uDispFreqX.value = n.displaceFrequency.x, r.uDispFreqZ.value = n.displaceFrequency.y, r.uDispAmount.value = n.displaceAmount, r.uDetailFreq.value = n.detailFrequency ?? .04, r.uDetailAmount.value = n.detailAmount ?? 0, r.uTwFreqX.value = n.twistFrequency.x, r.uTwFreqY.value = n.twistFrequency.y, r.uTwFreqZ.value = n.twistFrequency.z, r.uTwPowX.value = n.twistPower.x, r.uTwPowY.value = n.twistPower.y, r.uTwPowZ.value = n.twistPower.z, e.mesh.scale.set(n.scale.x, n.scale.y, n.scale.z), e.mesh.rotation.set(Gt.degToRad(n.rotation.x), Gt.degToRad(n.rotation.y), Gt.degToRad(n.rotation.z)), e.mesh.position.set(n.position.x, n.position.y, n.position.z), r.uOpacity.value = n.opacity;
|
|
13153
13229
|
});
|
|
13154
|
-
let e = (this.config.interaction?.radius ?? .3) * 2;
|
|
13155
|
-
this.waves.forEach((
|
|
13156
|
-
let
|
|
13157
|
-
if (!
|
|
13158
|
-
let
|
|
13159
|
-
|
|
13230
|
+
let e = (this.config.interaction?.radius ?? .3) * 2, t = this.config.interaction?.ribbonFlow ?? .8;
|
|
13231
|
+
this.waves.forEach((n, r) => {
|
|
13232
|
+
let i = this.config.waves[r] ?? this.config.waves[this.config.waves.length - 1];
|
|
13233
|
+
if (!yu(this.config, i)) return;
|
|
13234
|
+
let a = n.material.uniforms, o = i.interaction?.hover;
|
|
13235
|
+
a.uPointerRadius.value = e, a.uPointerAgitate.value = o?.agitate ?? 0, a.uPointerPush.value = o?.push ?? 0, a.uPointerWake.value = o?.wake ?? 0, a.uPointerThin.value = o?.thin ?? 0, a.uPointerHue.value = o?.hueShift ?? 0, a.uPointerLighten.value = o?.lighten ?? 0, a.uPointerRipple.value = i.interaction?.press?.ripple ?? 0, a.uShapeFlow.value = t;
|
|
13160
13236
|
}), this.updatePaletteTextures(), this.syncVideoPlayback(), this.group.scale.set(this.config.mirrorH ? -1 : 1, this.config.mirrorV ? -1 : 1, 1), this.onAfterRefresh(), this.running || this.renderOnce();
|
|
13161
13237
|
}
|
|
13162
13238
|
updatePaletteTextures() {
|
|
@@ -13200,13 +13276,13 @@ var hd, gd, _d, vd, yd, bd = t((() => {
|
|
|
13200
13276
|
t
|
|
13201
13277
|
].join("|");
|
|
13202
13278
|
if (a !== this.backgroundSig || !this.backgroundTexture) {
|
|
13203
|
-
let i =
|
|
13204
|
-
this.backgroundTexture?.dispose(), this.backgroundTexture =
|
|
13279
|
+
let i = Xu(n, r, e, t);
|
|
13280
|
+
this.backgroundTexture?.dispose(), this.backgroundTexture = Gu(i), this.backgroundSig = a;
|
|
13205
13281
|
}
|
|
13206
13282
|
this.scene.background = this.backgroundTexture;
|
|
13207
13283
|
return;
|
|
13208
13284
|
}
|
|
13209
|
-
let r = this.config.backgroundGradientSource ?? "stops", i =
|
|
13285
|
+
let r = this.config.backgroundGradientSource ?? "stops", i = fd[r], a = r !== "stops" && i?.kind === "gradient" && i.stops ? i.stops : this.config.backgroundPalette, o = a.map((e) => `${e.color}@${e.pos.toFixed(3)}`).join(","), s = [
|
|
13210
13286
|
"gradient",
|
|
13211
13287
|
r,
|
|
13212
13288
|
n,
|
|
@@ -13216,14 +13292,14 @@ var hd, gd, _d, vd, yd, bd = t((() => {
|
|
|
13216
13292
|
t
|
|
13217
13293
|
].join("|");
|
|
13218
13294
|
if (s !== this.backgroundSig || !this.backgroundTexture) {
|
|
13219
|
-
let r =
|
|
13295
|
+
let r = qu({
|
|
13220
13296
|
stops: a,
|
|
13221
13297
|
type: n,
|
|
13222
13298
|
angle: this.config.backgroundGradientAngle,
|
|
13223
13299
|
width: e,
|
|
13224
13300
|
height: t
|
|
13225
13301
|
});
|
|
13226
|
-
this.backgroundTexture?.dispose(), this.backgroundTexture =
|
|
13302
|
+
this.backgroundTexture?.dispose(), this.backgroundTexture = Gu(r), this.backgroundSig = s;
|
|
13227
13303
|
}
|
|
13228
13304
|
this.scene.background = this.backgroundTexture;
|
|
13229
13305
|
}
|
|
@@ -13246,7 +13322,7 @@ var hd, gd, _d, vd, yd, bd = t((() => {
|
|
|
13246
13322
|
c = this.backgroundImage, l = this.backgroundImage.naturalWidth, u = this.backgroundImage.naturalHeight, d = `custom|${s}`;
|
|
13247
13323
|
} else {
|
|
13248
13324
|
this.clearBackgroundVideo();
|
|
13249
|
-
let r = this.config.backgroundImageSource ?? "vaporwave", i = r === "hero" ?
|
|
13325
|
+
let r = this.config.backgroundImageSource ?? "vaporwave", i = r === "hero" ? gd() : fd[r]?.kind === "image" ? ad(fd[r], Math.max(t, n)) : null;
|
|
13250
13326
|
if (!i) {
|
|
13251
13327
|
this.scene.background = e;
|
|
13252
13328
|
return;
|
|
@@ -13265,8 +13341,8 @@ var hd, gd, _d, vd, yd, bd = t((() => {
|
|
|
13265
13341
|
n
|
|
13266
13342
|
].join("|");
|
|
13267
13343
|
if (f !== this.backgroundSig || !this.backgroundTexture) {
|
|
13268
|
-
let e =
|
|
13269
|
-
this.backgroundTexture?.dispose(), this.backgroundTexture =
|
|
13344
|
+
let e = Zu(c, l, u, t, n, r, this.config.background, i, a.x, a.y);
|
|
13345
|
+
this.backgroundTexture?.dispose(), this.backgroundTexture = Gu(e), this.backgroundSig = f, this.backgroundVideoCanvas = o ? e : void 0;
|
|
13270
13346
|
}
|
|
13271
13347
|
this.scene.background = this.backgroundTexture;
|
|
13272
13348
|
}
|
|
@@ -13318,11 +13394,11 @@ var hd, gd, _d, vd, yd, bd = t((() => {
|
|
|
13318
13394
|
x: 0,
|
|
13319
13395
|
y: 0
|
|
13320
13396
|
};
|
|
13321
|
-
|
|
13397
|
+
Qu(t, e, e.videoWidth, e.videoHeight, this.config.backgroundImageFit ?? "cover", this.config.background, this.config.backgroundImageZoom ?? 1, n.x, n.y), this.backgroundTexture.needsUpdate = !0;
|
|
13322
13398
|
}
|
|
13323
13399
|
applyPost() {
|
|
13324
13400
|
let e = this.postPass.uniforms;
|
|
13325
|
-
e.uBlurAmount.value = this.config.blur, e.uGrainAmount.value = this.config.grain, e.uBlurSamples.value = Math.round(this.config.blurSamples ?? 6), this.applyBloom();
|
|
13401
|
+
e.uBlurAmount.value = this.config.blur, e.uGrainAmount.value = this.config.grain, e.uBlurSamples.value = Math.round(this.config.blurSamples ?? 6), this.applyBloom(), this.applyInnerLight(), this.applyHalftone(), this.applyHeatmap(), this.applyHalftoneCmyk(), this.applyPaperTexture(), this.applyDither();
|
|
13326
13402
|
}
|
|
13327
13403
|
applyBloom() {
|
|
13328
13404
|
let e = this.config.bloomStrength ?? 0;
|
|
@@ -13334,9 +13410,124 @@ var hd, gd, _d, vd, yd, bd = t((() => {
|
|
|
13334
13410
|
this.bloomPass.strength = e, this.bloomPass.radius = this.config.bloomRadius ?? .4, this.bloomPass.threshold = this.config.bloomThreshold ?? .85;
|
|
13335
13411
|
} else this.bloomPass &&= (this.composer.removePass(this.bloomPass), this.bloomPass.dispose(), void 0);
|
|
13336
13412
|
}
|
|
13413
|
+
applyDither() {
|
|
13414
|
+
let e = this.config.dither ?? 0;
|
|
13415
|
+
if (e > 0) {
|
|
13416
|
+
this.ditherPass || (this.ditherPass = new Xc({
|
|
13417
|
+
uniforms: {
|
|
13418
|
+
tDiffuse: { value: null },
|
|
13419
|
+
uResolution: { value: this.renderer.getDrawingBufferSize(new G()) },
|
|
13420
|
+
uDitherStrength: { value: e },
|
|
13421
|
+
uDitherScale: { value: this.config.ditherScale ?? 2 },
|
|
13422
|
+
uDitherSteps: { value: this.config.ditherSteps ?? 4 }
|
|
13423
|
+
},
|
|
13424
|
+
vertexShader: $l,
|
|
13425
|
+
fragmentShader: tu
|
|
13426
|
+
}), this.composer.addPass(this.ditherPass));
|
|
13427
|
+
let t = this.ditherPass.uniforms;
|
|
13428
|
+
t.uDitherStrength.value = e, t.uDitherScale.value = Math.max(1, this.config.ditherScale ?? 2), t.uDitherSteps.value = Math.max(2, Math.round(this.config.ditherSteps ?? 4));
|
|
13429
|
+
} else this.ditherPass &&= (this.composer.removePass(this.ditherPass), this.ditherPass.dispose(), void 0);
|
|
13430
|
+
}
|
|
13431
|
+
applyInnerLight() {
|
|
13432
|
+
let e = this.config.innerLight ?? 0;
|
|
13433
|
+
if (e > 0) {
|
|
13434
|
+
let t = this.config.innerLightX ?? .5, n = this.config.innerLightY ?? .15;
|
|
13435
|
+
this.innerLightPass || (this.innerLightPass = new Xc({
|
|
13436
|
+
uniforms: {
|
|
13437
|
+
tDiffuse: { value: null },
|
|
13438
|
+
uInnerLight: { value: e },
|
|
13439
|
+
uInnerLightDensity: { value: this.config.innerLightDensity ?? .5 },
|
|
13440
|
+
uInnerLightDecay: { value: this.config.innerLightDecay ?? .95 },
|
|
13441
|
+
uInnerLightCenter: { value: new G(t, n) }
|
|
13442
|
+
},
|
|
13443
|
+
vertexShader: $l,
|
|
13444
|
+
fragmentShader: nu
|
|
13445
|
+
}), this.composer.insertPass(this.innerLightPass, 1));
|
|
13446
|
+
let r = this.innerLightPass.uniforms;
|
|
13447
|
+
r.uInnerLight.value = e, r.uInnerLightDensity.value = this.config.innerLightDensity ?? .5, r.uInnerLightDecay.value = this.config.innerLightDecay ?? .95, r.uInnerLightCenter.value.set(t, n);
|
|
13448
|
+
} else this.innerLightPass &&= (this.composer.removePass(this.innerLightPass), this.innerLightPass.dispose(), void 0);
|
|
13449
|
+
}
|
|
13450
|
+
applyHalftone() {
|
|
13451
|
+
let e = this.config.halftone ?? 0;
|
|
13452
|
+
if (e > 0) {
|
|
13453
|
+
this.halftonePass || (this.halftonePass = new Xc({
|
|
13454
|
+
uniforms: {
|
|
13455
|
+
tDiffuse: { value: null },
|
|
13456
|
+
uResolution: { value: this.renderer.getDrawingBufferSize(new G()) },
|
|
13457
|
+
uHalftone: { value: e },
|
|
13458
|
+
uHalftoneCell: { value: this.config.halftoneCell ?? 6 },
|
|
13459
|
+
uHalftoneAngle: { value: this.config.halftoneAngle ?? .4 }
|
|
13460
|
+
},
|
|
13461
|
+
vertexShader: $l,
|
|
13462
|
+
fragmentShader: ru
|
|
13463
|
+
}), this.composer.addPass(this.halftonePass));
|
|
13464
|
+
let t = this.halftonePass.uniforms;
|
|
13465
|
+
t.uHalftone.value = e, t.uHalftoneCell.value = Math.max(2, this.config.halftoneCell ?? 6), t.uHalftoneAngle.value = this.config.halftoneAngle ?? .4;
|
|
13466
|
+
} else this.halftonePass &&= (this.composer.removePass(this.halftonePass), this.halftonePass.dispose(), void 0);
|
|
13467
|
+
}
|
|
13468
|
+
applyHeatmap() {
|
|
13469
|
+
let e = this.config.heatmap ?? 0;
|
|
13470
|
+
e > 0 ? (this.heatmapPass || (this.heatmapPass = new Xc({
|
|
13471
|
+
uniforms: {
|
|
13472
|
+
tDiffuse: { value: null },
|
|
13473
|
+
uHeatmap: { value: e }
|
|
13474
|
+
},
|
|
13475
|
+
vertexShader: $l,
|
|
13476
|
+
fragmentShader: iu
|
|
13477
|
+
}), this.composer.addPass(this.heatmapPass)), this.heatmapPass.uniforms.uHeatmap.value = e) : this.heatmapPass &&= (this.composer.removePass(this.heatmapPass), this.heatmapPass.dispose(), void 0);
|
|
13478
|
+
}
|
|
13479
|
+
applyPaperTexture() {
|
|
13480
|
+
let e = this.config.paperTexture ?? 0;
|
|
13481
|
+
if (e > 0) {
|
|
13482
|
+
this.paperTexturePass || (this.paperTexturePass = new Xc({
|
|
13483
|
+
uniforms: {
|
|
13484
|
+
tDiffuse: { value: null },
|
|
13485
|
+
uPaper: { value: e },
|
|
13486
|
+
uPaperScale: { value: this.config.paperTextureScale ?? 2 }
|
|
13487
|
+
},
|
|
13488
|
+
vertexShader: $l,
|
|
13489
|
+
fragmentShader: au
|
|
13490
|
+
}), this.composer.addPass(this.paperTexturePass));
|
|
13491
|
+
let t = this.paperTexturePass.uniforms;
|
|
13492
|
+
t.uPaper.value = e, t.uPaperScale.value = Math.max(.5, this.config.paperTextureScale ?? 2);
|
|
13493
|
+
} else this.paperTexturePass &&= (this.composer.removePass(this.paperTexturePass), this.paperTexturePass.dispose(), void 0);
|
|
13494
|
+
}
|
|
13495
|
+
applyHalftoneCmyk() {
|
|
13496
|
+
let e = this.config.halftoneCmyk ?? 0;
|
|
13497
|
+
if (e > 0) {
|
|
13498
|
+
this.halftoneCmykPass || (this.halftoneCmykPass = new Xc({
|
|
13499
|
+
uniforms: {
|
|
13500
|
+
tDiffuse: { value: null },
|
|
13501
|
+
uHalftoneCmyk: { value: e },
|
|
13502
|
+
uHalftoneCmykCell: { value: this.config.halftoneCmykCell ?? 6 }
|
|
13503
|
+
},
|
|
13504
|
+
vertexShader: $l,
|
|
13505
|
+
fragmentShader: ou
|
|
13506
|
+
}), this.composer.addPass(this.halftoneCmykPass));
|
|
13507
|
+
let t = this.halftoneCmykPass.uniforms;
|
|
13508
|
+
t.uHalftoneCmyk.value = e, t.uHalftoneCmykCell.value = Math.max(2, this.config.halftoneCmykCell ?? 6);
|
|
13509
|
+
} else this.halftoneCmykPass &&= (this.composer.removePass(this.halftoneCmykPass), this.halftoneCmykPass.dispose(), void 0);
|
|
13510
|
+
}
|
|
13337
13511
|
onResize = () => {
|
|
13338
|
-
this.
|
|
13512
|
+
this.resizeRaf ||= requestAnimationFrame(() => {
|
|
13513
|
+
this.resizeRaf = 0;
|
|
13514
|
+
let e = this.viewportMetrics(), t = this.lastResize;
|
|
13515
|
+
t && e.w === t.w && e.h === t.h && e.dpr === t.dpr || this.resize();
|
|
13516
|
+
});
|
|
13339
13517
|
};
|
|
13518
|
+
onDprChange = () => {
|
|
13519
|
+
this.watchDpr(), this.resize();
|
|
13520
|
+
};
|
|
13521
|
+
watchDpr() {
|
|
13522
|
+
this.dprQuery?.removeEventListener("change", this.onDprChange), this.dprQuery = window.matchMedia(`(resolution: ${window.devicePixelRatio || 1}dppx)`), this.dprQuery.addEventListener("change", this.onDprChange);
|
|
13523
|
+
}
|
|
13524
|
+
viewportMetrics() {
|
|
13525
|
+
return {
|
|
13526
|
+
w: this.outputSize?.width ?? Math.max(1, this.container.clientWidth),
|
|
13527
|
+
h: this.outputSize?.height ?? Math.max(1, this.container.clientHeight),
|
|
13528
|
+
dpr: this.outputSize ? 1 : Math.min(window.devicePixelRatio || 1, this.config.dprMax)
|
|
13529
|
+
};
|
|
13530
|
+
}
|
|
13340
13531
|
onContextLost = (e) => {
|
|
13341
13532
|
e.preventDefault(), cancelAnimationFrame(this.rafId), this.running = !1;
|
|
13342
13533
|
};
|
|
@@ -13344,10 +13535,14 @@ var hd, gd, _d, vd, yd, bd = t((() => {
|
|
|
13344
13535
|
this.disposeWaves(), this.backgroundTexture?.dispose(), this.backgroundTexture = void 0, this.backgroundSig = "", this.buildWaves(), this.resize(), this.updateRunning();
|
|
13345
13536
|
};
|
|
13346
13537
|
resize() {
|
|
13347
|
-
let
|
|
13348
|
-
this.
|
|
13538
|
+
let { w: e, h: t, dpr: n } = this.viewportMetrics();
|
|
13539
|
+
this.lastResize = {
|
|
13540
|
+
w: e,
|
|
13541
|
+
h: t,
|
|
13542
|
+
dpr: n
|
|
13543
|
+
}, this.renderer.setPixelRatio(n), this.renderer.setSize(e, t, !this.outputSize), this.outputSize && (this.renderer.domElement.style.width = "100%", this.renderer.domElement.style.height = "100%"), this.composer.setPixelRatio(n), this.composer.setSize(e, t);
|
|
13349
13544
|
let r = e * n, i = t * n;
|
|
13350
|
-
this.postPass.uniforms.uResolution.value.set(r, i);
|
|
13545
|
+
this.postPass.uniforms.uResolution.value.set(r, i), this.ditherPass && this.ditherPass.uniforms.uResolution.value.set(r, i), this.halftonePass && this.halftonePass.uniforms.uResolution.value.set(r, i);
|
|
13351
13546
|
for (let e of this.waves) e.material.uniforms.uResolution.value.set(r, i);
|
|
13352
13547
|
this.camera.left = -r / 2, this.camera.right = r / 2, this.camera.top = i / 2, this.camera.bottom = -i / 2, this.applyZoom(), this.applyBackground(), this.onAfterResize(), this.running || this.renderOnce();
|
|
13353
13548
|
}
|
|
@@ -13396,8 +13591,8 @@ var hd, gd, _d, vd, yd, bd = t((() => {
|
|
|
13396
13591
|
this.updateBackgroundVideoFrame(), this.updateTime(), this.applyInteraction(), this.updateClipPlanes(), this.composer.render(), this.onAfterRenderFrame();
|
|
13397
13592
|
}
|
|
13398
13593
|
syncInteraction() {
|
|
13399
|
-
let e =
|
|
13400
|
-
e && !this.interaction ? this.interaction = new
|
|
13594
|
+
let e = Su(this.config);
|
|
13595
|
+
e && !this.interaction ? this.interaction = new Ru(this.container, () => this.config) : !e && this.interaction && (this.interaction.dispose(), this.interaction = void 0, this.interactionTimeOffset = 0, this.interactionZoom !== 1 && (this.interactionZoom = 1, this.applyZoom()));
|
|
13401
13596
|
}
|
|
13402
13597
|
applyInteraction() {
|
|
13403
13598
|
if (this.interaction) {
|
|
@@ -13405,13 +13600,13 @@ var hd, gd, _d, vd, yd, bd = t((() => {
|
|
|
13405
13600
|
this.applyInteractionRest();
|
|
13406
13601
|
return;
|
|
13407
13602
|
}
|
|
13408
|
-
|
|
13603
|
+
xu(this.config) && this.applyPointerField(this.interaction), this.applyBindings(this.interaction);
|
|
13409
13604
|
}
|
|
13410
13605
|
}
|
|
13411
13606
|
applyInteractionRest() {
|
|
13412
13607
|
for (let e = 0; e < this.waves.length; e++) {
|
|
13413
13608
|
let t = this.config.waves[e] ?? this.config.waves[this.config.waves.length - 1];
|
|
13414
|
-
if (!
|
|
13609
|
+
if (!yu(this.config, t)) continue;
|
|
13415
13610
|
let n = this.waves[e].material.uniforms;
|
|
13416
13611
|
n.uPointerActive.value = 0;
|
|
13417
13612
|
let r = n.uRippleAmp.value;
|
|
@@ -13425,7 +13620,7 @@ var hd, gd, _d, vd, yd, bd = t((() => {
|
|
|
13425
13620
|
out: this.interactionSceneOut
|
|
13426
13621
|
};
|
|
13427
13622
|
for (let n of e) {
|
|
13428
|
-
let e =
|
|
13623
|
+
let e = Lu[n.target];
|
|
13429
13624
|
e.apply(e.base(this.config), t);
|
|
13430
13625
|
}
|
|
13431
13626
|
}
|
|
@@ -13435,7 +13630,7 @@ var hd, gd, _d, vd, yd, bd = t((() => {
|
|
|
13435
13630
|
if (!t || !n || n.length === 0) continue;
|
|
13436
13631
|
let r = this.waves[e];
|
|
13437
13632
|
for (let e of n) {
|
|
13438
|
-
let n =
|
|
13633
|
+
let n = Iu[e.target];
|
|
13439
13634
|
n.apply(n.base(t), {
|
|
13440
13635
|
u: r.material.uniforms,
|
|
13441
13636
|
mesh: r.mesh
|
|
@@ -13447,7 +13642,7 @@ var hd, gd, _d, vd, yd, bd = t((() => {
|
|
|
13447
13642
|
let t = this.camera.right - this.camera.left, n = this.camera.top - this.camera.bottom, r = n === 0 ? 1 : t / n, i = e.sample().ripples, a = Math.min(1, .2 + .85 * e.pointerFlux()), o = e.pointerVelocity();
|
|
13448
13643
|
for (let t = 0; t < this.waves.length; t++) {
|
|
13449
13644
|
let n = this.config.waves[t] ?? this.config.waves[this.config.waves.length - 1];
|
|
13450
|
-
if (!
|
|
13645
|
+
if (!yu(this.config, n)) continue;
|
|
13451
13646
|
let s = this.waves[t].material.uniforms;
|
|
13452
13647
|
s.uPointerAgitate.value = (n.interaction?.hover?.agitate ?? 0) * a, s.uPointerVel.value.copy(o);
|
|
13453
13648
|
let c = e.fieldFor(t);
|
|
@@ -13463,7 +13658,7 @@ var hd, gd, _d, vd, yd, bd = t((() => {
|
|
|
13463
13658
|
out: this.interactionSceneOut
|
|
13464
13659
|
};
|
|
13465
13660
|
for (let n of this.config.interaction?.bindings ?? []) {
|
|
13466
|
-
let r =
|
|
13661
|
+
let r = Lu[n.target], i = Gt.lerp(n.from ?? r.base(this.config), n.to, e.bindingValue(n));
|
|
13467
13662
|
r.apply(i, t);
|
|
13468
13663
|
}
|
|
13469
13664
|
for (let t = 0; t < this.waves.length; t++) {
|
|
@@ -13471,7 +13666,7 @@ var hd, gd, _d, vd, yd, bd = t((() => {
|
|
|
13471
13666
|
if (!n || !r || r.length === 0) continue;
|
|
13472
13667
|
let i = this.waves[t];
|
|
13473
13668
|
for (let t of r) {
|
|
13474
|
-
let r =
|
|
13669
|
+
let r = Iu[t.target], a = Gt.lerp(t.from ?? r.base(n), t.to, e.bindingValue(t));
|
|
13475
13670
|
r.apply(a, {
|
|
13476
13671
|
u: i.material.uniforms,
|
|
13477
13672
|
mesh: i.mesh
|
|
@@ -13500,7 +13695,10 @@ var hd, gd, _d, vd, yd, bd = t((() => {
|
|
|
13500
13695
|
onAfterResize() {}
|
|
13501
13696
|
applyZoom() {
|
|
13502
13697
|
let e = this.camera.right - this.camera.left, t = this.camera.top - this.camera.bottom;
|
|
13503
|
-
this.camera.zoom =
|
|
13698
|
+
this.camera.zoom = this.baseFrameZoom(e, t) * (this.config.cameraZoom ?? 1) * this.interactionZoom, this.camera.updateProjectionMatrix();
|
|
13699
|
+
}
|
|
13700
|
+
baseFrameZoom(e, t) {
|
|
13701
|
+
return xd(e, t, this.config.cameraFit ?? "cover", this.config.cameraMinVisibleWidth ?? 0);
|
|
13504
13702
|
}
|
|
13505
13703
|
updateClipPlanes() {
|
|
13506
13704
|
this.clipBox.makeEmpty();
|
|
@@ -13510,7 +13708,7 @@ var hd, gd, _d, vd, yd, bd = t((() => {
|
|
|
13510
13708
|
let r = n.geometry.boundingSphere;
|
|
13511
13709
|
if (!r) continue;
|
|
13512
13710
|
let i = this.clipTmpA.setFromMatrixPosition(n.matrixWorld), a = Math.abs(Number(t.material.uniforms.uDispAmount.value) || 0), o = this.config.waves[e] ?? this.config.waves[this.config.waves.length - 1], s = 0;
|
|
13513
|
-
if (
|
|
13711
|
+
if (yu(this.config, o)) {
|
|
13514
13712
|
let e = o.interaction?.hover;
|
|
13515
13713
|
s = (e?.agitate ?? 0) + Math.abs(e?.push ?? 0) + (e?.wake ?? 0) + (o.interaction?.press?.ripple ?? 0);
|
|
13516
13714
|
}
|
|
@@ -13550,21 +13748,21 @@ var hd, gd, _d, vd, yd, bd = t((() => {
|
|
|
13550
13748
|
this.config = t, n ? this.rebuild() : this.refresh(), this.applyCameraFromConfig();
|
|
13551
13749
|
}
|
|
13552
13750
|
dispose() {
|
|
13553
|
-
cancelAnimationFrame(this.rafId), this.running = !1, this.interaction?.dispose(), this.interaction = void 0, this.resizeObserver.disconnect(), this.intersectionObserver.disconnect(), this.motionQuery.removeEventListener("change", this.onMotionChange), document.removeEventListener("visibilitychange", this.onVisibilityChange), this.renderer.domElement.removeEventListener("webglcontextlost", this.onContextLost), this.renderer.domElement.removeEventListener("webglcontextrestored", this.onContextRestored), this.clearBackgroundVideo(), this.backgroundTexture?.dispose();
|
|
13751
|
+
cancelAnimationFrame(this.rafId), cancelAnimationFrame(this.resizeRaf), this.running = !1, this.interaction?.dispose(), this.interaction = void 0, this.resizeObserver.disconnect(), this.intersectionObserver.disconnect(), this.motionQuery.removeEventListener("change", this.onMotionChange), this.dprQuery?.removeEventListener("change", this.onDprChange), document.removeEventListener("visibilitychange", this.onVisibilityChange), this.renderer.domElement.removeEventListener("webglcontextlost", this.onContextLost), this.renderer.domElement.removeEventListener("webglcontextrestored", this.onContextRestored), this.clearBackgroundVideo(), this.backgroundTexture?.dispose();
|
|
13554
13752
|
for (let e of this.waves) e.material.dispose(), e.geometry.dispose(), e.palette.dispose();
|
|
13555
|
-
this.bloomPass?.dispose(), this.composer.dispose(), this.renderer.dispose(), this.renderer.domElement.remove();
|
|
13753
|
+
this.bloomPass?.dispose(), this.ditherPass?.dispose(), this.innerLightPass?.dispose(), this.halftonePass?.dispose(), this.heatmapPass?.dispose(), this.paperTexturePass?.dispose(), this.halftoneCmykPass?.dispose(), this.composer.dispose(), this.renderer.dispose(), this.renderer.domElement.remove();
|
|
13556
13754
|
}
|
|
13557
13755
|
};
|
|
13558
|
-
})),
|
|
13559
|
-
WaveRenderer: () =>
|
|
13756
|
+
})), kd = /* @__PURE__ */ n({
|
|
13757
|
+
WaveRenderer: () => Dd,
|
|
13560
13758
|
createDefaultConfig: () => wl
|
|
13561
13759
|
});
|
|
13562
13760
|
//#endregion
|
|
13563
13761
|
//#region src/shell/probe.ts
|
|
13564
13762
|
t((() => {
|
|
13565
|
-
|
|
13763
|
+
Od(), Kl();
|
|
13566
13764
|
}))();
|
|
13567
|
-
function
|
|
13765
|
+
function Ad() {
|
|
13568
13766
|
if (typeof document > "u") return !1;
|
|
13569
13767
|
try {
|
|
13570
13768
|
let e = document.createElement("canvas"), t = { failIfMajorPerformanceCaveat: !0 }, n = e.getContext("webgl2", t) ?? e.getContext("webgl", t);
|
|
@@ -13573,22 +13771,22 @@ function Sd() {
|
|
|
13573
13771
|
return !1;
|
|
13574
13772
|
}
|
|
13575
13773
|
}
|
|
13576
|
-
function
|
|
13774
|
+
function jd() {
|
|
13577
13775
|
return typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
13578
13776
|
}
|
|
13579
|
-
function
|
|
13777
|
+
function Md() {
|
|
13580
13778
|
return typeof navigator > "u" ? !1 : navigator.connection?.saveData === !0;
|
|
13581
13779
|
}
|
|
13582
13780
|
//#endregion
|
|
13583
13781
|
//#region src/shell/poster.ts
|
|
13584
|
-
var
|
|
13585
|
-
function
|
|
13782
|
+
var Nd = "data-wave3d-poster";
|
|
13783
|
+
function Pd(e) {
|
|
13586
13784
|
getComputedStyle(e).position === "static" && (e.style.position = "relative");
|
|
13587
13785
|
}
|
|
13588
|
-
function
|
|
13589
|
-
let r = e.querySelector(`img[${
|
|
13786
|
+
function Fd(e, t, n = "fill") {
|
|
13787
|
+
let r = e.querySelector(`img[${Nd}]`);
|
|
13590
13788
|
if (!r && !t) return null;
|
|
13591
|
-
r || (r = document.createElement("img"), r.setAttribute(
|
|
13789
|
+
r || (r = document.createElement("img"), r.setAttribute(Nd, ""), r.decoding = "async", r.alt = "", r.setAttribute("aria-hidden", "true"), e.appendChild(r)), t && (r.src = t), Object.assign(r.style, {
|
|
13592
13790
|
position: "absolute",
|
|
13593
13791
|
inset: "0",
|
|
13594
13792
|
width: "100%",
|
|
@@ -13621,12 +13819,12 @@ function Dd(e, t, n = "fill") {
|
|
|
13621
13819
|
}
|
|
13622
13820
|
//#endregion
|
|
13623
13821
|
//#region src/shell/createWave.ts
|
|
13624
|
-
function
|
|
13822
|
+
function Id(e, t, n, r) {
|
|
13625
13823
|
let { lazy: i = !0, rootMargin: a = "200px", webgl: o = "auto", respectReducedMotion: s = !0, reducedMotionBehavior: c = "static", respectSaveData: l = !0, fadeMs: u = 300 } = r, d = "poster", f = null, p = { ...n };
|
|
13626
13824
|
r.paused !== void 0 && (p.paused = r.paused);
|
|
13627
13825
|
let m = /* @__PURE__ */ new Map(), h = !1, g = null, _, v = 0;
|
|
13628
|
-
|
|
13629
|
-
let y =
|
|
13826
|
+
Pd(t);
|
|
13827
|
+
let y = Fd(t, r.poster, r.posterFit);
|
|
13630
13828
|
function b(e) {
|
|
13631
13829
|
d !== e && (d = e, r.onStateChange?.(e));
|
|
13632
13830
|
}
|
|
@@ -13674,7 +13872,7 @@ function Od(e, t, n, r) {
|
|
|
13674
13872
|
}
|
|
13675
13873
|
function E() {
|
|
13676
13874
|
if (!h) {
|
|
13677
|
-
if (o === "auto" && !
|
|
13875
|
+
if (o === "auto" && !Ad()) {
|
|
13678
13876
|
x("no-webgl");
|
|
13679
13877
|
return;
|
|
13680
13878
|
}
|
|
@@ -13683,8 +13881,8 @@ function Od(e, t, n, r) {
|
|
|
13683
13881
|
}
|
|
13684
13882
|
function D() {
|
|
13685
13883
|
if (o !== "off") {
|
|
13686
|
-
if (l &&
|
|
13687
|
-
if (s && c === "poster" &&
|
|
13884
|
+
if (l && Md()) return x("save-data");
|
|
13885
|
+
if (s && c === "poster" && jd()) return x("reduced-motion");
|
|
13688
13886
|
i && typeof IntersectionObserver < "u" ? (g = new IntersectionObserver((e) => {
|
|
13689
13887
|
e.some((e) => e.isIntersecting) && (g?.disconnect(), g = null, E());
|
|
13690
13888
|
}, { rootMargin: a }), g.observe(t)) : E();
|
|
@@ -13727,11 +13925,11 @@ function Od(e, t, n, r) {
|
|
|
13727
13925
|
}
|
|
13728
13926
|
//#endregion
|
|
13729
13927
|
//#region src/presets.ts
|
|
13730
|
-
|
|
13731
|
-
var
|
|
13732
|
-
function
|
|
13928
|
+
Kl();
|
|
13929
|
+
var Ld = 180 / Math.PI;
|
|
13930
|
+
function Rd(e) {
|
|
13733
13931
|
let t = wl(), n = t.waves[0];
|
|
13734
|
-
return n.speed = e.speed, n.colorContrast = e.contrast, n.colorSaturation = e.sat, n.hueShift = e.hueRad *
|
|
13932
|
+
return n.speed = e.speed, n.colorContrast = e.contrast, n.colorSaturation = e.sat, n.hueShift = e.hueRad * Ld, n.displaceFrequency = {
|
|
13735
13933
|
x: e.dispX,
|
|
13736
13934
|
y: e.dispZ
|
|
13737
13935
|
}, n.displaceAmount = e.dispAmt, n.position = {
|
|
@@ -13739,9 +13937,9 @@ function Ad(e) {
|
|
|
13739
13937
|
y: e.pos[1],
|
|
13740
13938
|
z: e.pos[2]
|
|
13741
13939
|
}, n.rotation = {
|
|
13742
|
-
x: e.rotRad[0] *
|
|
13743
|
-
y: e.rotRad[1] *
|
|
13744
|
-
z: e.rotRad[2] *
|
|
13940
|
+
x: e.rotRad[0] * Ld,
|
|
13941
|
+
y: e.rotRad[1] * Ld,
|
|
13942
|
+
z: e.rotRad[2] * Ld
|
|
13745
13943
|
}, n.scale = {
|
|
13746
13944
|
x: e.scale[0],
|
|
13747
13945
|
y: e.scale[1],
|
|
@@ -13764,8 +13962,8 @@ function Ad(e) {
|
|
|
13764
13962
|
z: 0
|
|
13765
13963
|
}, t.cameraZoom = e.zoom, t;
|
|
13766
13964
|
}
|
|
13767
|
-
var
|
|
13768
|
-
Hero: () =>
|
|
13965
|
+
var zd = {
|
|
13966
|
+
Hero: () => Rd({
|
|
13769
13967
|
speed: .04,
|
|
13770
13968
|
contrast: 1,
|
|
13771
13969
|
sat: 1,
|
|
@@ -13809,7 +14007,7 @@ var jd = {
|
|
|
13809
14007
|
camTarget: [-420, -200]
|
|
13810
14008
|
}),
|
|
13811
14009
|
"Wave 2": () => wl(),
|
|
13812
|
-
"Wave 3": () =>
|
|
14010
|
+
"Wave 3": () => Rd({
|
|
13813
14011
|
speed: .08,
|
|
13814
14012
|
contrast: 1,
|
|
13815
14013
|
sat: 1,
|
|
@@ -13852,7 +14050,7 @@ var jd = {
|
|
|
13852
14050
|
zoom: 1.3,
|
|
13853
14051
|
camTarget: [-104, 13]
|
|
13854
14052
|
}),
|
|
13855
|
-
"Wave 4": () =>
|
|
14053
|
+
"Wave 4": () => Rd({
|
|
13856
14054
|
speed: .0525,
|
|
13857
14055
|
contrast: .969,
|
|
13858
14056
|
sat: 1.383,
|
|
@@ -13932,7 +14130,7 @@ var jd = {
|
|
|
13932
14130
|
]), t.creaseLight = 1, e.background = "#05060c", e.transparentBackground = !1, e.waves = bl(t, 3), e.waveCount = 3, e;
|
|
13933
14131
|
},
|
|
13934
14132
|
"Mesh Gradient": () => {
|
|
13935
|
-
let e =
|
|
14133
|
+
let e = zd.Hero(), t = e.waves[0];
|
|
13936
14134
|
return t.gradientType = "mesh", t.meshGradientPoints = [
|
|
13937
14135
|
{
|
|
13938
14136
|
color: "#0a84ff",
|
|
@@ -13973,7 +14171,7 @@ var jd = {
|
|
|
13973
14171
|
], t.meshGradientSoftness = .68, t.blendMode = "normal", t.hueShift = 0, t.colorContrast = 1.06, t.colorSaturation = 1.12, t.fiberStrength = .14, e.grain = .3, e.blur = .008, e.background = "#070914", e.backgroundMode = "color", e.transparentBackground = !1, e;
|
|
13974
14172
|
},
|
|
13975
14173
|
"Solar Bloom": () => {
|
|
13976
|
-
let e =
|
|
14174
|
+
let e = zd.Hero(), t = e.waves[0];
|
|
13977
14175
|
return t.usePaletteTexture = !1, t.gradientType = "radial", t.gradientShift = .14, t.palette = [
|
|
13978
14176
|
{
|
|
13979
14177
|
color: "#fff3c4",
|
|
@@ -14002,7 +14200,7 @@ var jd = {
|
|
|
14002
14200
|
], t.blendMode = "normal", t.hueShift = 0, t.colorContrast = 1.05, t.colorSaturation = 1.18, t.fiberStrength = .12, e.grain = .3, e.blur = .01, e.background = "#0a0714", e.backgroundMode = "gradient", e.backgroundGradientType = "radial", e.backgroundGradientSource = "stops", e.backgroundPalette = vl(["#2a1330", "#08040f"]), e.transparentBackground = !1, e;
|
|
14003
14201
|
},
|
|
14004
14202
|
Holographic: () => {
|
|
14005
|
-
let e =
|
|
14203
|
+
let e = zd.Hero(), t = e.waves[0];
|
|
14006
14204
|
return t.usePaletteTexture = !1, t.gradientType = "conic", t.gradientShift = .08, t.palette = [
|
|
14007
14205
|
{
|
|
14008
14206
|
color: "#8ef6e4",
|
|
@@ -14035,7 +14233,7 @@ var jd = {
|
|
|
14035
14233
|
], t.blendMode = "normal", t.hueShift = 0, t.colorContrast = 1.04, t.colorSaturation = 1.12, t.fiberStrength = .12, e.grain = .28, e.blur = .01, e.background = "#05060c", e.backgroundMode = "gradient", e.backgroundGradientType = "linear", e.backgroundGradientAngle = 135, e.backgroundGradientSource = "stops", e.backgroundPalette = vl(["#04121a", "#0a0518"]), e.transparentBackground = !1, e;
|
|
14036
14234
|
},
|
|
14037
14235
|
Aurora: () => {
|
|
14038
|
-
let e =
|
|
14236
|
+
let e = zd.Hero(), t = e.waves[0];
|
|
14039
14237
|
return t.gradientType = "mesh", t.meshGradientPoints = [
|
|
14040
14238
|
{
|
|
14041
14239
|
color: "#0a1f3c",
|
|
@@ -14107,31 +14305,31 @@ var jd = {
|
|
|
14107
14305
|
], e.backgroundMeshSoftness = .75, e.transparentBackground = !1, e;
|
|
14108
14306
|
},
|
|
14109
14307
|
Palestine: () => {
|
|
14110
|
-
let e =
|
|
14308
|
+
let e = zd.Hero(), t = e.waves[0];
|
|
14111
14309
|
return t.paletteSource = "palestine", t.blendMode = "normal", t.hueShift = 0, t.colorContrast = 1, t.colorSaturation = 1, e.grain = .35, e.background = "#f2efe8", e.transparentBackground = !0, e;
|
|
14112
14310
|
},
|
|
14113
14311
|
Spain: () => {
|
|
14114
|
-
let e =
|
|
14312
|
+
let e = zd.Hero(), t = e.waves[0];
|
|
14115
14313
|
return t.paletteSource = "spain", t.blendMode = "normal", t.hueShift = 0, t.colorContrast = 1.18, t.colorSaturation = 1.25, t.creaseLight = 1.6, e.grain = .3, e.background = "#1a0608", e.backgroundMode = "color", e.transparentBackground = !1, e;
|
|
14116
14314
|
},
|
|
14117
14315
|
"Vaporwave Sunset": () => {
|
|
14118
|
-
let e =
|
|
14119
|
-
return t.position.x = 525, t.rotation.x = -.64 *
|
|
14316
|
+
let e = zd.Hero(), t = e.waves[0];
|
|
14317
|
+
return t.position.x = 525, t.rotation.x = -.64 * Ld, t.rotation.z = 1.68 * Ld, t.paletteSource = "vaporwave", t.blendMode = "normal", t.hueShift = 0, t.colorContrast = 1.08, t.colorSaturation = 1.15, t.creaseLight = 1.25, e.cameraZoom = 1.1, e.cameraTarget = {
|
|
14120
14318
|
x: 150,
|
|
14121
14319
|
y: 360,
|
|
14122
14320
|
z: 0
|
|
14123
14321
|
}, e.background = "#09051f", e.transparentBackground = !1, e;
|
|
14124
14322
|
},
|
|
14125
14323
|
Kaleidoscope: () => {
|
|
14126
|
-
let e =
|
|
14324
|
+
let e = zd["Wave 3"](), t = e.waves[0];
|
|
14127
14325
|
return t.paletteSource = "kaleidoscope", t.blendMode = "normal", t.hueShift = 0, t.colorContrast = 1.05, t.colorSaturation = 1.12, e.grain = .5, e;
|
|
14128
14326
|
}
|
|
14129
14327
|
};
|
|
14130
|
-
|
|
14131
|
-
var
|
|
14132
|
-
function
|
|
14133
|
-
return
|
|
14328
|
+
Od(), Kl();
|
|
14329
|
+
var Bd = () => Promise.resolve(kd);
|
|
14330
|
+
function Vd(e, t = {}, n = {}) {
|
|
14331
|
+
return Id(Bd, e, t, n);
|
|
14134
14332
|
}
|
|
14135
|
-
var
|
|
14333
|
+
var Hd = Vd;
|
|
14136
14334
|
//#endregion
|
|
14137
|
-
export { Vl as DEFAULT_LIGHT_POSITION, Il as MAX_COLORS, Rl as MAX_LIGHTS, Ll as MAX_MESH_POINTS, zl as MAX_NOISE_BANDS, Bl as MAX_WAVES,
|
|
14335
|
+
export { Vl as CAMERA_FITS, Hl as DEFAULT_LIGHT_POSITION, Il as MAX_COLORS, Rl as MAX_LIGHTS, Ll as MAX_MESH_POINTS, zl as MAX_NOISE_BANDS, Bl as MAX_WAVES, zd as PRESETS, Dd as WaveRenderer, wl as createDefaultConfig, yl as createDefaultMeshPoints, gl as createLight, _l as createNoiseBand, Vd as createWave, Dl as ensureCamera, kl as ensureSceneDefaults, Fl as ensureStudioConfig, vl as makeStops, Sl as makeWave, bl as makeWaveSpread, Hd as mountWave, El as normalizeBackground, Pl as normalizeSceneInteraction, Ol as normalizeWave, Nl as normalizeWaveInteraction, Cl as resizeWaves };
|