@everymatrix/casino-random-game 0.0.363 → 0.0.367
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/README.md +30 -30
- package/dist/casino-random-game.js +1 -1
- package/dist/casino-random-game.js.map +1 -1
- package/index.html +47 -47
- package/index.js +1 -1
- package/package.json +2 -2
- package/public/reset.css +47 -47
- package/rollup.config.js +59 -59
- package/src/CasinoRandomGame.svelte +334 -334
- package/src/i18n.js +27 -27
- package/src/index.ts +4 -4
- package/src/translations.js +58 -58
- package/stories/CasinoRandomGame.stories.js +13 -13
- package/tsconfig.json +6 -6
|
@@ -1,334 +1,334 @@
|
|
|
1
|
-
<svelte:options tag={null} />
|
|
2
|
-
|
|
3
|
-
<script lang="ts">
|
|
4
|
-
import { getDevice } from 'rvhelper';
|
|
5
|
-
import { _, setupI18n, addNewMessages, setLocale } from './i18n';
|
|
6
|
-
import { CasinoRandomGameTranslations } from './translations';
|
|
7
|
-
|
|
8
|
-
export let endpoint:string = '';
|
|
9
|
-
export let datasource:string = '';
|
|
10
|
-
export let gameevent:string = '';
|
|
11
|
-
export let lang:string = '';
|
|
12
|
-
export let randombuttonicon:string = '';
|
|
13
|
-
|
|
14
|
-
let games:any = [];
|
|
15
|
-
let randomGame:any = '';
|
|
16
|
-
let gamesToShow:any;
|
|
17
|
-
let show:boolean = false;
|
|
18
|
-
let offset:number = 0;
|
|
19
|
-
let count:number = 0;
|
|
20
|
-
let slotDone:boolean = false;
|
|
21
|
-
|
|
22
|
-
let userAgent:string = window.navigator.userAgent;
|
|
23
|
-
|
|
24
|
-
setupI18n({ withLocale: 'en', translations: {}});
|
|
25
|
-
|
|
26
|
-
Object.keys(CasinoRandomGameTranslations).forEach((item:any) => {
|
|
27
|
-
addNewMessages(item, CasinoRandomGameTranslations[item]);
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
const getRandomGame = ():void => {
|
|
31
|
-
gamesToShow = shuffle(gamesToShow);
|
|
32
|
-
offset = 0;
|
|
33
|
-
count = 0;
|
|
34
|
-
slotDone = false;
|
|
35
|
-
randomGame = games[Math.floor(Math.random() * games.length)];
|
|
36
|
-
show = true;
|
|
37
|
-
|
|
38
|
-
let interval = setInterval(() => {
|
|
39
|
-
offset -= 100;
|
|
40
|
-
count++;
|
|
41
|
-
|
|
42
|
-
if (count == 20) {
|
|
43
|
-
slotDone = true;
|
|
44
|
-
clearInterval(interval);
|
|
45
|
-
}
|
|
46
|
-
}, 100);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
const shuffle = (array):Array<any> => {
|
|
50
|
-
let currentIndex = array.length, randomIndex;
|
|
51
|
-
|
|
52
|
-
while (currentIndex != 0) {
|
|
53
|
-
randomIndex = Math.floor(Math.random() * currentIndex);
|
|
54
|
-
currentIndex--;
|
|
55
|
-
|
|
56
|
-
[array[currentIndex], array[randomIndex]] = [array[randomIndex], array[currentIndex]];
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
return array;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
const playGame = ():void => {
|
|
63
|
-
window.postMessage({ type: gameevent, gameId: randomGame.gId || randomGame.id }, window.location.href);
|
|
64
|
-
show = false;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
const closeModal = ():void => {
|
|
68
|
-
show = false;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
const fetchGameList = ():void => {
|
|
72
|
-
let url = new URL(`${endpoint}/casino/games`);
|
|
73
|
-
|
|
74
|
-
url.searchParams.append('platform', getDevice(userAgent));
|
|
75
|
-
url.searchParams.append('datasource', datasource);
|
|
76
|
-
url.searchParams.append('fields', 'gId,id,href,thumbnail,name,vendor')
|
|
77
|
-
url.searchParams.append('expand', 'vendor');
|
|
78
|
-
url.searchParams.append('pagination', 'offset=0,limit=1000');
|
|
79
|
-
|
|
80
|
-
fetch(url.href)
|
|
81
|
-
.then((res:any) => res.json())
|
|
82
|
-
.then((data:any) => {
|
|
83
|
-
games = data.items;
|
|
84
|
-
gamesToShow = games.slice(0, 19);
|
|
85
|
-
});
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
const setActiveLanguage = () => {
|
|
89
|
-
setLocale(lang);
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
$: lang && setActiveLanguage();
|
|
93
|
-
$: endpoint && datasource && fetchGameList();
|
|
94
|
-
</script>
|
|
95
|
-
|
|
96
|
-
<div part="CustomStylingContainer">
|
|
97
|
-
<div>
|
|
98
|
-
{#if show}
|
|
99
|
-
<div class="ModalWindow" part="ModalWindow">
|
|
100
|
-
<div class="ModalContainer" part="ModalContainer" >
|
|
101
|
-
<span class="ModalCloseBtn" part="ModalCloseBtn" on:click={closeModal} role="button">
|
|
102
|
-
<slot name="close">
|
|
103
|
-
<svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"></path></svg>
|
|
104
|
-
</slot>
|
|
105
|
-
</span>
|
|
106
|
-
|
|
107
|
-
{#if !slotDone}
|
|
108
|
-
<div class="RandomGameWrapper" part="RandomGameWrapper">
|
|
109
|
-
<main class="RandomGamesSliderWrapper" part="RandomGamesSliderWrapper">
|
|
110
|
-
<div class="items" part="items" style="transform: translateY({offset}px);">
|
|
111
|
-
{#each gamesToShow as game, i}
|
|
112
|
-
<div class="item" part="item">
|
|
113
|
-
<img class="RandomGameImage" part="RandomGameImage" src={game.thumbnail} alt={game.name} title={game.name}/>
|
|
114
|
-
</div>
|
|
115
|
-
{/each}
|
|
116
|
-
</div>
|
|
117
|
-
</main>
|
|
118
|
-
<p class="RandomGameLoading" part="RandomGameLoading">{$_('randomGame.randomGameLoading')}</p>
|
|
119
|
-
</div>
|
|
120
|
-
{/if}
|
|
121
|
-
|
|
122
|
-
{#if slotDone}
|
|
123
|
-
<div class="RandomGameWrapper" part="RandomGameWrapper">
|
|
124
|
-
<div class="item" part="item">
|
|
125
|
-
<img class="RandomGameImage" part="RandomGameImage" src={randomGame.thumbnail} alt={randomGame.name} title={randomGame.name}/>
|
|
126
|
-
<button class="RandomTryAgain" part="RandomTryAgain" on:click={() => getRandomGame()}>
|
|
127
|
-
<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">
|
|
128
|
-
<style type="text/css">
|
|
129
|
-
.st0{fill:var(--emfe-w-color-white, #FFFFFF);;}
|
|
130
|
-
</style>
|
|
131
|
-
<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"/>
|
|
132
|
-
</svg>
|
|
133
|
-
</button>
|
|
134
|
-
</div>
|
|
135
|
-
<div class="RandomGameDetails" part="RandomGameDetails">
|
|
136
|
-
<p class="RandomGameTitle" part="RandomGameTitle">{randomGame.name}</p>
|
|
137
|
-
<p class="RandomGameVendor" part="RandomGameVendor">{randomGame.vendor.name}</p>
|
|
138
|
-
<button class="RandomGamePlay" part="RandomGamePlay" on:click={() => playGame()}>{$_('randomGame.playNowRandomGame')}</button>
|
|
139
|
-
</div>
|
|
140
|
-
</div>
|
|
141
|
-
{/if}
|
|
142
|
-
|
|
143
|
-
</div>
|
|
144
|
-
</div>
|
|
145
|
-
{/if}
|
|
146
|
-
<div class="RandomButtonWrapper" part="RandomButtonWrapper">
|
|
147
|
-
<button class="RandomButton" part="RandomButton" on:click={() => getRandomGame()}>
|
|
148
|
-
<span class="RandomButtonText" part="RandomButtonText">{$_('randomGame.playRandomGame')}</span>
|
|
149
|
-
<span class="RandomButtonIcon" part="RandomButtonIcon">
|
|
150
|
-
{@html randombuttonicon}
|
|
151
|
-
</span>
|
|
152
|
-
</button>
|
|
153
|
-
</div>
|
|
154
|
-
</div>
|
|
155
|
-
</div>
|
|
156
|
-
|
|
157
|
-
<style lang="scss">
|
|
158
|
-
:host {
|
|
159
|
-
font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji';
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
*,
|
|
163
|
-
*::before,
|
|
164
|
-
*::after {
|
|
165
|
-
margin: 0;
|
|
166
|
-
padding: 0;
|
|
167
|
-
list-style: none;
|
|
168
|
-
text-decoration: none;
|
|
169
|
-
outline: none;
|
|
170
|
-
box-sizing: border-box;
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
.ModalWindow {
|
|
174
|
-
display: flex;
|
|
175
|
-
position: fixed;
|
|
176
|
-
align-items: center;
|
|
177
|
-
justify-content: center;
|
|
178
|
-
width: 100%;
|
|
179
|
-
height: 100%;
|
|
180
|
-
z-index: 100;
|
|
181
|
-
top: 0;
|
|
182
|
-
left: 0;
|
|
183
|
-
background-color: rgba(0, 0, 0, .9);
|
|
184
|
-
.ModalContainer {
|
|
185
|
-
display: flex;
|
|
186
|
-
flex-direction: column;
|
|
187
|
-
align-items: center;
|
|
188
|
-
justify-content: center;
|
|
189
|
-
gap: 10px;
|
|
190
|
-
width: 90vw;
|
|
191
|
-
min-height: 380px;
|
|
192
|
-
max-width: 500px;
|
|
193
|
-
padding: 40px 40px 16px 40px;
|
|
194
|
-
border-top: 3px solid var(--emfe-w-color-secondary, #FD2839);
|
|
195
|
-
border-radius: 5px;
|
|
196
|
-
position: relative;
|
|
197
|
-
background: var(--emfe-w-color-white, #FFFFFF);
|
|
198
|
-
}
|
|
199
|
-
.ModalCloseBtn {
|
|
200
|
-
position: absolute;
|
|
201
|
-
top: 10px;
|
|
202
|
-
right: 10px;
|
|
203
|
-
border-radius: 50%;
|
|
204
|
-
color: var(--emfe-w-color-secondary, #FD2839);
|
|
205
|
-
background: rgba(255, 255, 255, .1);
|
|
206
|
-
cursor: pointer;
|
|
207
|
-
transition: all 150ms ease-in-out;
|
|
208
|
-
width: 28px;
|
|
209
|
-
height: 28px;
|
|
210
|
-
svg {
|
|
211
|
-
width: 28px;
|
|
212
|
-
height: 28px;
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
&:hover {
|
|
216
|
-
background: rgba(255, 255, 255, .2);
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
.ModalMobileContainer {
|
|
220
|
-
padding: 10px;
|
|
221
|
-
border-top: none;
|
|
222
|
-
.ModalCloseBtn {
|
|
223
|
-
margin: 10px;
|
|
224
|
-
svg {
|
|
225
|
-
width: 24px;
|
|
226
|
-
height: 24px;
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
.RandomGameWrapper {
|
|
233
|
-
display: flex;
|
|
234
|
-
flex-direction: column;
|
|
235
|
-
align-items: center;
|
|
236
|
-
justify-content: center;
|
|
237
|
-
gap: 10px;
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
.RandomGamesSliderWrapper {
|
|
241
|
-
height: 170px;
|
|
242
|
-
overflow: hidden;
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
.items {
|
|
246
|
-
gap: 5px;
|
|
247
|
-
transition: transform 0.3s ease-in-out;
|
|
248
|
-
transform: translateY(0px);
|
|
249
|
-
-webkit-transform-style: preserve-3d;
|
|
250
|
-
-webkit-backface-visibility: hidden;
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
.RandomGameLoading {
|
|
254
|
-
padding: 30px 0;
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
.RandomGameImage {
|
|
258
|
-
width: 256px;
|
|
259
|
-
height: 170px;
|
|
260
|
-
border-radius: 5px;
|
|
261
|
-
-webkit-transform-style: preserve-3d;
|
|
262
|
-
-webkit-backface-visibility: hidden;
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
.RandomTryAgain {
|
|
266
|
-
position: absolute;
|
|
267
|
-
bottom: -10px;
|
|
268
|
-
right: -10px;
|
|
269
|
-
background: var(--emfe-w-color-primary, #D0046C);
|
|
270
|
-
color: var(--emfe-w-color-white, #FFFFFF);
|
|
271
|
-
display: flex;
|
|
272
|
-
align-items: center;
|
|
273
|
-
padding: 6px;
|
|
274
|
-
border: none;
|
|
275
|
-
border-radius: 50%;
|
|
276
|
-
cursor: pointer;
|
|
277
|
-
svg {
|
|
278
|
-
width: 22px;
|
|
279
|
-
height: 22px;
|
|
280
|
-
}
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
.item {
|
|
284
|
-
position: relative;
|
|
285
|
-
-webkit-backface-visibility: hidden;
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
.RandomGameDetails {
|
|
289
|
-
display: flex;
|
|
290
|
-
flex-direction: column;
|
|
291
|
-
justify-content: center;
|
|
292
|
-
align-items: center;
|
|
293
|
-
gap: 5px;
|
|
294
|
-
.RandomGameTitle {
|
|
295
|
-
font-size: 16px;
|
|
296
|
-
line-height: 18px;
|
|
297
|
-
text-align: center;
|
|
298
|
-
}
|
|
299
|
-
.RandomGameVendor {
|
|
300
|
-
font-size: 10px;
|
|
301
|
-
margin-bottom: 10px;
|
|
302
|
-
}
|
|
303
|
-
.RandomGamePlay {
|
|
304
|
-
background: var(--emfe-w-color-primary, #D0046C);
|
|
305
|
-
color: var(--emfe-w-color-white, #FFFFFF);
|
|
306
|
-
border: none;
|
|
307
|
-
border-radius: 5px;
|
|
308
|
-
width: 200px;
|
|
309
|
-
height: 40px;
|
|
310
|
-
font-size: 14px;
|
|
311
|
-
cursor: pointer;
|
|
312
|
-
}
|
|
313
|
-
}
|
|
314
|
-
|
|
315
|
-
.RandomButtonWrapper {
|
|
316
|
-
display: flex;
|
|
317
|
-
justify-content: center;
|
|
318
|
-
margin-top: 30px;
|
|
319
|
-
width: 100%;
|
|
320
|
-
.RandomButton {
|
|
321
|
-
display: flex;
|
|
322
|
-
align-items: center;
|
|
323
|
-
gap: 5px;
|
|
324
|
-
background: var(--emfe-w-color-primary, #D0046C);
|
|
325
|
-
color: var(--emfe-w-color-white, #FFFFFF);
|
|
326
|
-
border: none;
|
|
327
|
-
border-radius: 5px;
|
|
328
|
-
padding: 0 30px;
|
|
329
|
-
height: 50px;
|
|
330
|
-
font-size: 16px;
|
|
331
|
-
cursor: pointer;
|
|
332
|
-
}
|
|
333
|
-
}
|
|
334
|
-
</style>
|
|
1
|
+
<svelte:options tag={null} />
|
|
2
|
+
|
|
3
|
+
<script lang="ts">
|
|
4
|
+
import { getDevice } from 'rvhelper';
|
|
5
|
+
import { _, setupI18n, addNewMessages, setLocale } from './i18n';
|
|
6
|
+
import { CasinoRandomGameTranslations } from './translations';
|
|
7
|
+
|
|
8
|
+
export let endpoint:string = '';
|
|
9
|
+
export let datasource:string = '';
|
|
10
|
+
export let gameevent:string = '';
|
|
11
|
+
export let lang:string = '';
|
|
12
|
+
export let randombuttonicon:string = '';
|
|
13
|
+
|
|
14
|
+
let games:any = [];
|
|
15
|
+
let randomGame:any = '';
|
|
16
|
+
let gamesToShow:any;
|
|
17
|
+
let show:boolean = false;
|
|
18
|
+
let offset:number = 0;
|
|
19
|
+
let count:number = 0;
|
|
20
|
+
let slotDone:boolean = false;
|
|
21
|
+
|
|
22
|
+
let userAgent:string = window.navigator.userAgent;
|
|
23
|
+
|
|
24
|
+
setupI18n({ withLocale: 'en', translations: {}});
|
|
25
|
+
|
|
26
|
+
Object.keys(CasinoRandomGameTranslations).forEach((item:any) => {
|
|
27
|
+
addNewMessages(item, CasinoRandomGameTranslations[item]);
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
const getRandomGame = ():void => {
|
|
31
|
+
gamesToShow = shuffle(gamesToShow);
|
|
32
|
+
offset = 0;
|
|
33
|
+
count = 0;
|
|
34
|
+
slotDone = false;
|
|
35
|
+
randomGame = games[Math.floor(Math.random() * games.length)];
|
|
36
|
+
show = true;
|
|
37
|
+
|
|
38
|
+
let interval = setInterval(() => {
|
|
39
|
+
offset -= 100;
|
|
40
|
+
count++;
|
|
41
|
+
|
|
42
|
+
if (count == 20) {
|
|
43
|
+
slotDone = true;
|
|
44
|
+
clearInterval(interval);
|
|
45
|
+
}
|
|
46
|
+
}, 100);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const shuffle = (array):Array<any> => {
|
|
50
|
+
let currentIndex = array.length, randomIndex;
|
|
51
|
+
|
|
52
|
+
while (currentIndex != 0) {
|
|
53
|
+
randomIndex = Math.floor(Math.random() * currentIndex);
|
|
54
|
+
currentIndex--;
|
|
55
|
+
|
|
56
|
+
[array[currentIndex], array[randomIndex]] = [array[randomIndex], array[currentIndex]];
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
return array;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
const playGame = ():void => {
|
|
63
|
+
window.postMessage({ type: gameevent, gameId: randomGame.gId || randomGame.id }, window.location.href);
|
|
64
|
+
show = false;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
const closeModal = ():void => {
|
|
68
|
+
show = false;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
const fetchGameList = ():void => {
|
|
72
|
+
let url = new URL(`${endpoint}/casino/games`);
|
|
73
|
+
|
|
74
|
+
url.searchParams.append('platform', getDevice(userAgent));
|
|
75
|
+
url.searchParams.append('datasource', datasource);
|
|
76
|
+
url.searchParams.append('fields', 'gId,id,href,thumbnail,name,vendor')
|
|
77
|
+
url.searchParams.append('expand', 'vendor');
|
|
78
|
+
url.searchParams.append('pagination', 'offset=0,limit=1000');
|
|
79
|
+
|
|
80
|
+
fetch(url.href)
|
|
81
|
+
.then((res:any) => res.json())
|
|
82
|
+
.then((data:any) => {
|
|
83
|
+
games = data.items;
|
|
84
|
+
gamesToShow = games.slice(0, 19);
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
const setActiveLanguage = () => {
|
|
89
|
+
setLocale(lang);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
$: lang && setActiveLanguage();
|
|
93
|
+
$: endpoint && datasource && fetchGameList();
|
|
94
|
+
</script>
|
|
95
|
+
|
|
96
|
+
<div part="CustomStylingContainer">
|
|
97
|
+
<div>
|
|
98
|
+
{#if show}
|
|
99
|
+
<div class="ModalWindow" part="ModalWindow">
|
|
100
|
+
<div class="ModalContainer" part="ModalContainer" >
|
|
101
|
+
<span class="ModalCloseBtn" part="ModalCloseBtn" on:click={closeModal} role="button">
|
|
102
|
+
<slot name="close">
|
|
103
|
+
<svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"></path></svg>
|
|
104
|
+
</slot>
|
|
105
|
+
</span>
|
|
106
|
+
|
|
107
|
+
{#if !slotDone}
|
|
108
|
+
<div class="RandomGameWrapper" part="RandomGameWrapper">
|
|
109
|
+
<main class="RandomGamesSliderWrapper" part="RandomGamesSliderWrapper">
|
|
110
|
+
<div class="items" part="items" style="transform: translateY({offset}px);">
|
|
111
|
+
{#each gamesToShow as game, i}
|
|
112
|
+
<div class="item" part="item">
|
|
113
|
+
<img class="RandomGameImage" part="RandomGameImage" src={game.thumbnail} alt={game.name} title={game.name}/>
|
|
114
|
+
</div>
|
|
115
|
+
{/each}
|
|
116
|
+
</div>
|
|
117
|
+
</main>
|
|
118
|
+
<p class="RandomGameLoading" part="RandomGameLoading">{$_('randomGame.randomGameLoading')}</p>
|
|
119
|
+
</div>
|
|
120
|
+
{/if}
|
|
121
|
+
|
|
122
|
+
{#if slotDone}
|
|
123
|
+
<div class="RandomGameWrapper" part="RandomGameWrapper">
|
|
124
|
+
<div class="item" part="item">
|
|
125
|
+
<img class="RandomGameImage" part="RandomGameImage" src={randomGame.thumbnail} alt={randomGame.name} title={randomGame.name}/>
|
|
126
|
+
<button class="RandomTryAgain" part="RandomTryAgain" on:click={() => getRandomGame()}>
|
|
127
|
+
<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">
|
|
128
|
+
<style type="text/css">
|
|
129
|
+
.st0{fill:var(--emfe-w-color-white, #FFFFFF);;}
|
|
130
|
+
</style>
|
|
131
|
+
<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"/>
|
|
132
|
+
</svg>
|
|
133
|
+
</button>
|
|
134
|
+
</div>
|
|
135
|
+
<div class="RandomGameDetails" part="RandomGameDetails">
|
|
136
|
+
<p class="RandomGameTitle" part="RandomGameTitle">{randomGame.name}</p>
|
|
137
|
+
<p class="RandomGameVendor" part="RandomGameVendor">{randomGame.vendor.name}</p>
|
|
138
|
+
<button class="RandomGamePlay" part="RandomGamePlay" on:click={() => playGame()}>{$_('randomGame.playNowRandomGame')}</button>
|
|
139
|
+
</div>
|
|
140
|
+
</div>
|
|
141
|
+
{/if}
|
|
142
|
+
|
|
143
|
+
</div>
|
|
144
|
+
</div>
|
|
145
|
+
{/if}
|
|
146
|
+
<div class="RandomButtonWrapper" part="RandomButtonWrapper">
|
|
147
|
+
<button class="RandomButton" part="RandomButton" on:click={() => getRandomGame()}>
|
|
148
|
+
<span class="RandomButtonText" part="RandomButtonText">{$_('randomGame.playRandomGame')}</span>
|
|
149
|
+
<span class="RandomButtonIcon" part="RandomButtonIcon">
|
|
150
|
+
{@html randombuttonicon}
|
|
151
|
+
</span>
|
|
152
|
+
</button>
|
|
153
|
+
</div>
|
|
154
|
+
</div>
|
|
155
|
+
</div>
|
|
156
|
+
|
|
157
|
+
<style lang="scss">
|
|
158
|
+
:host {
|
|
159
|
+
font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji';
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
*,
|
|
163
|
+
*::before,
|
|
164
|
+
*::after {
|
|
165
|
+
margin: 0;
|
|
166
|
+
padding: 0;
|
|
167
|
+
list-style: none;
|
|
168
|
+
text-decoration: none;
|
|
169
|
+
outline: none;
|
|
170
|
+
box-sizing: border-box;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.ModalWindow {
|
|
174
|
+
display: flex;
|
|
175
|
+
position: fixed;
|
|
176
|
+
align-items: center;
|
|
177
|
+
justify-content: center;
|
|
178
|
+
width: 100%;
|
|
179
|
+
height: 100%;
|
|
180
|
+
z-index: 100;
|
|
181
|
+
top: 0;
|
|
182
|
+
left: 0;
|
|
183
|
+
background-color: rgba(0, 0, 0, .9);
|
|
184
|
+
.ModalContainer {
|
|
185
|
+
display: flex;
|
|
186
|
+
flex-direction: column;
|
|
187
|
+
align-items: center;
|
|
188
|
+
justify-content: center;
|
|
189
|
+
gap: 10px;
|
|
190
|
+
width: 90vw;
|
|
191
|
+
min-height: 380px;
|
|
192
|
+
max-width: 500px;
|
|
193
|
+
padding: 40px 40px 16px 40px;
|
|
194
|
+
border-top: 3px solid var(--emfe-w-color-secondary, #FD2839);
|
|
195
|
+
border-radius: 5px;
|
|
196
|
+
position: relative;
|
|
197
|
+
background: var(--emfe-w-color-white, #FFFFFF);
|
|
198
|
+
}
|
|
199
|
+
.ModalCloseBtn {
|
|
200
|
+
position: absolute;
|
|
201
|
+
top: 10px;
|
|
202
|
+
right: 10px;
|
|
203
|
+
border-radius: 50%;
|
|
204
|
+
color: var(--emfe-w-color-secondary, #FD2839);
|
|
205
|
+
background: rgba(255, 255, 255, .1);
|
|
206
|
+
cursor: pointer;
|
|
207
|
+
transition: all 150ms ease-in-out;
|
|
208
|
+
width: 28px;
|
|
209
|
+
height: 28px;
|
|
210
|
+
svg {
|
|
211
|
+
width: 28px;
|
|
212
|
+
height: 28px;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
&:hover {
|
|
216
|
+
background: rgba(255, 255, 255, .2);
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
.ModalMobileContainer {
|
|
220
|
+
padding: 10px;
|
|
221
|
+
border-top: none;
|
|
222
|
+
.ModalCloseBtn {
|
|
223
|
+
margin: 10px;
|
|
224
|
+
svg {
|
|
225
|
+
width: 24px;
|
|
226
|
+
height: 24px;
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
.RandomGameWrapper {
|
|
233
|
+
display: flex;
|
|
234
|
+
flex-direction: column;
|
|
235
|
+
align-items: center;
|
|
236
|
+
justify-content: center;
|
|
237
|
+
gap: 10px;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
.RandomGamesSliderWrapper {
|
|
241
|
+
height: 170px;
|
|
242
|
+
overflow: hidden;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
.items {
|
|
246
|
+
gap: 5px;
|
|
247
|
+
transition: transform 0.3s ease-in-out;
|
|
248
|
+
transform: translateY(0px);
|
|
249
|
+
-webkit-transform-style: preserve-3d;
|
|
250
|
+
-webkit-backface-visibility: hidden;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
.RandomGameLoading {
|
|
254
|
+
padding: 30px 0;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
.RandomGameImage {
|
|
258
|
+
width: 256px;
|
|
259
|
+
height: 170px;
|
|
260
|
+
border-radius: 5px;
|
|
261
|
+
-webkit-transform-style: preserve-3d;
|
|
262
|
+
-webkit-backface-visibility: hidden;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
.RandomTryAgain {
|
|
266
|
+
position: absolute;
|
|
267
|
+
bottom: -10px;
|
|
268
|
+
right: -10px;
|
|
269
|
+
background: var(--emfe-w-color-primary, #D0046C);
|
|
270
|
+
color: var(--emfe-w-color-white, #FFFFFF);
|
|
271
|
+
display: flex;
|
|
272
|
+
align-items: center;
|
|
273
|
+
padding: 6px;
|
|
274
|
+
border: none;
|
|
275
|
+
border-radius: 50%;
|
|
276
|
+
cursor: pointer;
|
|
277
|
+
svg {
|
|
278
|
+
width: 22px;
|
|
279
|
+
height: 22px;
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
.item {
|
|
284
|
+
position: relative;
|
|
285
|
+
-webkit-backface-visibility: hidden;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
.RandomGameDetails {
|
|
289
|
+
display: flex;
|
|
290
|
+
flex-direction: column;
|
|
291
|
+
justify-content: center;
|
|
292
|
+
align-items: center;
|
|
293
|
+
gap: 5px;
|
|
294
|
+
.RandomGameTitle {
|
|
295
|
+
font-size: 16px;
|
|
296
|
+
line-height: 18px;
|
|
297
|
+
text-align: center;
|
|
298
|
+
}
|
|
299
|
+
.RandomGameVendor {
|
|
300
|
+
font-size: 10px;
|
|
301
|
+
margin-bottom: 10px;
|
|
302
|
+
}
|
|
303
|
+
.RandomGamePlay {
|
|
304
|
+
background: var(--emfe-w-color-primary, #D0046C);
|
|
305
|
+
color: var(--emfe-w-color-white, #FFFFFF);
|
|
306
|
+
border: none;
|
|
307
|
+
border-radius: 5px;
|
|
308
|
+
width: 200px;
|
|
309
|
+
height: 40px;
|
|
310
|
+
font-size: 14px;
|
|
311
|
+
cursor: pointer;
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
.RandomButtonWrapper {
|
|
316
|
+
display: flex;
|
|
317
|
+
justify-content: center;
|
|
318
|
+
margin-top: 30px;
|
|
319
|
+
width: 100%;
|
|
320
|
+
.RandomButton {
|
|
321
|
+
display: flex;
|
|
322
|
+
align-items: center;
|
|
323
|
+
gap: 5px;
|
|
324
|
+
background: var(--emfe-w-color-primary, #D0046C);
|
|
325
|
+
color: var(--emfe-w-color-white, #FFFFFF);
|
|
326
|
+
border: none;
|
|
327
|
+
border-radius: 5px;
|
|
328
|
+
padding: 0 30px;
|
|
329
|
+
height: 50px;
|
|
330
|
+
font-size: 16px;
|
|
331
|
+
cursor: pointer;
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
</style>
|