@everymatrix/casino-random-game 1.29.4 → 1.29.6
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/CHANGELOG.md +6 -0
- package/dist/casino-random-game.js +31 -26
- package/dist/casino-random-game.js.map +1 -1
- package/package.json +2 -2
- package/src/CasinoRandomGame.svelte +51 -33
- package/src/translations.js +22 -11
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@everymatrix/casino-random-game",
|
|
3
|
-
"version": "1.29.
|
|
3
|
+
"version": "1.29.6",
|
|
4
4
|
"main": "dist/casino-random-game.js",
|
|
5
5
|
"svelte": "src/index.ts",
|
|
6
6
|
"scripts": {
|
|
@@ -35,5 +35,5 @@
|
|
|
35
35
|
"publishConfig": {
|
|
36
36
|
"access": "public"
|
|
37
37
|
},
|
|
38
|
-
"gitHead": "
|
|
38
|
+
"gitHead": "a67714e03295f6cdb76990ce33c8baeec7819b9f"
|
|
39
39
|
}
|
|
@@ -23,6 +23,8 @@
|
|
|
23
23
|
let offset:number = 0;
|
|
24
24
|
let count:number = 0;
|
|
25
25
|
let slotDone:boolean = false;
|
|
26
|
+
let hasRandomGames:boolean = false;
|
|
27
|
+
let intervalId:number;
|
|
26
28
|
|
|
27
29
|
let userAgent:string = window.navigator.userAgent;
|
|
28
30
|
let customStylingContainer:HTMLElement;
|
|
@@ -55,20 +57,24 @@
|
|
|
55
57
|
show = true;
|
|
56
58
|
}
|
|
57
59
|
|
|
58
|
-
let intervalId;
|
|
59
60
|
const getRandomGame = (refresh?:boolean):void => {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
61
|
+
if (hasRandomGames) {
|
|
62
|
+
randomizeGame();
|
|
63
|
+
clearInterval(intervalId);
|
|
64
|
+
intervalId = setInterval(() => {
|
|
65
|
+
offset -= 75;
|
|
66
|
+
count++;
|
|
67
|
+
|
|
68
|
+
if (count == 20) {
|
|
69
|
+
slotDone = true;
|
|
70
|
+
clearInterval(intervalId);
|
|
71
|
+
}
|
|
72
|
+
}, 150);
|
|
66
73
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
}, 150);
|
|
74
|
+
} else {
|
|
75
|
+
show = true;
|
|
76
|
+
slotDone = true;
|
|
77
|
+
}
|
|
72
78
|
|
|
73
79
|
if(refresh){
|
|
74
80
|
//Analytics event
|
|
@@ -131,8 +137,17 @@
|
|
|
131
137
|
.then((res:any) => res.json())
|
|
132
138
|
.then((data:any) => {
|
|
133
139
|
games = data.items;
|
|
134
|
-
|
|
135
|
-
|
|
140
|
+
if (games.length) {
|
|
141
|
+
gamesToShow = games.slice(0, 19);
|
|
142
|
+
hasRandomGames = true;
|
|
143
|
+
} else {
|
|
144
|
+
gamesToShow = [];
|
|
145
|
+
hasRandomGames = false;
|
|
146
|
+
}
|
|
147
|
+
}).catch((err:any) => {
|
|
148
|
+
console.log(err);
|
|
149
|
+
hasRandomGames = false;
|
|
150
|
+
});;
|
|
136
151
|
}
|
|
137
152
|
|
|
138
153
|
const setActiveLanguage = () => {
|
|
@@ -162,7 +177,6 @@
|
|
|
162
177
|
$: lang && setActiveLanguage();
|
|
163
178
|
$: translationurl && setTranslationUrl();
|
|
164
179
|
$: endpoint && datasource && fetchGameList();
|
|
165
|
-
$: endpoint && datasource && filteredrandomgamecategories && fetchGameList();
|
|
166
180
|
$: clientstyling && customStylingContainer && setClientStyling();
|
|
167
181
|
$: clientstylingurl && customStylingContainer && setClientStylingURL();
|
|
168
182
|
</script>
|
|
@@ -193,29 +207,33 @@
|
|
|
193
207
|
{/if}
|
|
194
208
|
|
|
195
209
|
{#if slotDone}
|
|
196
|
-
|
|
197
|
-
<div class="
|
|
198
|
-
<
|
|
199
|
-
|
|
200
|
-
<
|
|
201
|
-
<
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
<
|
|
210
|
-
|
|
211
|
-
|
|
210
|
+
{#if hasRandomGames}
|
|
211
|
+
<div class="RandomGameWrapper">
|
|
212
|
+
<div class="item">
|
|
213
|
+
<img class="RandomGameImage" src={randomGame.thumbnail} alt={randomGame.name} title={randomGame.name}/>
|
|
214
|
+
<button class="RandomTryAgain" on:click={() => getRandomGame(true)}>
|
|
215
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" id="Layer_1" x="0px" y="0px" viewBox="0 0 200 200" style="enable-background:new 0 0 200 200;" xml:space="preserve">
|
|
216
|
+
<style type="text/css">
|
|
217
|
+
.st0{fill:var(--emfe-w-button-typography, var(--emfe-w-color-white, #FFFFFF));}
|
|
218
|
+
</style>
|
|
219
|
+
<path class="st0" d="M162.4,161.2C145.3,178.5,122.7,187,100,187c-19.1,0-38.2-6.2-54-18.4l2.2,24c0.4,3.6-2.4,6.9-6,7.3h-0.7 c-3.3,0-6.2-2.7-6.7-6l-3.8-41.1c-0.4-3.6,2.4-6.9,6-7.3l40.9-3.8c3.6-0.4,6.9,2.4,7.3,6c0.4,3.6-2.4,6.9-6,7.3l-26,2.4 c29.3,23.3,72.4,21.6,99.5-5.6c19.8-19.8,26.9-48.7,18.4-75.3c-1.1-3.6,0.9-7.3,4.4-8.4c3.6-1.1,7.3,0.9,8.4,4.4 C194,103.9,185.8,137.9,162.4,161.2L162.4,161.2z M47.1,47.9c27.1-27.1,70.2-29.1,99.5-5.6l-26,2.4c-3.6,0.4-6.4,3.6-6,7.3 c0.2,3.6,3.3,6,6.7,6h0.7l40.9-3.8c3.6-0.4,6.4-3.6,6-7.3l-4-41.1c-0.4-3.6-3.6-6.4-7.3-6c-3.6,0.4-6.4,3.6-6,7.3l2.2,24 C119.3,4.4,69.3,6.8,37.6,38.6C14.2,61.9,6,95.9,15.8,127.2c0.9,2.9,3.6,4.7,6.4,4.7c0.7,0,1.3,0,2-0.2c3.6-1.1,5.6-4.9,4.4-8.4 C20.2,96.6,27.4,67.7,47.1,47.9L47.1,47.9z"/>
|
|
220
|
+
</svg>
|
|
221
|
+
</button>
|
|
222
|
+
</div>
|
|
223
|
+
<div class="RandomGameDetails">
|
|
224
|
+
<p class="RandomGameTitle">{randomGame.name}</p>
|
|
225
|
+
<p class="RandomGameVendor">{randomGame.vendor.name}</p>
|
|
226
|
+
<button class="RandomGamePlay" on:click={() => playGame()}>{$_('playNowRandomGame')}</button>
|
|
227
|
+
</div>
|
|
212
228
|
</div>
|
|
213
|
-
|
|
229
|
+
{:else}
|
|
230
|
+
<p class="RandomGameLoading">{$_('noGames')}</p>
|
|
231
|
+
{/if}
|
|
214
232
|
{/if}
|
|
215
|
-
|
|
216
233
|
</div>
|
|
217
234
|
</div>
|
|
218
235
|
{/if}
|
|
236
|
+
|
|
219
237
|
<div class="RandomButtonWrapper">
|
|
220
238
|
<button class="RandomButton" on:click={() => getRandomGame()}>
|
|
221
239
|
{#if buttontext}
|
package/src/translations.js
CHANGED
|
@@ -2,56 +2,67 @@ export const TRANSLATIONS = {
|
|
|
2
2
|
"en": {
|
|
3
3
|
"playRandomGame": "Play a random game",
|
|
4
4
|
"randomGameLoading": "Selecting ...",
|
|
5
|
-
"playNowRandomGame": "Play Now"
|
|
5
|
+
"playNowRandomGame": "Play Now",
|
|
6
|
+
"noGames": "There are no random games to play"
|
|
6
7
|
},
|
|
7
8
|
"zh-hk": {
|
|
8
9
|
"playRandomGame": "玩隨機遊戲",
|
|
9
10
|
"randomGameLoading": "選擇...",
|
|
10
|
-
"playNowRandomGame": "現在播放"
|
|
11
|
+
"playNowRandomGame": "現在播放",
|
|
12
|
+
"noGames": "There are no random games to play"
|
|
11
13
|
},
|
|
12
14
|
"de": {
|
|
13
15
|
"playRandomGame": "Spiel ein Zufallsspiel",
|
|
14
16
|
"randomGameLoading": "Auswahl läuft",
|
|
15
|
-
"playNowRandomGame": "Jetzt spielen"
|
|
17
|
+
"playNowRandomGame": "Jetzt spielen",
|
|
18
|
+
"noGames": "There are no random games to play"
|
|
16
19
|
},
|
|
17
20
|
"fr": {
|
|
18
21
|
"playRandomGame": "Jouer à un jeu aléatoire",
|
|
19
22
|
"randomGameLoading": "Sélectinner ...",
|
|
20
|
-
"playNowRandomGame": "Jouer maintenant"
|
|
23
|
+
"playNowRandomGame": "Jouer maintenant",
|
|
24
|
+
"noGames": "There are no random games to play"
|
|
21
25
|
},
|
|
22
26
|
"ro": {
|
|
23
27
|
"playRandomGame": "Joaca-te un joc aleatoriu",
|
|
24
28
|
"randomGameLoading": "Se selecteaza ...",
|
|
25
|
-
"playNowRandomGame": "Joaca-te Acum"
|
|
29
|
+
"playNowRandomGame": "Joaca-te Acum",
|
|
30
|
+
"noGames": "Nu exista jocuri aleatorii de jucat"
|
|
26
31
|
},
|
|
27
32
|
"tr": {
|
|
28
33
|
"playRandomGame": "Rastgele Bir Oyun Oyna",
|
|
29
34
|
"randomGameLoading": "Oyun Seçiliyor",
|
|
30
|
-
"playNowRandomGame": "Şimdi Oyna"
|
|
35
|
+
"playNowRandomGame": "Şimdi Oyna",
|
|
36
|
+
"noGames": "There are no random games to play"
|
|
31
37
|
},
|
|
32
38
|
"es": {
|
|
33
39
|
"playRandomGame": "Juego aleatorio",
|
|
34
40
|
"randomGameLoading": "Seleccionando…",
|
|
35
|
-
"playNowRandomGame": "Juega Ya"
|
|
41
|
+
"playNowRandomGame": "Juega Ya",
|
|
42
|
+
"noGames": "There are no random games to play"
|
|
36
43
|
},
|
|
37
44
|
"pt": {
|
|
38
45
|
"playRandomGame": "Jogue um jogo aleatório",
|
|
39
46
|
"randomGameLoading": "Selecionando ...",
|
|
40
|
-
"playNowRandomGame": "Jogue agora"
|
|
47
|
+
"playNowRandomGame": "Jogue agora",
|
|
48
|
+
"noGames": "There are no random games to play"
|
|
41
49
|
},
|
|
42
50
|
"hr": {
|
|
43
51
|
"playRandomGame": "Igrajte nasumičnu igru",
|
|
44
52
|
"randomGameLoading": "Odabir...",
|
|
45
|
-
"playNowRandomGame": "Igraj sada"
|
|
53
|
+
"playNowRandomGame": "Igraj sada",
|
|
54
|
+
"noGames": "There are no random games to play"
|
|
46
55
|
},
|
|
47
56
|
"pt-br": {
|
|
48
57
|
"playRandomGame": "Jogue um jogo aleatório",
|
|
49
58
|
"randomGameCarregando": "Selecionando...",
|
|
50
|
-
"playNowRandomGame": "Jogue agora"
|
|
59
|
+
"playNowRandomGame": "Jogue agora",
|
|
60
|
+
"noGames": "There are no random games to play"
|
|
51
61
|
},
|
|
52
62
|
"es-mx": {
|
|
53
63
|
"playRandomGame": "Jugar un juego al azar",
|
|
54
64
|
"randomGameCargando": "Seleccionando..",
|
|
55
|
-
"playNowRandomGame": "Jugar ahora"
|
|
65
|
+
"playNowRandomGame": "Jugar ahora",
|
|
66
|
+
"noGames": "There are no random games to play"
|
|
56
67
|
}
|
|
57
68
|
}
|