@everymatrix/casino-game-page 0.0.281 → 0.0.284
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/casino-game-page.js +1 -1
- package/dist/casino-game-page.js.map +1 -1
- package/package.json +2 -2
- package/src/CasinoGamePage.svelte +46 -15
- package/src/translations.js +12 -12
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@everymatrix/casino-game-page",
|
3
|
-
"version": "0.0.
|
3
|
+
"version": "0.0.284",
|
4
4
|
"main": "dist/casino-game-page.js",
|
5
5
|
"svelte": "src/index.ts",
|
6
6
|
"scripts": {
|
@@ -36,5 +36,5 @@
|
|
36
36
|
"publishConfig": {
|
37
37
|
"access": "public"
|
38
38
|
},
|
39
|
-
"gitHead": "
|
39
|
+
"gitHead": "3ac9350aedecfd71862267436a50699f50fc6a01"
|
40
40
|
}
|
@@ -48,8 +48,10 @@
|
|
48
48
|
let playerID:string;
|
49
49
|
let sessionID:string;
|
50
50
|
|
51
|
-
let
|
52
|
-
let
|
51
|
+
let panicButton:HTMLElement;
|
52
|
+
let panicLoading:boolean = false;
|
53
|
+
let timer: number = 0;
|
54
|
+
let timerInterval:any;
|
53
55
|
|
54
56
|
let game:any;
|
55
57
|
let detailsObtained:boolean = false;
|
@@ -373,14 +375,8 @@
|
|
373
375
|
}
|
374
376
|
}
|
375
377
|
|
376
|
-
const
|
377
|
-
|
378
|
-
|
379
|
-
panicButtonTimeout = setTimeout(() => {
|
380
|
-
panicLoading = false;
|
381
|
-
window.postMessage({ type: 'PanicButtonClicked' }, window.location.href);
|
382
|
-
}, 3000);
|
383
|
-
clearTimeout(panicButtonTimeout);
|
378
|
+
const panicAction = ():void => {
|
379
|
+
window.postMessage({type: 'PanicButtonClicked'}, window.location.href);
|
384
380
|
}
|
385
381
|
|
386
382
|
const refreshTime = ():void => {
|
@@ -442,17 +438,52 @@
|
|
442
438
|
}
|
443
439
|
}
|
444
440
|
|
441
|
+
const startInterval = (e:any):void => {
|
442
|
+
timer = 0;
|
443
|
+
|
444
|
+
timerInterval = setInterval(() => {
|
445
|
+
timer += 1;
|
446
|
+
panicLoading = true;
|
447
|
+
|
448
|
+
if (timer >= 3) {
|
449
|
+
clearInterval(timerInterval)
|
450
|
+
}
|
451
|
+
}, 1000);
|
452
|
+
}
|
453
|
+
|
454
|
+
const endInterval = (e:any):void => {
|
455
|
+
if (timer < 3) {
|
456
|
+
panicLoading = false;
|
457
|
+
}
|
458
|
+
clearInterval(timerInterval);
|
459
|
+
}
|
460
|
+
|
445
461
|
onMount(() => {
|
446
462
|
window.addEventListener('resize', resizeHandler, false);
|
447
463
|
window.addEventListener('message', messageHandler, false);
|
448
464
|
|
449
465
|
isOnNative = !!isNative(userAgent);
|
450
466
|
|
451
|
-
|
452
|
-
|
453
|
-
|
467
|
+
panicButton?.addEventListener("mousedown", startInterval, false);
|
468
|
+
panicButton?.addEventListener('touchstart', startInterval, false)
|
469
|
+
|
470
|
+
// on mouseup stop interval count
|
471
|
+
panicButton?.addEventListener("mouseup", endInterval, false);
|
472
|
+
panicButton?.addEventListener("touchend", endInterval, false);
|
473
|
+
|
474
|
+
return () => {
|
475
|
+
window.removeEventListener('resize', resizeHandler);
|
476
|
+
window.removeEventListener('message', messageHandler);
|
477
|
+
|
478
|
+
clearInterval(timeInterval);
|
479
|
+
|
480
|
+
panicButton?.removeEventListener("mousedown", startInterval);
|
481
|
+
panicButton?.removeEventListener('touchstart', startInterval)
|
482
|
+
|
483
|
+
// on mouseup stop interval count
|
484
|
+
panicButton?.removeEventListener("mouseup", endInterval);
|
485
|
+
panicButton?.removeEventListener("touchend", endInterval);
|
454
486
|
|
455
|
-
clearInterval(timeInterval);
|
456
487
|
}
|
457
488
|
});
|
458
489
|
|
@@ -508,7 +539,7 @@
|
|
508
539
|
<svg class="w-1 h-1" part="w-1 h-1" fill="none" stroke="white" width="34px" height="34px" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"></path></svg>
|
509
540
|
<p>{$_('gamePage.break')}</p>
|
510
541
|
</div>
|
511
|
-
<button class="
|
542
|
+
<button class="PanicButton" class:PanicButtonAnimation={panicLoading} part="PanicButton" bind:this={panicButton} on:click={() => panicAction()}>{$_('casinoPage.breakButton')}</button>
|
512
543
|
</div>
|
513
544
|
{/if}
|
514
545
|
<p>{time}</p>
|
package/src/translations.js
CHANGED
@@ -45,13 +45,13 @@ export const GamePageTranslations = {
|
|
45
45
|
},
|
46
46
|
es: {
|
47
47
|
gamePage: {
|
48
|
-
signIn: '
|
49
|
-
register: '
|
50
|
-
deposit: '
|
51
|
-
playForFun: '
|
52
|
-
playNow: '
|
53
|
-
break: '
|
54
|
-
breakButton: '24
|
48
|
+
signIn: 'Iniciar sesión',
|
49
|
+
register: 'REGISTRO',
|
50
|
+
deposit: 'Depósito',
|
51
|
+
playForFun: 'Juega por diversión',
|
52
|
+
playNow: 'Empezar ahora!',
|
53
|
+
break: 'Tómate un descanso de 1 día del juego.',
|
54
|
+
breakButton: 'Tómese un descanso de 24 horas del juego',
|
55
55
|
}
|
56
56
|
},
|
57
57
|
tr: {
|
@@ -122,13 +122,13 @@ export const GamePageTranslations = {
|
|
122
122
|
},
|
123
123
|
pt: {
|
124
124
|
gamePage: {
|
125
|
-
signIn: '
|
126
|
-
register: '
|
125
|
+
signIn: 'Entrar',
|
126
|
+
register: 'REGISTRO',
|
127
127
|
deposit: 'Depósito',
|
128
|
-
playForFun: '
|
128
|
+
playForFun: 'Jogue por diversão',
|
129
129
|
playNow: 'Comece agora!',
|
130
|
-
break: '
|
131
|
-
breakButton: '24
|
130
|
+
break: 'Faça uma pausa de 1 dia no jogo',
|
131
|
+
breakButton: 'Faça uma pausa de 24 horas no jogo',
|
132
132
|
}
|
133
133
|
},
|
134
134
|
sl: {
|