@micjanic/recursive-grid 1.0.36 → 1.0.37
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.
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
var fe = Object.defineProperty;
|
|
2
|
-
var de = (
|
|
3
|
-
var p = (
|
|
4
|
-
import me, { createContext as pe, useState as
|
|
5
|
-
import { useApplication as Ee, useTick as Re, extend as ve, Application as
|
|
6
|
-
import { Graphics as re, Particle as te, Sprite as
|
|
2
|
+
var de = (s, t, n) => t in s ? fe(s, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : s[t] = n;
|
|
3
|
+
var p = (s, t, n) => de(s, typeof t != "symbol" ? t + "" : t, n);
|
|
4
|
+
import me, { createContext as pe, useState as ee, useEffect as F, useContext as he, useRef as V, useCallback as _e } from "react";
|
|
5
|
+
import { useApplication as Ee, useTick as Re, extend as ve, Application as Te } from "@pixi/react";
|
|
6
|
+
import { Graphics as re, Particle as te, Sprite as be, Container as xe, Texture as Pe, ParticleContainer as ye } from "pixi.js";
|
|
7
7
|
var N = { exports: {} }, A = {};
|
|
8
8
|
/**
|
|
9
9
|
* @license React
|
|
@@ -14,23 +14,23 @@ var N = { exports: {} }, A = {};
|
|
|
14
14
|
* This source code is licensed under the MIT license found in the
|
|
15
15
|
* LICENSE file in the root directory of this source tree.
|
|
16
16
|
*/
|
|
17
|
-
var
|
|
17
|
+
var z;
|
|
18
18
|
function Ae() {
|
|
19
|
-
if (
|
|
20
|
-
|
|
21
|
-
var
|
|
22
|
-
function n(
|
|
23
|
-
var
|
|
24
|
-
if (l !== void 0 && (
|
|
19
|
+
if (z) return A;
|
|
20
|
+
z = 1;
|
|
21
|
+
var s = Symbol.for("react.transitional.element"), t = Symbol.for("react.fragment");
|
|
22
|
+
function n(u, a, l) {
|
|
23
|
+
var o = null;
|
|
24
|
+
if (l !== void 0 && (o = "" + l), a.key !== void 0 && (o = "" + a.key), "key" in a) {
|
|
25
25
|
l = {};
|
|
26
|
-
for (var d in
|
|
27
|
-
d !== "key" && (l[d] =
|
|
28
|
-
} else l =
|
|
29
|
-
return
|
|
30
|
-
$$typeof:
|
|
31
|
-
type:
|
|
32
|
-
key:
|
|
33
|
-
ref:
|
|
26
|
+
for (var d in a)
|
|
27
|
+
d !== "key" && (l[d] = a[d]);
|
|
28
|
+
} else l = a;
|
|
29
|
+
return a = l.ref, {
|
|
30
|
+
$$typeof: s,
|
|
31
|
+
type: u,
|
|
32
|
+
key: o,
|
|
33
|
+
ref: a !== void 0 ? a : null,
|
|
34
34
|
props: l
|
|
35
35
|
};
|
|
36
36
|
}
|
|
@@ -46,10 +46,10 @@ var S = {};
|
|
|
46
46
|
* This source code is licensed under the MIT license found in the
|
|
47
47
|
* LICENSE file in the root directory of this source tree.
|
|
48
48
|
*/
|
|
49
|
-
var
|
|
49
|
+
var X;
|
|
50
50
|
function Se() {
|
|
51
|
-
return
|
|
52
|
-
function
|
|
51
|
+
return X || (X = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
52
|
+
function s(e) {
|
|
53
53
|
if (e == null) return null;
|
|
54
54
|
if (typeof e == "function")
|
|
55
55
|
return e.$$typeof === ie ? null : e.displayName || e.name || null;
|
|
@@ -59,7 +59,7 @@ function Se() {
|
|
|
59
59
|
return "Fragment";
|
|
60
60
|
case P:
|
|
61
61
|
return "Profiler";
|
|
62
|
-
case
|
|
62
|
+
case O:
|
|
63
63
|
return "StrictMode";
|
|
64
64
|
case ae:
|
|
65
65
|
return "Suspense";
|
|
@@ -72,9 +72,9 @@ function Se() {
|
|
|
72
72
|
switch (typeof e.tag == "number" && console.error(
|
|
73
73
|
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
74
74
|
), e.$$typeof) {
|
|
75
|
-
case
|
|
75
|
+
case T:
|
|
76
76
|
return "Portal";
|
|
77
|
-
case
|
|
77
|
+
case C:
|
|
78
78
|
return e.displayName || "Context";
|
|
79
79
|
case y:
|
|
80
80
|
return (e._context.displayName || "Context") + ".Consumer";
|
|
@@ -82,11 +82,11 @@ function Se() {
|
|
|
82
82
|
var r = e.render;
|
|
83
83
|
return e = e.displayName, e || (e = r.displayName || r.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
|
|
84
84
|
case se:
|
|
85
|
-
return r = e.displayName || null, r !== null ? r :
|
|
85
|
+
return r = e.displayName || null, r !== null ? r : s(e.type) || "Memo";
|
|
86
86
|
case D:
|
|
87
87
|
r = e._payload, e = e._init;
|
|
88
88
|
try {
|
|
89
|
-
return
|
|
89
|
+
return s(e(r));
|
|
90
90
|
} catch {
|
|
91
91
|
}
|
|
92
92
|
}
|
|
@@ -104,34 +104,34 @@ function Se() {
|
|
|
104
104
|
}
|
|
105
105
|
if (r) {
|
|
106
106
|
r = console;
|
|
107
|
-
var i = r.error,
|
|
107
|
+
var i = r.error, c = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
108
108
|
return i.call(
|
|
109
109
|
r,
|
|
110
110
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
111
|
-
|
|
111
|
+
c
|
|
112
112
|
), t(e);
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
|
-
function
|
|
115
|
+
function u(e) {
|
|
116
116
|
if (e === x) return "<>";
|
|
117
117
|
if (typeof e == "object" && e !== null && e.$$typeof === D)
|
|
118
118
|
return "<...>";
|
|
119
119
|
try {
|
|
120
|
-
var r =
|
|
120
|
+
var r = s(e);
|
|
121
121
|
return r ? "<" + r + ">" : "<...>";
|
|
122
122
|
} catch {
|
|
123
123
|
return "<...>";
|
|
124
124
|
}
|
|
125
125
|
}
|
|
126
|
-
function
|
|
127
|
-
var e =
|
|
126
|
+
function a() {
|
|
127
|
+
var e = I.A;
|
|
128
128
|
return e === null ? null : e.getOwner();
|
|
129
129
|
}
|
|
130
130
|
function l() {
|
|
131
131
|
return Error("react-stack-top-frame");
|
|
132
132
|
}
|
|
133
|
-
function
|
|
134
|
-
if (
|
|
133
|
+
function o(e) {
|
|
134
|
+
if (G.call(e, "key")) {
|
|
135
135
|
var r = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
136
136
|
if (r && r.isReactWarning) return !1;
|
|
137
137
|
}
|
|
@@ -150,20 +150,20 @@ function Se() {
|
|
|
150
150
|
});
|
|
151
151
|
}
|
|
152
152
|
function g() {
|
|
153
|
-
var e =
|
|
154
|
-
return
|
|
153
|
+
var e = s(this.type);
|
|
154
|
+
return U[e] || (U[e] = !0, console.error(
|
|
155
155
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
156
156
|
)), e = this.props.ref, e !== void 0 ? e : null;
|
|
157
157
|
}
|
|
158
|
-
function m(e, r, i,
|
|
159
|
-
var
|
|
158
|
+
function m(e, r, i, c, j, M) {
|
|
159
|
+
var f = i.ref;
|
|
160
160
|
return e = {
|
|
161
161
|
$$typeof: v,
|
|
162
162
|
type: e,
|
|
163
163
|
key: r,
|
|
164
164
|
props: i,
|
|
165
|
-
_owner:
|
|
166
|
-
}, (
|
|
165
|
+
_owner: c
|
|
166
|
+
}, (f !== void 0 ? f : null) !== null ? Object.defineProperty(e, "ref", {
|
|
167
167
|
enumerable: !1,
|
|
168
168
|
get: g
|
|
169
169
|
}) : Object.defineProperty(e, "ref", { enumerable: !1, value: null }), e._store = {}, Object.defineProperty(e._store, "validated", {
|
|
@@ -188,50 +188,50 @@ function Se() {
|
|
|
188
188
|
value: M
|
|
189
189
|
}), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
|
|
190
190
|
}
|
|
191
|
-
function k(e, r, i,
|
|
192
|
-
var
|
|
193
|
-
if (
|
|
194
|
-
if (
|
|
195
|
-
if (ue(
|
|
196
|
-
for (
|
|
197
|
-
E(c
|
|
198
|
-
Object.freeze && Object.freeze(
|
|
191
|
+
function k(e, r, i, c, j, M) {
|
|
192
|
+
var f = r.children;
|
|
193
|
+
if (f !== void 0)
|
|
194
|
+
if (c)
|
|
195
|
+
if (ue(f)) {
|
|
196
|
+
for (c = 0; c < f.length; c++)
|
|
197
|
+
E(f[c]);
|
|
198
|
+
Object.freeze && Object.freeze(f);
|
|
199
199
|
} else
|
|
200
200
|
console.error(
|
|
201
201
|
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
202
202
|
);
|
|
203
|
-
else E(
|
|
204
|
-
if (
|
|
205
|
-
|
|
206
|
-
var
|
|
203
|
+
else E(f);
|
|
204
|
+
if (G.call(r, "key")) {
|
|
205
|
+
f = s(e);
|
|
206
|
+
var b = Object.keys(r).filter(function(ce) {
|
|
207
207
|
return ce !== "key";
|
|
208
208
|
});
|
|
209
|
-
|
|
209
|
+
c = 0 < b.length ? "{key: someKey, " + b.join(": ..., ") + ": ...}" : "{key: someKey}", J[f + c] || (b = 0 < b.length ? "{" + b.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
210
210
|
`A props object containing a "key" prop is being spread into JSX:
|
|
211
211
|
let props = %s;
|
|
212
212
|
<%s {...props} />
|
|
213
213
|
React keys must be passed directly to JSX without using spread:
|
|
214
214
|
let props = %s;
|
|
215
215
|
<%s key={someKey} {...props} />`,
|
|
216
|
-
u,
|
|
217
216
|
c,
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
217
|
+
f,
|
|
218
|
+
b,
|
|
219
|
+
f
|
|
220
|
+
), J[f + c] = !0);
|
|
221
221
|
}
|
|
222
|
-
if (
|
|
222
|
+
if (f = null, i !== void 0 && (n(i), f = "" + i), o(r) && (n(r.key), f = "" + r.key), "key" in r) {
|
|
223
223
|
i = {};
|
|
224
224
|
for (var $ in r)
|
|
225
225
|
$ !== "key" && (i[$] = r[$]);
|
|
226
226
|
} else i = r;
|
|
227
|
-
return
|
|
227
|
+
return f && d(
|
|
228
228
|
i,
|
|
229
229
|
typeof e == "function" ? e.displayName || e.name || "Unknown" : e
|
|
230
230
|
), m(
|
|
231
231
|
e,
|
|
232
|
-
|
|
232
|
+
f,
|
|
233
233
|
i,
|
|
234
|
-
|
|
234
|
+
a(),
|
|
235
235
|
j,
|
|
236
236
|
M
|
|
237
237
|
);
|
|
@@ -242,7 +242,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
242
242
|
function R(e) {
|
|
243
243
|
return typeof e == "object" && e !== null && e.$$typeof === v;
|
|
244
244
|
}
|
|
245
|
-
var h = me, v = Symbol.for("react.transitional.element"),
|
|
245
|
+
var h = me, v = Symbol.for("react.transitional.element"), T = Symbol.for("react.portal"), x = Symbol.for("react.fragment"), O = Symbol.for("react.strict_mode"), P = Symbol.for("react.profiler"), y = Symbol.for("react.consumer"), C = Symbol.for("react.context"), w = Symbol.for("react.forward_ref"), ae = Symbol.for("react.suspense"), oe = Symbol.for("react.suspense_list"), se = Symbol.for("react.memo"), D = Symbol.for("react.lazy"), le = Symbol.for("react.activity"), ie = Symbol.for("react.client.reference"), I = h.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, G = Object.prototype.hasOwnProperty, ue = Array.isArray, Y = console.createTask ? console.createTask : function() {
|
|
246
246
|
return null;
|
|
247
247
|
};
|
|
248
248
|
h = {
|
|
@@ -250,66 +250,66 @@ React keys must be passed directly to JSX without using spread:
|
|
|
250
250
|
return e();
|
|
251
251
|
}
|
|
252
252
|
};
|
|
253
|
-
var L,
|
|
253
|
+
var L, U = {}, W = h.react_stack_bottom_frame.bind(
|
|
254
254
|
h,
|
|
255
255
|
l
|
|
256
|
-
)(),
|
|
256
|
+
)(), q = Y(u(l)), J = {};
|
|
257
257
|
S.Fragment = x, S.jsx = function(e, r, i) {
|
|
258
|
-
var
|
|
258
|
+
var c = 1e4 > I.recentlyCreatedOwnerStacks++;
|
|
259
259
|
return k(
|
|
260
260
|
e,
|
|
261
261
|
r,
|
|
262
262
|
i,
|
|
263
263
|
!1,
|
|
264
|
-
|
|
265
|
-
|
|
264
|
+
c ? Error("react-stack-top-frame") : W,
|
|
265
|
+
c ? Y(u(e)) : q
|
|
266
266
|
);
|
|
267
267
|
}, S.jsxs = function(e, r, i) {
|
|
268
|
-
var
|
|
268
|
+
var c = 1e4 > I.recentlyCreatedOwnerStacks++;
|
|
269
269
|
return k(
|
|
270
270
|
e,
|
|
271
271
|
r,
|
|
272
272
|
i,
|
|
273
273
|
!0,
|
|
274
|
-
|
|
275
|
-
|
|
274
|
+
c ? Error("react-stack-top-frame") : W,
|
|
275
|
+
c ? Y(u(e)) : q
|
|
276
276
|
);
|
|
277
277
|
};
|
|
278
278
|
})()), S;
|
|
279
279
|
}
|
|
280
|
-
var
|
|
280
|
+
var H;
|
|
281
281
|
function ge() {
|
|
282
|
-
return
|
|
282
|
+
return H || (H = 1, process.env.NODE_ENV === "production" ? N.exports = Ae() : N.exports = Se()), N.exports;
|
|
283
283
|
}
|
|
284
284
|
var _ = ge();
|
|
285
|
-
const ne = pe({}), ke = ({ children:
|
|
286
|
-
const { app: t } = Ee(), [n,
|
|
287
|
-
return
|
|
285
|
+
const ne = pe({}), ke = ({ children: s }) => {
|
|
286
|
+
const { app: t } = Ee(), [n, u] = ee(null);
|
|
287
|
+
return F(() => {
|
|
288
288
|
if (!t) return;
|
|
289
|
-
let
|
|
289
|
+
let a = !1;
|
|
290
290
|
const l = () => {
|
|
291
291
|
if (!t.renderer) {
|
|
292
292
|
requestAnimationFrame(l);
|
|
293
293
|
return;
|
|
294
294
|
}
|
|
295
|
-
const
|
|
296
|
-
|
|
297
|
-
const d = t.renderer.generateTexture(
|
|
298
|
-
|
|
295
|
+
const o = new re();
|
|
296
|
+
o.setFillStyle({ color: "#121225" }), o.rect(0, 0, 1, 1), o.fill();
|
|
297
|
+
const d = t.renderer.generateTexture(o);
|
|
298
|
+
o.destroy(), a || u(d);
|
|
299
299
|
};
|
|
300
300
|
return l(), () => {
|
|
301
|
-
|
|
301
|
+
a = !0;
|
|
302
302
|
try {
|
|
303
303
|
n == null || n.destroy(!0);
|
|
304
304
|
} catch {
|
|
305
305
|
}
|
|
306
|
-
|
|
306
|
+
u(null);
|
|
307
307
|
};
|
|
308
|
-
}, [t]), n ? /* @__PURE__ */ _.jsx(ne.Provider, { value: n, children:
|
|
308
|
+
}, [t]), n ? /* @__PURE__ */ _.jsx(ne.Provider, { value: n, children: s }) : null;
|
|
309
309
|
};
|
|
310
|
-
class
|
|
311
|
-
constructor(n,
|
|
312
|
-
super({ texture: n, x:
|
|
310
|
+
class Oe extends te {
|
|
311
|
+
constructor(n, u, a, l, o, d) {
|
|
312
|
+
super({ texture: n, x: u, y: a, scaleX: l, scaleY: o, alpha: 0 });
|
|
313
313
|
p(this, "animationProgress", 0);
|
|
314
314
|
p(this, "delayCounter", 0);
|
|
315
315
|
p(this, "randomSpeed");
|
|
@@ -317,7 +317,7 @@ class Ce extends te {
|
|
|
317
317
|
p(this, "startScaleX");
|
|
318
318
|
p(this, "startScaleY");
|
|
319
319
|
p(this, "targetAlpha");
|
|
320
|
-
this.texture = n, this.x =
|
|
320
|
+
this.texture = n, this.x = u, this.y = a, this.scaleX = l, this.scaleY = o, this.curLevel = d, this.startScaleX = l, this.startScaleY = o, this.curLevel = d, this.randomSpeed = 0.04 + Math.random() * 0.04, this.randomDelayOffset = Math.floor(Math.random() * 150), this.targetAlpha = 0.9 + Math.random() * 0.1;
|
|
321
321
|
}
|
|
322
322
|
update() {
|
|
323
323
|
if (this.delayCounter < this.curLevel * 15 + this.randomDelayOffset) {
|
|
@@ -331,14 +331,14 @@ class Ce extends te {
|
|
|
331
331
|
this.animationProgress += (this.targetAlpha - this.animationProgress) * this.randomSpeed, this.alpha = this.animationProgress;
|
|
332
332
|
}
|
|
333
333
|
}
|
|
334
|
-
class
|
|
334
|
+
class Ce {
|
|
335
335
|
constructor(t, n) {
|
|
336
336
|
p(this, "cells", []);
|
|
337
337
|
this.texture = t, this.particleContainerRefCurrent = n, this.texture = t;
|
|
338
338
|
}
|
|
339
|
-
add(t, n,
|
|
340
|
-
const
|
|
341
|
-
this.particleContainerRefCurrent.addParticle(
|
|
339
|
+
add(t, n, u, a, l) {
|
|
340
|
+
const o = new Oe(this.texture, t, n, u, a, l);
|
|
341
|
+
this.particleContainerRefCurrent.addParticle(o), this.cells.push(o);
|
|
342
342
|
}
|
|
343
343
|
updateAll() {
|
|
344
344
|
for (const t of this.cells)
|
|
@@ -346,67 +346,67 @@ class Oe {
|
|
|
346
346
|
}
|
|
347
347
|
}
|
|
348
348
|
const we = ({
|
|
349
|
-
gridRows:
|
|
349
|
+
gridRows: s,
|
|
350
350
|
gridCols: t,
|
|
351
351
|
cellWidth: n,
|
|
352
|
-
cellHeight:
|
|
353
|
-
gridDepth:
|
|
352
|
+
cellHeight: u,
|
|
353
|
+
gridDepth: a
|
|
354
354
|
}) => {
|
|
355
|
-
const l = he(ne),
|
|
356
|
-
|
|
355
|
+
const l = he(ne), o = V(null), d = V(null);
|
|
356
|
+
F(() => {
|
|
357
357
|
if (l) {
|
|
358
|
-
if (
|
|
358
|
+
if (o.current) {
|
|
359
359
|
try {
|
|
360
|
-
|
|
360
|
+
o.current.removeChildren();
|
|
361
361
|
} catch {
|
|
362
362
|
}
|
|
363
|
-
d.current = new
|
|
363
|
+
d.current = new Ce(
|
|
364
364
|
l,
|
|
365
|
-
|
|
365
|
+
o.current
|
|
366
366
|
), g(
|
|
367
367
|
0,
|
|
368
368
|
0,
|
|
369
369
|
n,
|
|
370
|
-
|
|
370
|
+
u,
|
|
371
371
|
t,
|
|
372
|
+
s,
|
|
372
373
|
a,
|
|
373
|
-
o
|
|
374
|
-
s.current
|
|
374
|
+
o.current
|
|
375
375
|
);
|
|
376
376
|
}
|
|
377
377
|
return () => {
|
|
378
378
|
var m;
|
|
379
379
|
try {
|
|
380
|
-
(m =
|
|
380
|
+
(m = o.current) == null || m.removeChildren();
|
|
381
381
|
} catch {
|
|
382
382
|
}
|
|
383
383
|
d.current = null;
|
|
384
384
|
};
|
|
385
385
|
}
|
|
386
|
-
}, [l, n,
|
|
386
|
+
}, [l, n, u, t, s, a]), Re(() => {
|
|
387
387
|
var m;
|
|
388
388
|
(m = d.current) == null || m.updateAll();
|
|
389
389
|
});
|
|
390
390
|
const g = _e(
|
|
391
|
-
(m, k, E, R, h, v,
|
|
392
|
-
var
|
|
391
|
+
(m, k, E, R, h, v, T, x) => {
|
|
392
|
+
var O;
|
|
393
393
|
for (let P = 0; P < v; P++)
|
|
394
394
|
for (let y = 0; y < h; y++) {
|
|
395
|
-
const
|
|
396
|
-
|
|
397
|
-
|
|
395
|
+
const C = m + y * E, w = k + P * R;
|
|
396
|
+
T <= 0 || Math.random() > 0.7 && T < a ? Math.random() > 0.1 && ((O = d.current) == null || O.add(
|
|
397
|
+
C,
|
|
398
398
|
w,
|
|
399
399
|
E - 1,
|
|
400
400
|
R - 1,
|
|
401
|
-
|
|
401
|
+
T
|
|
402
402
|
)) : g(
|
|
403
|
-
|
|
403
|
+
C,
|
|
404
404
|
w,
|
|
405
405
|
E / h,
|
|
406
406
|
R / v,
|
|
407
407
|
h,
|
|
408
408
|
v,
|
|
409
|
-
|
|
409
|
+
T - 1,
|
|
410
410
|
x
|
|
411
411
|
);
|
|
412
412
|
}
|
|
@@ -416,7 +416,7 @@ const we = ({
|
|
|
416
416
|
return /* @__PURE__ */ _.jsx(
|
|
417
417
|
"pixiParticleContainer",
|
|
418
418
|
{
|
|
419
|
-
ref:
|
|
419
|
+
ref: o,
|
|
420
420
|
dynamicProperties: {
|
|
421
421
|
position: !0,
|
|
422
422
|
vertex: !0,
|
|
@@ -425,59 +425,54 @@ const we = ({
|
|
|
425
425
|
}
|
|
426
426
|
);
|
|
427
427
|
}, je = ({
|
|
428
|
-
cellWidth:
|
|
428
|
+
cellWidth: s,
|
|
429
429
|
cellHeight: t,
|
|
430
430
|
gridRows: n,
|
|
431
|
-
gridCols:
|
|
432
|
-
gridDepth:
|
|
431
|
+
gridCols: u,
|
|
432
|
+
gridDepth: a
|
|
433
433
|
}) => /* @__PURE__ */ _.jsx(ke, { children: /* @__PURE__ */ _.jsx(
|
|
434
434
|
we,
|
|
435
435
|
{
|
|
436
|
-
cellWidth:
|
|
436
|
+
cellWidth: s,
|
|
437
437
|
cellHeight: t,
|
|
438
|
-
gridCols:
|
|
438
|
+
gridCols: u,
|
|
439
439
|
gridRows: n,
|
|
440
|
-
gridDepth:
|
|
440
|
+
gridDepth: a
|
|
441
441
|
}
|
|
442
442
|
) });
|
|
443
|
-
ve({ ParticleContainer: ye, Particle: te, Texture: Pe, Container: xe, Sprite:
|
|
444
|
-
const
|
|
445
|
-
const [
|
|
446
|
-
return
|
|
447
|
-
|
|
448
|
-
"
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
)
|
|
477
|
-
},
|
|
478
|
-
a
|
|
479
|
-
)
|
|
480
|
-
] });
|
|
443
|
+
ve({ ParticleContainer: ye, Particle: te, Texture: Pe, Container: xe, Sprite: be, Graphics: re });
|
|
444
|
+
const B = 2, Z = 2, Q = 300, K = 300, Ne = 6, $e = () => {
|
|
445
|
+
const [s, t] = ee(0);
|
|
446
|
+
return F(() => {
|
|
447
|
+
const n = setInterval(() => {
|
|
448
|
+
console.log("Reloading Pixi Application to clear GPU memory..."), t((u) => u + 1);
|
|
449
|
+
}, 2e3);
|
|
450
|
+
return () => clearInterval(n);
|
|
451
|
+
}, []), /* @__PURE__ */ _.jsx("div", { className: "flex flex-col items-center justify-center w-full h-full", children: /* @__PURE__ */ _.jsx(
|
|
452
|
+
Te,
|
|
453
|
+
{
|
|
454
|
+
antialias: !1,
|
|
455
|
+
width: Q * B,
|
|
456
|
+
height: K * Z,
|
|
457
|
+
className: "image-pixelated w-full",
|
|
458
|
+
backgroundAlpha: 0,
|
|
459
|
+
autoDensity: !0,
|
|
460
|
+
preserveDrawingBuffer: !0,
|
|
461
|
+
powerPreference: "high-performance",
|
|
462
|
+
autoStart: !0,
|
|
463
|
+
children: /* @__PURE__ */ _.jsx(
|
|
464
|
+
je,
|
|
465
|
+
{
|
|
466
|
+
gridCols: B,
|
|
467
|
+
gridRows: Z,
|
|
468
|
+
cellWidth: Q,
|
|
469
|
+
cellHeight: K,
|
|
470
|
+
gridDepth: Ne
|
|
471
|
+
}
|
|
472
|
+
)
|
|
473
|
+
},
|
|
474
|
+
s
|
|
475
|
+
) });
|
|
481
476
|
};
|
|
482
477
|
export {
|
|
483
478
|
$e as default
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recursive-grid.es.js","sources":["../node_modules/react/cjs/react-jsx-runtime.production.js","../node_modules/react/cjs/react-jsx-runtime.development.js","../node_modules/react/jsx-runtime.js","../src/context/CellTexturesContext.tsx","../src/classes/Cell.ts","../src/classes/CellManager.ts","../src/components/RecursiveGrid.tsx","../src/components/RecursiveGridContainer.tsx","../src/components/PixiApp.tsx"],"sourcesContent":["/**\n * @license React\n * react-jsx-runtime.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nvar REACT_ELEMENT_TYPE = Symbol.for(\"react.transitional.element\"),\n REACT_FRAGMENT_TYPE = Symbol.for(\"react.fragment\");\nfunction jsxProd(type, config, maybeKey) {\n var key = null;\n void 0 !== maybeKey && (key = \"\" + maybeKey);\n void 0 !== config.key && (key = \"\" + config.key);\n if (\"key\" in config) {\n maybeKey = {};\n for (var propName in config)\n \"key\" !== propName && (maybeKey[propName] = config[propName]);\n } else maybeKey = config;\n config = maybeKey.ref;\n return {\n $$typeof: REACT_ELEMENT_TYPE,\n type: type,\n key: key,\n ref: void 0 !== config ? config : null,\n props: maybeKey\n };\n}\nexports.Fragment = REACT_FRAGMENT_TYPE;\nexports.jsx = jsxProd;\nexports.jsxs = jsxProd;\n","/**\n * @license React\n * react-jsx-runtime.development.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\n\"production\" !== process.env.NODE_ENV &&\n (function () {\n function getComponentNameFromType(type) {\n if (null == type) return null;\n if (\"function\" === typeof type)\n return type.$$typeof === REACT_CLIENT_REFERENCE\n ? null\n : type.displayName || type.name || null;\n if (\"string\" === typeof type) return type;\n switch (type) {\n case REACT_FRAGMENT_TYPE:\n return \"Fragment\";\n case REACT_PROFILER_TYPE:\n return \"Profiler\";\n case REACT_STRICT_MODE_TYPE:\n return \"StrictMode\";\n case REACT_SUSPENSE_TYPE:\n return \"Suspense\";\n case REACT_SUSPENSE_LIST_TYPE:\n return \"SuspenseList\";\n case REACT_ACTIVITY_TYPE:\n return \"Activity\";\n }\n if (\"object\" === typeof type)\n switch (\n (\"number\" === typeof type.tag &&\n console.error(\n \"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue.\"\n ),\n type.$$typeof)\n ) {\n case REACT_PORTAL_TYPE:\n return \"Portal\";\n case REACT_CONTEXT_TYPE:\n return type.displayName || \"Context\";\n case REACT_CONSUMER_TYPE:\n return (type._context.displayName || \"Context\") + \".Consumer\";\n case REACT_FORWARD_REF_TYPE:\n var innerType = type.render;\n type = type.displayName;\n type ||\n ((type = innerType.displayName || innerType.name || \"\"),\n (type = \"\" !== type ? \"ForwardRef(\" + type + \")\" : \"ForwardRef\"));\n return type;\n case REACT_MEMO_TYPE:\n return (\n (innerType = type.displayName || null),\n null !== innerType\n ? innerType\n : getComponentNameFromType(type.type) || \"Memo\"\n );\n case REACT_LAZY_TYPE:\n innerType = type._payload;\n type = type._init;\n try {\n return getComponentNameFromType(type(innerType));\n } catch (x) {}\n }\n return null;\n }\n function testStringCoercion(value) {\n return \"\" + value;\n }\n function checkKeyStringCoercion(value) {\n try {\n testStringCoercion(value);\n var JSCompiler_inline_result = !1;\n } catch (e) {\n JSCompiler_inline_result = !0;\n }\n if (JSCompiler_inline_result) {\n JSCompiler_inline_result = console;\n var JSCompiler_temp_const = JSCompiler_inline_result.error;\n var JSCompiler_inline_result$jscomp$0 =\n (\"function\" === typeof Symbol &&\n Symbol.toStringTag &&\n value[Symbol.toStringTag]) ||\n value.constructor.name ||\n \"Object\";\n JSCompiler_temp_const.call(\n JSCompiler_inline_result,\n \"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.\",\n JSCompiler_inline_result$jscomp$0\n );\n return testStringCoercion(value);\n }\n }\n function getTaskName(type) {\n if (type === REACT_FRAGMENT_TYPE) return \"<>\";\n if (\n \"object\" === typeof type &&\n null !== type &&\n type.$$typeof === REACT_LAZY_TYPE\n )\n return \"<...>\";\n try {\n var name = getComponentNameFromType(type);\n return name ? \"<\" + name + \">\" : \"<...>\";\n } catch (x) {\n return \"<...>\";\n }\n }\n function getOwner() {\n var dispatcher = ReactSharedInternals.A;\n return null === dispatcher ? null : dispatcher.getOwner();\n }\n function UnknownOwner() {\n return Error(\"react-stack-top-frame\");\n }\n function hasValidKey(config) {\n if (hasOwnProperty.call(config, \"key\")) {\n var getter = Object.getOwnPropertyDescriptor(config, \"key\").get;\n if (getter && getter.isReactWarning) return !1;\n }\n return void 0 !== config.key;\n }\n function defineKeyPropWarningGetter(props, displayName) {\n function warnAboutAccessingKey() {\n specialPropKeyWarningShown ||\n ((specialPropKeyWarningShown = !0),\n console.error(\n \"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)\",\n displayName\n ));\n }\n warnAboutAccessingKey.isReactWarning = !0;\n Object.defineProperty(props, \"key\", {\n get: warnAboutAccessingKey,\n configurable: !0\n });\n }\n function elementRefGetterWithDeprecationWarning() {\n var componentName = getComponentNameFromType(this.type);\n didWarnAboutElementRef[componentName] ||\n ((didWarnAboutElementRef[componentName] = !0),\n console.error(\n \"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.\"\n ));\n componentName = this.props.ref;\n return void 0 !== componentName ? componentName : null;\n }\n function ReactElement(type, key, props, owner, debugStack, debugTask) {\n var refProp = props.ref;\n type = {\n $$typeof: REACT_ELEMENT_TYPE,\n type: type,\n key: key,\n props: props,\n _owner: owner\n };\n null !== (void 0 !== refProp ? refProp : null)\n ? Object.defineProperty(type, \"ref\", {\n enumerable: !1,\n get: elementRefGetterWithDeprecationWarning\n })\n : Object.defineProperty(type, \"ref\", { enumerable: !1, value: null });\n type._store = {};\n Object.defineProperty(type._store, \"validated\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: 0\n });\n Object.defineProperty(type, \"_debugInfo\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: null\n });\n Object.defineProperty(type, \"_debugStack\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: debugStack\n });\n Object.defineProperty(type, \"_debugTask\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: debugTask\n });\n Object.freeze && (Object.freeze(type.props), Object.freeze(type));\n return type;\n }\n function jsxDEVImpl(\n type,\n config,\n maybeKey,\n isStaticChildren,\n debugStack,\n debugTask\n ) {\n var children = config.children;\n if (void 0 !== children)\n if (isStaticChildren)\n if (isArrayImpl(children)) {\n for (\n isStaticChildren = 0;\n isStaticChildren < children.length;\n isStaticChildren++\n )\n validateChildKeys(children[isStaticChildren]);\n Object.freeze && Object.freeze(children);\n } else\n console.error(\n \"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.\"\n );\n else validateChildKeys(children);\n if (hasOwnProperty.call(config, \"key\")) {\n children = getComponentNameFromType(type);\n var keys = Object.keys(config).filter(function (k) {\n return \"key\" !== k;\n });\n isStaticChildren =\n 0 < keys.length\n ? \"{key: someKey, \" + keys.join(\": ..., \") + \": ...}\"\n : \"{key: someKey}\";\n didWarnAboutKeySpread[children + isStaticChildren] ||\n ((keys =\n 0 < keys.length ? \"{\" + keys.join(\": ..., \") + \": ...}\" : \"{}\"),\n console.error(\n 'A props object containing a \"key\" prop is being spread into JSX:\\n let props = %s;\\n <%s {...props} />\\nReact keys must be passed directly to JSX without using spread:\\n let props = %s;\\n <%s key={someKey} {...props} />',\n isStaticChildren,\n children,\n keys,\n children\n ),\n (didWarnAboutKeySpread[children + isStaticChildren] = !0));\n }\n children = null;\n void 0 !== maybeKey &&\n (checkKeyStringCoercion(maybeKey), (children = \"\" + maybeKey));\n hasValidKey(config) &&\n (checkKeyStringCoercion(config.key), (children = \"\" + config.key));\n if (\"key\" in config) {\n maybeKey = {};\n for (var propName in config)\n \"key\" !== propName && (maybeKey[propName] = config[propName]);\n } else maybeKey = config;\n children &&\n defineKeyPropWarningGetter(\n maybeKey,\n \"function\" === typeof type\n ? type.displayName || type.name || \"Unknown\"\n : type\n );\n return ReactElement(\n type,\n children,\n maybeKey,\n getOwner(),\n debugStack,\n debugTask\n );\n }\n function validateChildKeys(node) {\n isValidElement(node)\n ? node._store && (node._store.validated = 1)\n : \"object\" === typeof node &&\n null !== node &&\n node.$$typeof === REACT_LAZY_TYPE &&\n (\"fulfilled\" === node._payload.status\n ? isValidElement(node._payload.value) &&\n node._payload.value._store &&\n (node._payload.value._store.validated = 1)\n : node._store && (node._store.validated = 1));\n }\n function isValidElement(object) {\n return (\n \"object\" === typeof object &&\n null !== object &&\n object.$$typeof === REACT_ELEMENT_TYPE\n );\n }\n var React = require(\"react\"),\n REACT_ELEMENT_TYPE = Symbol.for(\"react.transitional.element\"),\n REACT_PORTAL_TYPE = Symbol.for(\"react.portal\"),\n REACT_FRAGMENT_TYPE = Symbol.for(\"react.fragment\"),\n REACT_STRICT_MODE_TYPE = Symbol.for(\"react.strict_mode\"),\n REACT_PROFILER_TYPE = Symbol.for(\"react.profiler\"),\n REACT_CONSUMER_TYPE = Symbol.for(\"react.consumer\"),\n REACT_CONTEXT_TYPE = Symbol.for(\"react.context\"),\n REACT_FORWARD_REF_TYPE = Symbol.for(\"react.forward_ref\"),\n REACT_SUSPENSE_TYPE = Symbol.for(\"react.suspense\"),\n REACT_SUSPENSE_LIST_TYPE = Symbol.for(\"react.suspense_list\"),\n REACT_MEMO_TYPE = Symbol.for(\"react.memo\"),\n REACT_LAZY_TYPE = Symbol.for(\"react.lazy\"),\n REACT_ACTIVITY_TYPE = Symbol.for(\"react.activity\"),\n REACT_CLIENT_REFERENCE = Symbol.for(\"react.client.reference\"),\n ReactSharedInternals =\n React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,\n hasOwnProperty = Object.prototype.hasOwnProperty,\n isArrayImpl = Array.isArray,\n createTask = console.createTask\n ? console.createTask\n : function () {\n return null;\n };\n React = {\n react_stack_bottom_frame: function (callStackForError) {\n return callStackForError();\n }\n };\n var specialPropKeyWarningShown;\n var didWarnAboutElementRef = {};\n var unknownOwnerDebugStack = React.react_stack_bottom_frame.bind(\n React,\n UnknownOwner\n )();\n var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));\n var didWarnAboutKeySpread = {};\n exports.Fragment = REACT_FRAGMENT_TYPE;\n exports.jsx = function (type, config, maybeKey) {\n var trackActualOwner =\n 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;\n return jsxDEVImpl(\n type,\n config,\n maybeKey,\n !1,\n trackActualOwner\n ? Error(\"react-stack-top-frame\")\n : unknownOwnerDebugStack,\n trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask\n );\n };\n exports.jsxs = function (type, config, maybeKey) {\n var trackActualOwner =\n 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;\n return jsxDEVImpl(\n type,\n config,\n maybeKey,\n !0,\n trackActualOwner\n ? Error(\"react-stack-top-frame\")\n : unknownOwnerDebugStack,\n trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask\n );\n };\n })();\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-jsx-runtime.production.js');\n} else {\n module.exports = require('./cjs/react-jsx-runtime.development.js');\n}\n","import { createContext, useContext, FC, ReactNode, useEffect, useState } from 'react'\r\nimport { useApplication } from '@pixi/react'\r\nimport { Graphics, Texture } from 'pixi.js'\r\n\r\ntype CellTextures = Texture\r\n\r\nconst CellTexturesContext = createContext<CellTextures>({} as CellTextures)\r\n\r\nexport const useCellTextures = () => useContext(CellTexturesContext)\r\n\r\nconst CellTexturesProvider: FC<{ children: ReactNode }> = ({ children }) => {\r\n const { app } = useApplication()\r\n const [texture, setTexture] = useState<Texture | null>(null)\r\n\r\n useEffect(() => {\r\n if (!app) return\r\n\r\n let isUnmounted = false\r\n\r\n const generate = () => {\r\n // Wait until Pixi Application has initialised the renderer\r\n if (!app.renderer) {\r\n requestAnimationFrame(generate)\r\n return\r\n }\r\n\r\n const g = new Graphics()\r\n g.setFillStyle({ color: '#121225' })\r\n g.rect(0, 0, 1, 1)\r\n g.fill()\r\n const generatedTexture = app.renderer.generateTexture(g)\r\n g.destroy()\r\n if (!isUnmounted) setTexture(generatedTexture)\r\n }\r\n\r\n generate()\r\n\r\n return () => {\r\n isUnmounted = true\r\n // Destroy generated texture to free GPU memory\r\n try {\r\n texture?.destroy(true)\r\n } catch {}\r\n setTexture(null)\r\n }\r\n }, [app])\r\n\r\n if (!texture) return null\r\n\r\n return (\r\n <CellTexturesContext.Provider value={texture}>\r\n {children}\r\n </CellTexturesContext.Provider>\r\n )\r\n}\r\n\r\nexport { CellTexturesContext, CellTexturesProvider }\r\n","import { Particle, Texture } from \"pixi.js\"\r\n\r\nexport class Cell extends Particle {\r\n private animationProgress = 0\r\n private delayCounter = 0\r\n private randomSpeed: number\r\n private randomDelayOffset: number\r\n startScaleX: number\r\n startScaleY: number\r\n targetAlpha: number\r\n\r\n constructor(\r\n public texture: Texture,\r\n public x: number,\r\n public y: number,\r\n public scaleX: number,\r\n public scaleY: number,\r\n public curLevel: number,\r\n ) {\r\n super({ texture, x, y, scaleX, scaleY, alpha: 0 })\r\n this.startScaleX = scaleX\r\n this.startScaleY = scaleY\r\n this.curLevel = curLevel\r\n\r\n // Randomize speed slightly (0.08 to 0.12)\r\n this.randomSpeed = 0.04 + Math.random() * 0.04\r\n // Randomize delay by a few frames\r\n this.randomDelayOffset = Math.floor(Math.random() * 150)\r\n this.targetAlpha = 0.9 + Math.random() * 0.1\r\n }\r\n\r\n update() {\r\n if (this.delayCounter < this.curLevel * 15 + this.randomDelayOffset) {\r\n this.delayCounter++\r\n return\r\n }\r\n\r\n if (this.animationProgress >= this.targetAlpha - 0.001) {\r\n this.animationProgress = this.targetAlpha\r\n this.alpha = this.targetAlpha\r\n return\r\n }\r\n\r\n this.animationProgress += (this.targetAlpha - this.animationProgress) * this.randomSpeed\r\n this.alpha = this.animationProgress\r\n }\r\n}\r\n","import { ParticleContainer, Texture } from 'pixi.js'\r\nimport { Cell } from './Cell'\r\n\r\nexport class CellManager {\r\n private cells: Cell[] = []\r\n\r\n constructor(\r\n public texture: Texture,\r\n public particleContainerRefCurrent: ParticleContainer\r\n ) {\r\n this.texture = texture\r\n }\r\n\r\n add(x: number, y: number, scaleX: number, scaleY: number, curLevel: number) {\r\n const cell = new Cell(this.texture, x, y, scaleX, scaleY, curLevel)\r\n this.particleContainerRefCurrent.addParticle(cell)\r\n this.cells.push(cell)\r\n }\r\n\r\n updateAll() {\r\n for (const cell of this.cells) {\r\n cell.update()\r\n }\r\n }\r\n}","import { FC, useCallback, useContext, useEffect, useRef } from 'react'\r\nimport { ParticleContainer } from 'pixi.js'\r\nimport { CellTexturesContext } from '../context/CellTexturesContext'\r\nimport { useTick } from '@pixi/react'\r\nimport { CellManager } from '../classes/CellManager'\r\n\r\ninterface GridProps {\r\n gridCols: number\r\n gridRows: number\r\n cellWidth: number\r\n cellHeight: number\r\n gridDepth: number\r\n}\r\n\r\nconst RecursiveGrid: FC<GridProps> = ({\r\n gridRows,\r\n gridCols,\r\n cellWidth,\r\n cellHeight,\r\n gridDepth,\r\n}) => {\r\n const texture = useContext(CellTexturesContext)\r\n const particleContainerRef = useRef<ParticleContainer>(null)\r\n const cellManager = useRef<CellManager>(null)\r\n\r\n useEffect(() => {\r\n if (!texture) return\r\n if (particleContainerRef.current) {\r\n // Clear any previous content on re-init\r\n try {\r\n particleContainerRef.current.removeChildren()\r\n } catch {}\r\n\r\n cellManager.current = new CellManager(\r\n texture,\r\n particleContainerRef.current\r\n )\r\n\r\n buildRecursiveGrid(\r\n 0,\r\n 0,\r\n cellWidth,\r\n cellHeight,\r\n gridCols,\r\n gridRows,\r\n gridDepth,\r\n particleContainerRef.current\r\n )\r\n }\r\n return () => {\r\n // Clean up particles and references on unmount/texture change\r\n try {\r\n particleContainerRef.current?.removeChildren()\r\n } catch {}\r\n cellManager.current = null\r\n }\r\n }, [texture, cellWidth, cellHeight, gridCols, gridRows, gridDepth])\r\n\r\n useTick(() => {\r\n cellManager.current?.updateAll()\r\n })\r\n\r\n const buildRecursiveGrid = useCallback(\r\n (\r\n x: number,\r\n y: number,\r\n cellWidth: number,\r\n cellHeight: number,\r\n gridCols: number,\r\n gridRows: number,\r\n curLevel: number,\r\n currentParticlesRef: ParticleContainer\r\n ) => {\r\n for (let row = 0; row < gridRows; row++) {\r\n for (let col = 0; col < gridCols; col++) {\r\n const startX = x + col * cellWidth\r\n const startY = y + row * cellHeight\r\n\r\n if (\r\n curLevel <= 0 ||\r\n (Math.random() > 0.7 && curLevel < gridDepth)\r\n ) {\r\n if (Math.random() > 0.1) {\r\n cellManager.current?.add(\r\n startX,\r\n startY,\r\n cellWidth - 1,\r\n cellHeight - 1,\r\n curLevel\r\n )\r\n }\r\n } else {\r\n buildRecursiveGrid(\r\n startX,\r\n startY,\r\n cellWidth / gridCols,\r\n cellHeight / gridRows,\r\n gridCols,\r\n gridRows,\r\n curLevel - 1,\r\n currentParticlesRef\r\n )\r\n }\r\n }\r\n }\r\n },\r\n []\r\n )\r\n\r\n return (\r\n <pixiParticleContainer\r\n ref={particleContainerRef}\r\n dynamicProperties={{\r\n position: true,\r\n vertex: true,\r\n color: true,\r\n }}\r\n />\r\n )\r\n}\r\n\r\nexport default RecursiveGrid\r\n","import { FC } from 'react'\r\nimport RecursiveGrid from './RecursiveGrid'\r\n\r\nimport { CellTexturesProvider } from '../context/CellTexturesContext'\r\n\r\ninterface RecursiveGridContainerProps {\r\n cellWidth: number\r\n cellHeight: number\r\n gridRows: number\r\n gridCols: number\r\n gridDepth: number\r\n}\r\n\r\nconst RecursiveGridContainer: FC<RecursiveGridContainerProps> = ({\r\n cellWidth,\r\n cellHeight,\r\n gridRows,\r\n gridCols,\r\n gridDepth,\r\n}) => {\r\n return (\r\n <CellTexturesProvider>\r\n <RecursiveGrid\r\n cellWidth={cellWidth}\r\n cellHeight={cellHeight}\r\n gridCols={gridCols}\r\n gridRows={gridRows}\r\n gridDepth={gridDepth}\r\n />\r\n </CellTexturesProvider>\r\n )\r\n}\r\n\r\nexport default RecursiveGridContainer\r\n","import { Application, extend } from '@pixi/react'\r\nimport {\r\n Sprite,\r\n Graphics,\r\n Container,\r\n Texture,\r\n Particle,\r\n ParticleContainer,\r\n} from 'pixi.js'\r\nimport RecursiveGridContainer from './RecursiveGridContainer'\r\nimport { useState } from 'react'\r\nextend({ ParticleContainer, Particle, Texture, Container, Sprite, Graphics })\r\n\r\nconst GRID_COLS = 2\r\nconst GRID_ROWS = 2\r\nconst CELL_WIDTH = 300\r\nconst CELL_HEIGHT = 300\r\nconst GRID_DEPTH = 6\r\n\r\nconst PixiApp = () => {\r\n const [reloadKey, setReloadKey] = useState<number>(0)\r\n\r\n return (\r\n <div className=\"flex flex-col items-center justify-center w-full h-full\">\r\n <button\r\n onClick={() => setReloadKey(reloadKey + 1)}\r\n className=\"mb-2 px-4 py-2 bg-blue-500 text-white rounded\"\r\n >\r\n Reload PixiApp\r\n </button>\r\n <Application\r\n key={reloadKey}\r\n antialias={false}\r\n width={CELL_WIDTH * GRID_COLS}\r\n height={CELL_HEIGHT * GRID_ROWS}\r\n className=\"image-pixelated w-full\"\r\n backgroundAlpha={0}\r\n autoDensity={true}\r\n preserveDrawingBuffer={true}\r\n powerPreference=\"high-performance\"\r\n autoStart={true}\r\n >\r\n <RecursiveGridContainer\r\n gridCols={GRID_COLS}\r\n gridRows={GRID_ROWS}\r\n cellWidth={CELL_WIDTH}\r\n cellHeight={CELL_HEIGHT}\r\n gridDepth={GRID_DEPTH}\r\n />\r\n </Application>\r\n </div>\r\n )\r\n}\r\n\r\nexport default PixiApp\r\n"],"names":["REACT_ELEMENT_TYPE","REACT_FRAGMENT_TYPE","jsxProd","type","config","maybeKey","key","propName","reactJsxRuntime_production","getComponentNameFromType","REACT_CLIENT_REFERENCE","REACT_PROFILER_TYPE","REACT_STRICT_MODE_TYPE","REACT_SUSPENSE_TYPE","REACT_SUSPENSE_LIST_TYPE","REACT_ACTIVITY_TYPE","REACT_PORTAL_TYPE","REACT_CONTEXT_TYPE","REACT_CONSUMER_TYPE","REACT_FORWARD_REF_TYPE","innerType","REACT_MEMO_TYPE","REACT_LAZY_TYPE","testStringCoercion","value","checkKeyStringCoercion","JSCompiler_inline_result","JSCompiler_temp_const","JSCompiler_inline_result$jscomp$0","getTaskName","name","getOwner","dispatcher","ReactSharedInternals","UnknownOwner","hasValidKey","hasOwnProperty","getter","defineKeyPropWarningGetter","props","displayName","warnAboutAccessingKey","specialPropKeyWarningShown","elementRefGetterWithDeprecationWarning","componentName","didWarnAboutElementRef","ReactElement","owner","debugStack","debugTask","refProp","jsxDEVImpl","isStaticChildren","children","isArrayImpl","validateChildKeys","keys","k","didWarnAboutKeySpread","node","isValidElement","object","React","require$$0","createTask","callStackForError","unknownOwnerDebugStack","unknownOwnerDebugTask","reactJsxRuntime_development","trackActualOwner","jsxRuntimeModule","require$$1","CellTexturesContext","createContext","CellTexturesProvider","app","useApplication","texture","setTexture","useState","useEffect","isUnmounted","generate","g","Graphics","generatedTexture","Cell","Particle","x","y","scaleX","scaleY","curLevel","__publicField","CellManager","particleContainerRefCurrent","cell","RecursiveGrid","gridRows","gridCols","cellWidth","cellHeight","gridDepth","useContext","particleContainerRef","useRef","cellManager","buildRecursiveGrid","_a","useTick","useCallback","currentParticlesRef","row","col","startX","startY","jsx","RecursiveGridContainer","extend","ParticleContainer","Texture","Container","Sprite","GRID_COLS","GRID_ROWS","CELL_WIDTH","CELL_HEIGHT","GRID_DEPTH","PixiApp","reloadKey","setReloadKey","jsxs","Application"],"mappings":";;;;;;;;;;;;;;;;;;;;AAWA,MAAIA,IAAqB,OAAO,IAAI,4BAA4B,GAC9DC,IAAsB,OAAO,IAAI,gBAAgB;AACnD,WAASC,EAAQC,GAAMC,GAAQC,GAAU;AACvC,QAAIC,IAAM;AAGV,QAFWD,MAAX,WAAwBC,IAAM,KAAKD,IACxBD,EAAO,QAAlB,WAA0BE,IAAM,KAAKF,EAAO,MACxC,SAASA,GAAQ;AACnB,MAAAC,IAAW,CAAA;AACX,eAASE,KAAYH;AACnB,QAAUG,MAAV,UAAuBF,EAASE,CAAQ,IAAIH,EAAOG,CAAQ;AAAA,IACjE,MAAS,CAAAF,IAAWD;AAClB,WAAAA,IAASC,EAAS,KACX;AAAA,MACL,UAAUL;AAAA,MACV,MAAMG;AAAA,MACN,KAAKG;AAAA,MACL,KAAgBF,MAAX,SAAoBA,IAAS;AAAA,MAClC,OAAOC;AAAA;EAEX;AACA,SAAAG,EAAA,WAAmBP,GACnBO,EAAA,MAAcN,GACdM,EAAA,OAAeN;;;;;;;;;;;;;;sBCtBE,QAAQ,IAAI,aAA7B,iBACG,WAAY;AACX,aAASO,EAAyBN,GAAM;AACtC,UAAYA,KAAR,KAAc,QAAO;AACzB,UAAmB,OAAOA,KAAtB;AACF,eAAOA,EAAK,aAAaO,KACrB,OACAP,EAAK,eAAeA,EAAK,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AAAA,EAAAA;AAAAA,EAACnB;AAAA,EAAA;AAAA,IACG,WAAAG;AAAA,IACA,YAAAC;AAAA,IACA,UAAAF;AAAA,IACA,UAAAD;AAAA,IACA,WAAAI;AAAA,EAAA;AAAA,GAER;AClBRgB,GAAO,EAAE,mBAAAC,IAAmB,UAAAhC,IAAU,SAAAiC,IAAS,WAAAC,IAAW,QAAAC,IAAQ,UAAAtC,IAAU;AAE5E,MAAMuC,IAAY,GACZC,IAAY,GACZC,IAAa,KACbC,IAAc,KACdC,KAAa,GAEbC,KAAU,MAAM;AAClB,QAAM,CAACC,GAAWC,CAAY,IAAInD,EAAiB,CAAC;AAEpD,SACIoD,gBAAAA,EAAAA,KAAC,OAAA,EAAI,WAAU,2DACX,UAAA;AAAA,IAAAf,gBAAAA,EAAAA;AAAAA,MAAC;AAAA,MAAA;AAAA,QACG,SAAS,MAAMc,EAAaD,IAAY,CAAC;AAAA,QACzC,WAAU;AAAA,QACb,UAAA;AAAA,MAAA;AAAA,IAAA;AAAA,IAGDb,gBAAAA,EAAAA;AAAAA,MAACgB;AAAA,MAAA;AAAA,QAEG,WAAW;AAAA,QACX,OAAOP,IAAaF;AAAA,QACpB,QAAQG,IAAcF;AAAA,QACtB,WAAU;AAAA,QACV,iBAAiB;AAAA,QACjB,aAAa;AAAA,QACb,uBAAuB;AAAA,QACvB,iBAAgB;AAAA,QAChB,WAAW;AAAA,QAEX,UAAAR,gBAAAA,EAAAA;AAAAA,UAACC;AAAA,UAAA;AAAA,YACG,UAAUM;AAAA,YACV,UAAUC;AAAA,YACV,WAAWC;AAAA,YACX,YAAYC;AAAA,YACZ,WAAWC;AAAA,UAAA;AAAA,QAAA;AAAA,MACf;AAAA,MAjBKE;AAAA,IAAA;AAAA,EAkBT,GACJ;AAER;","x_google_ignoreList":[0,1,2]}
|
|
1
|
+
{"version":3,"file":"recursive-grid.es.js","sources":["../node_modules/react/cjs/react-jsx-runtime.production.js","../node_modules/react/cjs/react-jsx-runtime.development.js","../node_modules/react/jsx-runtime.js","../src/context/CellTexturesContext.tsx","../src/classes/Cell.ts","../src/classes/CellManager.ts","../src/components/RecursiveGrid.tsx","../src/components/RecursiveGridContainer.tsx","../src/components/PixiApp.tsx"],"sourcesContent":["/**\n * @license React\n * react-jsx-runtime.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nvar REACT_ELEMENT_TYPE = Symbol.for(\"react.transitional.element\"),\n REACT_FRAGMENT_TYPE = Symbol.for(\"react.fragment\");\nfunction jsxProd(type, config, maybeKey) {\n var key = null;\n void 0 !== maybeKey && (key = \"\" + maybeKey);\n void 0 !== config.key && (key = \"\" + config.key);\n if (\"key\" in config) {\n maybeKey = {};\n for (var propName in config)\n \"key\" !== propName && (maybeKey[propName] = config[propName]);\n } else maybeKey = config;\n config = maybeKey.ref;\n return {\n $$typeof: REACT_ELEMENT_TYPE,\n type: type,\n key: key,\n ref: void 0 !== config ? config : null,\n props: maybeKey\n };\n}\nexports.Fragment = REACT_FRAGMENT_TYPE;\nexports.jsx = jsxProd;\nexports.jsxs = jsxProd;\n","/**\n * @license React\n * react-jsx-runtime.development.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\n\"production\" !== process.env.NODE_ENV &&\n (function () {\n function getComponentNameFromType(type) {\n if (null == type) return null;\n if (\"function\" === typeof type)\n return type.$$typeof === REACT_CLIENT_REFERENCE\n ? null\n : type.displayName || type.name || null;\n if (\"string\" === typeof type) return type;\n switch (type) {\n case REACT_FRAGMENT_TYPE:\n return \"Fragment\";\n case REACT_PROFILER_TYPE:\n return \"Profiler\";\n case REACT_STRICT_MODE_TYPE:\n return \"StrictMode\";\n case REACT_SUSPENSE_TYPE:\n return \"Suspense\";\n case REACT_SUSPENSE_LIST_TYPE:\n return \"SuspenseList\";\n case REACT_ACTIVITY_TYPE:\n return \"Activity\";\n }\n if (\"object\" === typeof type)\n switch (\n (\"number\" === typeof type.tag &&\n console.error(\n \"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue.\"\n ),\n type.$$typeof)\n ) {\n case REACT_PORTAL_TYPE:\n return \"Portal\";\n case REACT_CONTEXT_TYPE:\n return type.displayName || \"Context\";\n case REACT_CONSUMER_TYPE:\n return (type._context.displayName || \"Context\") + \".Consumer\";\n case REACT_FORWARD_REF_TYPE:\n var innerType = type.render;\n type = type.displayName;\n type ||\n ((type = innerType.displayName || innerType.name || \"\"),\n (type = \"\" !== type ? \"ForwardRef(\" + type + \")\" : \"ForwardRef\"));\n return type;\n case REACT_MEMO_TYPE:\n return (\n (innerType = type.displayName || null),\n null !== innerType\n ? innerType\n : getComponentNameFromType(type.type) || \"Memo\"\n );\n case REACT_LAZY_TYPE:\n innerType = type._payload;\n type = type._init;\n try {\n return getComponentNameFromType(type(innerType));\n } catch (x) {}\n }\n return null;\n }\n function testStringCoercion(value) {\n return \"\" + value;\n }\n function checkKeyStringCoercion(value) {\n try {\n testStringCoercion(value);\n var JSCompiler_inline_result = !1;\n } catch (e) {\n JSCompiler_inline_result = !0;\n }\n if (JSCompiler_inline_result) {\n JSCompiler_inline_result = console;\n var JSCompiler_temp_const = JSCompiler_inline_result.error;\n var JSCompiler_inline_result$jscomp$0 =\n (\"function\" === typeof Symbol &&\n Symbol.toStringTag &&\n value[Symbol.toStringTag]) ||\n value.constructor.name ||\n \"Object\";\n JSCompiler_temp_const.call(\n JSCompiler_inline_result,\n \"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.\",\n JSCompiler_inline_result$jscomp$0\n );\n return testStringCoercion(value);\n }\n }\n function getTaskName(type) {\n if (type === REACT_FRAGMENT_TYPE) return \"<>\";\n if (\n \"object\" === typeof type &&\n null !== type &&\n type.$$typeof === REACT_LAZY_TYPE\n )\n return \"<...>\";\n try {\n var name = getComponentNameFromType(type);\n return name ? \"<\" + name + \">\" : \"<...>\";\n } catch (x) {\n return \"<...>\";\n }\n }\n function getOwner() {\n var dispatcher = ReactSharedInternals.A;\n return null === dispatcher ? null : dispatcher.getOwner();\n }\n function UnknownOwner() {\n return Error(\"react-stack-top-frame\");\n }\n function hasValidKey(config) {\n if (hasOwnProperty.call(config, \"key\")) {\n var getter = Object.getOwnPropertyDescriptor(config, \"key\").get;\n if (getter && getter.isReactWarning) return !1;\n }\n return void 0 !== config.key;\n }\n function defineKeyPropWarningGetter(props, displayName) {\n function warnAboutAccessingKey() {\n specialPropKeyWarningShown ||\n ((specialPropKeyWarningShown = !0),\n console.error(\n \"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)\",\n displayName\n ));\n }\n warnAboutAccessingKey.isReactWarning = !0;\n Object.defineProperty(props, \"key\", {\n get: warnAboutAccessingKey,\n configurable: !0\n });\n }\n function elementRefGetterWithDeprecationWarning() {\n var componentName = getComponentNameFromType(this.type);\n didWarnAboutElementRef[componentName] ||\n ((didWarnAboutElementRef[componentName] = !0),\n console.error(\n \"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.\"\n ));\n componentName = this.props.ref;\n return void 0 !== componentName ? componentName : null;\n }\n function ReactElement(type, key, props, owner, debugStack, debugTask) {\n var refProp = props.ref;\n type = {\n $$typeof: REACT_ELEMENT_TYPE,\n type: type,\n key: key,\n props: props,\n _owner: owner\n };\n null !== (void 0 !== refProp ? refProp : null)\n ? Object.defineProperty(type, \"ref\", {\n enumerable: !1,\n get: elementRefGetterWithDeprecationWarning\n })\n : Object.defineProperty(type, \"ref\", { enumerable: !1, value: null });\n type._store = {};\n Object.defineProperty(type._store, \"validated\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: 0\n });\n Object.defineProperty(type, \"_debugInfo\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: null\n });\n Object.defineProperty(type, \"_debugStack\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: debugStack\n });\n Object.defineProperty(type, \"_debugTask\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: debugTask\n });\n Object.freeze && (Object.freeze(type.props), Object.freeze(type));\n return type;\n }\n function jsxDEVImpl(\n type,\n config,\n maybeKey,\n isStaticChildren,\n debugStack,\n debugTask\n ) {\n var children = config.children;\n if (void 0 !== children)\n if (isStaticChildren)\n if (isArrayImpl(children)) {\n for (\n isStaticChildren = 0;\n isStaticChildren < children.length;\n isStaticChildren++\n )\n validateChildKeys(children[isStaticChildren]);\n Object.freeze && Object.freeze(children);\n } else\n console.error(\n \"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.\"\n );\n else validateChildKeys(children);\n if (hasOwnProperty.call(config, \"key\")) {\n children = getComponentNameFromType(type);\n var keys = Object.keys(config).filter(function (k) {\n return \"key\" !== k;\n });\n isStaticChildren =\n 0 < keys.length\n ? \"{key: someKey, \" + keys.join(\": ..., \") + \": ...}\"\n : \"{key: someKey}\";\n didWarnAboutKeySpread[children + isStaticChildren] ||\n ((keys =\n 0 < keys.length ? \"{\" + keys.join(\": ..., \") + \": ...}\" : \"{}\"),\n console.error(\n 'A props object containing a \"key\" prop is being spread into JSX:\\n let props = %s;\\n <%s {...props} />\\nReact keys must be passed directly to JSX without using spread:\\n let props = %s;\\n <%s key={someKey} {...props} />',\n isStaticChildren,\n children,\n keys,\n children\n ),\n (didWarnAboutKeySpread[children + isStaticChildren] = !0));\n }\n children = null;\n void 0 !== maybeKey &&\n (checkKeyStringCoercion(maybeKey), (children = \"\" + maybeKey));\n hasValidKey(config) &&\n (checkKeyStringCoercion(config.key), (children = \"\" + config.key));\n if (\"key\" in config) {\n maybeKey = {};\n for (var propName in config)\n \"key\" !== propName && (maybeKey[propName] = config[propName]);\n } else maybeKey = config;\n children &&\n defineKeyPropWarningGetter(\n maybeKey,\n \"function\" === typeof type\n ? type.displayName || type.name || \"Unknown\"\n : type\n );\n return ReactElement(\n type,\n children,\n maybeKey,\n getOwner(),\n debugStack,\n debugTask\n );\n }\n function validateChildKeys(node) {\n isValidElement(node)\n ? node._store && (node._store.validated = 1)\n : \"object\" === typeof node &&\n null !== node &&\n node.$$typeof === REACT_LAZY_TYPE &&\n (\"fulfilled\" === node._payload.status\n ? isValidElement(node._payload.value) &&\n node._payload.value._store &&\n (node._payload.value._store.validated = 1)\n : node._store && (node._store.validated = 1));\n }\n function isValidElement(object) {\n return (\n \"object\" === typeof object &&\n null !== object &&\n object.$$typeof === REACT_ELEMENT_TYPE\n );\n }\n var React = require(\"react\"),\n REACT_ELEMENT_TYPE = Symbol.for(\"react.transitional.element\"),\n REACT_PORTAL_TYPE = Symbol.for(\"react.portal\"),\n REACT_FRAGMENT_TYPE = Symbol.for(\"react.fragment\"),\n REACT_STRICT_MODE_TYPE = Symbol.for(\"react.strict_mode\"),\n REACT_PROFILER_TYPE = Symbol.for(\"react.profiler\"),\n REACT_CONSUMER_TYPE = Symbol.for(\"react.consumer\"),\n REACT_CONTEXT_TYPE = Symbol.for(\"react.context\"),\n REACT_FORWARD_REF_TYPE = Symbol.for(\"react.forward_ref\"),\n REACT_SUSPENSE_TYPE = Symbol.for(\"react.suspense\"),\n REACT_SUSPENSE_LIST_TYPE = Symbol.for(\"react.suspense_list\"),\n REACT_MEMO_TYPE = Symbol.for(\"react.memo\"),\n REACT_LAZY_TYPE = Symbol.for(\"react.lazy\"),\n REACT_ACTIVITY_TYPE = Symbol.for(\"react.activity\"),\n REACT_CLIENT_REFERENCE = Symbol.for(\"react.client.reference\"),\n ReactSharedInternals =\n React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,\n hasOwnProperty = Object.prototype.hasOwnProperty,\n isArrayImpl = Array.isArray,\n createTask = console.createTask\n ? console.createTask\n : function () {\n return null;\n };\n React = {\n react_stack_bottom_frame: function (callStackForError) {\n return callStackForError();\n }\n };\n var specialPropKeyWarningShown;\n var didWarnAboutElementRef = {};\n var unknownOwnerDebugStack = React.react_stack_bottom_frame.bind(\n React,\n UnknownOwner\n )();\n var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));\n var didWarnAboutKeySpread = {};\n exports.Fragment = REACT_FRAGMENT_TYPE;\n exports.jsx = function (type, config, maybeKey) {\n var trackActualOwner =\n 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;\n return jsxDEVImpl(\n type,\n config,\n maybeKey,\n !1,\n trackActualOwner\n ? Error(\"react-stack-top-frame\")\n : unknownOwnerDebugStack,\n trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask\n );\n };\n exports.jsxs = function (type, config, maybeKey) {\n var trackActualOwner =\n 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;\n return jsxDEVImpl(\n type,\n config,\n maybeKey,\n !0,\n trackActualOwner\n ? Error(\"react-stack-top-frame\")\n : unknownOwnerDebugStack,\n trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask\n );\n };\n })();\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-jsx-runtime.production.js');\n} else {\n module.exports = require('./cjs/react-jsx-runtime.development.js');\n}\n","import { createContext, useContext, FC, ReactNode, useEffect, useState } from 'react'\r\nimport { useApplication } from '@pixi/react'\r\nimport { Graphics, Texture } from 'pixi.js'\r\n\r\ntype CellTextures = Texture\r\n\r\nconst CellTexturesContext = createContext<CellTextures>({} as CellTextures)\r\n\r\nexport const useCellTextures = () => useContext(CellTexturesContext)\r\n\r\nconst CellTexturesProvider: FC<{ children: ReactNode }> = ({ children }) => {\r\n const { app } = useApplication()\r\n const [texture, setTexture] = useState<Texture | null>(null)\r\n\r\n useEffect(() => {\r\n if (!app) return\r\n\r\n let isUnmounted = false\r\n\r\n const generate = () => {\r\n // Wait until Pixi Application has initialised the renderer\r\n if (!app.renderer) {\r\n requestAnimationFrame(generate)\r\n return\r\n }\r\n\r\n const g = new Graphics()\r\n g.setFillStyle({ color: '#121225' })\r\n g.rect(0, 0, 1, 1)\r\n g.fill()\r\n const generatedTexture = app.renderer.generateTexture(g)\r\n g.destroy()\r\n if (!isUnmounted) setTexture(generatedTexture)\r\n }\r\n\r\n generate()\r\n\r\n return () => {\r\n isUnmounted = true\r\n // Destroy generated texture to free GPU memory\r\n try {\r\n texture?.destroy(true)\r\n } catch {}\r\n setTexture(null)\r\n }\r\n }, [app])\r\n\r\n if (!texture) return null\r\n\r\n return (\r\n <CellTexturesContext.Provider value={texture}>\r\n {children}\r\n </CellTexturesContext.Provider>\r\n )\r\n}\r\n\r\nexport { CellTexturesContext, CellTexturesProvider }\r\n","import { Particle, Texture } from \"pixi.js\"\r\n\r\nexport class Cell extends Particle {\r\n private animationProgress = 0\r\n private delayCounter = 0\r\n private randomSpeed: number\r\n private randomDelayOffset: number\r\n startScaleX: number\r\n startScaleY: number\r\n targetAlpha: number\r\n\r\n constructor(\r\n public texture: Texture,\r\n public x: number,\r\n public y: number,\r\n public scaleX: number,\r\n public scaleY: number,\r\n public curLevel: number,\r\n ) {\r\n super({ texture, x, y, scaleX, scaleY, alpha: 0 })\r\n this.startScaleX = scaleX\r\n this.startScaleY = scaleY\r\n this.curLevel = curLevel\r\n\r\n // Randomize speed slightly (0.08 to 0.12)\r\n this.randomSpeed = 0.04 + Math.random() * 0.04\r\n // Randomize delay by a few frames\r\n this.randomDelayOffset = Math.floor(Math.random() * 150)\r\n this.targetAlpha = 0.9 + Math.random() * 0.1\r\n }\r\n\r\n update() {\r\n if (this.delayCounter < this.curLevel * 15 + this.randomDelayOffset) {\r\n this.delayCounter++\r\n return\r\n }\r\n\r\n if (this.animationProgress >= this.targetAlpha - 0.001) {\r\n this.animationProgress = this.targetAlpha\r\n this.alpha = this.targetAlpha\r\n return\r\n }\r\n\r\n this.animationProgress += (this.targetAlpha - this.animationProgress) * this.randomSpeed\r\n this.alpha = this.animationProgress\r\n }\r\n}\r\n","import { ParticleContainer, Texture } from 'pixi.js'\r\nimport { Cell } from './Cell'\r\n\r\nexport class CellManager {\r\n private cells: Cell[] = []\r\n\r\n constructor(\r\n public texture: Texture,\r\n public particleContainerRefCurrent: ParticleContainer\r\n ) {\r\n this.texture = texture\r\n }\r\n\r\n add(x: number, y: number, scaleX: number, scaleY: number, curLevel: number) {\r\n const cell = new Cell(this.texture, x, y, scaleX, scaleY, curLevel)\r\n this.particleContainerRefCurrent.addParticle(cell)\r\n this.cells.push(cell)\r\n }\r\n\r\n updateAll() {\r\n for (const cell of this.cells) {\r\n cell.update()\r\n }\r\n }\r\n}","import { FC, useCallback, useContext, useEffect, useRef } from 'react'\r\nimport { ParticleContainer } from 'pixi.js'\r\nimport { CellTexturesContext } from '../context/CellTexturesContext'\r\nimport { useTick } from '@pixi/react'\r\nimport { CellManager } from '../classes/CellManager'\r\n\r\ninterface GridProps {\r\n gridCols: number\r\n gridRows: number\r\n cellWidth: number\r\n cellHeight: number\r\n gridDepth: number\r\n}\r\n\r\nconst RecursiveGrid: FC<GridProps> = ({\r\n gridRows,\r\n gridCols,\r\n cellWidth,\r\n cellHeight,\r\n gridDepth,\r\n}) => {\r\n const texture = useContext(CellTexturesContext)\r\n const particleContainerRef = useRef<ParticleContainer>(null)\r\n const cellManager = useRef<CellManager>(null)\r\n\r\n useEffect(() => {\r\n if (!texture) return\r\n if (particleContainerRef.current) {\r\n // Clear any previous content on re-init\r\n try {\r\n particleContainerRef.current.removeChildren()\r\n } catch {}\r\n\r\n cellManager.current = new CellManager(\r\n texture,\r\n particleContainerRef.current\r\n )\r\n\r\n buildRecursiveGrid(\r\n 0,\r\n 0,\r\n cellWidth,\r\n cellHeight,\r\n gridCols,\r\n gridRows,\r\n gridDepth,\r\n particleContainerRef.current\r\n )\r\n }\r\n return () => {\r\n // Clean up particles and references on unmount/texture change\r\n try {\r\n particleContainerRef.current?.removeChildren()\r\n } catch {}\r\n cellManager.current = null\r\n }\r\n }, [texture, cellWidth, cellHeight, gridCols, gridRows, gridDepth])\r\n\r\n useTick(() => {\r\n cellManager.current?.updateAll()\r\n })\r\n\r\n const buildRecursiveGrid = useCallback(\r\n (\r\n x: number,\r\n y: number,\r\n cellWidth: number,\r\n cellHeight: number,\r\n gridCols: number,\r\n gridRows: number,\r\n curLevel: number,\r\n currentParticlesRef: ParticleContainer\r\n ) => {\r\n for (let row = 0; row < gridRows; row++) {\r\n for (let col = 0; col < gridCols; col++) {\r\n const startX = x + col * cellWidth\r\n const startY = y + row * cellHeight\r\n\r\n if (\r\n curLevel <= 0 ||\r\n (Math.random() > 0.7 && curLevel < gridDepth)\r\n ) {\r\n if (Math.random() > 0.1) {\r\n cellManager.current?.add(\r\n startX,\r\n startY,\r\n cellWidth - 1,\r\n cellHeight - 1,\r\n curLevel\r\n )\r\n }\r\n } else {\r\n buildRecursiveGrid(\r\n startX,\r\n startY,\r\n cellWidth / gridCols,\r\n cellHeight / gridRows,\r\n gridCols,\r\n gridRows,\r\n curLevel - 1,\r\n currentParticlesRef\r\n )\r\n }\r\n }\r\n }\r\n },\r\n []\r\n )\r\n\r\n return (\r\n <pixiParticleContainer\r\n ref={particleContainerRef}\r\n dynamicProperties={{\r\n position: true,\r\n vertex: true,\r\n color: true,\r\n }}\r\n />\r\n )\r\n}\r\n\r\nexport default RecursiveGrid\r\n","import { FC } from 'react'\r\nimport RecursiveGrid from './RecursiveGrid'\r\n\r\nimport { CellTexturesProvider } from '../context/CellTexturesContext'\r\n\r\ninterface RecursiveGridContainerProps {\r\n cellWidth: number\r\n cellHeight: number\r\n gridRows: number\r\n gridCols: number\r\n gridDepth: number\r\n}\r\n\r\nconst RecursiveGridContainer: FC<RecursiveGridContainerProps> = ({\r\n cellWidth,\r\n cellHeight,\r\n gridRows,\r\n gridCols,\r\n gridDepth,\r\n}) => {\r\n return (\r\n <CellTexturesProvider>\r\n <RecursiveGrid\r\n cellWidth={cellWidth}\r\n cellHeight={cellHeight}\r\n gridCols={gridCols}\r\n gridRows={gridRows}\r\n gridDepth={gridDepth}\r\n />\r\n </CellTexturesProvider>\r\n )\r\n}\r\n\r\nexport default RecursiveGridContainer\r\n","import { Application, extend } from '@pixi/react'\r\nimport {\r\n Sprite,\r\n Graphics,\r\n Container,\r\n Texture,\r\n Particle,\r\n ParticleContainer,\r\n} from 'pixi.js'\r\nimport RecursiveGridContainer from './RecursiveGridContainer'\r\nimport { useEffect, useState } from 'react'\r\nextend({ ParticleContainer, Particle, Texture, Container, Sprite, Graphics })\r\n\r\nconst GRID_COLS = 2\r\nconst GRID_ROWS = 2\r\nconst CELL_WIDTH = 300\r\nconst CELL_HEIGHT = 300\r\nconst GRID_DEPTH = 6\r\n\r\nconst PixiApp = () => {\r\n const [reloadKey, setReloadKey] = useState<number>(0)\r\n\r\n useEffect(() => {\r\n const interval = setInterval(() => {\r\n console.log('Reloading Pixi Application to clear GPU memory...')\r\n setReloadKey((prev) => prev + 1)\r\n }, 2000)\r\n\r\n return () => clearInterval(interval)\r\n }, [])\r\n\r\n return (\r\n <div className=\"flex flex-col items-center justify-center w-full h-full\">\r\n <Application\r\n key={reloadKey}\r\n antialias={false}\r\n width={CELL_WIDTH * GRID_COLS}\r\n height={CELL_HEIGHT * GRID_ROWS}\r\n className=\"image-pixelated w-full\"\r\n backgroundAlpha={0}\r\n autoDensity={true}\r\n preserveDrawingBuffer={true}\r\n powerPreference=\"high-performance\"\r\n autoStart={true}\r\n >\r\n <RecursiveGridContainer\r\n gridCols={GRID_COLS}\r\n gridRows={GRID_ROWS}\r\n cellWidth={CELL_WIDTH}\r\n cellHeight={CELL_HEIGHT}\r\n gridDepth={GRID_DEPTH}\r\n />\r\n </Application>\r\n </div>\r\n )\r\n}\r\n\r\nexport default PixiApp\r\n"],"names":["REACT_ELEMENT_TYPE","REACT_FRAGMENT_TYPE","jsxProd","type","config","maybeKey","key","propName","reactJsxRuntime_production","getComponentNameFromType","REACT_CLIENT_REFERENCE","REACT_PROFILER_TYPE","REACT_STRICT_MODE_TYPE","REACT_SUSPENSE_TYPE","REACT_SUSPENSE_LIST_TYPE","REACT_ACTIVITY_TYPE","REACT_PORTAL_TYPE","REACT_CONTEXT_TYPE","REACT_CONSUMER_TYPE","REACT_FORWARD_REF_TYPE","innerType","REACT_MEMO_TYPE","REACT_LAZY_TYPE","testStringCoercion","value","checkKeyStringCoercion","JSCompiler_inline_result","JSCompiler_temp_const","JSCompiler_inline_result$jscomp$0","getTaskName","name","getOwner","dispatcher","ReactSharedInternals","UnknownOwner","hasValidKey","hasOwnProperty","getter","defineKeyPropWarningGetter","props","displayName","warnAboutAccessingKey","specialPropKeyWarningShown","elementRefGetterWithDeprecationWarning","componentName","didWarnAboutElementRef","ReactElement","owner","debugStack","debugTask","refProp","jsxDEVImpl","isStaticChildren","children","isArrayImpl","validateChildKeys","keys","k","didWarnAboutKeySpread","node","isValidElement","object","React","require$$0","createTask","callStackForError","unknownOwnerDebugStack","unknownOwnerDebugTask","reactJsxRuntime_development","trackActualOwner","jsxRuntimeModule","require$$1","CellTexturesContext","createContext","CellTexturesProvider","app","useApplication","texture","setTexture","useState","useEffect","isUnmounted","generate","g","Graphics","generatedTexture","Cell","Particle","x","y","scaleX","scaleY","curLevel","__publicField","CellManager","particleContainerRefCurrent","cell","RecursiveGrid","gridRows","gridCols","cellWidth","cellHeight","gridDepth","useContext","particleContainerRef","useRef","cellManager","buildRecursiveGrid","_a","useTick","useCallback","currentParticlesRef","row","col","startX","startY","jsx","RecursiveGridContainer","extend","ParticleContainer","Texture","Container","Sprite","GRID_COLS","GRID_ROWS","CELL_WIDTH","CELL_HEIGHT","GRID_DEPTH","PixiApp","reloadKey","setReloadKey","interval","prev","Application"],"mappings":";;;;;;;;;;;;;;;;;;;;AAWA,MAAIA,IAAqB,OAAO,IAAI,4BAA4B,GAC9DC,IAAsB,OAAO,IAAI,gBAAgB;AACnD,WAASC,EAAQC,GAAMC,GAAQC,GAAU;AACvC,QAAIC,IAAM;AAGV,QAFWD,MAAX,WAAwBC,IAAM,KAAKD,IACxBD,EAA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f,gBAAAA,EAAAA,IAAC,OAAA,EAAI,WAAU,2DACX,UAAAA,gBAAAA,EAAAA;AAAAA,IAACiB;AAAA,IAAA;AAAA,MAEG,WAAW;AAAA,MACX,OAAOR,IAAaF;AAAA,MACpB,QAAQG,IAAcF;AAAA,MACtB,WAAU;AAAA,MACV,iBAAiB;AAAA,MACjB,aAAa;AAAA,MACb,uBAAuB;AAAA,MACvB,iBAAgB;AAAA,MAChB,WAAW;AAAA,MAEX,UAAAR,gBAAAA,EAAAA;AAAAA,QAACC;AAAA,QAAA;AAAA,UACG,UAAUM;AAAA,UACV,UAAUC;AAAA,UACV,WAAWC;AAAA,UACX,YAAYC;AAAA,UACZ,WAAWC;AAAA,QAAA;AAAA,MAAA;AAAA,IACf;AAAA,IAjBKE;AAAA,EAAA,GAmBb;AAER;","x_google_ignoreList":[0,1,2]}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var W;function te(){if(W)return A;W=1;var
|
|
9
|
+
*/var W;function te(){if(W)return A;W=1;var d=Symbol.for("react.transitional.element"),s=Symbol.for("react.fragment");function t(c,n,l){var a=null;if(l!==void 0&&(a=""+l),n.key!==void 0&&(a=""+n.key),"key"in n){l={};for(var p in n)p!=="key"&&(l[p]=n[p])}else l=n;return n=l.ref,{$$typeof:d,type:c,key:a,ref:n!==void 0?n:null,props:l}}return A.Fragment=s,A.jsx=t,A.jsxs=t,A}var S={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.development.js
|
|
12
12
|
*
|
|
@@ -14,10 +14,10 @@
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var X;function ne(){return X||(X=1,process.env.NODE_ENV!=="production"&&(function(){function
|
|
17
|
+
*/var X;function ne(){return X||(X=1,process.env.NODE_ENV!=="production"&&(function(){function d(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===he?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case g:return"Fragment";case k:return"Profiler";case N:return"StrictMode";case fe:return"Suspense";case de:return"SuspenseList";case pe:return"Activity"}if(typeof e=="object")switch(typeof e.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case P:return"Portal";case I:return e.displayName||"Context";case C:return(e._context.displayName||"Context")+".Consumer";case D:var r=e.render;return e=e.displayName,e||(e=r.displayName||r.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case me:return r=e.displayName||null,r!==null?r:d(e.type)||"Memo";case M:r=e._payload,e=e._init;try{return d(e(r))}catch{}}return null}function s(e){return""+e}function t(e){try{s(e);var r=!1}catch{r=!0}if(r){r=console;var i=r.error,u=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return i.call(r,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",u),s(e)}}function c(e){if(e===g)return"<>";if(typeof e=="object"&&e!==null&&e.$$typeof===M)return"<...>";try{var r=d(e);return r?"<"+r+">":"<...>"}catch{return"<...>"}}function n(){var e=G.A;return e===null?null:e.getOwner()}function l(){return Error("react-stack-top-frame")}function a(e){if(q.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function p(e,r){function i(){Q||(Q=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",r))}i.isReactWarning=!0,Object.defineProperty(e,"key",{get:i,configurable:!0})}function w(){var e=d(this.type);return K[e]||(K[e]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),e=this.props.ref,e!==void 0?e:null}function E(e,r,i,u,Y,L){var f=i.ref;return e={$$typeof:x,type:e,key:r,props:i,_owner:u},(f!==void 0?f:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:w}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:Y}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:L}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function j(e,r,i,u,Y,L){var f=r.children;if(f!==void 0)if(u)if(Ee(f)){for(u=0;u<f.length;u++)T(f[u]);Object.freeze&&Object.freeze(f)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else T(f);if(q.call(r,"key")){f=d(e);var y=Object.keys(r).filter(function(Re){return Re!=="key"});u=0<y.length?"{key: someKey, "+y.join(": ..., ")+": ...}":"{key: someKey}",re[f+u]||(y=0<y.length?"{"+y.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
18
18
|
let props = %s;
|
|
19
19
|
<%s {...props} />
|
|
20
20
|
React keys must be passed directly to JSX without using spread:
|
|
21
21
|
let props = %s;
|
|
22
|
-
<%s key={someKey} {...props} />`,
|
|
22
|
+
<%s key={someKey} {...props} />`,u,f,y,f),re[f+u]=!0)}if(f=null,i!==void 0&&(t(i),f=""+i),a(r)&&(t(r.key),f=""+r.key),"key"in r){i={};for(var U in r)U!=="key"&&(i[U]=r[U])}else i=r;return f&&p(i,typeof e=="function"?e.displayName||e.name||"Unknown":e),E(e,f,i,n(),Y,L)}function T(e){b(e)?e._store&&(e._store.validated=1):typeof e=="object"&&e!==null&&e.$$typeof===M&&(e._payload.status==="fulfilled"?b(e._payload.value)&&e._payload.value._store&&(e._payload.value._store.validated=1):e._store&&(e._store.validated=1))}function b(e){return typeof e=="object"&&e!==null&&e.$$typeof===x}var v=o,x=Symbol.for("react.transitional.element"),P=Symbol.for("react.portal"),g=Symbol.for("react.fragment"),N=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),C=Symbol.for("react.consumer"),I=Symbol.for("react.context"),D=Symbol.for("react.forward_ref"),fe=Symbol.for("react.suspense"),de=Symbol.for("react.suspense_list"),me=Symbol.for("react.memo"),M=Symbol.for("react.lazy"),pe=Symbol.for("react.activity"),he=Symbol.for("react.client.reference"),G=v.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,q=Object.prototype.hasOwnProperty,Ee=Array.isArray,F=console.createTask?console.createTask:function(){return null};v={react_stack_bottom_frame:function(e){return e()}};var Q,K={},$=v.react_stack_bottom_frame.bind(v,l)(),ee=F(c(l)),re={};S.Fragment=g,S.jsx=function(e,r,i){var u=1e4>G.recentlyCreatedOwnerStacks++;return j(e,r,i,!1,u?Error("react-stack-top-frame"):$,u?F(c(e)):ee)},S.jsxs=function(e,r,i){var u=1e4>G.recentlyCreatedOwnerStacks++;return j(e,r,i,!0,u?Error("react-stack-top-frame"):$,u?F(c(e)):ee)}})()),S}var J;function ae(){return J||(J=1,process.env.NODE_ENV==="production"?O.exports=te():O.exports=ne()),O.exports}var _=ae();const V=o.createContext({}),oe=({children:d})=>{const{app:s}=m.useApplication(),[t,c]=o.useState(null);return o.useEffect(()=>{if(!s)return;let n=!1;const l=()=>{if(!s.renderer){requestAnimationFrame(l);return}const a=new h.Graphics;a.setFillStyle({color:"#121225"}),a.rect(0,0,1,1),a.fill();const p=s.renderer.generateTexture(a);a.destroy(),n||c(p)};return l(),()=>{n=!0;try{t==null||t.destroy(!0)}catch{}c(null)}},[s]),t?_.jsx(V.Provider,{value:t,children:d}):null};class se extends h.Particle{constructor(t,c,n,l,a,p){super({texture:t,x:c,y:n,scaleX:l,scaleY:a,alpha:0});R(this,"animationProgress",0);R(this,"delayCounter",0);R(this,"randomSpeed");R(this,"randomDelayOffset");R(this,"startScaleX");R(this,"startScaleY");R(this,"targetAlpha");this.texture=t,this.x=c,this.y=n,this.scaleX=l,this.scaleY=a,this.curLevel=p,this.startScaleX=l,this.startScaleY=a,this.curLevel=p,this.randomSpeed=.04+Math.random()*.04,this.randomDelayOffset=Math.floor(Math.random()*150),this.targetAlpha=.9+Math.random()*.1}update(){if(this.delayCounter<this.curLevel*15+this.randomDelayOffset){this.delayCounter++;return}if(this.animationProgress>=this.targetAlpha-.001){this.animationProgress=this.targetAlpha,this.alpha=this.targetAlpha;return}this.animationProgress+=(this.targetAlpha-this.animationProgress)*this.randomSpeed,this.alpha=this.animationProgress}}class le{constructor(s,t){R(this,"cells",[]);this.texture=s,this.particleContainerRefCurrent=t,this.texture=s}add(s,t,c,n,l){const a=new se(this.texture,s,t,c,n,l);this.particleContainerRefCurrent.addParticle(a),this.cells.push(a)}updateAll(){for(const s of this.cells)s.update()}}const ie=({gridRows:d,gridCols:s,cellWidth:t,cellHeight:c,gridDepth:n})=>{const l=o.useContext(V),a=o.useRef(null),p=o.useRef(null);o.useEffect(()=>{if(l){if(a.current){try{a.current.removeChildren()}catch{}p.current=new le(l,a.current),w(0,0,t,c,s,d,n,a.current)}return()=>{var E;try{(E=a.current)==null||E.removeChildren()}catch{}p.current=null}}},[l,t,c,s,d,n]),m.useTick(()=>{var E;(E=p.current)==null||E.updateAll()});const w=o.useCallback((E,j,T,b,v,x,P,g)=>{var N;for(let k=0;k<x;k++)for(let C=0;C<v;C++){const I=E+C*T,D=j+k*b;P<=0||Math.random()>.7&&P<n?Math.random()>.1&&((N=p.current)==null||N.add(I,D,T-1,b-1,P)):w(I,D,T/v,b/x,v,x,P-1,g)}},[]);return _.jsx("pixiParticleContainer",{ref:a,dynamicProperties:{position:!0,vertex:!0,color:!0}})},ce=({cellWidth:d,cellHeight:s,gridRows:t,gridCols:c,gridDepth:n})=>_.jsx(oe,{children:_.jsx(ie,{cellWidth:d,cellHeight:s,gridCols:c,gridRows:t,gridDepth:n})});m.extend({ParticleContainer:h.ParticleContainer,Particle:h.Particle,Texture:h.Texture,Container:h.Container,Sprite:h.Sprite,Graphics:h.Graphics});const z=2,H=2,B=300,Z=300,ue=6;return()=>{const[d,s]=o.useState(0);return o.useEffect(()=>{const t=setInterval(()=>{console.log("Reloading Pixi Application to clear GPU memory..."),s(c=>c+1)},2e3);return()=>clearInterval(t)},[]),_.jsx("div",{className:"flex flex-col items-center justify-center w-full h-full",children:_.jsx(m.Application,{antialias:!1,width:B*z,height:Z*H,className:"image-pixelated w-full",backgroundAlpha:0,autoDensity:!0,preserveDrawingBuffer:!0,powerPreference:"high-performance",autoStart:!0,children:_.jsx(ce,{gridCols:z,gridRows:H,cellWidth:B,cellHeight:Z,gridDepth:ue})},d)})}}));
|
|
23
23
|
//# sourceMappingURL=recursive-grid.umd.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recursive-grid.umd.js","sources":["../node_modules/react/cjs/react-jsx-runtime.production.js","../node_modules/react/cjs/react-jsx-runtime.development.js","../node_modules/react/jsx-runtime.js","../src/context/CellTexturesContext.tsx","../src/classes/Cell.ts","../src/classes/CellManager.ts","../src/components/RecursiveGrid.tsx","../src/components/RecursiveGridContainer.tsx","../src/components/PixiApp.tsx"],"sourcesContent":["/**\n * @license React\n * react-jsx-runtime.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nvar REACT_ELEMENT_TYPE = Symbol.for(\"react.transitional.element\"),\n REACT_FRAGMENT_TYPE = Symbol.for(\"react.fragment\");\nfunction jsxProd(type, config, maybeKey) {\n var key = null;\n void 0 !== maybeKey && (key = \"\" + maybeKey);\n void 0 !== config.key && (key = \"\" + config.key);\n if (\"key\" in config) {\n maybeKey = {};\n for (var propName in config)\n \"key\" !== propName && (maybeKey[propName] = config[propName]);\n } else maybeKey = config;\n config = maybeKey.ref;\n return {\n $$typeof: REACT_ELEMENT_TYPE,\n type: type,\n key: key,\n ref: void 0 !== config ? config : null,\n props: maybeKey\n };\n}\nexports.Fragment = REACT_FRAGMENT_TYPE;\nexports.jsx = jsxProd;\nexports.jsxs = jsxProd;\n","/**\n * @license React\n * react-jsx-runtime.development.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\n\"production\" !== process.env.NODE_ENV &&\n (function () {\n function getComponentNameFromType(type) {\n if (null == type) return null;\n if (\"function\" === typeof type)\n return type.$$typeof === REACT_CLIENT_REFERENCE\n ? null\n : type.displayName || type.name || null;\n if (\"string\" === typeof type) return type;\n switch (type) {\n case REACT_FRAGMENT_TYPE:\n return \"Fragment\";\n case REACT_PROFILER_TYPE:\n return \"Profiler\";\n case REACT_STRICT_MODE_TYPE:\n return \"StrictMode\";\n case REACT_SUSPENSE_TYPE:\n return \"Suspense\";\n case REACT_SUSPENSE_LIST_TYPE:\n return \"SuspenseList\";\n case REACT_ACTIVITY_TYPE:\n return \"Activity\";\n }\n if (\"object\" === typeof type)\n switch (\n (\"number\" === typeof type.tag &&\n console.error(\n \"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue.\"\n ),\n type.$$typeof)\n ) {\n case REACT_PORTAL_TYPE:\n return \"Portal\";\n case REACT_CONTEXT_TYPE:\n return type.displayName || \"Context\";\n case REACT_CONSUMER_TYPE:\n return (type._context.displayName || \"Context\") + \".Consumer\";\n case REACT_FORWARD_REF_TYPE:\n var innerType = type.render;\n type = type.displayName;\n type ||\n ((type = innerType.displayName || innerType.name || \"\"),\n (type = \"\" !== type ? \"ForwardRef(\" + type + \")\" : \"ForwardRef\"));\n return type;\n case REACT_MEMO_TYPE:\n return (\n (innerType = type.displayName || null),\n null !== innerType\n ? innerType\n : getComponentNameFromType(type.type) || \"Memo\"\n );\n case REACT_LAZY_TYPE:\n innerType = type._payload;\n type = type._init;\n try {\n return getComponentNameFromType(type(innerType));\n } catch (x) {}\n }\n return null;\n }\n function testStringCoercion(value) {\n return \"\" + value;\n }\n function checkKeyStringCoercion(value) {\n try {\n testStringCoercion(value);\n var JSCompiler_inline_result = !1;\n } catch (e) {\n JSCompiler_inline_result = !0;\n }\n if (JSCompiler_inline_result) {\n JSCompiler_inline_result = console;\n var JSCompiler_temp_const = JSCompiler_inline_result.error;\n var JSCompiler_inline_result$jscomp$0 =\n (\"function\" === typeof Symbol &&\n Symbol.toStringTag &&\n value[Symbol.toStringTag]) ||\n value.constructor.name ||\n \"Object\";\n JSCompiler_temp_const.call(\n JSCompiler_inline_result,\n \"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.\",\n JSCompiler_inline_result$jscomp$0\n );\n return testStringCoercion(value);\n }\n }\n function getTaskName(type) {\n if (type === REACT_FRAGMENT_TYPE) return \"<>\";\n if (\n \"object\" === typeof type &&\n null !== type &&\n type.$$typeof === REACT_LAZY_TYPE\n )\n return \"<...>\";\n try {\n var name = getComponentNameFromType(type);\n return name ? \"<\" + name + \">\" : \"<...>\";\n } catch (x) {\n return \"<...>\";\n }\n }\n function getOwner() {\n var dispatcher = ReactSharedInternals.A;\n return null === dispatcher ? null : dispatcher.getOwner();\n }\n function UnknownOwner() {\n return Error(\"react-stack-top-frame\");\n }\n function hasValidKey(config) {\n if (hasOwnProperty.call(config, \"key\")) {\n var getter = Object.getOwnPropertyDescriptor(config, \"key\").get;\n if (getter && getter.isReactWarning) return !1;\n }\n return void 0 !== config.key;\n }\n function defineKeyPropWarningGetter(props, displayName) {\n function warnAboutAccessingKey() {\n specialPropKeyWarningShown ||\n ((specialPropKeyWarningShown = !0),\n console.error(\n \"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)\",\n displayName\n ));\n }\n warnAboutAccessingKey.isReactWarning = !0;\n Object.defineProperty(props, \"key\", {\n get: warnAboutAccessingKey,\n configurable: !0\n });\n }\n function elementRefGetterWithDeprecationWarning() {\n var componentName = getComponentNameFromType(this.type);\n didWarnAboutElementRef[componentName] ||\n ((didWarnAboutElementRef[componentName] = !0),\n console.error(\n \"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.\"\n ));\n componentName = this.props.ref;\n return void 0 !== componentName ? componentName : null;\n }\n function ReactElement(type, key, props, owner, debugStack, debugTask) {\n var refProp = props.ref;\n type = {\n $$typeof: REACT_ELEMENT_TYPE,\n type: type,\n key: key,\n props: props,\n _owner: owner\n };\n null !== (void 0 !== refProp ? refProp : null)\n ? Object.defineProperty(type, \"ref\", {\n enumerable: !1,\n get: elementRefGetterWithDeprecationWarning\n })\n : Object.defineProperty(type, \"ref\", { enumerable: !1, value: null });\n type._store = {};\n Object.defineProperty(type._store, \"validated\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: 0\n });\n Object.defineProperty(type, \"_debugInfo\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: null\n });\n Object.defineProperty(type, \"_debugStack\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: debugStack\n });\n Object.defineProperty(type, \"_debugTask\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: debugTask\n });\n Object.freeze && (Object.freeze(type.props), Object.freeze(type));\n return type;\n }\n function jsxDEVImpl(\n type,\n config,\n maybeKey,\n isStaticChildren,\n debugStack,\n debugTask\n ) {\n var children = config.children;\n if (void 0 !== children)\n if (isStaticChildren)\n if (isArrayImpl(children)) {\n for (\n isStaticChildren = 0;\n isStaticChildren < children.length;\n isStaticChildren++\n )\n validateChildKeys(children[isStaticChildren]);\n Object.freeze && Object.freeze(children);\n } else\n console.error(\n \"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.\"\n );\n else validateChildKeys(children);\n if (hasOwnProperty.call(config, \"key\")) {\n children = getComponentNameFromType(type);\n var keys = Object.keys(config).filter(function (k) {\n return \"key\" !== k;\n });\n isStaticChildren =\n 0 < keys.length\n ? \"{key: someKey, \" + keys.join(\": ..., \") + \": ...}\"\n : \"{key: someKey}\";\n didWarnAboutKeySpread[children + isStaticChildren] ||\n ((keys =\n 0 < keys.length ? \"{\" + keys.join(\": ..., \") + \": ...}\" : \"{}\"),\n console.error(\n 'A props object containing a \"key\" prop is being spread into JSX:\\n let props = %s;\\n <%s {...props} />\\nReact keys must be passed directly to JSX without using spread:\\n let props = %s;\\n <%s key={someKey} {...props} />',\n isStaticChildren,\n children,\n keys,\n children\n ),\n (didWarnAboutKeySpread[children + isStaticChildren] = !0));\n }\n children = null;\n void 0 !== maybeKey &&\n (checkKeyStringCoercion(maybeKey), (children = \"\" + maybeKey));\n hasValidKey(config) &&\n (checkKeyStringCoercion(config.key), (children = \"\" + config.key));\n if (\"key\" in config) {\n maybeKey = {};\n for (var propName in config)\n \"key\" !== propName && (maybeKey[propName] = config[propName]);\n } else maybeKey = config;\n children &&\n defineKeyPropWarningGetter(\n maybeKey,\n \"function\" === typeof type\n ? type.displayName || type.name || \"Unknown\"\n : type\n );\n return ReactElement(\n type,\n children,\n maybeKey,\n getOwner(),\n debugStack,\n debugTask\n );\n }\n function validateChildKeys(node) {\n isValidElement(node)\n ? node._store && (node._store.validated = 1)\n : \"object\" === typeof node &&\n null !== node &&\n node.$$typeof === REACT_LAZY_TYPE &&\n (\"fulfilled\" === node._payload.status\n ? isValidElement(node._payload.value) &&\n node._payload.value._store &&\n (node._payload.value._store.validated = 1)\n : node._store && (node._store.validated = 1));\n }\n function isValidElement(object) {\n return (\n \"object\" === typeof object &&\n null !== object &&\n object.$$typeof === REACT_ELEMENT_TYPE\n );\n }\n var React = require(\"react\"),\n REACT_ELEMENT_TYPE = Symbol.for(\"react.transitional.element\"),\n REACT_PORTAL_TYPE = Symbol.for(\"react.portal\"),\n REACT_FRAGMENT_TYPE = Symbol.for(\"react.fragment\"),\n REACT_STRICT_MODE_TYPE = Symbol.for(\"react.strict_mode\"),\n REACT_PROFILER_TYPE = Symbol.for(\"react.profiler\"),\n REACT_CONSUMER_TYPE = Symbol.for(\"react.consumer\"),\n REACT_CONTEXT_TYPE = Symbol.for(\"react.context\"),\n REACT_FORWARD_REF_TYPE = Symbol.for(\"react.forward_ref\"),\n REACT_SUSPENSE_TYPE = Symbol.for(\"react.suspense\"),\n REACT_SUSPENSE_LIST_TYPE = Symbol.for(\"react.suspense_list\"),\n REACT_MEMO_TYPE = Symbol.for(\"react.memo\"),\n REACT_LAZY_TYPE = Symbol.for(\"react.lazy\"),\n REACT_ACTIVITY_TYPE = Symbol.for(\"react.activity\"),\n REACT_CLIENT_REFERENCE = Symbol.for(\"react.client.reference\"),\n ReactSharedInternals =\n React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,\n hasOwnProperty = Object.prototype.hasOwnProperty,\n isArrayImpl = Array.isArray,\n createTask = console.createTask\n ? console.createTask\n : function () {\n return null;\n };\n React = {\n react_stack_bottom_frame: function (callStackForError) {\n return callStackForError();\n }\n };\n var specialPropKeyWarningShown;\n var didWarnAboutElementRef = {};\n var unknownOwnerDebugStack = React.react_stack_bottom_frame.bind(\n React,\n UnknownOwner\n )();\n var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));\n var didWarnAboutKeySpread = {};\n exports.Fragment = REACT_FRAGMENT_TYPE;\n exports.jsx = function (type, config, maybeKey) {\n var trackActualOwner =\n 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;\n return jsxDEVImpl(\n type,\n config,\n maybeKey,\n !1,\n trackActualOwner\n ? Error(\"react-stack-top-frame\")\n : unknownOwnerDebugStack,\n trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask\n );\n };\n exports.jsxs = function (type, config, maybeKey) {\n var trackActualOwner =\n 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;\n return jsxDEVImpl(\n type,\n config,\n maybeKey,\n !0,\n trackActualOwner\n ? Error(\"react-stack-top-frame\")\n : unknownOwnerDebugStack,\n trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask\n );\n };\n })();\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-jsx-runtime.production.js');\n} else {\n module.exports = require('./cjs/react-jsx-runtime.development.js');\n}\n","import { createContext, useContext, FC, ReactNode, useEffect, useState } from 'react'\r\nimport { useApplication } from '@pixi/react'\r\nimport { Graphics, Texture } from 'pixi.js'\r\n\r\ntype CellTextures = Texture\r\n\r\nconst CellTexturesContext = createContext<CellTextures>({} as CellTextures)\r\n\r\nexport const useCellTextures = () => useContext(CellTexturesContext)\r\n\r\nconst CellTexturesProvider: FC<{ children: ReactNode }> = ({ children }) => {\r\n const { app } = useApplication()\r\n const [texture, setTexture] = useState<Texture | null>(null)\r\n\r\n useEffect(() => {\r\n if (!app) return\r\n\r\n let isUnmounted = false\r\n\r\n const generate = () => {\r\n // Wait until Pixi Application has initialised the renderer\r\n if (!app.renderer) {\r\n requestAnimationFrame(generate)\r\n return\r\n }\r\n\r\n const g = new Graphics()\r\n g.setFillStyle({ color: '#121225' })\r\n g.rect(0, 0, 1, 1)\r\n g.fill()\r\n const generatedTexture = app.renderer.generateTexture(g)\r\n g.destroy()\r\n if (!isUnmounted) setTexture(generatedTexture)\r\n }\r\n\r\n generate()\r\n\r\n return () => {\r\n isUnmounted = true\r\n // Destroy generated texture to free GPU memory\r\n try {\r\n texture?.destroy(true)\r\n } catch {}\r\n setTexture(null)\r\n }\r\n }, [app])\r\n\r\n if (!texture) return null\r\n\r\n return (\r\n <CellTexturesContext.Provider value={texture}>\r\n {children}\r\n </CellTexturesContext.Provider>\r\n )\r\n}\r\n\r\nexport { CellTexturesContext, CellTexturesProvider }\r\n","import { Particle, Texture } from \"pixi.js\"\r\n\r\nexport class Cell extends Particle {\r\n private animationProgress = 0\r\n private delayCounter = 0\r\n private randomSpeed: number\r\n private randomDelayOffset: number\r\n startScaleX: number\r\n startScaleY: number\r\n targetAlpha: number\r\n\r\n constructor(\r\n public texture: Texture,\r\n public x: number,\r\n public y: number,\r\n public scaleX: number,\r\n public scaleY: number,\r\n public curLevel: number,\r\n ) {\r\n super({ texture, x, y, scaleX, scaleY, alpha: 0 })\r\n this.startScaleX = scaleX\r\n this.startScaleY = scaleY\r\n this.curLevel = curLevel\r\n\r\n // Randomize speed slightly (0.08 to 0.12)\r\n this.randomSpeed = 0.04 + Math.random() * 0.04\r\n // Randomize delay by a few frames\r\n this.randomDelayOffset = Math.floor(Math.random() * 150)\r\n this.targetAlpha = 0.9 + Math.random() * 0.1\r\n }\r\n\r\n update() {\r\n if (this.delayCounter < this.curLevel * 15 + this.randomDelayOffset) {\r\n this.delayCounter++\r\n return\r\n }\r\n\r\n if (this.animationProgress >= this.targetAlpha - 0.001) {\r\n this.animationProgress = this.targetAlpha\r\n this.alpha = this.targetAlpha\r\n return\r\n }\r\n\r\n this.animationProgress += (this.targetAlpha - this.animationProgress) * this.randomSpeed\r\n this.alpha = this.animationProgress\r\n }\r\n}\r\n","import { ParticleContainer, Texture } from 'pixi.js'\r\nimport { Cell } from './Cell'\r\n\r\nexport class CellManager {\r\n private cells: Cell[] = []\r\n\r\n constructor(\r\n public texture: Texture,\r\n public particleContainerRefCurrent: ParticleContainer\r\n ) {\r\n this.texture = texture\r\n }\r\n\r\n add(x: number, y: number, scaleX: number, scaleY: number, curLevel: number) {\r\n const cell = new Cell(this.texture, x, y, scaleX, scaleY, curLevel)\r\n this.particleContainerRefCurrent.addParticle(cell)\r\n this.cells.push(cell)\r\n }\r\n\r\n updateAll() {\r\n for (const cell of this.cells) {\r\n cell.update()\r\n }\r\n }\r\n}","import { FC, useCallback, useContext, useEffect, useRef } from 'react'\r\nimport { ParticleContainer } from 'pixi.js'\r\nimport { CellTexturesContext } from '../context/CellTexturesContext'\r\nimport { useTick } from '@pixi/react'\r\nimport { CellManager } from '../classes/CellManager'\r\n\r\ninterface GridProps {\r\n gridCols: number\r\n gridRows: number\r\n cellWidth: number\r\n cellHeight: number\r\n gridDepth: number\r\n}\r\n\r\nconst RecursiveGrid: FC<GridProps> = ({\r\n gridRows,\r\n gridCols,\r\n cellWidth,\r\n cellHeight,\r\n gridDepth,\r\n}) => {\r\n const texture = useContext(CellTexturesContext)\r\n const particleContainerRef = useRef<ParticleContainer>(null)\r\n const cellManager = useRef<CellManager>(null)\r\n\r\n useEffect(() => {\r\n if (!texture) return\r\n if (particleContainerRef.current) {\r\n // Clear any previous content on re-init\r\n try {\r\n particleContainerRef.current.removeChildren()\r\n } catch {}\r\n\r\n cellManager.current = new CellManager(\r\n texture,\r\n particleContainerRef.current\r\n )\r\n\r\n buildRecursiveGrid(\r\n 0,\r\n 0,\r\n cellWidth,\r\n cellHeight,\r\n gridCols,\r\n gridRows,\r\n gridDepth,\r\n particleContainerRef.current\r\n )\r\n }\r\n return () => {\r\n // Clean up particles and references on unmount/texture change\r\n try {\r\n particleContainerRef.current?.removeChildren()\r\n } catch {}\r\n cellManager.current = null\r\n }\r\n }, [texture, cellWidth, cellHeight, gridCols, gridRows, gridDepth])\r\n\r\n useTick(() => {\r\n cellManager.current?.updateAll()\r\n })\r\n\r\n const buildRecursiveGrid = useCallback(\r\n (\r\n x: number,\r\n y: number,\r\n cellWidth: number,\r\n cellHeight: number,\r\n gridCols: number,\r\n gridRows: number,\r\n curLevel: number,\r\n currentParticlesRef: ParticleContainer\r\n ) => {\r\n for (let row = 0; row < gridRows; row++) {\r\n for (let col = 0; col < gridCols; col++) {\r\n const startX = x + col * cellWidth\r\n const startY = y + row * cellHeight\r\n\r\n if (\r\n curLevel <= 0 ||\r\n (Math.random() > 0.7 && curLevel < gridDepth)\r\n ) {\r\n if (Math.random() > 0.1) {\r\n cellManager.current?.add(\r\n startX,\r\n startY,\r\n cellWidth - 1,\r\n cellHeight - 1,\r\n curLevel\r\n )\r\n }\r\n } else {\r\n buildRecursiveGrid(\r\n startX,\r\n startY,\r\n cellWidth / gridCols,\r\n cellHeight / gridRows,\r\n gridCols,\r\n gridRows,\r\n curLevel - 1,\r\n currentParticlesRef\r\n )\r\n }\r\n }\r\n }\r\n },\r\n []\r\n )\r\n\r\n return (\r\n <pixiParticleContainer\r\n ref={particleContainerRef}\r\n dynamicProperties={{\r\n position: true,\r\n vertex: true,\r\n color: true,\r\n }}\r\n />\r\n )\r\n}\r\n\r\nexport default RecursiveGrid\r\n","import { FC } from 'react'\r\nimport RecursiveGrid from './RecursiveGrid'\r\n\r\nimport { CellTexturesProvider } from '../context/CellTexturesContext'\r\n\r\ninterface RecursiveGridContainerProps {\r\n cellWidth: number\r\n cellHeight: number\r\n gridRows: number\r\n gridCols: number\r\n gridDepth: number\r\n}\r\n\r\nconst RecursiveGridContainer: FC<RecursiveGridContainerProps> = ({\r\n cellWidth,\r\n cellHeight,\r\n gridRows,\r\n gridCols,\r\n gridDepth,\r\n}) => {\r\n return (\r\n <CellTexturesProvider>\r\n <RecursiveGrid\r\n cellWidth={cellWidth}\r\n cellHeight={cellHeight}\r\n gridCols={gridCols}\r\n gridRows={gridRows}\r\n gridDepth={gridDepth}\r\n />\r\n </CellTexturesProvider>\r\n )\r\n}\r\n\r\nexport default RecursiveGridContainer\r\n","import { Application, extend } from '@pixi/react'\r\nimport {\r\n Sprite,\r\n Graphics,\r\n Container,\r\n Texture,\r\n Particle,\r\n ParticleContainer,\r\n} from 'pixi.js'\r\nimport RecursiveGridContainer from './RecursiveGridContainer'\r\nimport { useState } from 'react'\r\nextend({ ParticleContainer, Particle, Texture, Container, Sprite, Graphics })\r\n\r\nconst GRID_COLS = 2\r\nconst GRID_ROWS = 2\r\nconst CELL_WIDTH = 300\r\nconst CELL_HEIGHT = 300\r\nconst GRID_DEPTH = 6\r\n\r\nconst PixiApp = () => {\r\n const [reloadKey, setReloadKey] = useState<number>(0)\r\n\r\n return (\r\n <div className=\"flex flex-col items-center justify-center w-full h-full\">\r\n <button\r\n onClick={() => setReloadKey(reloadKey + 1)}\r\n className=\"mb-2 px-4 py-2 bg-blue-500 text-white rounded\"\r\n >\r\n Reload PixiApp\r\n </button>\r\n <Application\r\n key={reloadKey}\r\n antialias={false}\r\n width={CELL_WIDTH * GRID_COLS}\r\n height={CELL_HEIGHT * GRID_ROWS}\r\n className=\"image-pixelated w-full\"\r\n backgroundAlpha={0}\r\n autoDensity={true}\r\n preserveDrawingBuffer={true}\r\n powerPreference=\"high-performance\"\r\n autoStart={true}\r\n >\r\n <RecursiveGridContainer\r\n gridCols={GRID_COLS}\r\n gridRows={GRID_ROWS}\r\n cellWidth={CELL_WIDTH}\r\n cellHeight={CELL_HEIGHT}\r\n gridDepth={GRID_DEPTH}\r\n />\r\n </Application>\r\n </div>\r\n )\r\n}\r\n\r\nexport default PixiApp\r\n"],"names":["REACT_ELEMENT_TYPE","REACT_FRAGMENT_TYPE","jsxProd","type","config","maybeKey","key","propName","reactJsxRuntime_production","getComponentNameFromType","REACT_CLIENT_REFERENCE","REACT_PROFILER_TYPE","REACT_STRICT_MODE_TYPE","REACT_SUSPENSE_TYPE","REACT_SUSPENSE_LIST_TYPE","REACT_ACTIVITY_TYPE","REACT_PORTAL_TYPE","REACT_CONTEXT_TYPE","REACT_CONSUMER_TYPE","REACT_FORWARD_REF_TYPE","innerType","REACT_MEMO_TYPE","REACT_LAZY_TYPE","testStringCoercion","value","checkKeyStringCoercion","JSCompiler_inline_result","JSCompiler_temp_const","JSCompiler_inline_result$jscomp$0","getTaskName","name","getOwner","dispatcher","ReactSharedInternals","UnknownOwner","hasValidKey","hasOwnProperty","getter","defineKeyPropWarningGetter","props","displayName","warnAboutAccessingKey","specialPropKeyWarningShown","elementRefGetterWithDeprecationWarning","componentName","didWarnAboutElementRef","ReactElement","owner","debugStack","debugTask","refProp","jsxDEVImpl","isStaticChildren","children","isArrayImpl","validateChildKeys","keys","k","didWarnAboutKeySpread","node","isValidElement","object","React","require$$0","createTask","callStackForError","unknownOwnerDebugStack","unknownOwnerDebugTask","reactJsxRuntime_development","trackActualOwner","jsxRuntimeModule","require$$1","CellTexturesContext","createContext","CellTexturesProvider","app","useApplication","texture","setTexture","useState","useEffect","isUnmounted","generate","g","Graphics","generatedTexture","Cell","Particle","x","y","scaleX","scaleY","curLevel","__publicField","CellManager","particleContainerRefCurrent","cell","RecursiveGrid","gridRows","gridCols","cellWidth","cellHeight","gridDepth","useContext","particleContainerRef","useRef","cellManager","buildRecursiveGrid","_a","useTick","useCallback","currentParticlesRef","row","col","startX","startY","jsx","RecursiveGridContainer","extend","ParticleContainer","Texture","Container","Sprite","GRID_COLS","GRID_ROWS","CELL_WIDTH","CELL_HEIGHT","GRID_DEPTH","reloadKey","setReloadKey","jsxs","Application"],"mappings":";;;;;;;;yCAWA,IAAIA,EAAqB,OAAO,IAAI,4BAA4B,EAC9DC,EAAsB,OAAO,IAAI,gBAAgB,EACnD,SAASC,EAAQC,EAAMC,EAAQC,EAAU,CACvC,IAAIC,EAAM,KAGV,GAFWD,IAAX,SAAwBC,EAAM,GAAKD,GACxBD,EAAO,MAAlB,SAA0BE,EAAM,GAAKF,EAAO,KACxC,QAASA,EAAQ,CACnBC,EAAW,CAAA,EACX,QAASE,KAAYH,EACTG,IAAV,QAAuBF,EAASE,CAAQ,EAAIH,EAAOG,CAAQ,EACjE,MAASF,EAAWD,EAClB,OAAAA,EAASC,EAAS,IACX,CACL,SAAUL,EACV,KAAMG,EACN,IAAKG,EACL,IAAgBF,IAAX,OAAoBA,EAAS,KAClC,MAAOC,EAEX,CACA,OAAAG,EAAA,SAAmBP,EACnBO,EAAA,IAAcN,EACdM,EAAA,KAAeN;;;;;;;;sCCtBE,QAAQ,IAAI,WAA7B,eACG,UAAY,CACX,SAASO,EAAyBN,EAAM,CACtC,GAAYA,GAAR,KAAc,OAAO,KACzB,GAAmB,OAAOA,GAAtB,WACF,OAAOA,EAAK,WAAaO,GACrB,KACAP,EAAK,aAAeA,EAAK,MAAQ,KACvC,GAAiB,OAAOA,GAApB,SAA0B,OAAOA,EACrC,OAAQA,EAAI,CACV,K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MAAMuC,EAAY,EACZC,EAAY,EACZC,EAAa,IACbC,EAAc,IACdC,GAAa,QAEH,IAAM,CAClB,KAAM,CAACC,EAAWC,CAAY,EAAIlD,EAAAA,SAAiB,CAAC,EAEpD,OACImD,EAAAA,KAAC,MAAA,CAAI,UAAU,0DACX,SAAA,CAAAd,EAAAA,IAAC,SAAA,CACG,QAAS,IAAMa,EAAaD,EAAY,CAAC,EACzC,UAAU,gDACb,SAAA,gBAAA,CAAA,EAGDZ,EAAAA,IAACe,EAAAA,YAAA,CAEG,UAAW,GACX,MAAON,EAAaF,EACpB,OAAQG,EAAcF,EACtB,UAAU,yBACV,gBAAiB,EACjB,YAAa,GACb,sBAAuB,GACvB,gBAAgB,mBAChB,UAAW,GAEX,SAAAR,EAAAA,IAACC,GAAA,CACG,SAAUM,EACV,SAAUC,EACV,UAAWC,EACX,WAAYC,EACZ,UAAWC,EAAA,CAAA,CACf,EAjBKC,CAAA,CAkBT,EACJ,CAER","x_google_ignoreList":[0,1,2]}
|
|
1
|
+
{"version":3,"file":"recursive-grid.umd.js","sources":["../node_modules/react/cjs/react-jsx-runtime.production.js","../node_modules/react/cjs/react-jsx-runtime.development.js","../node_modules/react/jsx-runtime.js","../src/context/CellTexturesContext.tsx","../src/classes/Cell.ts","../src/classes/CellManager.ts","../src/components/RecursiveGrid.tsx","../src/components/RecursiveGridContainer.tsx","../src/components/PixiApp.tsx"],"sourcesContent":["/**\n * @license React\n * react-jsx-runtime.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nvar REACT_ELEMENT_TYPE = Symbol.for(\"react.transitional.element\"),\n REACT_FRAGMENT_TYPE = Symbol.for(\"react.fragment\");\nfunction jsxProd(type, config, maybeKey) {\n var key = null;\n void 0 !== maybeKey && (key = \"\" + maybeKey);\n void 0 !== config.key && (key = \"\" + config.key);\n if (\"key\" in config) {\n maybeKey = {};\n for (var propName in config)\n \"key\" !== propName && (maybeKey[propName] = config[propName]);\n } else maybeKey = config;\n config = maybeKey.ref;\n return {\n $$typeof: REACT_ELEMENT_TYPE,\n type: type,\n key: key,\n ref: void 0 !== config ? config : null,\n props: maybeKey\n };\n}\nexports.Fragment = REACT_FRAGMENT_TYPE;\nexports.jsx = jsxProd;\nexports.jsxs = jsxProd;\n","/**\n * @license React\n * react-jsx-runtime.development.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\n\"production\" !== process.env.NODE_ENV &&\n (function () {\n function getComponentNameFromType(type) {\n if (null == type) return null;\n if (\"function\" === typeof type)\n return type.$$typeof === REACT_CLIENT_REFERENCE\n ? null\n : type.displayName || type.name || null;\n if (\"string\" === typeof type) return type;\n switch (type) {\n case REACT_FRAGMENT_TYPE:\n return \"Fragment\";\n case REACT_PROFILER_TYPE:\n return \"Profiler\";\n case REACT_STRICT_MODE_TYPE:\n return \"StrictMode\";\n case REACT_SUSPENSE_TYPE:\n return \"Suspense\";\n case REACT_SUSPENSE_LIST_TYPE:\n return \"SuspenseList\";\n case REACT_ACTIVITY_TYPE:\n return \"Activity\";\n }\n if (\"object\" === typeof type)\n switch (\n (\"number\" === typeof type.tag &&\n console.error(\n \"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue.\"\n ),\n type.$$typeof)\n ) {\n case REACT_PORTAL_TYPE:\n return \"Portal\";\n case REACT_CONTEXT_TYPE:\n return type.displayName || \"Context\";\n case REACT_CONSUMER_TYPE:\n return (type._context.displayName || \"Context\") + \".Consumer\";\n case REACT_FORWARD_REF_TYPE:\n var innerType = type.render;\n type = type.displayName;\n type ||\n ((type = innerType.displayName || innerType.name || \"\"),\n (type = \"\" !== type ? \"ForwardRef(\" + type + \")\" : \"ForwardRef\"));\n return type;\n case REACT_MEMO_TYPE:\n return (\n (innerType = type.displayName || null),\n null !== innerType\n ? innerType\n : getComponentNameFromType(type.type) || \"Memo\"\n );\n case REACT_LAZY_TYPE:\n innerType = type._payload;\n type = type._init;\n try {\n return getComponentNameFromType(type(innerType));\n } catch (x) {}\n }\n return null;\n }\n function testStringCoercion(value) {\n return \"\" + value;\n }\n function checkKeyStringCoercion(value) {\n try {\n testStringCoercion(value);\n var JSCompiler_inline_result = !1;\n } catch (e) {\n JSCompiler_inline_result = !0;\n }\n if (JSCompiler_inline_result) {\n JSCompiler_inline_result = console;\n var JSCompiler_temp_const = JSCompiler_inline_result.error;\n var JSCompiler_inline_result$jscomp$0 =\n (\"function\" === typeof Symbol &&\n Symbol.toStringTag &&\n value[Symbol.toStringTag]) ||\n value.constructor.name ||\n \"Object\";\n JSCompiler_temp_const.call(\n JSCompiler_inline_result,\n \"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.\",\n JSCompiler_inline_result$jscomp$0\n );\n return testStringCoercion(value);\n }\n }\n function getTaskName(type) {\n if (type === REACT_FRAGMENT_TYPE) return \"<>\";\n if (\n \"object\" === typeof type &&\n null !== type &&\n type.$$typeof === REACT_LAZY_TYPE\n )\n return \"<...>\";\n try {\n var name = getComponentNameFromType(type);\n return name ? \"<\" + name + \">\" : \"<...>\";\n } catch (x) {\n return \"<...>\";\n }\n }\n function getOwner() {\n var dispatcher = ReactSharedInternals.A;\n return null === dispatcher ? null : dispatcher.getOwner();\n }\n function UnknownOwner() {\n return Error(\"react-stack-top-frame\");\n }\n function hasValidKey(config) {\n if (hasOwnProperty.call(config, \"key\")) {\n var getter = Object.getOwnPropertyDescriptor(config, \"key\").get;\n if (getter && getter.isReactWarning) return !1;\n }\n return void 0 !== config.key;\n }\n function defineKeyPropWarningGetter(props, displayName) {\n function warnAboutAccessingKey() {\n specialPropKeyWarningShown ||\n ((specialPropKeyWarningShown = !0),\n console.error(\n \"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)\",\n displayName\n ));\n }\n warnAboutAccessingKey.isReactWarning = !0;\n Object.defineProperty(props, \"key\", {\n get: warnAboutAccessingKey,\n configurable: !0\n });\n }\n function elementRefGetterWithDeprecationWarning() {\n var componentName = getComponentNameFromType(this.type);\n didWarnAboutElementRef[componentName] ||\n ((didWarnAboutElementRef[componentName] = !0),\n console.error(\n \"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.\"\n ));\n componentName = this.props.ref;\n return void 0 !== componentName ? componentName : null;\n }\n function ReactElement(type, key, props, owner, debugStack, debugTask) {\n var refProp = props.ref;\n type = {\n $$typeof: REACT_ELEMENT_TYPE,\n type: type,\n key: key,\n props: props,\n _owner: owner\n };\n null !== (void 0 !== refProp ? refProp : null)\n ? Object.defineProperty(type, \"ref\", {\n enumerable: !1,\n get: elementRefGetterWithDeprecationWarning\n })\n : Object.defineProperty(type, \"ref\", { enumerable: !1, value: null });\n type._store = {};\n Object.defineProperty(type._store, \"validated\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: 0\n });\n Object.defineProperty(type, \"_debugInfo\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: null\n });\n Object.defineProperty(type, \"_debugStack\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: debugStack\n });\n Object.defineProperty(type, \"_debugTask\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: debugTask\n });\n Object.freeze && (Object.freeze(type.props), Object.freeze(type));\n return type;\n }\n function jsxDEVImpl(\n type,\n config,\n maybeKey,\n isStaticChildren,\n debugStack,\n debugTask\n ) {\n var children = config.children;\n if (void 0 !== children)\n if (isStaticChildren)\n if (isArrayImpl(children)) {\n for (\n isStaticChildren = 0;\n isStaticChildren < children.length;\n isStaticChildren++\n )\n validateChildKeys(children[isStaticChildren]);\n Object.freeze && Object.freeze(children);\n } else\n console.error(\n \"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.\"\n );\n else validateChildKeys(children);\n if (hasOwnProperty.call(config, \"key\")) {\n children = getComponentNameFromType(type);\n var keys = Object.keys(config).filter(function (k) {\n return \"key\" !== k;\n });\n isStaticChildren =\n 0 < keys.length\n ? \"{key: someKey, \" + keys.join(\": ..., \") + \": ...}\"\n : \"{key: someKey}\";\n didWarnAboutKeySpread[children + isStaticChildren] ||\n ((keys =\n 0 < keys.length ? \"{\" + keys.join(\": ..., \") + \": ...}\" : \"{}\"),\n console.error(\n 'A props object containing a \"key\" prop is being spread into JSX:\\n let props = %s;\\n <%s {...props} />\\nReact keys must be passed directly to JSX without using spread:\\n let props = %s;\\n <%s key={someKey} {...props} />',\n isStaticChildren,\n children,\n keys,\n children\n ),\n (didWarnAboutKeySpread[children + isStaticChildren] = !0));\n }\n children = null;\n void 0 !== maybeKey &&\n (checkKeyStringCoercion(maybeKey), (children = \"\" + maybeKey));\n hasValidKey(config) &&\n (checkKeyStringCoercion(config.key), (children = \"\" + config.key));\n if (\"key\" in config) {\n maybeKey = {};\n for (var propName in config)\n \"key\" !== propName && (maybeKey[propName] = config[propName]);\n } else maybeKey = config;\n children &&\n defineKeyPropWarningGetter(\n maybeKey,\n \"function\" === typeof type\n ? type.displayName || type.name || \"Unknown\"\n : type\n );\n return ReactElement(\n type,\n children,\n maybeKey,\n getOwner(),\n debugStack,\n debugTask\n );\n }\n function validateChildKeys(node) {\n isValidElement(node)\n ? node._store && (node._store.validated = 1)\n : \"object\" === typeof node &&\n null !== node &&\n node.$$typeof === REACT_LAZY_TYPE &&\n (\"fulfilled\" === node._payload.status\n ? isValidElement(node._payload.value) &&\n node._payload.value._store &&\n (node._payload.value._store.validated = 1)\n : node._store && (node._store.validated = 1));\n }\n function isValidElement(object) {\n return (\n \"object\" === typeof object &&\n null !== object &&\n object.$$typeof === REACT_ELEMENT_TYPE\n );\n }\n var React = require(\"react\"),\n REACT_ELEMENT_TYPE = Symbol.for(\"react.transitional.element\"),\n REACT_PORTAL_TYPE = Symbol.for(\"react.portal\"),\n REACT_FRAGMENT_TYPE = Symbol.for(\"react.fragment\"),\n REACT_STRICT_MODE_TYPE = Symbol.for(\"react.strict_mode\"),\n REACT_PROFILER_TYPE = Symbol.for(\"react.profiler\"),\n REACT_CONSUMER_TYPE = Symbol.for(\"react.consumer\"),\n REACT_CONTEXT_TYPE = Symbol.for(\"react.context\"),\n REACT_FORWARD_REF_TYPE = Symbol.for(\"react.forward_ref\"),\n REACT_SUSPENSE_TYPE = Symbol.for(\"react.suspense\"),\n REACT_SUSPENSE_LIST_TYPE = Symbol.for(\"react.suspense_list\"),\n REACT_MEMO_TYPE = Symbol.for(\"react.memo\"),\n REACT_LAZY_TYPE = Symbol.for(\"react.lazy\"),\n REACT_ACTIVITY_TYPE = Symbol.for(\"react.activity\"),\n REACT_CLIENT_REFERENCE = Symbol.for(\"react.client.reference\"),\n ReactSharedInternals =\n React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,\n hasOwnProperty = Object.prototype.hasOwnProperty,\n isArrayImpl = Array.isArray,\n createTask = console.createTask\n ? console.createTask\n : function () {\n return null;\n };\n React = {\n react_stack_bottom_frame: function (callStackForError) {\n return callStackForError();\n }\n };\n var specialPropKeyWarningShown;\n var didWarnAboutElementRef = {};\n var unknownOwnerDebugStack = React.react_stack_bottom_frame.bind(\n React,\n UnknownOwner\n )();\n var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));\n var didWarnAboutKeySpread = {};\n exports.Fragment = REACT_FRAGMENT_TYPE;\n exports.jsx = function (type, config, maybeKey) {\n var trackActualOwner =\n 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;\n return jsxDEVImpl(\n type,\n config,\n maybeKey,\n !1,\n trackActualOwner\n ? Error(\"react-stack-top-frame\")\n : unknownOwnerDebugStack,\n trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask\n );\n };\n exports.jsxs = function (type, config, maybeKey) {\n var trackActualOwner =\n 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;\n return jsxDEVImpl(\n type,\n config,\n maybeKey,\n !0,\n trackActualOwner\n ? Error(\"react-stack-top-frame\")\n : unknownOwnerDebugStack,\n trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask\n );\n };\n })();\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-jsx-runtime.production.js');\n} else {\n module.exports = require('./cjs/react-jsx-runtime.development.js');\n}\n","import { createContext, useContext, FC, ReactNode, useEffect, useState } from 'react'\r\nimport { useApplication } from '@pixi/react'\r\nimport { Graphics, Texture } from 'pixi.js'\r\n\r\ntype CellTextures = Texture\r\n\r\nconst CellTexturesContext = createContext<CellTextures>({} as CellTextures)\r\n\r\nexport const useCellTextures = () => useContext(CellTexturesContext)\r\n\r\nconst CellTexturesProvider: FC<{ children: ReactNode }> = ({ children }) => {\r\n const { app } = useApplication()\r\n const [texture, setTexture] = useState<Texture | null>(null)\r\n\r\n useEffect(() => {\r\n if (!app) return\r\n\r\n let isUnmounted = false\r\n\r\n const generate = () => {\r\n // Wait until Pixi Application has initialised the renderer\r\n if (!app.renderer) {\r\n requestAnimationFrame(generate)\r\n return\r\n }\r\n\r\n const g = new Graphics()\r\n g.setFillStyle({ color: '#121225' })\r\n g.rect(0, 0, 1, 1)\r\n g.fill()\r\n const generatedTexture = app.renderer.generateTexture(g)\r\n g.destroy()\r\n if (!isUnmounted) setTexture(generatedTexture)\r\n }\r\n\r\n generate()\r\n\r\n return () => {\r\n isUnmounted = true\r\n // Destroy generated texture to free GPU memory\r\n try {\r\n texture?.destroy(true)\r\n } catch {}\r\n setTexture(null)\r\n }\r\n }, [app])\r\n\r\n if (!texture) return null\r\n\r\n return (\r\n <CellTexturesContext.Provider value={texture}>\r\n {children}\r\n </CellTexturesContext.Provider>\r\n )\r\n}\r\n\r\nexport { CellTexturesContext, CellTexturesProvider }\r\n","import { Particle, Texture } from \"pixi.js\"\r\n\r\nexport class Cell extends Particle {\r\n private animationProgress = 0\r\n private delayCounter = 0\r\n private randomSpeed: number\r\n private randomDelayOffset: number\r\n startScaleX: number\r\n startScaleY: number\r\n targetAlpha: number\r\n\r\n constructor(\r\n public texture: Texture,\r\n public x: number,\r\n public y: number,\r\n public scaleX: number,\r\n public scaleY: number,\r\n public curLevel: number,\r\n ) {\r\n super({ texture, x, y, scaleX, scaleY, alpha: 0 })\r\n this.startScaleX = scaleX\r\n this.startScaleY = scaleY\r\n this.curLevel = curLevel\r\n\r\n // Randomize speed slightly (0.08 to 0.12)\r\n this.randomSpeed = 0.04 + Math.random() * 0.04\r\n // Randomize delay by a few frames\r\n this.randomDelayOffset = Math.floor(Math.random() * 150)\r\n this.targetAlpha = 0.9 + Math.random() * 0.1\r\n }\r\n\r\n update() {\r\n if (this.delayCounter < this.curLevel * 15 + this.randomDelayOffset) {\r\n this.delayCounter++\r\n return\r\n }\r\n\r\n if (this.animationProgress >= this.targetAlpha - 0.001) {\r\n this.animationProgress = this.targetAlpha\r\n this.alpha = this.targetAlpha\r\n return\r\n }\r\n\r\n this.animationProgress += (this.targetAlpha - this.animationProgress) * this.randomSpeed\r\n this.alpha = this.animationProgress\r\n }\r\n}\r\n","import { ParticleContainer, Texture } from 'pixi.js'\r\nimport { Cell } from './Cell'\r\n\r\nexport class CellManager {\r\n private cells: Cell[] = []\r\n\r\n constructor(\r\n public texture: Texture,\r\n public particleContainerRefCurrent: ParticleContainer\r\n ) {\r\n this.texture = texture\r\n }\r\n\r\n add(x: number, y: number, scaleX: number, scaleY: number, curLevel: number) {\r\n const cell = new Cell(this.texture, x, y, scaleX, scaleY, curLevel)\r\n this.particleContainerRefCurrent.addParticle(cell)\r\n this.cells.push(cell)\r\n }\r\n\r\n updateAll() {\r\n for (const cell of this.cells) {\r\n cell.update()\r\n }\r\n }\r\n}","import { FC, useCallback, useContext, useEffect, useRef } from 'react'\r\nimport { ParticleContainer } from 'pixi.js'\r\nimport { CellTexturesContext } from '../context/CellTexturesContext'\r\nimport { useTick } from '@pixi/react'\r\nimport { CellManager } from '../classes/CellManager'\r\n\r\ninterface GridProps {\r\n gridCols: number\r\n gridRows: number\r\n cellWidth: number\r\n cellHeight: number\r\n gridDepth: number\r\n}\r\n\r\nconst RecursiveGrid: FC<GridProps> = ({\r\n gridRows,\r\n gridCols,\r\n cellWidth,\r\n cellHeight,\r\n gridDepth,\r\n}) => {\r\n const texture = useContext(CellTexturesContext)\r\n const particleContainerRef = useRef<ParticleContainer>(null)\r\n const cellManager = useRef<CellManager>(null)\r\n\r\n useEffect(() => {\r\n if (!texture) return\r\n if (particleContainerRef.current) {\r\n // Clear any previous content on re-init\r\n try {\r\n particleContainerRef.current.removeChildren()\r\n } catch {}\r\n\r\n cellManager.current = new CellManager(\r\n texture,\r\n particleContainerRef.current\r\n )\r\n\r\n buildRecursiveGrid(\r\n 0,\r\n 0,\r\n cellWidth,\r\n cellHeight,\r\n gridCols,\r\n gridRows,\r\n gridDepth,\r\n particleContainerRef.current\r\n )\r\n }\r\n return () => {\r\n // Clean up particles and references on unmount/texture change\r\n try {\r\n particleContainerRef.current?.removeChildren()\r\n } catch {}\r\n cellManager.current = null\r\n }\r\n }, [texture, cellWidth, cellHeight, gridCols, gridRows, gridDepth])\r\n\r\n useTick(() => {\r\n cellManager.current?.updateAll()\r\n })\r\n\r\n const buildRecursiveGrid = useCallback(\r\n (\r\n x: number,\r\n y: number,\r\n cellWidth: number,\r\n cellHeight: number,\r\n gridCols: number,\r\n gridRows: number,\r\n curLevel: number,\r\n currentParticlesRef: ParticleContainer\r\n ) => {\r\n for (let row = 0; row < gridRows; row++) {\r\n for (let col = 0; col < gridCols; col++) {\r\n const startX = x + col * cellWidth\r\n const startY = y + row * cellHeight\r\n\r\n if (\r\n curLevel <= 0 ||\r\n (Math.random() > 0.7 && curLevel < gridDepth)\r\n ) {\r\n if (Math.random() > 0.1) {\r\n cellManager.current?.add(\r\n startX,\r\n startY,\r\n cellWidth - 1,\r\n cellHeight - 1,\r\n curLevel\r\n )\r\n }\r\n } else {\r\n buildRecursiveGrid(\r\n startX,\r\n startY,\r\n cellWidth / gridCols,\r\n cellHeight / gridRows,\r\n gridCols,\r\n gridRows,\r\n curLevel - 1,\r\n currentParticlesRef\r\n )\r\n }\r\n }\r\n }\r\n },\r\n []\r\n )\r\n\r\n return (\r\n <pixiParticleContainer\r\n ref={particleContainerRef}\r\n dynamicProperties={{\r\n position: true,\r\n vertex: true,\r\n color: true,\r\n }}\r\n />\r\n )\r\n}\r\n\r\nexport default RecursiveGrid\r\n","import { FC } from 'react'\r\nimport RecursiveGrid from './RecursiveGrid'\r\n\r\nimport { CellTexturesProvider } from '../context/CellTexturesContext'\r\n\r\ninterface RecursiveGridContainerProps {\r\n cellWidth: number\r\n cellHeight: number\r\n gridRows: number\r\n gridCols: number\r\n gridDepth: number\r\n}\r\n\r\nconst RecursiveGridContainer: FC<RecursiveGridContainerProps> = ({\r\n cellWidth,\r\n cellHeight,\r\n gridRows,\r\n gridCols,\r\n gridDepth,\r\n}) => {\r\n return (\r\n <CellTexturesProvider>\r\n <RecursiveGrid\r\n cellWidth={cellWidth}\r\n cellHeight={cellHeight}\r\n gridCols={gridCols}\r\n gridRows={gridRows}\r\n gridDepth={gridDepth}\r\n />\r\n </CellTexturesProvider>\r\n )\r\n}\r\n\r\nexport default RecursiveGridContainer\r\n","import { Application, extend } from '@pixi/react'\r\nimport {\r\n Sprite,\r\n Graphics,\r\n Container,\r\n Texture,\r\n Particle,\r\n ParticleContainer,\r\n} from 'pixi.js'\r\nimport RecursiveGridContainer from './RecursiveGridContainer'\r\nimport { useEffect, useState } from 'react'\r\nextend({ ParticleContainer, Particle, Texture, Container, Sprite, Graphics })\r\n\r\nconst GRID_COLS = 2\r\nconst GRID_ROWS = 2\r\nconst CELL_WIDTH = 300\r\nconst CELL_HEIGHT = 300\r\nconst GRID_DEPTH = 6\r\n\r\nconst PixiApp = () => {\r\n const [reloadKey, setReloadKey] = useState<number>(0)\r\n\r\n useEffect(() => {\r\n const interval = setInterval(() => {\r\n console.log('Reloading Pixi Application to clear GPU memory...')\r\n setReloadKey((prev) => prev + 1)\r\n }, 2000)\r\n\r\n return () => clearInterval(interval)\r\n }, [])\r\n\r\n return (\r\n <div className=\"flex flex-col items-center justify-center w-full h-full\">\r\n <Application\r\n key={reloadKey}\r\n antialias={false}\r\n width={CELL_WIDTH * GRID_COLS}\r\n height={CELL_HEIGHT * GRID_ROWS}\r\n className=\"image-pixelated w-full\"\r\n backgroundAlpha={0}\r\n autoDensity={true}\r\n preserveDrawingBuffer={true}\r\n powerPreference=\"high-performance\"\r\n autoStart={true}\r\n >\r\n <RecursiveGridContainer\r\n gridCols={GRID_COLS}\r\n gridRows={GRID_ROWS}\r\n cellWidth={CELL_WIDTH}\r\n cellHeight={CELL_HEIGHT}\r\n gridDepth={GRID_DEPTH}\r\n />\r\n </Application>\r\n </div>\r\n )\r\n}\r\n\r\nexport default PixiApp\r\n"],"names":["REACT_ELEMENT_TYPE","REACT_FRAGMENT_TYPE","jsxProd","type","config","maybeKey","key","propName","reactJsxRuntime_production","getComponentNameFromType","REACT_CLIENT_REFERENCE","REACT_PROFILER_TYPE","REACT_STRICT_MODE_TYPE","REACT_SUSPENSE_TYPE","REACT_SUSPENSE_LIST_TYPE","REACT_ACTIVITY_TYPE","REACT_PORTAL_TYPE","REACT_CONTEXT_TYPE","REACT_CONSUMER_TYPE","REACT_FORWARD_REF_TYPE","innerType","REACT_MEMO_TYPE","REACT_LAZY_TYPE","testStringCoercion","value","checkKeyStringCoercion","JSCompiler_inline_result","JSCompiler_temp_const","JSCompiler_inline_result$jscomp$0","getTaskName","name","getOwner","dispatcher","ReactSharedInternals","UnknownOwner","hasValidKey","hasOwnProperty","getter","defineKeyPropWarningGetter","props","displayName","warnAboutAccessingKey","specialPropKeyWarningShown","elementRefGetterWithDeprecationWarning","componentName","didWarnAboutElementRef","ReactElement","owner","debugStack","debugTask","refProp","jsxDEVImpl","isStaticChildren","children","isArrayImpl","validateChildKeys","keys","k","didWarnAboutKeySpread","node","isValidElement","object","React","require$$0","createTask","callStackForError","unknownOwnerDebugStack","unknownOwnerDebugTask","reactJsxRuntime_development","trackActualOwner","jsxRuntimeModule","require$$1","CellTexturesContext","createContext","CellTexturesProvider","app","useApplication","texture","setTexture","useState","useEffect","isUnmounted","generate","g","Graphics","generatedTexture","Cell","Particle","x","y","scaleX","scaleY","curLevel","__publicField","CellManager","particleContainerRefCurrent","cell","RecursiveGrid","gridRows","gridCols","cellWidth","cellHeight","gridDepth","useContext","particleContainerRef","useRef","cellManager","buildRecursiveGrid","_a","useTick","useCallback","currentParticlesRef","row","col","startX","startY","jsx","RecursiveGridContainer","extend","ParticleContainer","Texture","Container","Sprite","GRID_COLS","GRID_ROWS","CELL_WIDTH","CELL_HEIGHT","GRID_DEPTH","reloadKey","setReloadKey","interval","prev","Application"],"mappings":";;;;;;;;yCAWA,IAAIA,EAAqB,OAAO,IAAI,4BAA4B,EAC9DC,EAAsB,OAAO,IAAI,gBAAgB,EACnD,SAASC,EAAQC,EAAMC,EAAQC,EAAU,CACvC,IAAIC,EAAM,KAGV,GAFWD,IAAX,SAAwBC,EAAM,GAAKD,GACxBD,EAAO,MAAlB,SAA0BE,EAAM,GAAKF,EAAO,KACxC,QAASA,EAAQ,CACnBC,EAAW,CAAA,EACX,QAASE,KAAYH,EACTG,IAAV,QAAuBF,EAASE,CAAQ,EAAIH,EAAOG,CAAQ,EACjE,MAASF,EAAWD,EAClB,OAAAA,EAASC,EAAS,IACX,CACL,SAAUL,EACV,KAAMG,EACN,IAAKG,EACL,IAAgBF,IAAX,OAAoBA,EAAS,KAClC,MAAOC,EAEX,CACA,OAAAG,EAAA,SAAmBP,EACnBO,EAAA,IAAcN,EACdM,EAAA,KAAeN;;;;;;;;sCCtBE,QAAQ,IAAI,WAA7B,eACG,UAAY,CACX,SAASO,EAAyBN,EAAM,CACtC,GAAYA,GAAR,KAAc,OAAO,KACzB,GAAmB,OAAOA,GAAtB,WACF,OAAOA,EAAK,WAAaO,GACrB,K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