@everymatrix/casino-game-page 0.0.289 → 0.0.290
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 +89 -39
- 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.290",
|
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": "88cef54931a3357b0ae9a20f4fa09091e1f8bb73"
|
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,46 @@
|
|
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
|
+
|
144
168
|
case 'LaunchGameFrame':
|
145
169
|
openGameFrame(e.data.gameId, e.data.gameFunMode);
|
146
170
|
break;
|
147
171
|
|
148
172
|
case 'ModalClosed':
|
149
173
|
// the timeout is necessary in order to sync with the closing of the modal frame and provide a smoother transition
|
174
|
+
showModal = 'false';
|
175
|
+
removeEventsToDisplayedElements();
|
150
176
|
setTimeout(() => { detailsObtained = integratedgameframe === "true";}, 500);
|
151
177
|
break;
|
152
178
|
|
@@ -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 => {
|
@@ -461,29 +487,11 @@
|
|
461
487
|
onMount(() => {
|
462
488
|
window.addEventListener('resize', resizeHandler, false);
|
463
489
|
window.addEventListener('message', messageHandler, false);
|
464
|
-
|
465
490
|
isOnNative = !!isNative(userAgent);
|
466
491
|
|
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
492
|
return () => {
|
475
493
|
window.removeEventListener('resize', resizeHandler);
|
476
494
|
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
495
|
}
|
488
496
|
});
|
489
497
|
|
@@ -493,8 +501,10 @@
|
|
493
501
|
$: checksession == 'false' && session && endpoint && setSession();
|
494
502
|
$: clientstyling && setClientStyling();
|
495
503
|
$: clientstylingurl && setClientStylingURL();
|
504
|
+
$: (showModal == 'true') && panicButton && addEventsToDisplayedElements();
|
496
505
|
</script>
|
497
506
|
|
507
|
+
|
498
508
|
{#if isLoading}
|
499
509
|
<p class="SearchLoading" part="SearchLoading">Loading, please wait ...</p>
|
500
510
|
{:else}
|
@@ -507,13 +517,13 @@
|
|
507
517
|
{#if isLoggedIn}
|
508
518
|
{#if favorites == 'true'}
|
509
519
|
{#if game.isFavored}
|
510
|
-
<div class="FavIconContainer" part="FavIconContainer" on:click="{() => toggleFavoriteGame(game.id)}">
|
520
|
+
<div class="FavIconContainer {haspanicbutton == 'true' ? 'FavIconPanicButton' : ''}" part="FavIconContainer {haspanicbutton == 'true' ? 'FavIconPanicButton' : ''}" on:click="{() => toggleFavoriteGame(game.id)}">
|
511
521
|
<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
522
|
<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
523
|
</svg>
|
514
524
|
</div>
|
515
525
|
{:else}
|
516
|
-
<div class="FavIconContainer" part="FavIconContainer" on:click="{() => toggleFavoriteGame(game.id)}">
|
526
|
+
<div class="FavIconContainer {haspanicbutton == 'true' ? 'FavIconPanicButton' : ''}" part="FavIconContainer {haspanicbutton == 'true' ? 'FavIconPanicButton' : ''}" on:click="{() => toggleFavoriteGame(game.id)}">
|
517
527
|
<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
528
|
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
529
|
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 +546,7 @@
|
|
536
546
|
</div>
|
537
547
|
{#if haspanicbutton === "true"}
|
538
548
|
<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>
|
549
|
+
<button class="PanicButton {(getDevice(userAgent) !== 'PC') ? 'PanicButtonMobile' : ''}" class:PanicButtonAnimation={panicLoading} part="PanicButton {(getDevice(userAgent) !== 'PC') ? 'PanicButtonMobile' : ''}" bind:this={panicButton} on:click={() => panicAction()}>{$_('gamePage.breakButton')}</button>
|
544
550
|
</div>
|
545
551
|
{/if}
|
546
552
|
<p>{time}</p>
|
@@ -556,7 +562,6 @@
|
|
556
562
|
<button class="FullWidthButton" part="FullWidthButton" on:click='{() => {openGameWindow(game)}}'>{$_('gamePage.playForFun')}</button>
|
557
563
|
<p>{time}</p>
|
558
564
|
</div>
|
559
|
-
|
560
565
|
{:else}
|
561
566
|
<div class="GameDetails" part="GameDetails">
|
562
567
|
<h3>{game.name}</h3>
|
@@ -578,9 +583,7 @@
|
|
578
583
|
<p class="Time" part="Time" bind:this={timeContainer}><span>{time}</span></p>
|
579
584
|
{#if haspanicbutton === "true"}
|
580
585
|
<div class="PanicSection" part="PanicSection">
|
581
|
-
<
|
582
|
-
<p>{$_('gamePage.break')}</p>
|
583
|
-
<button class="Button" part="Button" on:click={() => panicAction()}>{$_('gamePage.breakButton')}</button>
|
586
|
+
<button class="Button" class:PanicButtonAnimation={panicLoading} part="Button" bind:this={panicButton} on:click={() => panicAction()}>{$_('gamePage.breakButton')}</button>
|
584
587
|
</div>
|
585
588
|
{/if}
|
586
589
|
{#if isFullscreen}
|
@@ -781,10 +784,11 @@
|
|
781
784
|
left: 15px;
|
782
785
|
cursor: pointer;
|
783
786
|
}
|
784
|
-
|
785
|
-
|
786
|
-
margin:
|
787
|
+
|
788
|
+
.FavIconPanicButton {
|
789
|
+
margin-top: 40px;
|
787
790
|
}
|
791
|
+
|
788
792
|
.PanicText {
|
789
793
|
display: flex;
|
790
794
|
align-items: center;
|
@@ -813,9 +817,55 @@
|
|
813
817
|
}
|
814
818
|
}
|
815
819
|
|
820
|
+
// the use of !important is necessary in order to override margin from .PanicSection
|
821
|
+
.PanicSectionMobile {
|
822
|
+
position: absolute;
|
823
|
+
top: 0;
|
824
|
+
left: 0;
|
825
|
+
width: 100%;
|
826
|
+
text-align: center;
|
827
|
+
margin: 10px 0 0 0 !important;
|
828
|
+
}
|
829
|
+
|
830
|
+
.PanicButtonMobile {
|
831
|
+
border-radius: 5px;
|
832
|
+
margin: 0 10px;
|
833
|
+
border: 1px solid var(--emfe-w-color-primary, #D0046C);
|
834
|
+
background-color: var(--emfe-w-color-primary, #D0046C);
|
835
|
+
width: 100% !important;
|
836
|
+
height: 30px;
|
837
|
+
color: var(--emfe-w-color-white, #FFFFFF);
|
838
|
+
cursor: pointer;
|
839
|
+
}
|
840
|
+
|
816
841
|
.PanicButtonAnimation {
|
817
|
-
|
818
|
-
|
819
|
-
|
842
|
+
background: -webkit-linear-gradient(
|
843
|
+
135deg,
|
844
|
+
#FD2839 5%, #D0046C 100%
|
845
|
+
);
|
846
|
+
|
847
|
+
background: -moz-linear-gradient(
|
848
|
+
135deg,
|
849
|
+
#FD2839 5%, #D0046C 100%
|
850
|
+
);
|
851
|
+
|
852
|
+
background: -o-linear-gradient(
|
853
|
+
135deg,
|
854
|
+
#FD2839 5%, #D0046C 100%
|
855
|
+
);
|
856
|
+
|
857
|
+
width: 240px;
|
858
|
+
color: #fff;
|
859
|
+
|
860
|
+
-webkit-animation: bar-animation 2s linear;
|
861
|
+
}
|
862
|
+
|
863
|
+
@-webkit-keyframes bar-animation {
|
864
|
+
0% {
|
865
|
+
background-position: 0;
|
866
|
+
}
|
867
|
+
100% {
|
868
|
+
background-position: 240px;
|
869
|
+
}
|
820
870
|
}
|
821
|
-
</style>
|
871
|
+
</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: 'Take 1 day break from playing - 24-hour Cool Off',
|
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: 'Take 1 day break from playing - 24 Stunden Auszeit',
|
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: 'Take 1 day break from playing - 24-hour Cool Off',
|
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: 'Take 1 day break from playing - 24-hour Cool Off',
|
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: 'Take 1 day break from playing - 24-hour Cool Off',
|
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: 'Take 1 day break from playing - 24-hour Cool Off',
|
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: 'Take 1 day break from playing - 24-hour Cool Off',
|
154
141
|
}
|
155
142
|
}
|
156
143
|
};
|