lighteningcards 1.0.0 → 2.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +203 -11
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/index.esm.js +204 -12
- package/dist/index.esm.js.map +1 -1
- package/package.json +50 -51
- package/rollup.config-1758777476076.cjs +85 -0
- package/src/LighteningCard.css +4 -7
- package/src/LighteningCard.js +9 -4
- package/src/hooks/useLeftThunder.js +5 -3
- package/src/hooks/useLightening.js +2 -3
- package/src/hooks/useLighteningStart.js +135 -0
- package/src/hooks/useMiddleThunder.js +74 -0
- package/src/hooks/useRightThunder.js +5 -3
package/dist/index.cjs.js
CHANGED
|
@@ -42,12 +42,12 @@ const useLeftThunder = () => {
|
|
|
42
42
|
const animatedSprite = new pixi_js.AnimatedSprite(frames);
|
|
43
43
|
animatedSprite.animationSpeed = 0.25; // Faster speed for more visible animation
|
|
44
44
|
animatedSprite.loop = true;
|
|
45
|
-
animatedSprite.scale.set(0.
|
|
45
|
+
animatedSprite.scale.set(0.3);
|
|
46
46
|
animatedSprite.anchor.set(0.5, 0.5);
|
|
47
47
|
|
|
48
48
|
// Center the sprite in the canvas
|
|
49
|
-
animatedSprite.x = this.appRef.current.renderer.width / 2;
|
|
50
|
-
animatedSprite.y = this.appRef.current.renderer.height / 2;
|
|
49
|
+
animatedSprite.x = this.appRef.current.renderer.width / 2 - (window.innerWidth > 768 ? 40 : -75);
|
|
50
|
+
animatedSprite.y = this.appRef.current.renderer.height / 2 + 15;
|
|
51
51
|
this.appRef.current.stage.addChild(animatedSprite);
|
|
52
52
|
animatedSprite.play();
|
|
53
53
|
});
|
|
@@ -97,12 +97,12 @@ const useRightThunder = () => {
|
|
|
97
97
|
const animatedSprite = new pixi_js.AnimatedSprite(frames);
|
|
98
98
|
animatedSprite.animationSpeed = 0.25; // Faster speed for more visible animation
|
|
99
99
|
animatedSprite.loop = true;
|
|
100
|
-
animatedSprite.scale.set(0.
|
|
100
|
+
animatedSprite.scale.set(0.3);
|
|
101
101
|
animatedSprite.anchor.set(0.5, 0.5);
|
|
102
102
|
|
|
103
103
|
// Center the sprite in the canvas
|
|
104
|
-
animatedSprite.x = this.appRef.current.renderer.width / 2;
|
|
105
|
-
animatedSprite.y = this.appRef.current.renderer.height / 2;
|
|
104
|
+
animatedSprite.x = this.appRef.current.renderer.width / 2 + (window.innerWidth > 768 ? 40 : -75);
|
|
105
|
+
animatedSprite.y = this.appRef.current.renderer.height / 2 + 15;
|
|
106
106
|
this.appRef.current.stage.addChild(animatedSprite);
|
|
107
107
|
animatedSprite.play();
|
|
108
108
|
});
|
|
@@ -131,7 +131,7 @@ const useLightening = () => {
|
|
|
131
131
|
// Calculate layout: arrange cards horizontally, centered
|
|
132
132
|
const numCards = this.cards.length;
|
|
133
133
|
const spacing = 77.6 * 0.5 + 20; // space between cards, adjust as needed
|
|
134
|
-
const spriteScale = 0.3;
|
|
134
|
+
const spriteScale = window.innerWidth < 768 ? 0.25 : 0.3;
|
|
135
135
|
this.appRef.current.renderer.height / 2;
|
|
136
136
|
|
|
137
137
|
// We'll keep track of all sprite promises to add them after all loaded
|
|
@@ -176,7 +176,7 @@ const useLightening = () => {
|
|
|
176
176
|
|
|
177
177
|
// Add multiplier text
|
|
178
178
|
const multiplier_txt = new pixi_js.Text({
|
|
179
|
-
text: `${(_card$multiplier = card.multiplier) !== null && _card$multiplier !== void 0 ? _card$multiplier : card.multplier}
|
|
179
|
+
text: `${(_card$multiplier = card.multiplier) !== null && _card$multiplier !== void 0 ? _card$multiplier : card.multplier}X`,
|
|
180
180
|
style: {
|
|
181
181
|
fontSize: 75,
|
|
182
182
|
fontWeight: "bold",
|
|
@@ -230,10 +230,195 @@ const useLightening = () => {
|
|
|
230
230
|
};
|
|
231
231
|
};
|
|
232
232
|
|
|
233
|
+
const useMiddleThunder = () => {
|
|
234
|
+
class MiddleThunder {
|
|
235
|
+
constructor(spritePath, appRef) {
|
|
236
|
+
this.spritePath = spritePath;
|
|
237
|
+
this.appRef = appRef;
|
|
238
|
+
this.initiateAnimation();
|
|
239
|
+
}
|
|
240
|
+
async initiateAnimation() {
|
|
241
|
+
pixi_js.Assets.load(this.spritePath).then(baseTexture => {
|
|
242
|
+
var _baseTexture$resource, _baseTexture$resource2;
|
|
243
|
+
// Ensure the animation is visible and sized correctly
|
|
244
|
+
const frames = [];
|
|
245
|
+
// Get the correct texture dimensions
|
|
246
|
+
const texWidth = ((_baseTexture$resource = baseTexture.resource) === null || _baseTexture$resource === void 0 ? void 0 : _baseTexture$resource.width) || baseTexture.width;
|
|
247
|
+
const texHeight = ((_baseTexture$resource2 = baseTexture.resource) === null || _baseTexture$resource2 === void 0 ? void 0 : _baseTexture$resource2.height) || baseTexture.height;
|
|
248
|
+
const columns = 3;
|
|
249
|
+
const rows = 18;
|
|
250
|
+
const frameWidth = texWidth / columns;
|
|
251
|
+
const frameHeight = texHeight / rows;
|
|
252
|
+
|
|
253
|
+
// Row-major order: for each row, for each column
|
|
254
|
+
for (let row = 0; row < rows; row++) {
|
|
255
|
+
for (let col = 0; col < columns; col++) {
|
|
256
|
+
const x = col * frameWidth;
|
|
257
|
+
const y = row * frameHeight;
|
|
258
|
+
const frameRect = new pixi_js.Rectangle(x, y, frameWidth, frameHeight);
|
|
259
|
+
frames.push(new pixi_js.Texture({
|
|
260
|
+
source: baseTexture.source,
|
|
261
|
+
// Use the correct source for the Texture constructor
|
|
262
|
+
frame: frameRect
|
|
263
|
+
}));
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
// Create and configure the AnimatedSprite
|
|
268
|
+
const animatedSprite = new pixi_js.AnimatedSprite(frames);
|
|
269
|
+
animatedSprite.animationSpeed = 0.25; // Faster speed for more visible animation
|
|
270
|
+
animatedSprite.loop = false;
|
|
271
|
+
animatedSprite.scale.set(0.5);
|
|
272
|
+
animatedSprite.anchor.set(0.5, 0.5);
|
|
273
|
+
|
|
274
|
+
// Center the sprite in the canvas
|
|
275
|
+
animatedSprite.x = this.appRef.current.renderer.width / 2;
|
|
276
|
+
animatedSprite.y = 0;
|
|
277
|
+
const tikcer = new pixi_js.Ticker();
|
|
278
|
+
tikcer.autoStart = true;
|
|
279
|
+
let iteration = 0;
|
|
280
|
+
const unitDistance = this.appRef.current.renderer.height / 60;
|
|
281
|
+
tikcer.add(tick => {
|
|
282
|
+
animatedSprite.y += unitDistance;
|
|
283
|
+
iteration++;
|
|
284
|
+
if (iteration === 60) {
|
|
285
|
+
tikcer.stop();
|
|
286
|
+
tikcer.destroy();
|
|
287
|
+
}
|
|
288
|
+
});
|
|
289
|
+
this.appRef.current.stage.addChild(animatedSprite);
|
|
290
|
+
animatedSprite.play();
|
|
291
|
+
});
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
return {
|
|
295
|
+
MiddleThunder
|
|
296
|
+
};
|
|
297
|
+
};
|
|
298
|
+
|
|
299
|
+
const useLighteningStart = () => {
|
|
300
|
+
class LighteningStart {
|
|
301
|
+
constructor(cards, spritePath, appRef) {
|
|
302
|
+
this.cards = cards;
|
|
303
|
+
this.spritePath = spritePath;
|
|
304
|
+
this.appRef = appRef;
|
|
305
|
+
this.initiateAnimation();
|
|
306
|
+
}
|
|
307
|
+
async initiateAnimation() {
|
|
308
|
+
// Create a container to hold all animatedSprites
|
|
309
|
+
const {
|
|
310
|
+
Container
|
|
311
|
+
} = await import('pixi.js');
|
|
312
|
+
const cardsContainer = new Container();
|
|
313
|
+
|
|
314
|
+
// Calculate layout: arrange cards horizontally, centered
|
|
315
|
+
const numCards = this.cards.length;
|
|
316
|
+
const spacing = 77.6 * 0.5 + 20; // space between cards, adjust as needed
|
|
317
|
+
const spriteScale = window.innerWidth < 768 ? 0.25 : 0.3;
|
|
318
|
+
this.appRef.current.renderer.height / 2;
|
|
319
|
+
|
|
320
|
+
// We'll keep track of all sprite promises to add them after all loaded
|
|
321
|
+
const spritePromises = this.cards.map(async (card, i) => {
|
|
322
|
+
var _baseTexture$resource, _baseTexture$resource2, _card$multiplier, _card$suit;
|
|
323
|
+
const baseTexture = await pixi_js.Assets.load(this.spritePath);
|
|
324
|
+
|
|
325
|
+
// Prepare frames for animation
|
|
326
|
+
const frames = [];
|
|
327
|
+
const texWidth = ((_baseTexture$resource = baseTexture.resource) === null || _baseTexture$resource === void 0 ? void 0 : _baseTexture$resource.width) || baseTexture.width;
|
|
328
|
+
const texHeight = ((_baseTexture$resource2 = baseTexture.resource) === null || _baseTexture$resource2 === void 0 ? void 0 : _baseTexture$resource2.height) || baseTexture.height;
|
|
329
|
+
const columns = 10;
|
|
330
|
+
const rows = 3;
|
|
331
|
+
const frameWidth = texWidth / columns;
|
|
332
|
+
const frameHeight = texHeight / rows;
|
|
333
|
+
for (let row = 0; row < rows; row++) {
|
|
334
|
+
for (let col = 0; col < columns; col++) {
|
|
335
|
+
const x = col * frameWidth;
|
|
336
|
+
const y = row * frameHeight;
|
|
337
|
+
const frameRect = new pixi_js.Rectangle(x, y, frameWidth, frameHeight);
|
|
338
|
+
frames.push(new pixi_js.Texture({
|
|
339
|
+
source: baseTexture.source,
|
|
340
|
+
frame: frameRect
|
|
341
|
+
}));
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
// Create and configure the AnimatedSprite
|
|
346
|
+
const animatedSprite = new pixi_js.AnimatedSprite(frames);
|
|
347
|
+
animatedSprite.animationSpeed = 0.25;
|
|
348
|
+
animatedSprite.loop = false;
|
|
349
|
+
animatedSprite.scale.set(spriteScale);
|
|
350
|
+
animatedSprite.anchor.set(0.5);
|
|
351
|
+
animatedSprite.allowChildren = true;
|
|
352
|
+
|
|
353
|
+
// Position horizontally, centered
|
|
354
|
+
const totalWidth = (numCards - 1) * spacing;
|
|
355
|
+
animatedSprite.x = -totalWidth / 2 + i * spacing;
|
|
356
|
+
animatedSprite.y = 0; // Centered in container
|
|
357
|
+
|
|
358
|
+
animatedSprite.play();
|
|
359
|
+
|
|
360
|
+
// Add multiplier text
|
|
361
|
+
const multiplier_txt = new pixi_js.Text({
|
|
362
|
+
text: `${(_card$multiplier = card.multiplier) !== null && _card$multiplier !== void 0 ? _card$multiplier : card.multplier}X`,
|
|
363
|
+
style: {
|
|
364
|
+
fontSize: 75,
|
|
365
|
+
fontWeight: "bold",
|
|
366
|
+
fill: 0xffd700,
|
|
367
|
+
align: "center"
|
|
368
|
+
}
|
|
369
|
+
});
|
|
370
|
+
multiplier_txt.anchor.set(0.5);
|
|
371
|
+
multiplier_txt.position.set(0, -50);
|
|
372
|
+
animatedSprite.addChild(multiplier_txt);
|
|
373
|
+
|
|
374
|
+
// Suit icon
|
|
375
|
+
let suit_url = "";
|
|
376
|
+
switch ((_card$suit = card.suit) === null || _card$suit === void 0 ? void 0 : _card$suit.toLowerCase()) {
|
|
377
|
+
case "hearts":
|
|
378
|
+
suit_url = "https://upload.wikimedia.org/wikipedia/commons/thumb/f/f0/SuitHearts.svg/60px-SuitHearts.svg.png";
|
|
379
|
+
break;
|
|
380
|
+
case "clubs":
|
|
381
|
+
suit_url = "https://upload.wikimedia.org/wikipedia/commons/thumb/8/8a/SuitClubs.svg/60px-SuitClubs.svg.png";
|
|
382
|
+
break;
|
|
383
|
+
case "diamonds":
|
|
384
|
+
suit_url = "https://upload.wikimedia.org/wikipedia/commons/thumb/d/db/SuitDiamonds.svg/60px-SuitDiamonds.svg.png";
|
|
385
|
+
break;
|
|
386
|
+
default:
|
|
387
|
+
suit_url = "https://upload.wikimedia.org/wikipedia/commons/thumb/5/5b/SuitSpades.svg/60px-SuitSpades.svg.png";
|
|
388
|
+
break;
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
// Load and add suit sprite
|
|
392
|
+
const card_suit_tex = await pixi_js.Assets.load(suit_url);
|
|
393
|
+
const card_suit_sprite = new pixi_js.Sprite(card_suit_tex);
|
|
394
|
+
card_suit_sprite.anchor.set(0.5);
|
|
395
|
+
card_suit_sprite.scale.set(1.2);
|
|
396
|
+
card_suit_sprite.position.set(0, 35);
|
|
397
|
+
animatedSprite.addChild(card_suit_sprite);
|
|
398
|
+
return animatedSprite;
|
|
399
|
+
});
|
|
400
|
+
|
|
401
|
+
// After all sprites are loaded, add them to the container and stage
|
|
402
|
+
Promise.all(spritePromises).then(sprites => {
|
|
403
|
+
sprites.forEach(sprite => cardsContainer.addChild(sprite));
|
|
404
|
+
// Center the container in the canvas
|
|
405
|
+
cardsContainer.x = this.appRef.current.renderer.width / 2;
|
|
406
|
+
cardsContainer.y = this.appRef.current.renderer.height / 2;
|
|
407
|
+
this.appRef.current.stage.addChild(cardsContainer);
|
|
408
|
+
});
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
return {
|
|
412
|
+
LighteningStart
|
|
413
|
+
};
|
|
414
|
+
};
|
|
415
|
+
|
|
233
416
|
// CSS is provided separately via the style field in package.json
|
|
234
417
|
|
|
235
418
|
const thunder_left = "https://babylonbetst.evo-games.com/frontend/evo/mini/images/lightnings.f9848fb7.webp";
|
|
419
|
+
const thunder_middle = "https://babylonbetst.evo-games.com/frontend/evo/mini/images/feeborderb.0e2c6bbe.webp";
|
|
236
420
|
const thunder_right = "https://babylonbetst.evo-games.com/frontend/evo/mini/images/lightnings.aeaa062e.webp";
|
|
421
|
+
const border_start = "https://babylonbetst.evo-games.com/frontend/evo/mini/images/borderstar.65180209.webp";
|
|
237
422
|
const border_loop = "https://babylonbetst.evo-games.com/frontend/evo/mini/images/borderloop.c55570cc.webp";
|
|
238
423
|
const LighteningCard = ({
|
|
239
424
|
roundStatus,
|
|
@@ -247,9 +432,15 @@ const LighteningCard = ({
|
|
|
247
432
|
const {
|
|
248
433
|
RightThunder
|
|
249
434
|
} = useRightThunder();
|
|
435
|
+
const {
|
|
436
|
+
MiddleThunder
|
|
437
|
+
} = useMiddleThunder();
|
|
250
438
|
const {
|
|
251
439
|
Lightening
|
|
252
440
|
} = useLightening();
|
|
441
|
+
const {
|
|
442
|
+
LighteningStart
|
|
443
|
+
} = useLighteningStart();
|
|
253
444
|
const initiatePixiApplication = async () => {
|
|
254
445
|
appRef.current = new pixi_js.Application();
|
|
255
446
|
await appRef.current.init({
|
|
@@ -263,7 +454,8 @@ const LighteningCard = ({
|
|
|
263
454
|
globalThis.__PIXI_APP__ = appRef.current;
|
|
264
455
|
roundStatus === "NO_MORE_BETS" && new LeftThunder(thunder_left, appRef);
|
|
265
456
|
roundStatus === "NO_MORE_BETS" && new RightThunder(thunder_right, appRef);
|
|
266
|
-
roundStatus === "
|
|
457
|
+
roundStatus === "NO_MORE_BETS" && new MiddleThunder(thunder_middle, appRef);
|
|
458
|
+
roundStatus === "LIGHTNING" && new LighteningStart(cards, border_start, appRef);
|
|
267
459
|
["NEW_CARD", "ROUND_END", "BETTING_STARTED"].includes(roundStatus) && new Lightening(cards, border_loop, appRef);
|
|
268
460
|
};
|
|
269
461
|
React.useEffect(() => {
|
|
@@ -272,8 +464,8 @@ const LighteningCard = ({
|
|
|
272
464
|
// Cleanup function
|
|
273
465
|
return () => {
|
|
274
466
|
if (appRef.current) {
|
|
275
|
-
var _appRef$current;
|
|
276
|
-
(_appRef$current = appRef.current) === null || _appRef$current === void 0
|
|
467
|
+
var _appRef$current, _appRef$current2;
|
|
468
|
+
((_appRef$current = appRef.current) === null || _appRef$current === void 0 ? void 0 : _appRef$current.renderer) && ((_appRef$current2 = appRef.current) === null || _appRef$current2 === void 0 ? void 0 : _appRef$current2.destroy(true));
|
|
277
469
|
appRef.current = null;
|
|
278
470
|
}
|
|
279
471
|
};
|
package/dist/index.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs.js","sources":["../src/hooks/useLeftThunder.js","../src/hooks/useRightThunder.js","../src/hooks/useLightening.js","../src/LighteningCard.js"],"sourcesContent":["import { AnimatedSprite, Assets, Rectangle, Texture } from \"pixi.js\";\r\n\r\nconst useLeftThunder = () => {\r\n class LeftThunder {\r\n constructor(spritePath, appRef) {\r\n this.spritePath = spritePath;\r\n this.appRef = appRef;\r\n this.initiateAnimation();\r\n }\r\n\r\n async initiateAnimation() {\r\n Assets.load(this.spritePath).then((baseTexture) => {\r\n // Ensure the animation is visible and sized correctly\r\n const frames = [];\r\n // Get the correct texture dimensions\r\n const texWidth = baseTexture.resource?.width || baseTexture.width;\r\n const texHeight = baseTexture.resource?.height || baseTexture.height;\r\n\r\n const columns = 3;\r\n const rows = 10;\r\n\r\n const frameWidth = texWidth / columns;\r\n const frameHeight = texHeight / rows;\r\n\r\n // Row-major order: for each row, for each column\r\n for (let row = 0; row < rows; row++) {\r\n for (let col = 0; col < columns; col++) {\r\n const x = col * frameWidth;\r\n const y = row * frameHeight;\r\n const frameRect = new Rectangle(x, y, frameWidth, frameHeight);\r\n frames.push(\r\n new Texture({\r\n source: baseTexture.source, // Use the correct source for the Texture constructor\r\n frame: frameRect,\r\n })\r\n );\r\n }\r\n }\r\n\r\n // Create and configure the AnimatedSprite\r\n const animatedSprite = new AnimatedSprite(frames);\r\n animatedSprite.animationSpeed = 0.25; // Faster speed for more visible animation\r\n animatedSprite.loop = true;\r\n animatedSprite.scale.set(0.4);\r\n animatedSprite.anchor.set(0.5, 0.5);\r\n\r\n // Center the sprite in the canvas\r\n animatedSprite.x = this.appRef.current.renderer.width / 2;\r\n animatedSprite.y = this.appRef.current.renderer.height / 2;\r\n\r\n this.appRef.current.stage.addChild(animatedSprite);\r\n animatedSprite.play();\r\n });\r\n }\r\n }\r\n\r\n return {\r\n LeftThunder,\r\n };\r\n};\r\n\r\nexport default useLeftThunder;\r\n","import { AnimatedSprite, Assets, Rectangle, Texture } from \"pixi.js\";\r\n\r\nconst useRightThunder = () => {\r\n class RightThunder {\r\n constructor(spritePath, appRef) {\r\n this.spritePath = spritePath;\r\n this.appRef = appRef;\r\n this.initiateAnimation();\r\n }\r\n\r\n async initiateAnimation() {\r\n Assets.load(this.spritePath).then((baseTexture) => {\r\n // Ensure the animation is visible and sized correctly\r\n const frames = [];\r\n\r\n // Get the correct texture dimensions\r\n const texWidth = baseTexture.resource?.width || baseTexture.width;\r\n const texHeight = baseTexture.resource?.height || baseTexture.height;\r\n\r\n const columns = 3;\r\n const rows = 10;\r\n\r\n const frameWidth = texWidth / columns;\r\n const frameHeight = texHeight / rows;\r\n\r\n // Row-major order: for each row, for each column\r\n for (let row = 0; row < rows; row++) {\r\n for (let col = 0; col < columns; col++) {\r\n const x = col * frameWidth;\r\n const y = row * frameHeight;\r\n const frameRect = new Rectangle(x, y, frameWidth, frameHeight);\r\n frames.push(\r\n new Texture({\r\n source: baseTexture.source, // Use the correct source for the Texture constructor\r\n frame: frameRect,\r\n })\r\n );\r\n }\r\n }\r\n\r\n // Create and configure the AnimatedSprite\r\n const animatedSprite = new AnimatedSprite(frames);\r\n animatedSprite.animationSpeed = 0.25; // Faster speed for more visible animation\r\n animatedSprite.loop = true;\r\n animatedSprite.scale.set(0.4);\r\n animatedSprite.anchor.set(0.5, 0.5);\r\n\r\n // Center the sprite in the canvas\r\n animatedSprite.x = this.appRef.current.renderer.width / 2;\r\n animatedSprite.y = this.appRef.current.renderer.height / 2;\r\n\r\n this.appRef.current.stage.addChild(animatedSprite);\r\n animatedSprite.play();\r\n });\r\n }\r\n }\r\n return { RightThunder };\r\n};\r\n\r\nexport default useRightThunder;\r\n","import {\r\n AnimatedSprite,\r\n Assets,\r\n Rectangle,\r\n Text,\r\n Texture,\r\n Sprite,\r\n Graphics,\r\n} from \"pixi.js\";\r\nimport { useEffect, useRef } from \"react\";\r\n\r\nconst useLightening = () => {\r\n class Lightening {\r\n constructor(cards, spritePath, appRef) {\r\n this.cards = cards;\r\n this.spritePath = spritePath;\r\n this.appRef = appRef;\r\n this.initiateAnimation();\r\n }\r\n\r\n async initiateAnimation() {\r\n // Create a container to hold all animatedSprites\r\n const { Container } = await import(\"pixi.js\");\r\n const cardsContainer = new Container();\r\n\r\n // Calculate layout: arrange cards horizontally, centered\r\n const numCards = this.cards.length;\r\n const spacing = 77.6 * 0.5 + 20; // space between cards, adjust as needed\r\n const spriteScale = 0.3;\r\n const baseY = this.appRef.current.renderer.height / 2;\r\n\r\n // We'll keep track of all sprite promises to add them after all loaded\r\n const spritePromises = this.cards.map(async (card, i) => {\r\n const baseTexture = await Assets.load(this.spritePath);\r\n\r\n // Prepare frames for animation\r\n const frames = [];\r\n const texWidth = baseTexture.resource?.width || baseTexture.width;\r\n const texHeight = baseTexture.resource?.height || baseTexture.height;\r\n const columns = 10;\r\n const rows = 3;\r\n const frameWidth = texWidth / columns;\r\n const frameHeight = texHeight / rows;\r\n\r\n for (let row = 0; row < rows; row++) {\r\n for (let col = 0; col < columns; col++) {\r\n const x = col * frameWidth;\r\n const y = row * frameHeight;\r\n const frameRect = new Rectangle(x, y, frameWidth, frameHeight);\r\n frames.push(\r\n new Texture({\r\n source: baseTexture.source,\r\n frame: frameRect,\r\n })\r\n );\r\n }\r\n }\r\n\r\n // Create and configure the AnimatedSprite\r\n const animatedSprite = new AnimatedSprite(frames);\r\n animatedSprite.animationSpeed = 0.25;\r\n animatedSprite.loop = true;\r\n animatedSprite.scale.set(spriteScale);\r\n animatedSprite.anchor.set(0.5);\r\n animatedSprite.allowChildren = true;\r\n\r\n // Position horizontally, centered\r\n const totalWidth = (numCards - 1) * spacing;\r\n animatedSprite.x = -totalWidth / 2 + i * spacing;\r\n animatedSprite.y = 0; // Centered in container\r\n\r\n animatedSprite.play();\r\n\r\n // Add multiplier text\r\n const multiplier_txt = new Text({\r\n text: `${card.multiplier ?? card.multplier}x`,\r\n style: {\r\n fontSize: 75,\r\n fontWeight: \"bold\",\r\n fill: 0xffd700,\r\n align: \"center\",\r\n },\r\n });\r\n multiplier_txt.anchor.set(0.5);\r\n multiplier_txt.position.set(0, -50);\r\n animatedSprite.addChild(multiplier_txt);\r\n\r\n // Suit icon\r\n let suit_url = \"\";\r\n switch (card.suit?.toLowerCase()) {\r\n case \"hearts\":\r\n suit_url =\r\n \"https://upload.wikimedia.org/wikipedia/commons/thumb/f/f0/SuitHearts.svg/60px-SuitHearts.svg.png\";\r\n break;\r\n case \"clubs\":\r\n suit_url =\r\n \"https://upload.wikimedia.org/wikipedia/commons/thumb/8/8a/SuitClubs.svg/60px-SuitClubs.svg.png\";\r\n break;\r\n case \"diamonds\":\r\n suit_url =\r\n \"https://upload.wikimedia.org/wikipedia/commons/thumb/d/db/SuitDiamonds.svg/60px-SuitDiamonds.svg.png\";\r\n break;\r\n default:\r\n suit_url =\r\n \"https://upload.wikimedia.org/wikipedia/commons/thumb/5/5b/SuitSpades.svg/60px-SuitSpades.svg.png\";\r\n break;\r\n }\r\n\r\n // Load and add suit sprite\r\n const card_suit_tex = await Assets.load(suit_url);\r\n const card_suit_sprite = new Sprite(card_suit_tex);\r\n card_suit_sprite.anchor.set(0.5);\r\n card_suit_sprite.scale.set(1.2);\r\n card_suit_sprite.position.set(0, 35);\r\n animatedSprite.addChild(card_suit_sprite);\r\n\r\n return animatedSprite;\r\n });\r\n\r\n // After all sprites are loaded, add them to the container and stage\r\n Promise.all(spritePromises).then((sprites) => {\r\n sprites.forEach((sprite) => cardsContainer.addChild(sprite));\r\n // Center the container in the canvas\r\n cardsContainer.x = this.appRef.current.renderer.width / 2;\r\n cardsContainer.y = this.appRef.current.renderer.height / 2;\r\n this.appRef.current.stage.addChild(cardsContainer);\r\n });\r\n }\r\n }\r\n\r\n return {\r\n Lightening,\r\n };\r\n};\r\n\r\nexport default useLightening;\r\n","import React, { useEffect, useRef } from \"react\";\r\nimport PropTypes from \"prop-types\";\r\nimport { Application } from \"pixi.js\";\r\nimport useLeftThunder from \"./hooks/useLeftThunder\";\r\nimport useRightThunder from \"./hooks/useRightThunder\";\r\nimport useLightening from \"./hooks/useLightening\";\r\nimport \"./LighteningCard.css\";\r\n\r\n// CSS is provided separately via the style field in package.json\r\n\r\nconst thunder_left =\r\n \"https://babylonbetst.evo-games.com/frontend/evo/mini/images/lightnings.f9848fb7.webp\";\r\nconst thunder_middle =\r\n \"https://babylonbetst.evo-games.com/frontend/evo/mini/images/lightnings.88df6be3.webp\";\r\nconst thunder_right =\r\n \"https://babylonbetst.evo-games.com/frontend/evo/mini/images/lightnings.aeaa062e.webp\";\r\n\r\nconst border_start =\r\n \"https://babylonbetst.evo-games.com/frontend/evo/mini/images/borderstar.65180209.webp\";\r\nconst border_loop =\r\n \"https://babylonbetst.evo-games.com/frontend/evo/mini/images/borderloop.c55570cc.webp\";\r\n\r\nconst LighteningCard = ({ roundStatus, cards }) => {\r\n const containerRef = useRef(null);\r\n const appRef = useRef(null);\r\n const { LeftThunder } = useLeftThunder();\r\n const { RightThunder } = useRightThunder();\r\n const { Lightening } = useLightening();\r\n\r\n const initiatePixiApplication = async () => {\r\n appRef.current = new Application();\r\n await appRef.current.init({\r\n resizeTo: containerRef.current,\r\n backgroundAlpha: 0,\r\n powerPreference: \"high-performance\",\r\n resolution: window.devicePixelRatio || 1,\r\n autoDensity: true, // This ensures the canvas CSS size is correct\r\n });\r\n containerRef.current.appendChild(appRef.current.canvas);\r\n globalThis.__PIXI_APP__ = appRef.current;\r\n\r\n roundStatus === \"NO_MORE_BETS\" && new LeftThunder(thunder_left, appRef);\r\n roundStatus === \"NO_MORE_BETS\" && new RightThunder(thunder_right, appRef);\r\n roundStatus === \"LIGHTNING\" && new Lightening(cards, border_loop, appRef);\r\n [\"NEW_CARD\", \"ROUND_END\", \"BETTING_STARTED\"].includes(roundStatus) &&\r\n new Lightening(cards, border_loop, appRef);\r\n };\r\n\r\n useEffect(() => {\r\n if (!containerRef.current) return;\r\n initiatePixiApplication();\r\n // Cleanup function\r\n return () => {\r\n if (appRef.current) {\r\n appRef.current?.destroy(true);\r\n appRef.current = null;\r\n }\r\n };\r\n }, [roundStatus]);\r\n\r\n return <div className=\"lightening-card\" ref={containerRef}></div>;\r\n};\r\n\r\nLighteningCard.propTypes = {\r\n roundStatus: PropTypes.string.isRequired,\r\n cards: PropTypes.arrayOf(\r\n PropTypes.shape({\r\n multiplier: PropTypes.number,\r\n rank: PropTypes.string,\r\n suit: PropTypes.string,\r\n })\r\n ),\r\n assetPath: PropTypes.string, // Path to the animation asset\r\n onAnimationReady: PropTypes.func, // Callback when animation is ready\r\n};\r\n\r\nLighteningCard.defaultProps = {\r\n cards: [],\r\n};\r\n\r\nexport default LighteningCard;\r\n"],"names":["useLeftThunder","LeftThunder","constructor","spritePath","appRef","initiateAnimation","Assets","load","then","baseTexture","_baseTexture$resource","_baseTexture$resource2","frames","texWidth","resource","width","texHeight","height","columns","rows","frameWidth","frameHeight","row","col","x","y","frameRect","Rectangle","push","Texture","source","frame","animatedSprite","AnimatedSprite","animationSpeed","loop","scale","set","anchor","current","renderer","stage","addChild","play","useRightThunder","RightThunder","useLightening","Lightening","cards","Container","cardsContainer","numCards","length","spacing","spriteScale","spritePromises","map","card","i","_card$multiplier","_card$suit","allowChildren","totalWidth","multiplier_txt","Text","text","multiplier","multplier","style","fontSize","fontWeight","fill","align","position","suit_url","suit","toLowerCase","card_suit_tex","card_suit_sprite","Sprite","Promise","all","sprites","forEach","sprite","thunder_left","thunder_right","border_loop","LighteningCard","roundStatus","containerRef","useRef","initiatePixiApplication","Application","init","resizeTo","backgroundAlpha","powerPreference","resolution","window","devicePixelRatio","autoDensity","appendChild","canvas","globalThis","__PIXI_APP__","includes","useEffect","_appRef$current","destroy","React","createElement","className","ref","propTypes","PropTypes","string","isRequired","arrayOf","shape","number","rank","assetPath","onAnimationReady","func","defaultProps"],"mappings":";;;;;;AAEA,MAAMA,cAAc,GAAGA,MAAM;AAC3B,EAAA,MAAMC,WAAW,CAAC;AAChBC,IAAAA,WAAWA,CAACC,UAAU,EAAEC,MAAM,EAAE;MAC9B,IAAI,CAACD,UAAU,GAAGA,UAAU;MAC5B,IAAI,CAACC,MAAM,GAAGA,MAAM;MACpB,IAAI,CAACC,iBAAiB,EAAE;AAC1B,IAAA;IAEA,MAAMA,iBAAiBA,GAAG;MACxBC,cAAM,CAACC,IAAI,CAAC,IAAI,CAACJ,UAAU,CAAC,CAACK,I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EACDM,SAAS,EAAEP,SAAS,CAACC,MAAM;AAAE;AAC7BO,EAAAA,gBAAgB,EAAER,SAAS,CAACS,IAAI;AAClC,CAAC;AAEDpC,cAAc,CAACqC,YAAY,GAAG;AAC5B7E,EAAAA,KAAK,EAAE;AACT,CAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":["../src/hooks/useLeftThunder.js","../src/hooks/useRightThunder.js","../src/hooks/useLightening.js","../src/hooks/useMiddleThunder.js","../src/hooks/useLighteningStart.js","../src/LighteningCard.js"],"sourcesContent":["import { AnimatedSprite, Assets, Rectangle, Texture } from \"pixi.js\";\r\n\r\nconst useLeftThunder = () => {\r\n class LeftThunder {\r\n constructor(spritePath, appRef) {\r\n this.spritePath = spritePath;\r\n this.appRef = appRef;\r\n this.initiateAnimation();\r\n }\r\n\r\n async initiateAnimation() {\r\n Assets.load(this.spritePath).then((baseTexture) => {\r\n // Ensure the animation is visible and sized correctly\r\n const frames = [];\r\n // Get the correct texture dimensions\r\n const texWidth = baseTexture.resource?.width || baseTexture.width;\r\n const texHeight = baseTexture.resource?.height || baseTexture.height;\r\n\r\n const columns = 3;\r\n const rows = 10;\r\n\r\n const frameWidth = texWidth / columns;\r\n const frameHeight = texHeight / rows;\r\n\r\n // Row-major order: for each row, for each column\r\n for (let row = 0; row < rows; row++) {\r\n for (let col = 0; col < columns; col++) {\r\n const x = col * frameWidth;\r\n const y = row * frameHeight;\r\n const frameRect = new Rectangle(x, y, frameWidth, frameHeight);\r\n frames.push(\r\n new Texture({\r\n source: baseTexture.source, // Use the correct source for the Texture constructor\r\n frame: frameRect,\r\n })\r\n );\r\n }\r\n }\r\n\r\n // Create and configure the AnimatedSprite\r\n const animatedSprite = new AnimatedSprite(frames);\r\n animatedSprite.animationSpeed = 0.25; // Faster speed for more visible animation\r\n animatedSprite.loop = true;\r\n animatedSprite.scale.set(0.3);\r\n animatedSprite.anchor.set(0.5, 0.5);\r\n\r\n // Center the sprite in the canvas\r\n animatedSprite.x =\r\n this.appRef.current.renderer.width / 2 -\r\n (window.innerWidth > 768 ? 40 : -75);\r\n animatedSprite.y = this.appRef.current.renderer.height / 2 + 15;\r\n\r\n this.appRef.current.stage.addChild(animatedSprite);\r\n animatedSprite.play();\r\n });\r\n }\r\n }\r\n\r\n return {\r\n LeftThunder,\r\n };\r\n};\r\n\r\nexport default useLeftThunder;\r\n","import { AnimatedSprite, Assets, Rectangle, Texture } from \"pixi.js\";\r\n\r\nconst useRightThunder = () => {\r\n class RightThunder {\r\n constructor(spritePath, appRef) {\r\n this.spritePath = spritePath;\r\n this.appRef = appRef;\r\n this.initiateAnimation();\r\n }\r\n\r\n async initiateAnimation() {\r\n Assets.load(this.spritePath).then((baseTexture) => {\r\n // Ensure the animation is visible and sized correctly\r\n const frames = [];\r\n\r\n // Get the correct texture dimensions\r\n const texWidth = baseTexture.resource?.width || baseTexture.width;\r\n const texHeight = baseTexture.resource?.height || baseTexture.height;\r\n\r\n const columns = 3;\r\n const rows = 10;\r\n\r\n const frameWidth = texWidth / columns;\r\n const frameHeight = texHeight / rows;\r\n\r\n // Row-major order: for each row, for each column\r\n for (let row = 0; row < rows; row++) {\r\n for (let col = 0; col < columns; col++) {\r\n const x = col * frameWidth;\r\n const y = row * frameHeight;\r\n const frameRect = new Rectangle(x, y, frameWidth, frameHeight);\r\n frames.push(\r\n new Texture({\r\n source: baseTexture.source, // Use the correct source for the Texture constructor\r\n frame: frameRect,\r\n })\r\n );\r\n }\r\n }\r\n\r\n // Create and configure the AnimatedSprite\r\n const animatedSprite = new AnimatedSprite(frames);\r\n animatedSprite.animationSpeed = 0.25; // Faster speed for more visible animation\r\n animatedSprite.loop = true;\r\n animatedSprite.scale.set(0.3);\r\n animatedSprite.anchor.set(0.5, 0.5);\r\n\r\n // Center the sprite in the canvas\r\n animatedSprite.x =\r\n this.appRef.current.renderer.width / 2 +\r\n (window.innerWidth > 768 ? 40 : -75);\r\n animatedSprite.y = this.appRef.current.renderer.height / 2 + 15;\r\n\r\n this.appRef.current.stage.addChild(animatedSprite);\r\n animatedSprite.play();\r\n });\r\n }\r\n }\r\n return { RightThunder };\r\n};\r\n\r\nexport default useRightThunder;\r\n","import {\r\n AnimatedSprite,\r\n Assets,\r\n Rectangle,\r\n Text,\r\n Texture,\r\n Sprite,\r\n Graphics,\r\n} from \"pixi.js\";\r\n\r\nconst useLightening = () => {\r\n class Lightening {\r\n constructor(cards, spritePath, appRef) {\r\n this.cards = cards;\r\n this.spritePath = spritePath;\r\n this.appRef = appRef;\r\n this.initiateAnimation();\r\n }\r\n\r\n async initiateAnimation() {\r\n // Create a container to hold all animatedSprites\r\n const { Container } = await import(\"pixi.js\");\r\n const cardsContainer = new Container();\r\n\r\n // Calculate layout: arrange cards horizontally, centered\r\n const numCards = this.cards.length;\r\n const spacing = 77.6 * 0.5 + 20; // space between cards, adjust as needed\r\n const spriteScale = window.innerWidth < 768 ? 0.25 : 0.3;\r\n const baseY = this.appRef.current.renderer.height / 2;\r\n\r\n // We'll keep track of all sprite promises to add them after all loaded\r\n const spritePromises = this.cards.map(async (card, i) => {\r\n const baseTexture = await Assets.load(this.spritePath);\r\n\r\n // Prepare frames for animation\r\n const frames = [];\r\n const texWidth = baseTexture.resource?.width || baseTexture.width;\r\n const texHeight = baseTexture.resource?.height || baseTexture.height;\r\n const columns = 10;\r\n const rows = 3;\r\n const frameWidth = texWidth / columns;\r\n const frameHeight = texHeight / rows;\r\n\r\n for (let row = 0; row < rows; row++) {\r\n for (let col = 0; col < columns; col++) {\r\n const x = col * frameWidth;\r\n const y = row * frameHeight;\r\n const frameRect = new Rectangle(x, y, frameWidth, frameHeight);\r\n frames.push(\r\n new Texture({\r\n source: baseTexture.source,\r\n frame: frameRect,\r\n })\r\n );\r\n }\r\n }\r\n\r\n // Create and configure the AnimatedSprite\r\n const animatedSprite = new AnimatedSprite(frames);\r\n animatedSprite.animationSpeed = 0.25;\r\n animatedSprite.loop = true;\r\n animatedSprite.scale.set(spriteScale);\r\n animatedSprite.anchor.set(0.5);\r\n animatedSprite.allowChildren = true;\r\n\r\n // Position horizontally, centered\r\n const totalWidth = (numCards - 1) * spacing;\r\n animatedSprite.x = -totalWidth / 2 + i * spacing;\r\n animatedSprite.y = 0; // Centered in container\r\n\r\n animatedSprite.play();\r\n\r\n // Add multiplier text\r\n const multiplier_txt = new Text({\r\n text: `${card.multiplier ?? card.multplier}X`,\r\n style: {\r\n fontSize: 75,\r\n fontWeight: \"bold\",\r\n fill: 0xffd700,\r\n align: \"center\",\r\n },\r\n });\r\n multiplier_txt.anchor.set(0.5);\r\n multiplier_txt.position.set(0, -50);\r\n animatedSprite.addChild(multiplier_txt);\r\n\r\n // Suit icon\r\n let suit_url = \"\";\r\n switch (card.suit?.toLowerCase()) {\r\n case \"hearts\":\r\n suit_url =\r\n \"https://upload.wikimedia.org/wikipedia/commons/thumb/f/f0/SuitHearts.svg/60px-SuitHearts.svg.png\";\r\n break;\r\n case \"clubs\":\r\n suit_url =\r\n \"https://upload.wikimedia.org/wikipedia/commons/thumb/8/8a/SuitClubs.svg/60px-SuitClubs.svg.png\";\r\n break;\r\n case \"diamonds\":\r\n suit_url =\r\n \"https://upload.wikimedia.org/wikipedia/commons/thumb/d/db/SuitDiamonds.svg/60px-SuitDiamonds.svg.png\";\r\n break;\r\n default:\r\n suit_url =\r\n \"https://upload.wikimedia.org/wikipedia/commons/thumb/5/5b/SuitSpades.svg/60px-SuitSpades.svg.png\";\r\n break;\r\n }\r\n\r\n // Load and add suit sprite\r\n const card_suit_tex = await Assets.load(suit_url);\r\n const card_suit_sprite = new Sprite(card_suit_tex);\r\n card_suit_sprite.anchor.set(0.5);\r\n card_suit_sprite.scale.set(1.2);\r\n card_suit_sprite.position.set(0, 35);\r\n animatedSprite.addChild(card_suit_sprite);\r\n\r\n return animatedSprite;\r\n });\r\n\r\n // After all sprites are loaded, add them to the container and stage\r\n Promise.all(spritePromises).then((sprites) => {\r\n sprites.forEach((sprite) => cardsContainer.addChild(sprite));\r\n // Center the container in the canvas\r\n cardsContainer.x = this.appRef.current.renderer.width / 2;\r\n cardsContainer.y = this.appRef.current.renderer.height / 2;\r\n this.appRef.current.stage.addChild(cardsContainer);\r\n });\r\n }\r\n }\r\n\r\n return {\r\n Lightening,\r\n };\r\n};\r\n\r\nexport default useLightening;\r\n","import { AnimatedSprite, Assets, Rectangle, Texture, Ticker } from \"pixi.js\";\r\n\r\nconst useMiddleThunder = () => {\r\n class MiddleThunder {\r\n constructor(spritePath, appRef) {\r\n this.spritePath = spritePath;\r\n this.appRef = appRef;\r\n this.initiateAnimation();\r\n }\r\n\r\n async initiateAnimation() {\r\n Assets.load(this.spritePath).then((baseTexture) => {\r\n // Ensure the animation is visible and sized correctly\r\n const frames = [];\r\n // Get the correct texture dimensions\r\n const texWidth = baseTexture.resource?.width || baseTexture.width;\r\n const texHeight = baseTexture.resource?.height || baseTexture.height;\r\n\r\n const columns = 3;\r\n const rows = 18;\r\n\r\n const frameWidth = texWidth / columns;\r\n const frameHeight = texHeight / rows;\r\n\r\n // Row-major order: for each row, for each column\r\n for (let row = 0; row < rows; row++) {\r\n for (let col = 0; col < columns; col++) {\r\n const x = col * frameWidth;\r\n const y = row * frameHeight;\r\n const frameRect = new Rectangle(x, y, frameWidth, frameHeight);\r\n frames.push(\r\n new Texture({\r\n source: baseTexture.source, // Use the correct source for the Texture constructor\r\n frame: frameRect,\r\n })\r\n );\r\n }\r\n }\r\n\r\n // Create and configure the AnimatedSprite\r\n const animatedSprite = new AnimatedSprite(frames);\r\n animatedSprite.animationSpeed = 0.25; // Faster speed for more visible animation\r\n animatedSprite.loop = false;\r\n animatedSprite.scale.set(0.5);\r\n animatedSprite.anchor.set(0.5, 0.5);\r\n\r\n // Center the sprite in the canvas\r\n animatedSprite.x = this.appRef.current.renderer.width / 2;\r\n animatedSprite.y = 0;\r\n const tikcer = new Ticker();\r\n tikcer.autoStart = true;\r\n let iteration = 0;\r\n\r\n const unitDistance = this.appRef.current.renderer.height / 60;\r\n tikcer.add((tick) => {\r\n animatedSprite.y += unitDistance;\r\n iteration++;\r\n if (iteration === 60) {\r\n tikcer.stop();\r\n tikcer.destroy();\r\n }\r\n });\r\n\r\n this.appRef.current.stage.addChild(animatedSprite);\r\n animatedSprite.play();\r\n });\r\n }\r\n }\r\n return {\r\n MiddleThunder,\r\n };\r\n};\r\n\r\nexport default useMiddleThunder;\r\n","import {\r\n AnimatedSprite,\r\n Assets,\r\n Rectangle,\r\n Text,\r\n Texture,\r\n Sprite,\r\n Graphics,\r\n} from \"pixi.js\";\r\n\r\nconst useLighteningStart = () => {\r\n class LighteningStart {\r\n constructor(cards, spritePath, appRef) {\r\n this.cards = cards;\r\n this.spritePath = spritePath;\r\n this.appRef = appRef;\r\n this.initiateAnimation();\r\n }\r\n\r\n async initiateAnimation() {\r\n // Create a container to hold all animatedSprites\r\n const { Container } = await import(\"pixi.js\");\r\n const cardsContainer = new Container();\r\n\r\n // Calculate layout: arrange cards horizontally, centered\r\n const numCards = this.cards.length;\r\n const spacing = 77.6 * 0.5 + 20; // space between cards, adjust as needed\r\n const spriteScale = window.innerWidth < 768 ? 0.25 : 0.3;\r\n const baseY = this.appRef.current.renderer.height / 2;\r\n\r\n // We'll keep track of all sprite promises to add them after all loaded\r\n const spritePromises = this.cards.map(async (card, i) => {\r\n const baseTexture = await Assets.load(this.spritePath);\r\n\r\n // Prepare frames for animation\r\n const frames = [];\r\n const texWidth = baseTexture.resource?.width || baseTexture.width;\r\n const texHeight = baseTexture.resource?.height || baseTexture.height;\r\n const columns = 10;\r\n const rows = 3;\r\n const frameWidth = texWidth / columns;\r\n const frameHeight = texHeight / rows;\r\n\r\n for (let row = 0; row < rows; row++) {\r\n for (let col = 0; col < columns; col++) {\r\n const x = col * frameWidth;\r\n const y = row * frameHeight;\r\n const frameRect = new Rectangle(x, y, frameWidth, frameHeight);\r\n frames.push(\r\n new Texture({\r\n source: baseTexture.source,\r\n frame: frameRect,\r\n })\r\n );\r\n }\r\n }\r\n\r\n // Create and configure the AnimatedSprite\r\n const animatedSprite = new AnimatedSprite(frames);\r\n animatedSprite.animationSpeed = 0.25;\r\n animatedSprite.loop = false;\r\n animatedSprite.scale.set(spriteScale);\r\n animatedSprite.anchor.set(0.5);\r\n animatedSprite.allowChildren = true;\r\n\r\n // Position horizontally, centered\r\n const totalWidth = (numCards - 1) * spacing;\r\n animatedSprite.x = -totalWidth / 2 + i * spacing;\r\n animatedSprite.y = 0; // Centered in container\r\n\r\n animatedSprite.play();\r\n\r\n // Add multiplier text\r\n const multiplier_txt = new Text({\r\n text: `${card.multiplier ?? card.multplier}X`,\r\n style: {\r\n fontSize: 75,\r\n fontWeight: \"bold\",\r\n fill: 0xffd700,\r\n align: \"center\",\r\n },\r\n });\r\n multiplier_txt.anchor.set(0.5);\r\n multiplier_txt.position.set(0, -50);\r\n animatedSprite.addChild(multiplier_txt);\r\n\r\n // Suit icon\r\n let suit_url = \"\";\r\n switch (card.suit?.toLowerCase()) {\r\n case \"hearts\":\r\n suit_url =\r\n \"https://upload.wikimedia.org/wikipedia/commons/thumb/f/f0/SuitHearts.svg/60px-SuitHearts.svg.png\";\r\n break;\r\n case \"clubs\":\r\n suit_url =\r\n \"https://upload.wikimedia.org/wikipedia/commons/thumb/8/8a/SuitClubs.svg/60px-SuitClubs.svg.png\";\r\n break;\r\n case \"diamonds\":\r\n suit_url =\r\n \"https://upload.wikimedia.org/wikipedia/commons/thumb/d/db/SuitDiamonds.svg/60px-SuitDiamonds.svg.png\";\r\n break;\r\n default:\r\n suit_url =\r\n \"https://upload.wikimedia.org/wikipedia/commons/thumb/5/5b/SuitSpades.svg/60px-SuitSpades.svg.png\";\r\n break;\r\n }\r\n\r\n // Load and add suit sprite\r\n const card_suit_tex = await Assets.load(suit_url);\r\n const card_suit_sprite = new Sprite(card_suit_tex);\r\n card_suit_sprite.anchor.set(0.5);\r\n card_suit_sprite.scale.set(1.2);\r\n card_suit_sprite.position.set(0, 35);\r\n animatedSprite.addChild(card_suit_sprite);\r\n\r\n return animatedSprite;\r\n });\r\n\r\n // After all sprites are loaded, add them to the container and stage\r\n Promise.all(spritePromises).then((sprites) => {\r\n sprites.forEach((sprite) => cardsContainer.addChild(sprite));\r\n // Center the container in the canvas\r\n cardsContainer.x = this.appRef.current.renderer.width / 2;\r\n cardsContainer.y = this.appRef.current.renderer.height / 2;\r\n this.appRef.current.stage.addChild(cardsContainer);\r\n });\r\n }\r\n }\r\n\r\n return {\r\n LighteningStart,\r\n };\r\n};\r\n\r\nexport default useLighteningStart;\r\n","import React, { useEffect, useRef } from \"react\";\r\nimport PropTypes from \"prop-types\";\r\nimport { Application } from \"pixi.js\";\r\nimport useLeftThunder from \"./hooks/useLeftThunder\";\r\nimport useRightThunder from \"./hooks/useRightThunder\";\r\nimport useLightening from \"./hooks/useLightening\";\r\nimport useMiddleThunder from \"./hooks/useMiddleThunder\";\r\nimport useLighteningStart from \"./hooks/useLighteningStart\";\r\nimport \"./LighteningCard.css\";\r\n\r\n// CSS is provided separately via the style field in package.json\r\n\r\nconst thunder_left =\r\n \"https://babylonbetst.evo-games.com/frontend/evo/mini/images/lightnings.f9848fb7.webp\";\r\nconst thunder_middle =\r\n \"https://babylonbetst.evo-games.com/frontend/evo/mini/images/feeborderb.0e2c6bbe.webp\";\r\nconst thunder_right =\r\n \"https://babylonbetst.evo-games.com/frontend/evo/mini/images/lightnings.aeaa062e.webp\";\r\n\r\nconst border_start =\r\n \"https://babylonbetst.evo-games.com/frontend/evo/mini/images/borderstar.65180209.webp\";\r\nconst border_loop =\r\n \"https://babylonbetst.evo-games.com/frontend/evo/mini/images/borderloop.c55570cc.webp\";\r\n\r\nconst LighteningCard = ({ roundStatus, cards }) => {\r\n const containerRef = useRef(null);\r\n const appRef = useRef(null);\r\n const { LeftThunder } = useLeftThunder();\r\n const { RightThunder } = useRightThunder();\r\n const { MiddleThunder } = useMiddleThunder();\r\n const { Lightening } = useLightening();\r\n const { LighteningStart } = useLighteningStart();\r\n const initiatePixiApplication = async () => {\r\n appRef.current = new Application();\r\n await appRef.current.init({\r\n resizeTo: containerRef.current,\r\n backgroundAlpha: 0,\r\n powerPreference: \"high-performance\",\r\n resolution: window.devicePixelRatio || 1,\r\n autoDensity: true, // This ensures the canvas CSS size is correct\r\n });\r\n containerRef.current.appendChild(appRef.current.canvas);\r\n globalThis.__PIXI_APP__ = appRef.current;\r\n\r\n roundStatus === \"NO_MORE_BETS\" && new LeftThunder(thunder_left, appRef);\r\n roundStatus === \"NO_MORE_BETS\" && new RightThunder(thunder_right, appRef);\r\n roundStatus === \"NO_MORE_BETS\" && new MiddleThunder(thunder_middle, appRef);\r\n roundStatus === \"LIGHTNING\" &&\r\n new LighteningStart(cards, border_start, appRef);\r\n [\"NEW_CARD\", \"ROUND_END\", \"BETTING_STARTED\"].includes(roundStatus) &&\r\n new Lightening(cards, border_loop, appRef);\r\n };\r\n\r\n useEffect(() => {\r\n if (!containerRef.current) return;\r\n initiatePixiApplication();\r\n // Cleanup function\r\n return () => {\r\n if (appRef.current) {\r\n appRef.current?.renderer && appRef.current?.destroy(true);\r\n appRef.current = null;\r\n }\r\n };\r\n }, [roundStatus]);\r\n\r\n return <div className=\"lightening-card\" ref={containerRef}></div>;\r\n};\r\n\r\nLighteningCard.propTypes = {\r\n roundStatus: PropTypes.string.isRequired,\r\n cards: PropTypes.arrayOf(\r\n PropTypes.shape({\r\n multiplier: PropTypes.number,\r\n rank: PropTypes.string,\r\n suit: PropTypes.string,\r\n })\r\n ),\r\n assetPath: PropTypes.string, // Path to the animation asset\r\n onAnimationReady: PropTypes.func, // Callback when animation is ready\r\n};\r\n\r\nLighteningCard.defaultProps = {\r\n cards: [],\r\n};\r\n\r\nexport default LighteningCard;\r\n"],"names":["useLeftThunder","LeftThunder","constructor","spritePath","appRef","initiateAnimation","Assets","load","then","baseTexture","_baseTexture$resource","_baseTexture$resource2","frames","texWidth","resource","width","texHeight","height","columns","rows","frameWidth","frameHeight","row","col","x","y","frameRect","Rectangle","push","Texture","source","frame","animatedSprite","AnimatedSprite","animationSpeed","loop","scale","set","anchor","current","renderer","window","innerWidth","stage","addChild","play","useRightThunder","RightThunder","useLightening","Lightening","cards","Container","cardsContainer","numCards","length","spacing","spriteScale","spritePromises","map","card","i","_card$multiplier","_card$suit","allowChildren","totalWidth","multiplier_txt","Text","text","multiplier","multplier","style","fontSize","fontWeight","fill","align","position","suit_url","suit","toLowerCase","card_suit_tex","card_suit_sprite","Sprite","Promise","all","sprites","forEach","sprite","useMiddleThunder","MiddleThunder","tikcer","Ticker","autoStart","iteration","unitDistance","add","tick","stop","destroy","useLighteningStart","LighteningStart","thunder_left","thunder_middle","thunder_right","border_start","border_loop","LighteningCard","roundStatus","containerRef","useRef","initiatePixiApplication","Application","init","resizeTo","backgroundAlpha","powerPreference","resolution","devicePixelRatio","autoDensity","appendChild","canvas","globalThis","__PIXI_APP__","includes","useEffect","_appRef$current","_appRef$current2","React","createElement","className","ref","propTypes","PropTypes","string","isRequired","arrayOf","shape","number","rank","assetPath","onAnimationReady","func","defaultProps"],"mappings":";;;;;;AAEA,MAAMA,cAAc,GAAGA,MAAM;AAC3B,EAAA,MAAMC,WAAW,CAAC;AAChBC,IAAAA,WAAWA,CAACC,UAAU,EAAEC,MAAM,EAAE;MAC9B,IAAI,CAACD,UAAU,GAAGA,UAAU;MAC5B,IAAI,CAACC,MAAM,GAAGA,MAAM;MACpB,IAAI,CAACC,iBAAiB,EAAE;AAC1B,IAAA;IAEA,MAAMA,iBAAiBA,GAAG;MACxBC,cAAM,CAACC,IAAI,CAAC,IAAI,CAACJ,UAAU,CAAC,CAACK,IAAI,CAAEC,WAAW,IAAK;QAAA,IAAAC,qBAAA,EAAAC,sBAAA;AACjD;QACA,MAAMC,MAAM,GAAG,EAAE;AACjB;AACA,QAAA,MAAMC,QAAQ,GAAG,CAAA,CAAAH,qBAAA,GAAAD,WAAW,CAACK,QAAQ,MAAA,IAAA,IAAAJ,qBAAA,uBAApBA,qBAAA,CAAsBK,KAAK,KAAIN,WAAW,CAACM,KAAK;AACjE,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,cAAc,CAACyB,SAAS,GAAG;AACzBxB,EAAAA,WAAW,EAAEyB,SAAS,CAACC,MAAM,CAACC,UAAU;EACxCnF,KAAK,EAAEiF,SAAS,CAACG,OAAO,CACtBH,SAAS,CAACI,KAAK,CAAC;IACdnE,UAAU,EAAE+D,SAAS,CAACK,MAAM;IAC5BC,IAAI,EAAEN,SAAS,CAACC,MAAM;IACtBvD,IAAI,EAAEsD,SAAS,CAACC;AAClB,GAAC,CACH,CAAC;EACDM,SAAS,EAAEP,SAAS,CAACC,MAAM;AAAE;AAC7BO,EAAAA,gBAAgB,EAAER,SAAS,CAACS,IAAI;AAClC,CAAC;AAEDnC,cAAc,CAACoC,YAAY,GAAG;AAC5B3F,EAAAA,KAAK,EAAE;AACT,CAAC;;;;"}
|
package/dist/index.css
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
.lightening-card{
|
|
1
|
+
.lightening-card{height:100%;left:0;position:absolute;top:0;transform:translate(0);width:100%;z-index:100000}@media (max-width:768px){.lightening-card{z-index:100000}}
|
|
2
2
|
/*# sourceMappingURL=index.css.map */
|
package/dist/index.css.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["LighteningCard.css"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"sources":["LighteningCard.css"],"names":[],"mappings":"AAAA,iBAQE,WAAY,CAJZ,MAAQ,CAFR,iBAAkB,CAClB,KAAS,CAET,sBAA4B,CAE5B,UAAW,CANX,cAQF,CAEA,yBACE,iBACE,cACF,CACF","file":"index.css","sourcesContent":[".lightening-card {\r\n z-index: 100000;\r\n position: absolute;\r\n top: 0rem;\r\n left: 0%;\r\n transform: translate(0%, 0%);\r\n\r\n width: 100%;\r\n height: 100%;\r\n}\r\n\r\n@media (max-width: 768px) {\r\n .lightening-card {\r\n z-index: 100000;\r\n }\r\n}\r\n"]}
|