@everymatrix/casino-game-page 0.0.289 → 0.0.292
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 +97 -55
- package/src/translations.js +13 -26
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.292",
|
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": "c69fc04487b15c7c69d2a7c8943340d2a8b78c4f"
|
40
40
|
}
|
@@ -35,7 +35,6 @@
|
|
35
35
|
export let playforfun:string = 'true';
|
36
36
|
export let checksession:string = 'true';
|
37
37
|
export let integratedgameframe:string = 'false';
|
38
|
-
|
39
38
|
export let gameid:string = '';
|
40
39
|
|
41
40
|
let time:Object;
|
@@ -75,6 +74,7 @@
|
|
75
74
|
let buttonsContainer:HTMLElement;
|
76
75
|
let timeContainer:HTMLElement;
|
77
76
|
let isOnNative:boolean = false;
|
77
|
+
let showModal:string = 'false';
|
78
78
|
|
79
79
|
setupI18n({ withLocale: 'en', translations: {}});
|
80
80
|
|
@@ -91,6 +91,7 @@
|
|
91
91
|
// Maybe we should check if the session is valid, somehow?
|
92
92
|
if (sessionID && sessionID.length > 0) {
|
93
93
|
isLoggedIn = true;
|
94
|
+
isLoading = false;
|
94
95
|
|
95
96
|
url.searchParams.append('_sid', sessionID)
|
96
97
|
url.searchParams.append('funMode', 'false')
|
@@ -101,6 +102,7 @@
|
|
101
102
|
}
|
102
103
|
|
103
104
|
const createGameURL = (gameId:string, modal?):void => {
|
105
|
+
|
104
106
|
let url:URL = new URL(`${endpoint}/casino/games/${gameId}`);
|
105
107
|
|
106
108
|
url.searchParams.append('language', lang);
|
@@ -131,22 +133,50 @@
|
|
131
133
|
}
|
132
134
|
}
|
133
135
|
});
|
134
|
-
|
135
136
|
window.postMessage({ type: 'RequestModalSize' }, window.location.href);
|
136
137
|
}
|
137
138
|
|
139
|
+
const addEventsToDisplayedElements = () => {
|
140
|
+
panicButton?.addEventListener("mousedown", startInterval, false);
|
141
|
+
panicButton?.addEventListener('touchstart', startInterval, false)
|
142
|
+
|
143
|
+
// on mouseup stop interval count
|
144
|
+
panicButton?.addEventListener("mouseup", endInterval, false);
|
145
|
+
panicButton?.addEventListener("touchend", endInterval, false);
|
146
|
+
}
|
147
|
+
|
148
|
+
const removeEventsToDisplayedElements = ():void => {
|
149
|
+
panicLoading = false;
|
150
|
+
panicButton?.removeEventListener("mousedown", startInterval);
|
151
|
+
panicButton?.removeEventListener('touchstart', startInterval)
|
152
|
+
|
153
|
+
// on mouseup stop interval count
|
154
|
+
panicButton?.removeEventListener("mouseup", endInterval);
|
155
|
+
panicButton?.removeEventListener("touchend", endInterval);
|
156
|
+
}
|
157
|
+
|
138
158
|
const messageHandler = (e:any):void => {
|
139
159
|
switch (e.data.type) {
|
140
160
|
case 'GameLaunchID':
|
141
161
|
createGameURL(e.data.gameId, true);
|
142
162
|
break;
|
143
163
|
|
164
|
+
case 'ShowGameModal':
|
165
|
+
showModal = 'true';
|
166
|
+
break;
|
167
|
+
|
168
|
+
case 'OpenGameFrame':
|
169
|
+
showModal = 'true';
|
170
|
+
break;
|
171
|
+
|
144
172
|
case 'LaunchGameFrame':
|
145
173
|
openGameFrame(e.data.gameId, e.data.gameFunMode);
|
146
174
|
break;
|
147
175
|
|
148
176
|
case 'ModalClosed':
|
149
177
|
// the timeout is necessary in order to sync with the closing of the modal frame and provide a smoother transition
|
178
|
+
showModal = 'false';
|
179
|
+
removeEventsToDisplayedElements();
|
150
180
|
setTimeout(() => { detailsObtained = integratedgameframe === "true";}, 500);
|
151
181
|
break;
|
152
182
|
|
@@ -375,10 +405,6 @@
|
|
375
405
|
}
|
376
406
|
}
|
377
407
|
|
378
|
-
const panicAction = ():void => {
|
379
|
-
window.postMessage({type: 'PanicButtonClicked'}, window.location.href);
|
380
|
-
}
|
381
|
-
|
382
408
|
const refreshTime = ():void => {
|
383
409
|
if (clockformat) {
|
384
410
|
time = moment().format(clockformat);
|
@@ -394,7 +420,6 @@
|
|
394
420
|
const setActiveLanguage = ():void => {
|
395
421
|
setLocale(lang);
|
396
422
|
|
397
|
-
isLoading = false;
|
398
423
|
mobileView = isMobile(userAgent);
|
399
424
|
}
|
400
425
|
|
@@ -412,6 +437,7 @@
|
|
412
437
|
sessionID = session;
|
413
438
|
isLoggedIn = true;
|
414
439
|
}
|
440
|
+
|
415
441
|
}
|
416
442
|
|
417
443
|
const setClientStyling = ():void => {
|
@@ -446,6 +472,7 @@
|
|
446
472
|
panicLoading = true;
|
447
473
|
|
448
474
|
if (timer >= 3) {
|
475
|
+
window.postMessage({type: 'PanicButtonClicked'}, window.location.href);
|
449
476
|
clearInterval(timerInterval)
|
450
477
|
}
|
451
478
|
}, 1000);
|
@@ -461,29 +488,12 @@
|
|
461
488
|
onMount(() => {
|
462
489
|
window.addEventListener('resize', resizeHandler, false);
|
463
490
|
window.addEventListener('message', messageHandler, false);
|
464
|
-
|
465
491
|
isOnNative = !!isNative(userAgent);
|
466
492
|
|
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
493
|
return () => {
|
494
|
+
removeEventsToDisplayedElements();
|
475
495
|
window.removeEventListener('resize', resizeHandler);
|
476
496
|
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);
|
486
|
-
|
487
497
|
}
|
488
498
|
});
|
489
499
|
|
@@ -493,8 +503,10 @@
|
|
493
503
|
$: checksession == 'false' && session && endpoint && setSession();
|
494
504
|
$: clientstyling && setClientStyling();
|
495
505
|
$: clientstylingurl && setClientStylingURL();
|
506
|
+
$: (showModal == 'true') && panicButton && addEventsToDisplayedElements();
|
496
507
|
</script>
|
497
508
|
|
509
|
+
|
498
510
|
{#if isLoading}
|
499
511
|
<p class="SearchLoading" part="SearchLoading">Loading, please wait ...</p>
|
500
512
|
{:else}
|
@@ -507,13 +519,13 @@
|
|
507
519
|
{#if isLoggedIn}
|
508
520
|
{#if favorites == 'true'}
|
509
521
|
{#if game.isFavored}
|
510
|
-
<div class="FavIconContainer" part="FavIconContainer" on:click="{() => toggleFavoriteGame(game.id)}">
|
522
|
+
<div class="FavIconContainer {haspanicbutton == 'true' ? 'FavIconPanicButton' : ''}" part="FavIconContainer {haspanicbutton == 'true' ? 'FavIconPanicButton' : ''}" on:click="{() => toggleFavoriteGame(game.id)}">
|
511
523
|
<svg version="1.1" class="FavoredIcon" part="FavoredIcon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 19.481 19.481" xmlns:xlink="http://www.w3.org/1999/xlink" enable-background="new 0 0 19.481 19.481">
|
512
524
|
<path style="fill: white" d="m10.201,.758l2.478,5.865 6.344,.545c0.44,0.038 0.619,0.587 0.285,0.876l-4.812,4.169 1.442,6.202c0.1,0.431-0.367,0.77-0.745,0.541l-5.452-3.288-5.452,3.288c-0.379,0.228-0.845-0.111-0.745-0.541l1.442-6.202-4.813-4.17c-0.334-0.289-0.156-0.838 0.285-0.876l6.344-.545 2.478-5.864c0.172-0.408 0.749-0.408 0.921,0z"/>
|
513
525
|
</svg>
|
514
526
|
</div>
|
515
527
|
{:else}
|
516
|
-
<div class="FavIconContainer" part="FavIconContainer" on:click="{() => toggleFavoriteGame(game.id)}">
|
528
|
+
<div class="FavIconContainer {haspanicbutton == 'true' ? 'FavIconPanicButton' : ''}" part="FavIconContainer {haspanicbutton == 'true' ? 'FavIconPanicButton' : ''}" on:click="{() => toggleFavoriteGame(game.id)}">
|
517
529
|
<svg version="1.1" class="UnfavoredIcon" part="UnfavoredIcon" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="20px" y="20px"
|
518
530
|
viewBox="0 0 512.001 512.001" style="enable-background:new 0 0 512.001 512.001;" xml:space="preserve"><path style="fill: white" d="M511.266,197.256c-1.764-5.431-6.458-9.388-12.108-10.209l-158.722-23.065L269.452,20.155
|
519
531
|
c-2.527-5.12-7.741-8.361-13.451-8.361c-5.709,0-10.924,3.242-13.451,8.361l-70.988,143.828L12.843,187.047
|
@@ -536,11 +548,7 @@
|
|
536
548
|
</div>
|
537
549
|
{#if haspanicbutton === "true"}
|
538
550
|
<div class="PanicSection {(getDevice(userAgent) !== 'PC') ? 'PanicSectionMobile' : ''}" part="PanicSection {(getDevice(userAgent) !== 'PC') ? 'PanicSectionMobile' : ''}">
|
539
|
-
<
|
540
|
-
<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>
|
541
|
-
<p>{$_('gamePage.break')}</p>
|
542
|
-
</div>
|
543
|
-
<button class="PanicButton" class:PanicButtonAnimation={panicLoading} part="PanicButton" bind:this={panicButton} on:click={() => panicAction()}>{$_('casinoPage.breakButton')}</button>
|
551
|
+
<button class="PanicButton {(getDevice(userAgent) !== 'PC') ? 'PanicButtonMobile' : ''}" class:PanicButtonAnimation={panicLoading} part="PanicButton {(getDevice(userAgent) !== 'PC') ? 'PanicButtonMobile' : ''}" bind:this={panicButton}>{$_('gamePage.breakButton')}</button>
|
544
552
|
</div>
|
545
553
|
{/if}
|
546
554
|
<p>{time}</p>
|
@@ -556,7 +564,6 @@
|
|
556
564
|
<button class="FullWidthButton" part="FullWidthButton" on:click='{() => {openGameWindow(game)}}'>{$_('gamePage.playForFun')}</button>
|
557
565
|
<p>{time}</p>
|
558
566
|
</div>
|
559
|
-
|
560
567
|
{:else}
|
561
568
|
<div class="GameDetails" part="GameDetails">
|
562
569
|
<h3>{game.name}</h3>
|
@@ -578,9 +585,7 @@
|
|
578
585
|
<p class="Time" part="Time" bind:this={timeContainer}><span>{time}</span></p>
|
579
586
|
{#if haspanicbutton === "true"}
|
580
587
|
<div class="PanicSection" part="PanicSection">
|
581
|
-
<
|
582
|
-
<p>{$_('gamePage.break')}</p>
|
583
|
-
<button class="Button" part="Button" on:click={() => panicAction()}>{$_('gamePage.breakButton')}</button>
|
588
|
+
<button class="Button" class:PanicButtonAnimation={panicLoading} part="Button" bind:this={panicButton}>{$_('gamePage.breakButton')}</button>
|
584
589
|
</div>
|
585
590
|
{/if}
|
586
591
|
{#if isFullscreen}
|
@@ -781,41 +786,78 @@
|
|
781
786
|
left: 15px;
|
782
787
|
cursor: pointer;
|
783
788
|
}
|
784
|
-
|
785
|
-
|
786
|
-
margin:
|
787
|
-
}
|
788
|
-
.PanicText {
|
789
|
-
display: flex;
|
790
|
-
align-items: center;
|
789
|
+
|
790
|
+
.FavIconPanicButton {
|
791
|
+
margin-top: 45px;
|
791
792
|
}
|
793
|
+
|
792
794
|
.PanicSection {
|
793
795
|
display: flex;
|
794
796
|
align-items: center;
|
795
797
|
gap: 10px;
|
796
798
|
margin: 20px 0;
|
797
799
|
|
798
|
-
svg {
|
799
|
-
fill: none;
|
800
|
-
}
|
801
|
-
p {
|
802
|
-
font-size: 16px;
|
803
|
-
color: var(--emfe-w-color-white, #FFFFFF);
|
804
|
-
}
|
805
800
|
.Button {
|
806
801
|
border-radius: 5px;
|
807
802
|
border: 1px solid var(--emfe-w-color-primary, #D0046C);
|
808
803
|
background-color: var(--emfe-w-color-primary, #D0046C);
|
809
|
-
width:
|
804
|
+
width: 280px;
|
810
805
|
height: 60px;
|
811
806
|
color: var(--emfe-w-color-white, #FFFFFF);
|
812
807
|
cursor: pointer;
|
813
808
|
}
|
814
809
|
}
|
815
810
|
|
811
|
+
// the use of !important is necessary in order to override margin from .PanicSection
|
812
|
+
.PanicSectionMobile {
|
813
|
+
position: absolute;
|
814
|
+
top: 0;
|
815
|
+
left: 0;
|
816
|
+
width: 100%;
|
817
|
+
text-align: center;
|
818
|
+
margin: 10px 0 0 0 !important;
|
819
|
+
}
|
820
|
+
|
821
|
+
.PanicButtonMobile {
|
822
|
+
border-radius: 5px;
|
823
|
+
margin: 0 10px;
|
824
|
+
border: 1px solid var(--emfe-w-color-primary, #D0046C);
|
825
|
+
background-color: var(--emfe-w-color-primary, #D0046C);
|
826
|
+
width: 100% !important;
|
827
|
+
height: 30px;
|
828
|
+
color: var(--emfe-w-color-white, #FFFFFF);
|
829
|
+
cursor: pointer;
|
830
|
+
}
|
831
|
+
|
816
832
|
.PanicButtonAnimation {
|
817
|
-
|
818
|
-
|
819
|
-
|
833
|
+
background: -webkit-linear-gradient(
|
834
|
+
135deg,
|
835
|
+
rgba(20, 20, 20, 0) 55%, rgba(20, 20, 20, 0.3) 100%
|
836
|
+
);
|
837
|
+
|
838
|
+
background: -moz-linear-gradient(
|
839
|
+
135deg,
|
840
|
+
rgba(20, 20, 20, 0) 55%, rgba(20, 20, 20, 0.3) 100%
|
841
|
+
);
|
842
|
+
|
843
|
+
background: -o-linear-gradient(
|
844
|
+
135deg,
|
845
|
+
rgba(20, 20, 20, 0) 55%, rgba(20, 20, 20, 0.3) 100%
|
846
|
+
);
|
847
|
+
|
848
|
+
background-color: var(--emfe-w-color-primary, #D0046C);
|
849
|
+
width: 280px;
|
850
|
+
color: #fff;
|
851
|
+
|
852
|
+
-webkit-animation: bar-animation 2s linear;
|
853
|
+
}
|
854
|
+
|
855
|
+
@-webkit-keyframes bar-animation {
|
856
|
+
0% {
|
857
|
+
background-position: 0;
|
858
|
+
}
|
859
|
+
100% {
|
860
|
+
background-position: 280px;
|
861
|
+
}
|
820
862
|
}
|
821
|
-
</style>
|
863
|
+
</style>
|
package/src/translations.js
CHANGED
@@ -6,8 +6,7 @@ export const GamePageTranslations = {
|
|
6
6
|
deposit: 'Deposit',
|
7
7
|
playForFun: 'Play for fun',
|
8
8
|
playNow: 'Start now!',
|
9
|
-
|
10
|
-
breakButton: '24-hour Cool Off',
|
9
|
+
breakButton: 'Hold button for 3 seconds to take 24-hours instant lock',
|
11
10
|
}
|
12
11
|
},
|
13
12
|
de: {
|
@@ -17,8 +16,7 @@ export const GamePageTranslations = {
|
|
17
16
|
deposit: 'Einzahlung',
|
18
17
|
playForFun: 'Play for fun',
|
19
18
|
playNow: 'Jetzt starten!',
|
20
|
-
|
21
|
-
breakButton: '24 Stunden Auszeit',
|
19
|
+
breakButton: 'Für 24 Std. Games Sofortpause, 3 Sekunden drücken',
|
22
20
|
}
|
23
21
|
},
|
24
22
|
it: {
|
@@ -28,8 +26,7 @@ export const GamePageTranslations = {
|
|
28
26
|
deposit: 'Deposito',
|
29
27
|
playForFun: 'Play for fun',
|
30
28
|
playNow: 'Inizia ora!',
|
31
|
-
|
32
|
-
breakButton: '24-hour Cool Off',
|
29
|
+
breakButton: 'Prenditi 1 giorno di pausa dal gioco - 24-hour Cool Off',
|
33
30
|
}
|
34
31
|
},
|
35
32
|
fr: {
|
@@ -50,8 +47,7 @@ export const GamePageTranslations = {
|
|
50
47
|
deposit: 'Depósito',
|
51
48
|
playForFun: 'Juega por diversión',
|
52
49
|
playNow: 'Empezar ahora!',
|
53
|
-
|
54
|
-
breakButton: 'Tómese un descanso de 24 horas del juego',
|
50
|
+
breakButton: 'Tómese 1 día de descanso de jugar - Tómese un descanso de 24 horas del juego',
|
55
51
|
}
|
56
52
|
},
|
57
53
|
tr: {
|
@@ -61,8 +57,7 @@ export const GamePageTranslations = {
|
|
61
57
|
deposit: 'DEPOZİTO',
|
62
58
|
playForFun: 'EĞLENCE İÇİN OYNA',
|
63
59
|
playNow: 'ŞİMDİ OYNA',
|
64
|
-
|
65
|
-
breakButton: '24-hour Cool Off',
|
60
|
+
breakButton: 'Oyuna 1 gün ara verin - 24-hour Cool Off',
|
66
61
|
}
|
67
62
|
},
|
68
63
|
ru: {
|
@@ -72,8 +67,7 @@ export const GamePageTranslations = {
|
|
72
67
|
deposit: 'ДЕПОЗИТ',
|
73
68
|
playForFun: 'ИГРАЙТЕ ДЛЯ УДОВОЛЬСТВИЯ',
|
74
69
|
playNow: 'ИГРАТЬ СЕЙЧАС',
|
75
|
-
|
76
|
-
breakButton: '24-hour Cool Off',
|
70
|
+
breakButton: 'Сделайте 1 день перерыва в игре - 24-hour Cool Off',
|
77
71
|
}
|
78
72
|
},
|
79
73
|
ro: {
|
@@ -83,8 +77,7 @@ export const GamePageTranslations = {
|
|
83
77
|
deposit: 'DEPOZITEAZA',
|
84
78
|
playForFun: 'JOACĂ PENTRU DISTRACTIE',
|
85
79
|
playNow: 'JOACĂ ACUM',
|
86
|
-
|
87
|
-
breakButton: '24-hour Cool Off',
|
80
|
+
breakButton: 'Luați o pauză de la joc - 24-hour Cool Off',
|
88
81
|
}
|
89
82
|
},
|
90
83
|
hr: {
|
@@ -94,8 +87,7 @@ export const GamePageTranslations = {
|
|
94
87
|
deposit: 'Uplata',
|
95
88
|
playForFun: 'Igraj za zabavu',
|
96
89
|
playNow: 'Započnite sada!',
|
97
|
-
|
98
|
-
breakButton: '24-hour Cool Off',
|
90
|
+
breakButton: 'Hold button for 3 seconds to take 24-hours instant lock',
|
99
91
|
}
|
100
92
|
},
|
101
93
|
hu: {
|
@@ -105,8 +97,7 @@ export const GamePageTranslations = {
|
|
105
97
|
deposit: 'Befizetés',
|
106
98
|
playForFun: 'Play for fun',
|
107
99
|
playNow: 'Játsszon most!',
|
108
|
-
|
109
|
-
breakButton: '24-hour Cool Off',
|
100
|
+
breakButton: 'Hold button for 3 seconds to take 24-hours instant lock',
|
110
101
|
}
|
111
102
|
},
|
112
103
|
pl: {
|
@@ -116,8 +107,7 @@ export const GamePageTranslations = {
|
|
116
107
|
deposit: 'Wpłata',
|
117
108
|
playForFun: 'Graj dla zabawy',
|
118
109
|
playNow: 'Rozpocznij teraz!',
|
119
|
-
|
120
|
-
breakButton: '24-hour Cool Off',
|
110
|
+
breakButton: 'Hold button for 3 seconds to take 24-hours instant lock',
|
121
111
|
}
|
122
112
|
},
|
123
113
|
pt: {
|
@@ -127,8 +117,7 @@ export const GamePageTranslations = {
|
|
127
117
|
deposit: 'Depósito',
|
128
118
|
playForFun: 'Jogue por diversão',
|
129
119
|
playNow: 'Comece agora!',
|
130
|
-
|
131
|
-
breakButton: 'Faça uma pausa de 24 horas no jogo',
|
120
|
+
breakButton: 'Faça uma pausa de 1 dia no jogo - Faça uma pausa de 24 horas no jogo',
|
132
121
|
}
|
133
122
|
},
|
134
123
|
sl: {
|
@@ -138,8 +127,7 @@ export const GamePageTranslations = {
|
|
138
127
|
deposit: 'Vplačilo',
|
139
128
|
playForFun: 'Igrajte za zabavo',
|
140
129
|
playNow: 'Začnite zdaj!',
|
141
|
-
|
142
|
-
breakButton: '24-hour Cool Off',
|
130
|
+
breakButton: 'Hold button for 3 seconds to take 24-hours instant lock',
|
143
131
|
}
|
144
132
|
},
|
145
133
|
sr: {
|
@@ -149,8 +137,7 @@ export const GamePageTranslations = {
|
|
149
137
|
deposit: 'Uplata',
|
150
138
|
playForFun: 'Igraj za zabavu',
|
151
139
|
playNow: 'Započnite sada!',
|
152
|
-
|
153
|
-
breakButton: '24-hour Cool Off',
|
140
|
+
breakButton: 'Hold button for 3 seconds to take 24-hours instant lock',
|
154
141
|
}
|
155
142
|
}
|
156
143
|
};
|