@wave3d/core 0.3.0 → 0.4.1
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 +34 -0
- package/dist/config/model.js +33 -0
- package/dist/config/model.js.map +1 -1
- package/dist/renderer/WaveRenderer.d.ts +25 -0
- package/dist/renderer/WaveRenderer.js +190 -1
- package/dist/renderer/WaveRenderer.js.map +1 -1
- package/dist/renderer/shaders.js +213 -6
- package/dist/renderer/shaders.js.map +1 -1
- package/dist/standalone/wave3d.standalone.js +367 -219
- 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
|
@@ -11493,6 +11493,22 @@ function wl() {
|
|
|
11493
11493
|
grain: 1.1,
|
|
11494
11494
|
blur: .02,
|
|
11495
11495
|
blurSamples: 6,
|
|
11496
|
+
dither: 0,
|
|
11497
|
+
ditherScale: 2,
|
|
11498
|
+
ditherSteps: 4,
|
|
11499
|
+
innerLight: 0,
|
|
11500
|
+
innerLightDensity: .5,
|
|
11501
|
+
innerLightDecay: .95,
|
|
11502
|
+
innerLightX: .5,
|
|
11503
|
+
innerLightY: .15,
|
|
11504
|
+
halftone: 0,
|
|
11505
|
+
halftoneCell: 6,
|
|
11506
|
+
halftoneAngle: .4,
|
|
11507
|
+
heatmap: 0,
|
|
11508
|
+
paperTexture: 0,
|
|
11509
|
+
paperTextureScale: 2,
|
|
11510
|
+
halftoneCmyk: 0,
|
|
11511
|
+
halftoneCmykCell: 6,
|
|
11496
11512
|
ambient: .45,
|
|
11497
11513
|
lights: [],
|
|
11498
11514
|
mirrorH: !1,
|
|
@@ -11578,7 +11594,7 @@ function Ol(e) {
|
|
|
11578
11594
|
}, 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
11595
|
}
|
|
11580
11596
|
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);
|
|
11597
|
+
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
11598
|
}
|
|
11583
11599
|
function Al(e, t, n, r) {
|
|
11584
11600
|
let i = Number(e);
|
|
@@ -11617,7 +11633,7 @@ function Nl(e) {
|
|
|
11617
11633
|
}
|
|
11618
11634
|
function Pl(e) {
|
|
11619
11635
|
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, Wl)));
|
|
11636
|
+
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, Wl)));
|
|
11621
11637
|
}
|
|
11622
11638
|
function Fl(e) {
|
|
11623
11639
|
let t = e;
|
|
@@ -11663,7 +11679,7 @@ var Il, Ll, Rl, zl, Bl, Vl, Hl, Ul, Wl, Gl = t((() => {
|
|
|
11663
11679
|
"blur",
|
|
11664
11680
|
"grain"
|
|
11665
11681
|
];
|
|
11666
|
-
})), Kl, ql, Jl, Yl, Xl, Zl, Ql, $l, eu = t((() => {
|
|
11682
|
+
})), Kl, ql, Jl, Yl, Xl, Zl, Ql, $l, eu, tu, nu, ru, iu, au, ou = t((() => {
|
|
11667
11683
|
Gl(), Kl = "\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", ql = "\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", Jl = "\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", Yl = `
|
|
11668
11684
|
${Kl}
|
|
11669
11685
|
|
|
@@ -11690,6 +11706,9 @@ uniform float uPointerAgitate;
|
|
|
11690
11706
|
uniform float uPointerPush; // signed membrane dome at the cursor (+ repel / − attract)
|
|
11691
11707
|
uniform float uPointerWake; // drag-wake trough amplitude (behind the moving cursor)
|
|
11692
11708
|
uniform vec2 uPointerVel; // smoothed pointer velocity, NDC/s (drag-wake direction)
|
|
11709
|
+
// Ribbon flow: stretch the falloff along the strip's length axis so the field reaches ALONG the
|
|
11710
|
+
// ribbon rather than as a screen disc. 0 = the plain circular smoothstep (byte-identical when off).
|
|
11711
|
+
uniform float uShapeFlow;
|
|
11693
11712
|
varying float vPointerFall; // falloff × presence — consumed by both fragment themes
|
|
11694
11713
|
#ifdef POINTER_RIPPLES
|
|
11695
11714
|
uniform vec2 uRippleOrigin[4]; // NDC
|
|
@@ -11783,11 +11802,35 @@ void main(){
|
|
|
11783
11802
|
pos = (vec4(pos, 1.0) * rotC).xyz;
|
|
11784
11803
|
|
|
11785
11804
|
#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
|
-
|
|
11805
|
+
// Pointer field: displace along the wave's own (post-twist) up-axis, weighted by a screen-space
|
|
11806
|
+
// falloff around the smoothed cursor — a circle at uShapeFlow 0, stretched along the ribbon as it
|
|
11807
|
+
// rises. Everything here is ADDITIVE and fenced, so the shared path above/below is untouched and
|
|
11808
|
+
// byte-identical when POINTER_FX is off.
|
|
11809
|
+
// Shared clip-space transform, computed once and reused for the cursor metric and the ribbon
|
|
11810
|
+
// tangent (the compiler is not guaranteed to CSE the triple product otherwise). Associativity is
|
|
11811
|
+
// unchanged, so preClip is bit-for-bit what the plain P*V*M*v product produced.
|
|
11812
|
+
mat4 mvp = projectionMatrix * viewMatrix * modelMatrix;
|
|
11813
|
+
vec4 preClip = mvp * vec4(pos, 1.0);
|
|
11814
|
+
// Screen-space offset from the cursor (aspect-corrected → round in pixels). The DEFAULT metric.
|
|
11815
|
+
vec2 ndcHere = preClip.xy / max(preClip.w, 1.0e-6);
|
|
11816
|
+
vec2 dp = (ndcHere - uPointer) * vec2(uPointerAspect, 1.0);
|
|
11817
|
+
// Ribbon flow: stretch the metric along the strip's own LENGTH axis so the field reaches ALONG the
|
|
11818
|
+
// ribbon and stays tight across it — the "flows with the material" feel, per-vertex (so it follows
|
|
11819
|
+
// the strip's curve) with no CPU surface pick. The length axis is local +X (uv.x runs with x)
|
|
11820
|
+
// carried through the SAME twist as the surface. The camera is orthographic (affine, w=1), so the
|
|
11821
|
+
// axis's screen image is the linear map of the DIRECTION (w=0): one mat·dir, no second
|
|
11822
|
+
// point-projection and no perspective divide. (A true per-pixel uv would need GPU picking — the
|
|
11823
|
+
// visible surface is shader-displaced, so a CPU raycast of the base geometry misses.)
|
|
11824
|
+
if (uShapeFlow > 0.0) {
|
|
11825
|
+
vec3 tangentLocal = (((vec4(1.0, 0.0, 0.0, 0.0) * rotA) * rotB) * rotC).xyz;
|
|
11826
|
+
vec2 tang = (mvp * vec4(tangentLocal, 0.0)).xy * vec2(uPointerAspect, 1.0);
|
|
11827
|
+
float tl = length(tang);
|
|
11828
|
+
if (tl > 1.0e-6) {
|
|
11829
|
+
tang /= tl;
|
|
11830
|
+
vec2 nrm = vec2(-tang.y, tang.x);
|
|
11831
|
+
dp = vec2(dot(dp, tang) / (1.0 + uShapeFlow * 2.5), dot(dp, nrm)); // up to 3.5× reach along length
|
|
11832
|
+
}
|
|
11833
|
+
}
|
|
11791
11834
|
float fall = smoothstep(uPointerRadius, 0.0, length(dp));
|
|
11792
11835
|
vPointerFall = fall * uPointerActive;
|
|
11793
11836
|
// Displacement axis = local +Y carried through the SAME three twist rotations as pos (row-vector
|
|
@@ -12102,9 +12145,9 @@ void main(){
|
|
|
12102
12145
|
gl_FragColor.rgb *= gl_FragColor.a;
|
|
12103
12146
|
#endif
|
|
12104
12147
|
}
|
|
12105
|
-
`, Ql = "\nvarying vec2 vUv;\nvoid main(){\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n", $l = "\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";
|
|
12106
|
-
})),
|
|
12107
|
-
Vc(),
|
|
12148
|
+
`, Ql = "\nvarying vec2 vUv;\nvoid main(){\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n", $l = "\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", eu = "\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", tu = "\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", nu = "\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", ru = "\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", iu = "\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", au = "\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";
|
|
12149
|
+
})), su, cu, lu, uu, du, fu, pu = t((() => {
|
|
12150
|
+
Vc(), su = 400, cu = 16, lu = su / 4, uu = new K(1, 0, 0), du = new K(0, 1, 0), fu = class {
|
|
12108
12151
|
geometry;
|
|
12109
12152
|
segments = -1;
|
|
12110
12153
|
constructor(e) {
|
|
@@ -12113,11 +12156,11 @@ void main(){
|
|
|
12113
12156
|
resize(e) {
|
|
12114
12157
|
if (e === this.segments) return;
|
|
12115
12158
|
this.segments = e;
|
|
12116
|
-
let t = Gt.clamp(Math.round(e), 48, 200), n = t * 2, r = new wi(
|
|
12159
|
+
let t = Gt.clamp(Math.round(e), 48, 200), n = t * 2, r = new wi(su, su, t, n), i = r.attributes.position, a = r.attributes.uv, o = new K();
|
|
12117
12160
|
for (let e = 0; e < i.count; e++) {
|
|
12118
12161
|
o.fromBufferAttribute(i, e);
|
|
12119
12162
|
let t = a.getY(e), n = 4 - 2 * (4 * t * (1 - t)) ** 9.5;
|
|
12120
|
-
o.x < -16 ? o.z += n : o.x <
|
|
12163
|
+
o.x < -16 ? o.z += n : o.x < cu ? (o.z = Math.cos(Gt.mapLinear(o.x, -16, cu, 0, Math.PI)) * n, o.x = Math.cos(Gt.mapLinear(o.x, -16, cu, -Math.PI / 2, Math.PI / 2)) * n - cu) : (o.z -= n, o.x = -o.x), o.x += lu, o.applyAxisAngle(uu, -Math.PI / 2), o.applyAxisAngle(du, -Math.PI / 2), i.setXYZ(e, o.x, o.y, o.z);
|
|
12121
12164
|
}
|
|
12122
12165
|
i.needsUpdate = !0;
|
|
12123
12166
|
let s = t + 1, c = r.getIndex(), l = c ? Array.from(c.array) : [];
|
|
@@ -12138,115 +12181,115 @@ void main(){
|
|
|
12138
12181
|
}));
|
|
12139
12182
|
//#endregion
|
|
12140
12183
|
//#region src/renderer/interaction.ts
|
|
12141
|
-
function
|
|
12184
|
+
function mu(e, t) {
|
|
12142
12185
|
return e > 0 ? 1 - Math.exp(-t / e) : 1;
|
|
12143
12186
|
}
|
|
12144
|
-
function
|
|
12187
|
+
function hu(e, t, n, r, i, a) {
|
|
12145
12188
|
if (a <= 0) return;
|
|
12146
|
-
let o = a >
|
|
12189
|
+
let o = a > ju ? Math.min(Math.ceil(a / ju), Mu) : 1, s = a / o, c = r * r, l = 2 * i * r;
|
|
12147
12190
|
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
12191
|
}
|
|
12149
|
-
function
|
|
12192
|
+
function gu(e) {
|
|
12150
12193
|
return e.interaction?.enabled !== !1;
|
|
12151
12194
|
}
|
|
12152
|
-
function
|
|
12195
|
+
function _u(e) {
|
|
12153
12196
|
let t = e.interaction;
|
|
12154
12197
|
return !!t && (!!t.hover || (t.press?.ripple ?? 0) > 0);
|
|
12155
12198
|
}
|
|
12156
|
-
function
|
|
12157
|
-
return
|
|
12199
|
+
function vu(e, t) {
|
|
12200
|
+
return gu(e) && _u(t);
|
|
12158
12201
|
}
|
|
12159
|
-
function
|
|
12160
|
-
return
|
|
12202
|
+
function yu(e, t) {
|
|
12203
|
+
return gu(e) && (t.interaction?.press?.ripple ?? 0) > 0;
|
|
12161
12204
|
}
|
|
12162
|
-
function
|
|
12163
|
-
return
|
|
12205
|
+
function bu(e) {
|
|
12206
|
+
return gu(e) && e.waves.some(_u);
|
|
12164
12207
|
}
|
|
12165
|
-
function
|
|
12166
|
-
return
|
|
12208
|
+
function xu(e) {
|
|
12209
|
+
return gu(e) ? (e.interaction?.bindings?.length ?? 0) > 0 ? !0 : e.waves.some((e) => {
|
|
12167
12210
|
let t = e.interaction;
|
|
12168
12211
|
return !!t && (!!t.hover || (t.press?.ripple ?? 0) > 0 || (t.bindings?.length ?? 0) > 0);
|
|
12169
12212
|
}) : !1;
|
|
12170
12213
|
}
|
|
12171
|
-
var
|
|
12172
|
-
Vc(), hl(),
|
|
12214
|
+
var Su, Cu, wu, Tu, Eu, Du, Ou, ku, Au, ju, Mu, Nu, Pu, Fu, Iu, Lu, Ru = t((() => {
|
|
12215
|
+
Vc(), hl(), Su = 1.5, Cu = .08, wu = 4, Tu = 2, Eu = .15, Du = .12, Ou = .25, ku = .7, Au = .02, ju = 1 / 120, Mu = 6, Nu = (e, t) => ({
|
|
12173
12216
|
base: e,
|
|
12174
12217
|
apply: t
|
|
12175
|
-
}),
|
|
12218
|
+
}), Pu = (e, t) => ({
|
|
12176
12219
|
base: e,
|
|
12177
12220
|
apply: t
|
|
12178
|
-
}),
|
|
12179
|
-
displaceAmount:
|
|
12221
|
+
}), Fu = {
|
|
12222
|
+
displaceAmount: Nu((e) => e.displaceAmount, (e, t) => {
|
|
12180
12223
|
t.u.uDispAmount.value = e;
|
|
12181
12224
|
}),
|
|
12182
|
-
detailAmount:
|
|
12225
|
+
detailAmount: Nu((e) => e.detailAmount ?? 0, (e, t) => {
|
|
12183
12226
|
t.u.uDetailAmount.value = e;
|
|
12184
12227
|
}),
|
|
12185
|
-
twistPowerX:
|
|
12228
|
+
twistPowerX: Nu((e) => e.twistPower.x, (e, t) => {
|
|
12186
12229
|
t.u.uTwPowX.value = e;
|
|
12187
12230
|
}),
|
|
12188
|
-
twistPowerY:
|
|
12231
|
+
twistPowerY: Nu((e) => e.twistPower.y, (e, t) => {
|
|
12189
12232
|
t.u.uTwPowY.value = e;
|
|
12190
12233
|
}),
|
|
12191
|
-
twistPowerZ:
|
|
12234
|
+
twistPowerZ: Nu((e) => e.twistPower.z, (e, t) => {
|
|
12192
12235
|
t.u.uTwPowZ.value = e;
|
|
12193
12236
|
}),
|
|
12194
|
-
twistFrequencyX:
|
|
12237
|
+
twistFrequencyX: Nu((e) => e.twistFrequency.x, (e, t) => {
|
|
12195
12238
|
t.u.uTwFreqX.value = e;
|
|
12196
12239
|
}),
|
|
12197
|
-
twistFrequencyY:
|
|
12240
|
+
twistFrequencyY: Nu((e) => e.twistFrequency.y, (e, t) => {
|
|
12198
12241
|
t.u.uTwFreqY.value = e;
|
|
12199
12242
|
}),
|
|
12200
|
-
twistFrequencyZ:
|
|
12243
|
+
twistFrequencyZ: Nu((e) => e.twistFrequency.z, (e, t) => {
|
|
12201
12244
|
t.u.uTwFreqZ.value = e;
|
|
12202
12245
|
}),
|
|
12203
|
-
hueShift:
|
|
12246
|
+
hueShift: Nu((e) => e.hueShift, (e, t) => {
|
|
12204
12247
|
t.u.uHueShift.value = e;
|
|
12205
12248
|
}),
|
|
12206
|
-
gradientShift:
|
|
12249
|
+
gradientShift: Nu((e) => e.gradientShift ?? 0, (e, t) => {
|
|
12207
12250
|
t.u.uGradShift.value = e;
|
|
12208
12251
|
}),
|
|
12209
|
-
colorSaturation:
|
|
12252
|
+
colorSaturation: Nu((e) => e.colorSaturation, (e, t) => {
|
|
12210
12253
|
t.u.uSaturation.value = e;
|
|
12211
12254
|
}),
|
|
12212
|
-
opacity:
|
|
12255
|
+
opacity: Nu((e) => e.opacity, (e, t) => {
|
|
12213
12256
|
t.u.uOpacity.value = e;
|
|
12214
12257
|
}),
|
|
12215
|
-
lineThickness:
|
|
12258
|
+
lineThickness: Nu((e) => e.lineThickness ?? 1, (e, t) => {
|
|
12216
12259
|
t.u.uLineThickness.value = e;
|
|
12217
12260
|
}),
|
|
12218
|
-
lineAmount:
|
|
12261
|
+
lineAmount: Nu((e) => e.lineAmount ?? 425, (e, t) => {
|
|
12219
12262
|
t.u.uLineAmount.value = e;
|
|
12220
12263
|
}),
|
|
12221
|
-
fiberStrength:
|
|
12264
|
+
fiberStrength: Nu((e) => e.fiberStrength, (e, t) => {
|
|
12222
12265
|
t.u.uFiberStrength.value = e;
|
|
12223
12266
|
}),
|
|
12224
|
-
sheen:
|
|
12267
|
+
sheen: Nu((e) => e.sheen ?? 1, (e, t) => {
|
|
12225
12268
|
t.u.uSheen.value = e;
|
|
12226
12269
|
}),
|
|
12227
|
-
iridescence:
|
|
12270
|
+
iridescence: Nu((e) => e.iridescence ?? 0, (e, t) => {
|
|
12228
12271
|
t.u.uIridescence.value = e;
|
|
12229
12272
|
}),
|
|
12230
|
-
positionX:
|
|
12273
|
+
positionX: Nu((e) => e.position.x, (e, t) => {
|
|
12231
12274
|
t.mesh.position.x = e;
|
|
12232
12275
|
}),
|
|
12233
|
-
positionY:
|
|
12276
|
+
positionY: Nu((e) => e.position.y, (e, t) => {
|
|
12234
12277
|
t.mesh.position.y = e;
|
|
12235
12278
|
})
|
|
12236
|
-
},
|
|
12237
|
-
timeOffset:
|
|
12279
|
+
}, Iu = {
|
|
12280
|
+
timeOffset: Pu((e) => e.timeOffset ?? 0, (e, t) => {
|
|
12238
12281
|
t.out.timeOffset = e;
|
|
12239
12282
|
}),
|
|
12240
|
-
cameraZoom:
|
|
12283
|
+
cameraZoom: Pu((e) => e.cameraZoom ?? 1, (e, t) => {
|
|
12241
12284
|
t.out.zoom = e;
|
|
12242
12285
|
}),
|
|
12243
|
-
blur:
|
|
12286
|
+
blur: Pu((e) => e.blur, (e, t) => {
|
|
12244
12287
|
t.post.uBlurAmount.value = e;
|
|
12245
12288
|
}),
|
|
12246
|
-
grain:
|
|
12289
|
+
grain: Pu((e) => e.grain, (e, t) => {
|
|
12247
12290
|
t.post.uGrainAmount.value = e;
|
|
12248
12291
|
})
|
|
12249
|
-
},
|
|
12292
|
+
}, Lu = class {
|
|
12250
12293
|
container;
|
|
12251
12294
|
cfg;
|
|
12252
12295
|
scrollOverride = null;
|
|
@@ -12324,12 +12367,12 @@ var gu, _u, vu, yu, bu, xu, Su, Cu, wu, Tu, Eu, Du, Ou, ku, Au, ju, Mu = t((() =
|
|
|
12324
12367
|
update(e) {
|
|
12325
12368
|
let t = this.cfg();
|
|
12326
12369
|
if (!t) return;
|
|
12327
|
-
let n = Math.max(e, 0), r =
|
|
12370
|
+
let n = Math.max(e, 0), r = mu(Du, n);
|
|
12328
12371
|
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 =
|
|
12372
|
+
let e = mu(Cu, n);
|
|
12330
12373
|
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
12374
|
}
|
|
12332
|
-
this.pointerSpeed = this.presence * ml(this.velNdc.length() /
|
|
12375
|
+
this.pointerSpeed = this.presence * ml(this.velNdc.length() / wu);
|
|
12333
12376
|
let i = t.waves;
|
|
12334
12377
|
this.fields.length > i.length && (this.fields.length = i.length);
|
|
12335
12378
|
for (let e = 0; e < i.length; e++) {
|
|
@@ -12339,19 +12382,19 @@ var gu, _u, vu, yu, bu, xu, Su, Cu, wu, Tu, Eu, Du, Ou, ku, Au, ju, Mu = t((() =
|
|
|
12339
12382
|
vel: new G(),
|
|
12340
12383
|
presence: this.presenceTarget
|
|
12341
12384
|
}, this.fields[e] = t);
|
|
12342
|
-
let r = Math.max(i[e].interaction?.hover?.smoothing ??
|
|
12343
|
-
|
|
12385
|
+
let r = Math.max(i[e].interaction?.hover?.smoothing ?? Du, Au);
|
|
12386
|
+
hu(t.ndc, t.vel, this.ndcTarget, 1 / r, ku, n), t.presence += (this.presenceTarget - t.presence) * mu(r, n);
|
|
12344
12387
|
}
|
|
12345
12388
|
let a = this.scrollOverride ?? this.computeScroll();
|
|
12346
12389
|
if (n > 1e-5) {
|
|
12347
12390
|
let e = Math.abs(a - this.scrollPrev) / n;
|
|
12348
|
-
this.scrollVel += (e - this.scrollVel) *
|
|
12391
|
+
this.scrollVel += (e - this.scrollVel) * mu(Eu, n);
|
|
12349
12392
|
}
|
|
12350
12393
|
this.scrollPrev = a, this.scroll = a, this.appearLatched = !0;
|
|
12351
12394
|
for (let e of this.ripples) {
|
|
12352
12395
|
if (!e.active) continue;
|
|
12353
12396
|
e.age += n;
|
|
12354
|
-
let t = Math.max(0, 1 - e.age /
|
|
12397
|
+
let t = Math.max(0, 1 - e.age / Su);
|
|
12355
12398
|
e.amp = t * t, e.amp <= 0 && (e.active = !1);
|
|
12356
12399
|
}
|
|
12357
12400
|
this.updateBindings(t, n);
|
|
@@ -12373,7 +12416,7 @@ var gu, _u, vu, yu, bu, xu, Su, Cu, wu, Tu, Eu, Du, Ou, ku, Au, ju, Mu = t((() =
|
|
|
12373
12416
|
(!r || r.source !== e.source) && (r = {
|
|
12374
12417
|
value: e.source === "appear" ? 0 : n,
|
|
12375
12418
|
source: e.source
|
|
12376
|
-
}, this.bindingState.set(e, r)), r.value += (n - r.value) *
|
|
12419
|
+
}, this.bindingState.set(e, r)), r.value += (n - r.value) * mu(e.smoothing ?? Ou, t);
|
|
12377
12420
|
}
|
|
12378
12421
|
bindingValue(e) {
|
|
12379
12422
|
return this.bindingState.get(e)?.value ?? 0;
|
|
@@ -12386,7 +12429,7 @@ var gu, _u, vu, yu, bu, xu, Su, Cu, wu, Tu, Eu, Du, Ou, ku, Au, ju, Mu = t((() =
|
|
|
12386
12429
|
case "pointerY": return (this.ndc.y + 1) * .5;
|
|
12387
12430
|
case "pointerSpeed": return this.pointerSpeed;
|
|
12388
12431
|
case "press": return this.press;
|
|
12389
|
-
case "scrollVelocity": return ml(this.scrollVel /
|
|
12432
|
+
case "scrollVelocity": return ml(this.scrollVel / Tu);
|
|
12390
12433
|
case "appear": return +!!this.appearLatched;
|
|
12391
12434
|
default: return this.customInputs.get(e.slice(7)) ?? 0;
|
|
12392
12435
|
}
|
|
@@ -12451,42 +12494,42 @@ var gu, _u, vu, yu, bu, xu, Su, Cu, wu, Tu, Eu, Du, Ou, ku, Au, ju, Mu = t((() =
|
|
|
12451
12494
|
}));
|
|
12452
12495
|
//#endregion
|
|
12453
12496
|
//#region src/renderer/palette.ts
|
|
12454
|
-
function
|
|
12497
|
+
function zu(e) {
|
|
12455
12498
|
return e * e * (3 - 2 * e);
|
|
12456
12499
|
}
|
|
12457
|
-
function
|
|
12500
|
+
function Bu(e, t) {
|
|
12458
12501
|
let n = new X(e).clone().convertLinearToSRGB();
|
|
12459
12502
|
return `rgba(${Math.round(n.r * 255)}, ${Math.round(n.g * 255)}, ${Math.round(n.b * 255)}, ${t})`;
|
|
12460
12503
|
}
|
|
12461
|
-
function
|
|
12504
|
+
function Vu(e) {
|
|
12462
12505
|
let t = document.createElement("canvas");
|
|
12463
|
-
t.width =
|
|
12506
|
+
t.width = od, t.height = sd;
|
|
12464
12507
|
let n = t.getContext("2d");
|
|
12465
12508
|
if (!n) return t;
|
|
12466
|
-
let r = [...e.stops].sort((e, t) => e.pos - t.pos), i = n.createLinearGradient(0, 0,
|
|
12509
|
+
let r = [...e.stops].sort((e, t) => e.pos - t.pos), i = n.createLinearGradient(0, 0, od, 0);
|
|
12467
12510
|
if (r.length === 0) i.addColorStop(0, "#ffffff");
|
|
12468
12511
|
else for (let e of r) i.addColorStop(ml(e.pos), e.color);
|
|
12469
|
-
n.fillStyle = i, n.fillRect(0, 0,
|
|
12512
|
+
n.fillStyle = i, n.fillRect(0, 0, od, sd);
|
|
12470
12513
|
let a = ml(e.edgeAmount);
|
|
12471
12514
|
if (a > .001) {
|
|
12472
|
-
let t = n.createLinearGradient(0, 0, 0,
|
|
12473
|
-
t.addColorStop(0,
|
|
12515
|
+
let t = n.createLinearGradient(0, 0, 0, sd);
|
|
12516
|
+
t.addColorStop(0, Bu(e.edgeColor, a)), t.addColorStop(.5, Bu(e.edgeColor, 0)), t.addColorStop(1, Bu(e.edgeColor, a)), n.fillStyle = t, n.fillRect(0, 0, od, sd);
|
|
12474
12517
|
}
|
|
12475
12518
|
return t;
|
|
12476
12519
|
}
|
|
12477
|
-
function
|
|
12520
|
+
function Hu(e) {
|
|
12478
12521
|
return `${e.stops.map((e) => `${e.color}@${e.pos.toFixed(3)}`).join(",")}|${e.edgeColor}|${e.edgeAmount.toFixed(3)}`;
|
|
12479
12522
|
}
|
|
12480
|
-
function
|
|
12523
|
+
function Uu(e) {
|
|
12481
12524
|
return e.colorSpace = At, e.minFilter = z, e.magFilter = z, e.wrapS = he, e.wrapT = he, e.generateMipmaps = !1, e;
|
|
12482
12525
|
}
|
|
12483
|
-
function
|
|
12484
|
-
return
|
|
12526
|
+
function Wu(e) {
|
|
12527
|
+
return Uu(new yi(e));
|
|
12485
12528
|
}
|
|
12486
|
-
function
|
|
12487
|
-
return
|
|
12529
|
+
function Gu(e) {
|
|
12530
|
+
return Wu(Vu(e));
|
|
12488
12531
|
}
|
|
12489
|
-
function
|
|
12532
|
+
function Ku(e) {
|
|
12490
12533
|
let t = document.createElement("canvas");
|
|
12491
12534
|
t.width = Math.max(1, Math.round(e.width)), t.height = Math.max(1, Math.round(e.height));
|
|
12492
12535
|
let n = t.getContext("2d");
|
|
@@ -12503,11 +12546,11 @@ function Bu(e) {
|
|
|
12503
12546
|
else for (let e of l) c.addColorStop(ml(e.pos), e.color);
|
|
12504
12547
|
return n.fillStyle = c, n.fillRect(0, 0, r, i), t;
|
|
12505
12548
|
}
|
|
12506
|
-
function
|
|
12549
|
+
function qu(e) {
|
|
12507
12550
|
let t = ml(e), n = t <= .0031308 ? t * 12.92 : 1.055 * t ** (1 / 2.4) - .055;
|
|
12508
12551
|
return Math.round(ml(n) * 255);
|
|
12509
12552
|
}
|
|
12510
|
-
function
|
|
12553
|
+
function Ju(e, t, n, r) {
|
|
12511
12554
|
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
12555
|
for (let e = 0; e < a; e++) {
|
|
12513
12556
|
let t = 1 - e / Math.max(1, a - 1);
|
|
@@ -12518,12 +12561,12 @@ function Hu(e, t, n, r) {
|
|
|
12518
12561
|
a += l[e].r * s, o += l[e].g * s, d += l[e].b * s, f += s;
|
|
12519
12562
|
}
|
|
12520
12563
|
let p = Math.max(f, 1e-4), m = (e * i + n) * 4;
|
|
12521
|
-
s[m] =
|
|
12564
|
+
s[m] = qu(a / p), s[m + 1] = qu(o / p), s[m + 2] = qu(d / p), s[m + 3] = 255;
|
|
12522
12565
|
}
|
|
12523
12566
|
}
|
|
12524
12567
|
return o;
|
|
12525
12568
|
}
|
|
12526
|
-
function
|
|
12569
|
+
function Yu(e, t, n, r) {
|
|
12527
12570
|
let i = document.createElement("canvas");
|
|
12528
12571
|
i.width = Math.max(1, Math.round(n)), i.height = Math.max(1, Math.round(r));
|
|
12529
12572
|
let a = i.getContext("2d");
|
|
@@ -12531,42 +12574,42 @@ function Uu(e, t, n, r) {
|
|
|
12531
12574
|
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
12575
|
l.width = s, l.height = c;
|
|
12533
12576
|
let u = l.getContext("2d");
|
|
12534
|
-
return u ? (u.putImageData(
|
|
12577
|
+
return u ? (u.putImageData(Ju(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
12578
|
}
|
|
12536
|
-
function
|
|
12579
|
+
function Xu(e, t, n, r, i, a, o, s = 1, c = 0, l = 0) {
|
|
12537
12580
|
let u = document.createElement("canvas");
|
|
12538
|
-
return u.width = Math.max(1, Math.round(r)), u.height = Math.max(1, Math.round(i)),
|
|
12581
|
+
return u.width = Math.max(1, Math.round(r)), u.height = Math.max(1, Math.round(i)), Zu(u, e, t, n, a, o, s, c, l), u;
|
|
12539
12582
|
}
|
|
12540
|
-
function
|
|
12583
|
+
function Zu(e, t, n, r, i, a, o = 1, s = 0, c = 0) {
|
|
12541
12584
|
let l = e.getContext("2d");
|
|
12542
12585
|
if (!l) return;
|
|
12543
12586
|
l.fillStyle = a, l.fillRect(0, 0, e.width, e.height);
|
|
12544
12587
|
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
12588
|
l.drawImage(t, (e.width - p) / 2 + h, (e.height - m) / 2 + g, p, m);
|
|
12546
12589
|
}
|
|
12547
|
-
function
|
|
12590
|
+
function Qu(e) {
|
|
12548
12591
|
let t = (t, n) => {
|
|
12549
12592
|
let r = t * 374761393 + n * 668265263 + e * 1442695041 | 0;
|
|
12550
12593
|
return r = Math.imul(r ^ r >>> 13, 1274126177), ((r ^ r >>> 16) >>> 0) / 4294967295;
|
|
12551
12594
|
};
|
|
12552
12595
|
return (e, n) => {
|
|
12553
|
-
let r = Math.floor(e), i = Math.floor(n), a =
|
|
12596
|
+
let r = Math.floor(e), i = Math.floor(n), a = zu(e - r), o = zu(n - i), s = t(r, i), c = t(r + 1, i), l = t(r, i + 1), u = t(r + 1, i + 1);
|
|
12554
12597
|
return s * (1 - a) * (1 - o) + c * a * (1 - o) + l * (1 - a) * o + u * a * o;
|
|
12555
12598
|
};
|
|
12556
12599
|
}
|
|
12557
|
-
function
|
|
12600
|
+
function $u(e, t, n, r) {
|
|
12558
12601
|
let i = 0, a = .5, o = 1, s = 0;
|
|
12559
12602
|
for (let c = 0; c < r; c++) i += a * e(t * o, n * o), s += a, o *= 2, a *= .5;
|
|
12560
12603
|
return i / s;
|
|
12561
12604
|
}
|
|
12562
|
-
function
|
|
12563
|
-
let t = Math.max(64, Math.min(1280, Math.round(e))), n =
|
|
12605
|
+
function ed(e = 220) {
|
|
12606
|
+
let t = Math.max(64, Math.min(1280, Math.round(e))), n = ld.get(t);
|
|
12564
12607
|
if (n) return n;
|
|
12565
12608
|
let r = document.createElement("canvas");
|
|
12566
12609
|
r.width = t, r.height = t;
|
|
12567
12610
|
let i = r.getContext("2d");
|
|
12568
12611
|
if (!i) return r;
|
|
12569
|
-
let a = i.createImageData(t, t), o =
|
|
12612
|
+
let a = i.createImageData(t, t), o = Qu(11), s = Qu(91), c = Qu(47), l = [
|
|
12570
12613
|
[0, [
|
|
12571
12614
|
34,
|
|
12572
12615
|
26,
|
|
@@ -12610,24 +12653,24 @@ function Ju(e = 220) {
|
|
|
12610
12653
|
return l[l.length - 1][1];
|
|
12611
12654
|
};
|
|
12612
12655
|
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(
|
|
12656
|
+
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($u(o, l, d, 4)), h = Math.max(0, $u(c, l * 1.6 + 3, d * 1.6, 3) - .55) * 1.7;
|
|
12614
12657
|
f = f * (1 - h) + 70 * h, p = p * (1 - h) + 210 * h, m = m * (1 - h) + 200 * h;
|
|
12615
12658
|
let g = (e * t + n) * 4;
|
|
12616
12659
|
a.data[g] = f, a.data[g + 1] = p, a.data[g + 2] = m, a.data[g + 3] = 255;
|
|
12617
12660
|
}
|
|
12618
|
-
return i.putImageData(a, 0, 0),
|
|
12661
|
+
return i.putImageData(a, 0, 0), ld.set(t, r), r;
|
|
12619
12662
|
}
|
|
12620
|
-
function
|
|
12621
|
-
let i = `${e}|${t}x${n}`, a =
|
|
12663
|
+
function td(e, t, n, r) {
|
|
12664
|
+
let i = `${e}|${t}x${n}`, a = ud.get(i);
|
|
12622
12665
|
if (a) return a;
|
|
12623
12666
|
let o = document.createElement("canvas");
|
|
12624
12667
|
o.width = t, o.height = n;
|
|
12625
12668
|
let s = o.getContext("2d");
|
|
12626
|
-
return s && r(s, t, n),
|
|
12669
|
+
return s && r(s, t, n), ud.set(i, o), o;
|
|
12627
12670
|
}
|
|
12628
|
-
function
|
|
12671
|
+
function nd(e = 240) {
|
|
12629
12672
|
let t = Math.max(120, Math.min(2048, Math.round(e)));
|
|
12630
|
-
return
|
|
12673
|
+
return td("vaporwave", t, Math.round(t * 2 / 3), (e, t, n) => {
|
|
12631
12674
|
let r = t / 240, i = e.createLinearGradient(0, 0, 0, n);
|
|
12632
12675
|
i.addColorStop(0, "#120638"), i.addColorStop(.56, "#8e2de2"), i.addColorStop(1, "#ff2fa8"), e.fillStyle = i, e.fillRect(0, 0, t, n);
|
|
12633
12676
|
let a = n * .48, o = n * .28, s = e.createLinearGradient(0, a - o, 0, a + o);
|
|
@@ -12643,9 +12686,9 @@ function Xu(e = 240) {
|
|
|
12643
12686
|
e.globalAlpha = 1;
|
|
12644
12687
|
});
|
|
12645
12688
|
}
|
|
12646
|
-
function
|
|
12689
|
+
function rd(e = 220) {
|
|
12647
12690
|
let t = Math.max(110, Math.min(2048, Math.round(e)));
|
|
12648
|
-
return
|
|
12691
|
+
return td("kaleidoscope", t, t, (e, t, n) => {
|
|
12649
12692
|
let r = t / 220, i = [
|
|
12650
12693
|
"#00e5ff",
|
|
12651
12694
|
"#6c3bff",
|
|
@@ -12661,25 +12704,25 @@ function Zu(e = 220) {
|
|
|
12661
12704
|
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
12705
|
});
|
|
12663
12706
|
}
|
|
12664
|
-
function
|
|
12665
|
-
return e.build ? e.build(t) :
|
|
12707
|
+
function id(e, t) {
|
|
12708
|
+
return e.build ? e.build(t) : Vu({
|
|
12666
12709
|
stops: e.stops ?? [],
|
|
12667
12710
|
edgeColor: e.edgeColor ?? "#8e9dff",
|
|
12668
12711
|
edgeAmount: e.edgeAmount ?? 0
|
|
12669
12712
|
});
|
|
12670
12713
|
}
|
|
12671
|
-
function
|
|
12672
|
-
return
|
|
12714
|
+
function ad(e) {
|
|
12715
|
+
return Uu(new Zi().load(e));
|
|
12673
12716
|
}
|
|
12674
|
-
var
|
|
12675
|
-
Vc(), hl(), Gl(),
|
|
12717
|
+
var od, sd, cd, ld, ud, dd, fd = t((() => {
|
|
12718
|
+
Vc(), hl(), Gl(), od = 256, sd = 64, cd = (e) => e.map(([e, t]) => ({
|
|
12676
12719
|
color: e,
|
|
12677
12720
|
pos: t
|
|
12678
|
-
})),
|
|
12721
|
+
})), ld = /* @__PURE__ */ new Map(), ud = /* @__PURE__ */ new Map(), dd = {
|
|
12679
12722
|
palestine: {
|
|
12680
12723
|
label: "Palestine",
|
|
12681
12724
|
kind: "gradient",
|
|
12682
|
-
stops:
|
|
12725
|
+
stops: cd([
|
|
12683
12726
|
["#000000", 0],
|
|
12684
12727
|
["#f7f7f2", .34],
|
|
12685
12728
|
["#149954", .67],
|
|
@@ -12691,7 +12734,7 @@ var ed, td, nd, rd, id, ad, od = t((() => {
|
|
|
12691
12734
|
spain: {
|
|
12692
12735
|
label: "Spain",
|
|
12693
12736
|
kind: "gradient",
|
|
12694
|
-
stops:
|
|
12737
|
+
stops: cd([
|
|
12695
12738
|
["#aa151b", 0],
|
|
12696
12739
|
["#aa151b", .24],
|
|
12697
12740
|
["#f1bf00", .34],
|
|
@@ -12705,7 +12748,7 @@ var ed, td, nd, rd, id, ad, od = t((() => {
|
|
|
12705
12748
|
grandLine: {
|
|
12706
12749
|
label: "Grand Line",
|
|
12707
12750
|
kind: "gradient",
|
|
12708
|
-
stops:
|
|
12751
|
+
stops: cd([
|
|
12709
12752
|
["#071b33", 0],
|
|
12710
12753
|
["#087ea4", .22],
|
|
12711
12754
|
["#45d4c5", .4],
|
|
@@ -12720,22 +12763,22 @@ var ed, td, nd, rd, id, ad, od = t((() => {
|
|
|
12720
12763
|
vaporwave: {
|
|
12721
12764
|
label: "Vaporwave Sunset",
|
|
12722
12765
|
kind: "image",
|
|
12723
|
-
build:
|
|
12766
|
+
build: nd
|
|
12724
12767
|
},
|
|
12725
12768
|
kaleidoscope: {
|
|
12726
12769
|
label: "Kaleidoscope",
|
|
12727
12770
|
kind: "image",
|
|
12728
|
-
build:
|
|
12771
|
+
build: rd
|
|
12729
12772
|
},
|
|
12730
12773
|
nebula: {
|
|
12731
12774
|
label: "Nebula (2D)",
|
|
12732
12775
|
kind: "image",
|
|
12733
|
-
build:
|
|
12776
|
+
build: ed
|
|
12734
12777
|
},
|
|
12735
12778
|
sunset: {
|
|
12736
12779
|
label: "Sunset",
|
|
12737
12780
|
kind: "gradient",
|
|
12738
|
-
stops:
|
|
12781
|
+
stops: cd([
|
|
12739
12782
|
["#3b1c6b", 0],
|
|
12740
12783
|
["#8b2fa0", .3],
|
|
12741
12784
|
["#e0457a", .56],
|
|
@@ -12748,7 +12791,7 @@ var ed, td, nd, rd, id, ad, od = t((() => {
|
|
|
12748
12791
|
aurora: {
|
|
12749
12792
|
label: "Aurora",
|
|
12750
12793
|
kind: "gradient",
|
|
12751
|
-
stops:
|
|
12794
|
+
stops: cd([
|
|
12752
12795
|
["#0b3d4f", 0],
|
|
12753
12796
|
["#1fb89e", .3],
|
|
12754
12797
|
["#5ee0a0", .52],
|
|
@@ -12761,7 +12804,7 @@ var ed, td, nd, rd, id, ad, od = t((() => {
|
|
|
12761
12804
|
ocean: {
|
|
12762
12805
|
label: "Ocean",
|
|
12763
12806
|
kind: "gradient",
|
|
12764
|
-
stops:
|
|
12807
|
+
stops: cd([
|
|
12765
12808
|
["#0a1f4d", 0],
|
|
12766
12809
|
["#1f6fb8", .36],
|
|
12767
12810
|
["#2bd0d0", .66],
|
|
@@ -12773,7 +12816,7 @@ var ed, td, nd, rd, id, ad, od = t((() => {
|
|
|
12773
12816
|
ember: {
|
|
12774
12817
|
label: "Ember",
|
|
12775
12818
|
kind: "gradient",
|
|
12776
|
-
stops:
|
|
12819
|
+
stops: cd([
|
|
12777
12820
|
["#2a0707", 0],
|
|
12778
12821
|
["#a81e1e", .34],
|
|
12779
12822
|
["#ff5a2e", .64],
|
|
@@ -12785,7 +12828,7 @@ var ed, td, nd, rd, id, ad, od = t((() => {
|
|
|
12785
12828
|
iris: {
|
|
12786
12829
|
label: "Iris",
|
|
12787
12830
|
kind: "gradient",
|
|
12788
|
-
stops:
|
|
12831
|
+
stops: cd([
|
|
12789
12832
|
["#2e1065", 0],
|
|
12790
12833
|
["#7c3aed", .34],
|
|
12791
12834
|
["#db2777", .64],
|
|
@@ -12797,7 +12840,7 @@ var ed, td, nd, rd, id, ad, od = t((() => {
|
|
|
12797
12840
|
mono: {
|
|
12798
12841
|
label: "Mono",
|
|
12799
12842
|
kind: "gradient",
|
|
12800
|
-
stops:
|
|
12843
|
+
stops: cd([
|
|
12801
12844
|
["#16161e", 0],
|
|
12802
12845
|
["#6b7280", .4],
|
|
12803
12846
|
["#c2c8d2", .72],
|
|
@@ -12810,39 +12853,39 @@ var ed, td, nd, rd, id, ad, od = t((() => {
|
|
|
12810
12853
|
}));
|
|
12811
12854
|
//#endregion
|
|
12812
12855
|
//#region src/util/base64.ts
|
|
12813
|
-
function
|
|
12856
|
+
function pd(e) {
|
|
12814
12857
|
let t = atob(e.replace(/-/g, "+").replace(/_/g, "/")), n = new Uint8Array(new ArrayBuffer(t.length));
|
|
12815
12858
|
for (let e = 0; e < t.length; e++) n[e] = t.charCodeAt(e);
|
|
12816
12859
|
return n;
|
|
12817
12860
|
}
|
|
12818
|
-
var
|
|
12861
|
+
var md = t((() => {}));
|
|
12819
12862
|
//#endregion
|
|
12820
12863
|
//#region src/renderer/heroPalette.ts
|
|
12821
|
-
function
|
|
12864
|
+
function hd() {
|
|
12822
12865
|
let e = document.createElement("canvas");
|
|
12823
|
-
e.width =
|
|
12866
|
+
e.width = _d, e.height = _d;
|
|
12824
12867
|
let t = e.getContext("2d");
|
|
12825
12868
|
if (t) {
|
|
12826
|
-
let e =
|
|
12827
|
-
t.putImageData(new ImageData(new Uint8ClampedArray(e.buffer),
|
|
12869
|
+
let e = pd(vd);
|
|
12870
|
+
t.putImageData(new ImageData(new Uint8ClampedArray(e.buffer), _d, _d), 0, 0);
|
|
12828
12871
|
}
|
|
12829
12872
|
return e;
|
|
12830
12873
|
}
|
|
12831
|
-
function
|
|
12832
|
-
let e =
|
|
12874
|
+
function gd() {
|
|
12875
|
+
let e = Uu(new ci(pd(vd), _d, _d, U, Se));
|
|
12833
12876
|
return e.needsUpdate = !0, e;
|
|
12834
12877
|
}
|
|
12835
|
-
var
|
|
12836
|
-
Vc(),
|
|
12878
|
+
var _d, vd, yd = t((() => {
|
|
12879
|
+
Vc(), md(), fd(), _d = 32, vd = "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
12880
|
}));
|
|
12838
12881
|
//#endregion
|
|
12839
12882
|
//#region src/renderer/WaveRenderer.ts
|
|
12840
|
-
function
|
|
12841
|
-
let n =
|
|
12883
|
+
function bd(e, t) {
|
|
12884
|
+
let n = wd.set(e);
|
|
12842
12885
|
return t.set(n.r, n.g, n.b);
|
|
12843
12886
|
}
|
|
12844
|
-
var
|
|
12845
|
-
Vc(), nl(), il(), cl(), Zc(), fl(),
|
|
12887
|
+
var xd, Sd, Cd, wd, Td, Ed = t((() => {
|
|
12888
|
+
Vc(), nl(), il(), cl(), Zc(), fl(), ou(), pu(), Ru(), fd(), yd(), Gl(), xd = 220, Sd = 1333, Cd = class {
|
|
12846
12889
|
makeVideo;
|
|
12847
12890
|
onVideoReady;
|
|
12848
12891
|
texture;
|
|
@@ -12855,8 +12898,8 @@ var hd, gd, _d, vd, yd, bd = t((() => {
|
|
|
12855
12898
|
}
|
|
12856
12899
|
apply(e, t) {
|
|
12857
12900
|
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 = () =>
|
|
12901
|
+
if (n) this.ensureVideo(n), this.video?.readyState && this.video.readyState >= 2 ? (a = "video|" + n, o = () => Uu(new _i(this.video))) : (a = "video-loading|" + n, o = () => gd());
|
|
12902
|
+
else if (r) this.clearVideo(), a = "url|" + r, o = () => ad(r);
|
|
12860
12903
|
else if (i === "stops") {
|
|
12861
12904
|
this.clearVideo();
|
|
12862
12905
|
let t = {
|
|
@@ -12864,8 +12907,8 @@ var hd, gd, _d, vd, yd, bd = t((() => {
|
|
|
12864
12907
|
edgeColor: e.paletteEdgeColor ?? "#8e9dff",
|
|
12865
12908
|
edgeAmount: e.paletteEdgeAmount ?? .3
|
|
12866
12909
|
};
|
|
12867
|
-
a = "stops|" +
|
|
12868
|
-
} else
|
|
12910
|
+
a = "stops|" + Hu(t), o = () => Gu(t);
|
|
12911
|
+
} else dd[i] ? (this.clearVideo(), a = "map|" + i, o = () => Wu(id(dd[i]))) : (this.clearVideo(), a = "hero", o = () => gd());
|
|
12869
12912
|
(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
12913
|
}
|
|
12871
12914
|
syncPlayback(e, t) {
|
|
@@ -12888,7 +12931,7 @@ var hd, gd, _d, vd, yd, bd = t((() => {
|
|
|
12888
12931
|
dispose() {
|
|
12889
12932
|
this.texture?.dispose(), this.texture = void 0, this.clearVideo(), this.failedUrl = "";
|
|
12890
12933
|
}
|
|
12891
|
-
},
|
|
12934
|
+
}, wd = new X(), Td = class {
|
|
12892
12935
|
renderer;
|
|
12893
12936
|
scene = new Gn();
|
|
12894
12937
|
camera;
|
|
@@ -12896,6 +12939,12 @@ var hd, gd, _d, vd, yd, bd = t((() => {
|
|
|
12896
12939
|
composer;
|
|
12897
12940
|
postPass;
|
|
12898
12941
|
bloomPass;
|
|
12942
|
+
ditherPass;
|
|
12943
|
+
innerLightPass;
|
|
12944
|
+
halftonePass;
|
|
12945
|
+
heatmapPass;
|
|
12946
|
+
paperTexturePass;
|
|
12947
|
+
halftoneCmykPass;
|
|
12899
12948
|
container;
|
|
12900
12949
|
respectReducedMotion;
|
|
12901
12950
|
skipIntroRamp;
|
|
@@ -12960,7 +13009,7 @@ var hd, gd, _d, vd, yd, bd = t((() => {
|
|
|
12960
13009
|
}
|
|
12961
13010
|
get segments() {
|
|
12962
13011
|
let e = this.config.quality / Math.sqrt(Math.max(1, this.config.waves.length));
|
|
12963
|
-
return Gt.clamp(Math.round(
|
|
13012
|
+
return Gt.clamp(Math.round(xd * e), 24, 360);
|
|
12964
13013
|
}
|
|
12965
13014
|
makeUniforms() {
|
|
12966
13015
|
let e = [], t = [];
|
|
@@ -13048,6 +13097,7 @@ var hd, gd, _d, vd, yd, bd = t((() => {
|
|
|
13048
13097
|
uPointerPush: { value: 0 },
|
|
13049
13098
|
uPointerWake: { value: 0 },
|
|
13050
13099
|
uPointerVel: { value: new G(0, 0) },
|
|
13100
|
+
uShapeFlow: { value: 0 },
|
|
13051
13101
|
uPointerThin: { value: 0 },
|
|
13052
13102
|
uPointerHue: { value: 0 },
|
|
13053
13103
|
uPointerLighten: { value: 0 },
|
|
@@ -13061,10 +13111,10 @@ var hd, gd, _d, vd, yd, bd = t((() => {
|
|
|
13061
13111
|
let t = {};
|
|
13062
13112
|
e?.twistMotion && (t.TWIST_MOTION = ""), (this.config.loopSeconds ?? 0) > 0 && (t.LOOP_MOTION = "");
|
|
13063
13113
|
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 &&
|
|
13114
|
+
return ((e?.detailAmount ?? 0) !== 0 || n) && (t.DETAIL_OCTAVE = ""), (e?.depthTint ?? 0) > 0 && (t.DEPTH_TINT = ""), (e?.edgeFeather ?? .1) !== .1 && (t.EDGE_FEATHER = ""), e && vu(this.config, e) && (t.POINTER_FX = "", yu(this.config, e) && (t.POINTER_RIPPLES = "")), t;
|
|
13065
13115
|
}
|
|
13066
13116
|
addWave() {
|
|
13067
|
-
let e = new
|
|
13117
|
+
let e = new fu(this.segments), t = this.config.waves[this.waves.length] ?? this.config.waves[0], n = new Oi({
|
|
13068
13118
|
uniforms: this.makeUniforms(),
|
|
13069
13119
|
defines: this.waveDefines(t),
|
|
13070
13120
|
vertexShader: Yl,
|
|
@@ -13077,7 +13127,7 @@ var hd, gd, _d, vd, yd, bd = t((() => {
|
|
|
13077
13127
|
this.applyBlendMode(n, t?.blendMode ?? "squared");
|
|
13078
13128
|
let r = new si(e.geometry, n);
|
|
13079
13129
|
r.frustumCulled = !1, this.group.add(r);
|
|
13080
|
-
let i = new
|
|
13130
|
+
let i = new Cd((e) => this.createLoopingVideo(e), () => {
|
|
13081
13131
|
this.updatePaletteTextures(), this.syncVideoPlayback(), this.running || this.renderOnce();
|
|
13082
13132
|
});
|
|
13083
13133
|
this.waves.push({
|
|
@@ -13126,21 +13176,21 @@ var hd, gd, _d, vd, yd, bd = t((() => {
|
|
|
13126
13176
|
color: "#ffffff",
|
|
13127
13177
|
pos: 0
|
|
13128
13178
|
};
|
|
13129
|
-
|
|
13179
|
+
bd(t.color, l[e]), u[e] = t.pos;
|
|
13130
13180
|
}
|
|
13131
13181
|
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
13182
|
let d = n.meshGradientPoints.slice(0, 8), f = r.uMeshPointPos.value, p = r.uMeshPointColor.value, m = r.uMeshPointInfluence.value;
|
|
13133
13183
|
for (let e = 0; e < 8; e++) {
|
|
13134
13184
|
let t = d[e] ?? d[d.length - 1];
|
|
13135
|
-
t && (f[e].set(t.x, t.y),
|
|
13185
|
+
t && (f[e].set(t.x, t.y), bd(t.color, p[e]), m[e] = t.influence);
|
|
13136
13186
|
}
|
|
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,
|
|
13187
|
+
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, bd(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, bd(n.depthTintColor ?? "#0a2540", r.uDepthTintColor.value), r.uEdgeFade.value = n.edgeFade, r.uEdgeFeather.value = n.edgeFeather ?? .1;
|
|
13138
13188
|
let h = this.config.lights ?? [];
|
|
13139
13189
|
r.uAmbient.value = this.config.ambient ?? .45, r.uNumLights.value = Math.min(h.length, 8);
|
|
13140
13190
|
let g = r.uLightPos.value, _ = r.uLightColor.value, v = r.uLightIntensity.value;
|
|
13141
13191
|
for (let e = 0; e < 8; e++) {
|
|
13142
13192
|
let t = h[e];
|
|
13143
|
-
t ? (g[e].set(t.position.x, t.position.y, t.position.z),
|
|
13193
|
+
t ? (g[e].set(t.position.x, t.position.y, t.position.z), bd(t.color, _[e]), v[e] = t.intensity) : v[e] = 0;
|
|
13144
13194
|
}
|
|
13145
13195
|
let y = n.noiseBands ?? [];
|
|
13146
13196
|
r.uNumNoiseBands.value = Math.min(y.length, 4);
|
|
@@ -13151,12 +13201,12 @@ var hd, gd, _d, vd, yd, bd = t((() => {
|
|
|
13151
13201
|
}
|
|
13152
13202
|
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
13203
|
});
|
|
13154
|
-
let e = (this.config.interaction?.radius ?? .3) * 2;
|
|
13155
|
-
this.waves.forEach((
|
|
13156
|
-
let
|
|
13157
|
-
if (!
|
|
13158
|
-
let
|
|
13159
|
-
|
|
13204
|
+
let e = (this.config.interaction?.radius ?? .3) * 2, t = this.config.interaction?.ribbonFlow ?? .8;
|
|
13205
|
+
this.waves.forEach((n, r) => {
|
|
13206
|
+
let i = this.config.waves[r] ?? this.config.waves[this.config.waves.length - 1];
|
|
13207
|
+
if (!vu(this.config, i)) return;
|
|
13208
|
+
let a = n.material.uniforms, o = i.interaction?.hover;
|
|
13209
|
+
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
13210
|
}), 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
13211
|
}
|
|
13162
13212
|
updatePaletteTextures() {
|
|
@@ -13200,13 +13250,13 @@ var hd, gd, _d, vd, yd, bd = t((() => {
|
|
|
13200
13250
|
t
|
|
13201
13251
|
].join("|");
|
|
13202
13252
|
if (a !== this.backgroundSig || !this.backgroundTexture) {
|
|
13203
|
-
let i =
|
|
13204
|
-
this.backgroundTexture?.dispose(), this.backgroundTexture =
|
|
13253
|
+
let i = Yu(n, r, e, t);
|
|
13254
|
+
this.backgroundTexture?.dispose(), this.backgroundTexture = Wu(i), this.backgroundSig = a;
|
|
13205
13255
|
}
|
|
13206
13256
|
this.scene.background = this.backgroundTexture;
|
|
13207
13257
|
return;
|
|
13208
13258
|
}
|
|
13209
|
-
let r = this.config.backgroundGradientSource ?? "stops", i =
|
|
13259
|
+
let r = this.config.backgroundGradientSource ?? "stops", i = dd[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
13260
|
"gradient",
|
|
13211
13261
|
r,
|
|
13212
13262
|
n,
|
|
@@ -13216,14 +13266,14 @@ var hd, gd, _d, vd, yd, bd = t((() => {
|
|
|
13216
13266
|
t
|
|
13217
13267
|
].join("|");
|
|
13218
13268
|
if (s !== this.backgroundSig || !this.backgroundTexture) {
|
|
13219
|
-
let r =
|
|
13269
|
+
let r = Ku({
|
|
13220
13270
|
stops: a,
|
|
13221
13271
|
type: n,
|
|
13222
13272
|
angle: this.config.backgroundGradientAngle,
|
|
13223
13273
|
width: e,
|
|
13224
13274
|
height: t
|
|
13225
13275
|
});
|
|
13226
|
-
this.backgroundTexture?.dispose(), this.backgroundTexture =
|
|
13276
|
+
this.backgroundTexture?.dispose(), this.backgroundTexture = Wu(r), this.backgroundSig = s;
|
|
13227
13277
|
}
|
|
13228
13278
|
this.scene.background = this.backgroundTexture;
|
|
13229
13279
|
}
|
|
@@ -13246,7 +13296,7 @@ var hd, gd, _d, vd, yd, bd = t((() => {
|
|
|
13246
13296
|
c = this.backgroundImage, l = this.backgroundImage.naturalWidth, u = this.backgroundImage.naturalHeight, d = `custom|${s}`;
|
|
13247
13297
|
} else {
|
|
13248
13298
|
this.clearBackgroundVideo();
|
|
13249
|
-
let r = this.config.backgroundImageSource ?? "vaporwave", i = r === "hero" ?
|
|
13299
|
+
let r = this.config.backgroundImageSource ?? "vaporwave", i = r === "hero" ? hd() : dd[r]?.kind === "image" ? id(dd[r], Math.max(t, n)) : null;
|
|
13250
13300
|
if (!i) {
|
|
13251
13301
|
this.scene.background = e;
|
|
13252
13302
|
return;
|
|
@@ -13265,8 +13315,8 @@ var hd, gd, _d, vd, yd, bd = t((() => {
|
|
|
13265
13315
|
n
|
|
13266
13316
|
].join("|");
|
|
13267
13317
|
if (f !== this.backgroundSig || !this.backgroundTexture) {
|
|
13268
|
-
let e =
|
|
13269
|
-
this.backgroundTexture?.dispose(), this.backgroundTexture =
|
|
13318
|
+
let e = Xu(c, l, u, t, n, r, this.config.background, i, a.x, a.y);
|
|
13319
|
+
this.backgroundTexture?.dispose(), this.backgroundTexture = Wu(e), this.backgroundSig = f, this.backgroundVideoCanvas = o ? e : void 0;
|
|
13270
13320
|
}
|
|
13271
13321
|
this.scene.background = this.backgroundTexture;
|
|
13272
13322
|
}
|
|
@@ -13318,11 +13368,11 @@ var hd, gd, _d, vd, yd, bd = t((() => {
|
|
|
13318
13368
|
x: 0,
|
|
13319
13369
|
y: 0
|
|
13320
13370
|
};
|
|
13321
|
-
|
|
13371
|
+
Zu(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
13372
|
}
|
|
13323
13373
|
applyPost() {
|
|
13324
13374
|
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();
|
|
13375
|
+
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
13376
|
}
|
|
13327
13377
|
applyBloom() {
|
|
13328
13378
|
let e = this.config.bloomStrength ?? 0;
|
|
@@ -13334,6 +13384,104 @@ var hd, gd, _d, vd, yd, bd = t((() => {
|
|
|
13334
13384
|
this.bloomPass.strength = e, this.bloomPass.radius = this.config.bloomRadius ?? .4, this.bloomPass.threshold = this.config.bloomThreshold ?? .85;
|
|
13335
13385
|
} else this.bloomPass &&= (this.composer.removePass(this.bloomPass), this.bloomPass.dispose(), void 0);
|
|
13336
13386
|
}
|
|
13387
|
+
applyDither() {
|
|
13388
|
+
let e = this.config.dither ?? 0;
|
|
13389
|
+
if (e > 0) {
|
|
13390
|
+
this.ditherPass || (this.ditherPass = new Xc({
|
|
13391
|
+
uniforms: {
|
|
13392
|
+
tDiffuse: { value: null },
|
|
13393
|
+
uResolution: { value: this.renderer.getDrawingBufferSize(new G()) },
|
|
13394
|
+
uDitherStrength: { value: e },
|
|
13395
|
+
uDitherScale: { value: this.config.ditherScale ?? 2 },
|
|
13396
|
+
uDitherSteps: { value: this.config.ditherSteps ?? 4 }
|
|
13397
|
+
},
|
|
13398
|
+
vertexShader: Ql,
|
|
13399
|
+
fragmentShader: eu
|
|
13400
|
+
}), this.composer.addPass(this.ditherPass));
|
|
13401
|
+
let t = this.ditherPass.uniforms;
|
|
13402
|
+
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));
|
|
13403
|
+
} else this.ditherPass &&= (this.composer.removePass(this.ditherPass), this.ditherPass.dispose(), void 0);
|
|
13404
|
+
}
|
|
13405
|
+
applyInnerLight() {
|
|
13406
|
+
let e = this.config.innerLight ?? 0;
|
|
13407
|
+
if (e > 0) {
|
|
13408
|
+
let t = this.config.innerLightX ?? .5, n = this.config.innerLightY ?? .15;
|
|
13409
|
+
this.innerLightPass || (this.innerLightPass = new Xc({
|
|
13410
|
+
uniforms: {
|
|
13411
|
+
tDiffuse: { value: null },
|
|
13412
|
+
uInnerLight: { value: e },
|
|
13413
|
+
uInnerLightDensity: { value: this.config.innerLightDensity ?? .5 },
|
|
13414
|
+
uInnerLightDecay: { value: this.config.innerLightDecay ?? .95 },
|
|
13415
|
+
uInnerLightCenter: { value: new G(t, n) }
|
|
13416
|
+
},
|
|
13417
|
+
vertexShader: Ql,
|
|
13418
|
+
fragmentShader: tu
|
|
13419
|
+
}), this.composer.insertPass(this.innerLightPass, 1));
|
|
13420
|
+
let r = this.innerLightPass.uniforms;
|
|
13421
|
+
r.uInnerLight.value = e, r.uInnerLightDensity.value = this.config.innerLightDensity ?? .5, r.uInnerLightDecay.value = this.config.innerLightDecay ?? .95, r.uInnerLightCenter.value.set(t, n);
|
|
13422
|
+
} else this.innerLightPass &&= (this.composer.removePass(this.innerLightPass), this.innerLightPass.dispose(), void 0);
|
|
13423
|
+
}
|
|
13424
|
+
applyHalftone() {
|
|
13425
|
+
let e = this.config.halftone ?? 0;
|
|
13426
|
+
if (e > 0) {
|
|
13427
|
+
this.halftonePass || (this.halftonePass = new Xc({
|
|
13428
|
+
uniforms: {
|
|
13429
|
+
tDiffuse: { value: null },
|
|
13430
|
+
uResolution: { value: this.renderer.getDrawingBufferSize(new G()) },
|
|
13431
|
+
uHalftone: { value: e },
|
|
13432
|
+
uHalftoneCell: { value: this.config.halftoneCell ?? 6 },
|
|
13433
|
+
uHalftoneAngle: { value: this.config.halftoneAngle ?? .4 }
|
|
13434
|
+
},
|
|
13435
|
+
vertexShader: Ql,
|
|
13436
|
+
fragmentShader: nu
|
|
13437
|
+
}), this.composer.addPass(this.halftonePass));
|
|
13438
|
+
let t = this.halftonePass.uniforms;
|
|
13439
|
+
t.uHalftone.value = e, t.uHalftoneCell.value = Math.max(2, this.config.halftoneCell ?? 6), t.uHalftoneAngle.value = this.config.halftoneAngle ?? .4;
|
|
13440
|
+
} else this.halftonePass &&= (this.composer.removePass(this.halftonePass), this.halftonePass.dispose(), void 0);
|
|
13441
|
+
}
|
|
13442
|
+
applyHeatmap() {
|
|
13443
|
+
let e = this.config.heatmap ?? 0;
|
|
13444
|
+
e > 0 ? (this.heatmapPass || (this.heatmapPass = new Xc({
|
|
13445
|
+
uniforms: {
|
|
13446
|
+
tDiffuse: { value: null },
|
|
13447
|
+
uHeatmap: { value: e }
|
|
13448
|
+
},
|
|
13449
|
+
vertexShader: Ql,
|
|
13450
|
+
fragmentShader: ru
|
|
13451
|
+
}), this.composer.addPass(this.heatmapPass)), this.heatmapPass.uniforms.uHeatmap.value = e) : this.heatmapPass &&= (this.composer.removePass(this.heatmapPass), this.heatmapPass.dispose(), void 0);
|
|
13452
|
+
}
|
|
13453
|
+
applyPaperTexture() {
|
|
13454
|
+
let e = this.config.paperTexture ?? 0;
|
|
13455
|
+
if (e > 0) {
|
|
13456
|
+
this.paperTexturePass || (this.paperTexturePass = new Xc({
|
|
13457
|
+
uniforms: {
|
|
13458
|
+
tDiffuse: { value: null },
|
|
13459
|
+
uPaper: { value: e },
|
|
13460
|
+
uPaperScale: { value: this.config.paperTextureScale ?? 2 }
|
|
13461
|
+
},
|
|
13462
|
+
vertexShader: Ql,
|
|
13463
|
+
fragmentShader: iu
|
|
13464
|
+
}), this.composer.addPass(this.paperTexturePass));
|
|
13465
|
+
let t = this.paperTexturePass.uniforms;
|
|
13466
|
+
t.uPaper.value = e, t.uPaperScale.value = Math.max(.5, this.config.paperTextureScale ?? 2);
|
|
13467
|
+
} else this.paperTexturePass &&= (this.composer.removePass(this.paperTexturePass), this.paperTexturePass.dispose(), void 0);
|
|
13468
|
+
}
|
|
13469
|
+
applyHalftoneCmyk() {
|
|
13470
|
+
let e = this.config.halftoneCmyk ?? 0;
|
|
13471
|
+
if (e > 0) {
|
|
13472
|
+
this.halftoneCmykPass || (this.halftoneCmykPass = new Xc({
|
|
13473
|
+
uniforms: {
|
|
13474
|
+
tDiffuse: { value: null },
|
|
13475
|
+
uHalftoneCmyk: { value: e },
|
|
13476
|
+
uHalftoneCmykCell: { value: this.config.halftoneCmykCell ?? 6 }
|
|
13477
|
+
},
|
|
13478
|
+
vertexShader: Ql,
|
|
13479
|
+
fragmentShader: au
|
|
13480
|
+
}), this.composer.addPass(this.halftoneCmykPass));
|
|
13481
|
+
let t = this.halftoneCmykPass.uniforms;
|
|
13482
|
+
t.uHalftoneCmyk.value = e, t.uHalftoneCmykCell.value = Math.max(2, this.config.halftoneCmykCell ?? 6);
|
|
13483
|
+
} else this.halftoneCmykPass &&= (this.composer.removePass(this.halftoneCmykPass), this.halftoneCmykPass.dispose(), void 0);
|
|
13484
|
+
}
|
|
13337
13485
|
onResize = () => {
|
|
13338
13486
|
this.resize();
|
|
13339
13487
|
};
|
|
@@ -13347,7 +13495,7 @@ var hd, gd, _d, vd, yd, bd = t((() => {
|
|
|
13347
13495
|
let e = this.outputSize?.width ?? Math.max(1, this.container.clientWidth), t = this.outputSize?.height ?? Math.max(1, this.container.clientHeight), n = this.outputSize ? 1 : Math.min(window.devicePixelRatio || 1, this.config.dprMax);
|
|
13348
13496
|
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
13497
|
let r = e * n, i = t * n;
|
|
13350
|
-
this.postPass.uniforms.uResolution.value.set(r, i);
|
|
13498
|
+
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
13499
|
for (let e of this.waves) e.material.uniforms.uResolution.value.set(r, i);
|
|
13352
13500
|
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
13501
|
}
|
|
@@ -13396,8 +13544,8 @@ var hd, gd, _d, vd, yd, bd = t((() => {
|
|
|
13396
13544
|
this.updateBackgroundVideoFrame(), this.updateTime(), this.applyInteraction(), this.updateClipPlanes(), this.composer.render(), this.onAfterRenderFrame();
|
|
13397
13545
|
}
|
|
13398
13546
|
syncInteraction() {
|
|
13399
|
-
let e =
|
|
13400
|
-
e && !this.interaction ? this.interaction = new
|
|
13547
|
+
let e = xu(this.config);
|
|
13548
|
+
e && !this.interaction ? this.interaction = new Lu(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
13549
|
}
|
|
13402
13550
|
applyInteraction() {
|
|
13403
13551
|
if (this.interaction) {
|
|
@@ -13405,13 +13553,13 @@ var hd, gd, _d, vd, yd, bd = t((() => {
|
|
|
13405
13553
|
this.applyInteractionRest();
|
|
13406
13554
|
return;
|
|
13407
13555
|
}
|
|
13408
|
-
|
|
13556
|
+
bu(this.config) && this.applyPointerField(this.interaction), this.applyBindings(this.interaction);
|
|
13409
13557
|
}
|
|
13410
13558
|
}
|
|
13411
13559
|
applyInteractionRest() {
|
|
13412
13560
|
for (let e = 0; e < this.waves.length; e++) {
|
|
13413
13561
|
let t = this.config.waves[e] ?? this.config.waves[this.config.waves.length - 1];
|
|
13414
|
-
if (!
|
|
13562
|
+
if (!vu(this.config, t)) continue;
|
|
13415
13563
|
let n = this.waves[e].material.uniforms;
|
|
13416
13564
|
n.uPointerActive.value = 0;
|
|
13417
13565
|
let r = n.uRippleAmp.value;
|
|
@@ -13425,7 +13573,7 @@ var hd, gd, _d, vd, yd, bd = t((() => {
|
|
|
13425
13573
|
out: this.interactionSceneOut
|
|
13426
13574
|
};
|
|
13427
13575
|
for (let n of e) {
|
|
13428
|
-
let e =
|
|
13576
|
+
let e = Iu[n.target];
|
|
13429
13577
|
e.apply(e.base(this.config), t);
|
|
13430
13578
|
}
|
|
13431
13579
|
}
|
|
@@ -13435,7 +13583,7 @@ var hd, gd, _d, vd, yd, bd = t((() => {
|
|
|
13435
13583
|
if (!t || !n || n.length === 0) continue;
|
|
13436
13584
|
let r = this.waves[e];
|
|
13437
13585
|
for (let e of n) {
|
|
13438
|
-
let n =
|
|
13586
|
+
let n = Fu[e.target];
|
|
13439
13587
|
n.apply(n.base(t), {
|
|
13440
13588
|
u: r.material.uniforms,
|
|
13441
13589
|
mesh: r.mesh
|
|
@@ -13447,7 +13595,7 @@ var hd, gd, _d, vd, yd, bd = t((() => {
|
|
|
13447
13595
|
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
13596
|
for (let t = 0; t < this.waves.length; t++) {
|
|
13449
13597
|
let n = this.config.waves[t] ?? this.config.waves[this.config.waves.length - 1];
|
|
13450
|
-
if (!
|
|
13598
|
+
if (!vu(this.config, n)) continue;
|
|
13451
13599
|
let s = this.waves[t].material.uniforms;
|
|
13452
13600
|
s.uPointerAgitate.value = (n.interaction?.hover?.agitate ?? 0) * a, s.uPointerVel.value.copy(o);
|
|
13453
13601
|
let c = e.fieldFor(t);
|
|
@@ -13463,7 +13611,7 @@ var hd, gd, _d, vd, yd, bd = t((() => {
|
|
|
13463
13611
|
out: this.interactionSceneOut
|
|
13464
13612
|
};
|
|
13465
13613
|
for (let n of this.config.interaction?.bindings ?? []) {
|
|
13466
|
-
let r =
|
|
13614
|
+
let r = Iu[n.target], i = Gt.lerp(n.from ?? r.base(this.config), n.to, e.bindingValue(n));
|
|
13467
13615
|
r.apply(i, t);
|
|
13468
13616
|
}
|
|
13469
13617
|
for (let t = 0; t < this.waves.length; t++) {
|
|
@@ -13471,7 +13619,7 @@ var hd, gd, _d, vd, yd, bd = t((() => {
|
|
|
13471
13619
|
if (!n || !r || r.length === 0) continue;
|
|
13472
13620
|
let i = this.waves[t];
|
|
13473
13621
|
for (let t of r) {
|
|
13474
|
-
let r =
|
|
13622
|
+
let r = Fu[t.target], a = Gt.lerp(t.from ?? r.base(n), t.to, e.bindingValue(t));
|
|
13475
13623
|
r.apply(a, {
|
|
13476
13624
|
u: i.material.uniforms,
|
|
13477
13625
|
mesh: i.mesh
|
|
@@ -13500,7 +13648,7 @@ var hd, gd, _d, vd, yd, bd = t((() => {
|
|
|
13500
13648
|
onAfterResize() {}
|
|
13501
13649
|
applyZoom() {
|
|
13502
13650
|
let e = this.camera.right - this.camera.left, t = this.camera.top - this.camera.bottom;
|
|
13503
|
-
this.camera.zoom = Math.max(e /
|
|
13651
|
+
this.camera.zoom = Math.max(e / Sd, t / 750) * (this.config.cameraZoom ?? 1) * this.interactionZoom, this.camera.updateProjectionMatrix();
|
|
13504
13652
|
}
|
|
13505
13653
|
updateClipPlanes() {
|
|
13506
13654
|
this.clipBox.makeEmpty();
|
|
@@ -13510,7 +13658,7 @@ var hd, gd, _d, vd, yd, bd = t((() => {
|
|
|
13510
13658
|
let r = n.geometry.boundingSphere;
|
|
13511
13659
|
if (!r) continue;
|
|
13512
13660
|
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 (
|
|
13661
|
+
if (vu(this.config, o)) {
|
|
13514
13662
|
let e = o.interaction?.hover;
|
|
13515
13663
|
s = (e?.agitate ?? 0) + Math.abs(e?.push ?? 0) + (e?.wake ?? 0) + (o.interaction?.press?.ripple ?? 0);
|
|
13516
13664
|
}
|
|
@@ -13552,19 +13700,19 @@ var hd, gd, _d, vd, yd, bd = t((() => {
|
|
|
13552
13700
|
dispose() {
|
|
13553
13701
|
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();
|
|
13554
13702
|
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();
|
|
13703
|
+
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
13704
|
}
|
|
13557
13705
|
};
|
|
13558
|
-
})),
|
|
13559
|
-
WaveRenderer: () =>
|
|
13706
|
+
})), Dd = /* @__PURE__ */ n({
|
|
13707
|
+
WaveRenderer: () => Td,
|
|
13560
13708
|
createDefaultConfig: () => wl
|
|
13561
13709
|
});
|
|
13562
13710
|
//#endregion
|
|
13563
13711
|
//#region src/shell/probe.ts
|
|
13564
13712
|
t((() => {
|
|
13565
|
-
|
|
13713
|
+
Ed(), Gl();
|
|
13566
13714
|
}))();
|
|
13567
|
-
function
|
|
13715
|
+
function Od() {
|
|
13568
13716
|
if (typeof document > "u") return !1;
|
|
13569
13717
|
try {
|
|
13570
13718
|
let e = document.createElement("canvas"), t = { failIfMajorPerformanceCaveat: !0 }, n = e.getContext("webgl2", t) ?? e.getContext("webgl", t);
|
|
@@ -13573,22 +13721,22 @@ function Sd() {
|
|
|
13573
13721
|
return !1;
|
|
13574
13722
|
}
|
|
13575
13723
|
}
|
|
13576
|
-
function
|
|
13724
|
+
function kd() {
|
|
13577
13725
|
return typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
13578
13726
|
}
|
|
13579
|
-
function
|
|
13727
|
+
function Ad() {
|
|
13580
13728
|
return typeof navigator > "u" ? !1 : navigator.connection?.saveData === !0;
|
|
13581
13729
|
}
|
|
13582
13730
|
//#endregion
|
|
13583
13731
|
//#region src/shell/poster.ts
|
|
13584
|
-
var
|
|
13585
|
-
function
|
|
13732
|
+
var jd = "data-wave3d-poster";
|
|
13733
|
+
function Md(e) {
|
|
13586
13734
|
getComputedStyle(e).position === "static" && (e.style.position = "relative");
|
|
13587
13735
|
}
|
|
13588
|
-
function
|
|
13589
|
-
let r = e.querySelector(`img[${
|
|
13736
|
+
function Nd(e, t, n = "fill") {
|
|
13737
|
+
let r = e.querySelector(`img[${jd}]`);
|
|
13590
13738
|
if (!r && !t) return null;
|
|
13591
|
-
r || (r = document.createElement("img"), r.setAttribute(
|
|
13739
|
+
r || (r = document.createElement("img"), r.setAttribute(jd, ""), r.decoding = "async", r.alt = "", r.setAttribute("aria-hidden", "true"), e.appendChild(r)), t && (r.src = t), Object.assign(r.style, {
|
|
13592
13740
|
position: "absolute",
|
|
13593
13741
|
inset: "0",
|
|
13594
13742
|
width: "100%",
|
|
@@ -13621,12 +13769,12 @@ function Dd(e, t, n = "fill") {
|
|
|
13621
13769
|
}
|
|
13622
13770
|
//#endregion
|
|
13623
13771
|
//#region src/shell/createWave.ts
|
|
13624
|
-
function
|
|
13772
|
+
function Pd(e, t, n, r) {
|
|
13625
13773
|
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
13774
|
r.paused !== void 0 && (p.paused = r.paused);
|
|
13627
13775
|
let m = /* @__PURE__ */ new Map(), h = !1, g = null, _, v = 0;
|
|
13628
|
-
|
|
13629
|
-
let y =
|
|
13776
|
+
Md(t);
|
|
13777
|
+
let y = Nd(t, r.poster, r.posterFit);
|
|
13630
13778
|
function b(e) {
|
|
13631
13779
|
d !== e && (d = e, r.onStateChange?.(e));
|
|
13632
13780
|
}
|
|
@@ -13674,7 +13822,7 @@ function Od(e, t, n, r) {
|
|
|
13674
13822
|
}
|
|
13675
13823
|
function E() {
|
|
13676
13824
|
if (!h) {
|
|
13677
|
-
if (o === "auto" && !
|
|
13825
|
+
if (o === "auto" && !Od()) {
|
|
13678
13826
|
x("no-webgl");
|
|
13679
13827
|
return;
|
|
13680
13828
|
}
|
|
@@ -13683,8 +13831,8 @@ function Od(e, t, n, r) {
|
|
|
13683
13831
|
}
|
|
13684
13832
|
function D() {
|
|
13685
13833
|
if (o !== "off") {
|
|
13686
|
-
if (l &&
|
|
13687
|
-
if (s && c === "poster" &&
|
|
13834
|
+
if (l && Ad()) return x("save-data");
|
|
13835
|
+
if (s && c === "poster" && kd()) return x("reduced-motion");
|
|
13688
13836
|
i && typeof IntersectionObserver < "u" ? (g = new IntersectionObserver((e) => {
|
|
13689
13837
|
e.some((e) => e.isIntersecting) && (g?.disconnect(), g = null, E());
|
|
13690
13838
|
}, { rootMargin: a }), g.observe(t)) : E();
|
|
@@ -13728,10 +13876,10 @@ function Od(e, t, n, r) {
|
|
|
13728
13876
|
//#endregion
|
|
13729
13877
|
//#region src/presets.ts
|
|
13730
13878
|
Gl();
|
|
13731
|
-
var
|
|
13732
|
-
function
|
|
13879
|
+
var Fd = 180 / Math.PI;
|
|
13880
|
+
function Id(e) {
|
|
13733
13881
|
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 *
|
|
13882
|
+
return n.speed = e.speed, n.colorContrast = e.contrast, n.colorSaturation = e.sat, n.hueShift = e.hueRad * Fd, n.displaceFrequency = {
|
|
13735
13883
|
x: e.dispX,
|
|
13736
13884
|
y: e.dispZ
|
|
13737
13885
|
}, n.displaceAmount = e.dispAmt, n.position = {
|
|
@@ -13739,9 +13887,9 @@ function Ad(e) {
|
|
|
13739
13887
|
y: e.pos[1],
|
|
13740
13888
|
z: e.pos[2]
|
|
13741
13889
|
}, n.rotation = {
|
|
13742
|
-
x: e.rotRad[0] *
|
|
13743
|
-
y: e.rotRad[1] *
|
|
13744
|
-
z: e.rotRad[2] *
|
|
13890
|
+
x: e.rotRad[0] * Fd,
|
|
13891
|
+
y: e.rotRad[1] * Fd,
|
|
13892
|
+
z: e.rotRad[2] * Fd
|
|
13745
13893
|
}, n.scale = {
|
|
13746
13894
|
x: e.scale[0],
|
|
13747
13895
|
y: e.scale[1],
|
|
@@ -13764,8 +13912,8 @@ function Ad(e) {
|
|
|
13764
13912
|
z: 0
|
|
13765
13913
|
}, t.cameraZoom = e.zoom, t;
|
|
13766
13914
|
}
|
|
13767
|
-
var
|
|
13768
|
-
Hero: () =>
|
|
13915
|
+
var Ld = {
|
|
13916
|
+
Hero: () => Id({
|
|
13769
13917
|
speed: .04,
|
|
13770
13918
|
contrast: 1,
|
|
13771
13919
|
sat: 1,
|
|
@@ -13809,7 +13957,7 @@ var jd = {
|
|
|
13809
13957
|
camTarget: [-420, -200]
|
|
13810
13958
|
}),
|
|
13811
13959
|
"Wave 2": () => wl(),
|
|
13812
|
-
"Wave 3": () =>
|
|
13960
|
+
"Wave 3": () => Id({
|
|
13813
13961
|
speed: .08,
|
|
13814
13962
|
contrast: 1,
|
|
13815
13963
|
sat: 1,
|
|
@@ -13852,7 +14000,7 @@ var jd = {
|
|
|
13852
14000
|
zoom: 1.3,
|
|
13853
14001
|
camTarget: [-104, 13]
|
|
13854
14002
|
}),
|
|
13855
|
-
"Wave 4": () =>
|
|
14003
|
+
"Wave 4": () => Id({
|
|
13856
14004
|
speed: .0525,
|
|
13857
14005
|
contrast: .969,
|
|
13858
14006
|
sat: 1.383,
|
|
@@ -13932,7 +14080,7 @@ var jd = {
|
|
|
13932
14080
|
]), t.creaseLight = 1, e.background = "#05060c", e.transparentBackground = !1, e.waves = bl(t, 3), e.waveCount = 3, e;
|
|
13933
14081
|
},
|
|
13934
14082
|
"Mesh Gradient": () => {
|
|
13935
|
-
let e =
|
|
14083
|
+
let e = Ld.Hero(), t = e.waves[0];
|
|
13936
14084
|
return t.gradientType = "mesh", t.meshGradientPoints = [
|
|
13937
14085
|
{
|
|
13938
14086
|
color: "#0a84ff",
|
|
@@ -13973,7 +14121,7 @@ var jd = {
|
|
|
13973
14121
|
], 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
14122
|
},
|
|
13975
14123
|
"Solar Bloom": () => {
|
|
13976
|
-
let e =
|
|
14124
|
+
let e = Ld.Hero(), t = e.waves[0];
|
|
13977
14125
|
return t.usePaletteTexture = !1, t.gradientType = "radial", t.gradientShift = .14, t.palette = [
|
|
13978
14126
|
{
|
|
13979
14127
|
color: "#fff3c4",
|
|
@@ -14002,7 +14150,7 @@ var jd = {
|
|
|
14002
14150
|
], 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
14151
|
},
|
|
14004
14152
|
Holographic: () => {
|
|
14005
|
-
let e =
|
|
14153
|
+
let e = Ld.Hero(), t = e.waves[0];
|
|
14006
14154
|
return t.usePaletteTexture = !1, t.gradientType = "conic", t.gradientShift = .08, t.palette = [
|
|
14007
14155
|
{
|
|
14008
14156
|
color: "#8ef6e4",
|
|
@@ -14035,7 +14183,7 @@ var jd = {
|
|
|
14035
14183
|
], 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
14184
|
},
|
|
14037
14185
|
Aurora: () => {
|
|
14038
|
-
let e =
|
|
14186
|
+
let e = Ld.Hero(), t = e.waves[0];
|
|
14039
14187
|
return t.gradientType = "mesh", t.meshGradientPoints = [
|
|
14040
14188
|
{
|
|
14041
14189
|
color: "#0a1f3c",
|
|
@@ -14107,31 +14255,31 @@ var jd = {
|
|
|
14107
14255
|
], e.backgroundMeshSoftness = .75, e.transparentBackground = !1, e;
|
|
14108
14256
|
},
|
|
14109
14257
|
Palestine: () => {
|
|
14110
|
-
let e =
|
|
14258
|
+
let e = Ld.Hero(), t = e.waves[0];
|
|
14111
14259
|
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
14260
|
},
|
|
14113
14261
|
Spain: () => {
|
|
14114
|
-
let e =
|
|
14262
|
+
let e = Ld.Hero(), t = e.waves[0];
|
|
14115
14263
|
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
14264
|
},
|
|
14117
14265
|
"Vaporwave Sunset": () => {
|
|
14118
|
-
let e =
|
|
14119
|
-
return t.position.x = 525, t.rotation.x = -.64 *
|
|
14266
|
+
let e = Ld.Hero(), t = e.waves[0];
|
|
14267
|
+
return t.position.x = 525, t.rotation.x = -.64 * Fd, t.rotation.z = 1.68 * Fd, 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
14268
|
x: 150,
|
|
14121
14269
|
y: 360,
|
|
14122
14270
|
z: 0
|
|
14123
14271
|
}, e.background = "#09051f", e.transparentBackground = !1, e;
|
|
14124
14272
|
},
|
|
14125
14273
|
Kaleidoscope: () => {
|
|
14126
|
-
let e =
|
|
14274
|
+
let e = Ld["Wave 3"](), t = e.waves[0];
|
|
14127
14275
|
return t.paletteSource = "kaleidoscope", t.blendMode = "normal", t.hueShift = 0, t.colorContrast = 1.05, t.colorSaturation = 1.12, e.grain = .5, e;
|
|
14128
14276
|
}
|
|
14129
14277
|
};
|
|
14130
|
-
|
|
14131
|
-
var
|
|
14132
|
-
function
|
|
14133
|
-
return
|
|
14278
|
+
Ed(), Gl();
|
|
14279
|
+
var Rd = () => Promise.resolve(Dd);
|
|
14280
|
+
function zd(e, t = {}, n = {}) {
|
|
14281
|
+
return Pd(Rd, e, t, n);
|
|
14134
14282
|
}
|
|
14135
|
-
var
|
|
14283
|
+
var Bd = zd;
|
|
14136
14284
|
//#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,
|
|
14285
|
+
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, Ld as PRESETS, Td as WaveRenderer, wl as createDefaultConfig, yl as createDefaultMeshPoints, gl as createLight, _l as createNoiseBand, zd as createWave, Dl as ensureCamera, kl as ensureSceneDefaults, Fl as ensureStudioConfig, vl as makeStops, Sl as makeWave, bl as makeWaveSpread, Bd as mountWave, El as normalizeBackground, Pl as normalizeSceneInteraction, Ol as normalizeWave, Nl as normalizeWaveInteraction, Cl as resizeWaves };
|