@everymatrix/casino-page-nd 1.37.5

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.
@@ -0,0 +1,857 @@
1
+ <svelte:options tag={null} />
2
+
3
+ <script lang="ts">
4
+ import { onMount } from "svelte";
5
+ import { isMobile, getDevice } from 'rvhelper';
6
+ import { _, addNewMessages, setupI18n, setLocale } from './i18n';
7
+ import { TRANSLATIONS } from './translations';
8
+ import type {
9
+ CategoriesData,
10
+ CategoriesItems,
11
+ } from './CasinoPage.types';
12
+
13
+ import '@everymatrix/casino-games-category-section-nd';
14
+ import '@everymatrix/casino-random-game';
15
+ import '@everymatrix/casino-winners';
16
+ import '@everymatrix/casino-jackpot-banner';
17
+ import '@everymatrix/casino-collections-providers';
18
+ import '@everymatrix/casino-favorites-section';
19
+ import '@everymatrix/casino-last-played-section';
20
+ import '@everymatrix/casino-most-played-section';
21
+ import '@everymatrix/casino-my-games';
22
+ import '@everymatrix/casino-search';
23
+ import '@everymatrix/casino-calendar';
24
+
25
+ export let endpoint:string = '';
26
+ export let env:string = '';
27
+ export let datasource:string = '';
28
+ export let currency:string = '';
29
+ export let lang:string = ''; // Language
30
+ export let session:string = ''; // Value for sessionID
31
+ export let userid:string = ''; // Value for UserID;
32
+ export let clientstyling:string = '';
33
+ export let userroles:string = '';
34
+ export let clientstylingurl:string = '';
35
+ export let translationurl:string = '';
36
+ export let cmsendpoint:string = '';
37
+
38
+ export let categorybackground:string = '';
39
+ export let visiblegames:string;
40
+ export let favorites:string = '';
41
+ export let haspanicbutton:string = 'false';
42
+ export let filteredcategories:string = '';
43
+ export let activecategory:string = '';
44
+ export let showgamename:string = '';
45
+ export let livecasino:string = 'false';
46
+ export let playrandomgame:string = 'false';
47
+ export let randomgameslider:string = 'false';
48
+ export let filteredrandomgamecategories:string = '';
49
+ export let gamepagemodalurl:string = 'false';
50
+ export let casinogamesgridslider: string = 'false';
51
+ //Casino Winners
52
+ export let positionwinnerswidget:string ='';
53
+ export let tabsorder:string = '';
54
+ export let enableautoscroll:string = '';
55
+ export let istopavailable:string = '';
56
+ export let isrecentavailable:string = '';
57
+ export let integratedgameframedesktop:string = 'false';
58
+ export let integratedgameframemobile:string = 'false';
59
+ export let periodrecent:string = '';
60
+ export let periodtop:string = '';
61
+ export let numberusersrecent:string = '';
62
+ export let numberuserstop:string = '';
63
+ export let amountlimit:string = '';
64
+ export let defaultcurrency:string = '';
65
+ export let showsubgroups:string = '';
66
+ //Jackpot Banners
67
+ export let positionjackpotbanners:string = '';
68
+ export let caticon0:string = '';
69
+ export let caticon1:string = '';
70
+ export let caticon2:string = '';
71
+ export let caticon3:string = '';
72
+ export let backgroundsrc:string='';
73
+ export let backgroundsrcmobile:string='';
74
+ export let titlelogopath = '';
75
+ export let iconlabels:string = '';
76
+ export let visualstructure:string = '';
77
+ //Casino Collections Providers
78
+ export let positioncollections:string = '';
79
+ export let type:string = '';
80
+ export let titletype:string = '';
81
+ export let collectionprovidersgamenames:string = '';
82
+ export let addfilterselector:string = 'false';
83
+ export let addsortingselector:string = 'false';
84
+ export let filterbylogo:string = '';
85
+ //Casino Calendar
86
+ export let positioncasinocalendar = '';
87
+ //Casino My Games
88
+ export let casinomygames:string = 'false';
89
+ export let mostplayed:string = '';
90
+ export let lastplayed:string = '';
91
+ export let lastplayedperiod:string = 'Last30Days';
92
+ export let mostplayedperiod:string = 'Last30Days';
93
+ export let lastplayedorder:string = '';
94
+ export let lastplayedlimit:string = '';
95
+ export let lastplayedunique: string = 'true';
96
+ export let mostplayedrounds:string = '';
97
+ export let winnersdatasources:string = '';
98
+ export let fetchviaevent:string = 'true';
99
+ //Je lobby widget
100
+ export let positionjelobbywidget:string = '';
101
+ //Casino Random Game Slider
102
+ export let specificcategory:string = '';
103
+ export let launchbygamecard:string = '';
104
+ export let iconvisible:string = '';
105
+ export let iconvisibleonanim:string = '';
106
+
107
+ // Button icon for random game widget
108
+ export let randombuttonicon:string = '';
109
+
110
+ let userAgent:any = window.navigator.userAgent;
111
+ let gameevent:string;
112
+
113
+ if (!isMobile(userAgent)) {
114
+ gameevent = 'ShowGameModal';
115
+ } else {
116
+ gameevent = 'OpenGameFrame';
117
+ }
118
+
119
+ // CasinoPage loading state
120
+ let isLoading:boolean = false;
121
+ let hasErrors:boolean = false;
122
+ let isLoggedIn:boolean = false;
123
+ let error:string = '';
124
+ let playerID:string;
125
+ let sessionID:string;
126
+ let panicButton:HTMLElement;
127
+ let panicLoading:boolean = false;
128
+ let timer: number = 0;
129
+ let timerInterval:any;
130
+
131
+ // CasinoPage state
132
+ let myGamesSection:boolean = false;
133
+ let searchFocus:boolean = false;
134
+ let lobbyScreen:boolean = true;
135
+ let adjustingScroll:boolean = false;
136
+ let searchIsOn:boolean = false;
137
+
138
+ // Needs to be checked if there are relevant
139
+ let shownCategories:Array<CategoriesItems> = [];
140
+ let activeCategory:string;
141
+ let allCategoriesIds:string[] = [];
142
+ let searchWrapper:HTMLElement;
143
+ let searchElementWrapper:HTMLElement;
144
+ let searchPositionTop:number;
145
+ let searchedGamesCache:Object = {};
146
+
147
+ const scrollOffset:number = 0;
148
+
149
+ let scrollTop:boolean = false;
150
+ let activeRecentSearches:boolean = false;
151
+ let categoriesData;
152
+ let receivedFavoriteResults:Object;
153
+ let currentCategoryId:string = '';
154
+ let customStylingContainer:HTMLElement;
155
+ let firstLoad:boolean = false;
156
+
157
+ setupI18n({ withLocale: 'en', translations: {}});
158
+
159
+ const setTranslationUrl = ():void => {
160
+ let url:URL = new URL(translationurl);
161
+
162
+ fetch(url.href).then((res:any) => res.json())
163
+ .then((res) => {
164
+ Object.keys(res).forEach((item:any):void => {
165
+ addNewMessages(item, res[item]);
166
+ });
167
+ }).catch((err:any) => {
168
+ console.log(err);
169
+ });
170
+ }
171
+
172
+ Object.keys(TRANSLATIONS).forEach((item):void => {
173
+ addNewMessages(item, TRANSLATIONS[item]);
174
+ });
175
+
176
+ const CategoryChangeHandler = (categoryEvent:any):void => {
177
+ scrollTop = true;
178
+ casinomygames = 'false';
179
+
180
+ // needs to be executed after the page has been populated
181
+ setTimeout(() => {
182
+ window.postMessage({ type: 'WidgetTopReference', scrollTop }, window.location.href);
183
+ });
184
+
185
+ switch(categoryEvent.data.itemId) {
186
+ case 'LOBBY':
187
+ lobbyScreen = true;
188
+ myGamesSection = false;
189
+ activeCategory = '';
190
+ break;
191
+
192
+ case 'MYGAMES':
193
+ casinomygames = 'true';
194
+ lobbyScreen = false;
195
+ myGamesSection = true;
196
+ activeCategory = '';
197
+ break;
198
+
199
+ case 'FAVORITES':
200
+ lobbyScreen = false;
201
+ myGamesSection = true;
202
+ activeCategory = '';
203
+ break;
204
+
205
+ case 'MOSTPLAYED':
206
+ if (mostplayed == 'true') {
207
+ activeCategory = '';
208
+ lobbyScreen = false;
209
+ myGamesSection = true;
210
+ }
211
+ break;
212
+
213
+ case 'LASTPLAYED':
214
+ if (lastplayed == 'true') {
215
+ activeCategory = '';
216
+ lobbyScreen = false;
217
+ myGamesSection = true;
218
+ }
219
+ break;
220
+
221
+ default:
222
+ lobbyScreen = false;
223
+ myGamesSection = false;
224
+ activeCategory = categoryEvent.data.itemId;
225
+ //@TODO: if we remove the settimeout, the postmessage does not execute, at all - weird behaviour
226
+ setTimeout(() => {
227
+ window.postMessage({ type: 'CategoryUpdate', itemId: activeCategory}, window.location.href);
228
+ }, 2000);
229
+ break;
230
+ }
231
+ }
232
+
233
+ const messageHandler = (e:any):void => {
234
+ if (e.data) {
235
+ switch(e.data.type) {
236
+ // @TODO: removed and tested, but kept in case unforeseen issues occur - reason: multiple calls on category change
237
+ case 'CategoryChange':
238
+ CategoryChangeHandler(e);
239
+ break;
240
+
241
+ case 'UserSessionID':
242
+ sessionID = e.data.session;
243
+ playerID = e.data.userID;
244
+
245
+ break;
246
+
247
+ case 'ApplyFilters':
248
+ window.postMessage({ type: 'CategoryUpdate', itemId: currentCategoryId, origin: e.data.origin }, window.location.href);
249
+ break;
250
+
251
+ case 'CategoryVendors':
252
+ currentCategoryId = e.data.categoryid;
253
+ break;
254
+
255
+ case "searchCancelled":
256
+ searchIsOn = false;
257
+ if(activeCategory){
258
+ CategoryChangeHandler({ data: { itemId: activeCategory }});
259
+ }
260
+ break;
261
+
262
+ case "searchActive":
263
+ searchIsOn = true;
264
+ break;
265
+
266
+ case 'ModalClosed':
267
+ if(activeRecentSearches){
268
+ activeRecentSearches = false;
269
+ }
270
+ break;
271
+
272
+ case 'SubgroupsIds':
273
+ //Add subgroups ids fetched in the slider to the list of categories ids
274
+ if(!allCategoriesIds.some(categoryId => e.data.subGroupsIds.includes(categoryId))) {
275
+ allCategoriesIds.push(...e.data.subGroupsIds);
276
+ }
277
+ break;
278
+ }
279
+ }
280
+ }
281
+
282
+ const getCategories = (url:any):Promise<any> => {
283
+ return new Promise((resolve, reject) => {
284
+ isLoading = true;
285
+
286
+ fetch(url)
287
+ .then((res:any) => res.json())
288
+ .then((data:CategoriesData) => {
289
+ isLoading = false;
290
+
291
+ resolve(data);
292
+ }).catch((err:any) => {
293
+ hasErrors = true;
294
+ isLoading = false;
295
+
296
+ console.error(err);
297
+
298
+ reject(err);
299
+ });
300
+ });
301
+ }
302
+
303
+ //
304
+ // --- START of communication with other widgets
305
+ //
306
+
307
+ const sendCategoryData = (node:any, categoryId:string):void => {
308
+ currentCategoryId = categoryId;
309
+ window.postMessage({ type: `CategoryData_${categoryId}`, categoryId, visiblegames, receivedFavoriteResults }, window.location.href);
310
+ }
311
+
312
+ //
313
+ // --- END of communication with other widgets
314
+ //
315
+
316
+ /* Listen for scroll */
317
+ const scrollHandler = ():void => {
318
+ if (searchElementWrapper) {
319
+ searchPositionTop = searchElementWrapper.getBoundingClientRect().top + document.body.getBoundingClientRect().top;
320
+ }
321
+
322
+ if (document.documentElement.scrollTop > searchPositionTop || searchPositionTop > 130) {
323
+ adjustingScroll = true;
324
+ } else {
325
+ adjustingScroll = false;
326
+ }
327
+ }
328
+
329
+ const checkAttrs = ():boolean => {
330
+ if (!endpoint) {
331
+ error = "Endpoint is missing! Please provide a valid endpointURL.";
332
+ hasErrors = true;
333
+ isLoading = false;
334
+
335
+ console.error(error);
336
+ }
337
+
338
+ if (!datasource) {
339
+ error = "Datasource is missing! Please provide a valid datasource.";
340
+ hasErrors = true;
341
+ isLoading = false;
342
+
343
+ console.error(error);
344
+ }
345
+
346
+ if (!lang || lang.length < 2) {
347
+ error = "Language is missing! Please provide a valid language (alpha2code)";
348
+ hasErrors = true;
349
+ isLoading = false;
350
+
351
+ console.error(error);
352
+ }
353
+
354
+ return hasErrors;
355
+ }
356
+
357
+ const updateCategoriesLanguage = ():void => {
358
+ if (firstLoad) {
359
+ setTimeout(() => {
360
+ window.postMessage({ type: 'CategoryUpdate', itemId: activeCategory}, window.location.href);
361
+ }, 500);
362
+ }
363
+
364
+ firstLoad = false;
365
+ }
366
+
367
+ const initialSetup = ():void => {
368
+ if (!checkAttrs()) {
369
+ isLoading = true;
370
+
371
+ setLocale(lang);
372
+
373
+ let categoriesUrl:URL = new URL(`${endpoint}/v1/casino/groups/${datasource}`);
374
+
375
+ categoriesUrl.searchParams.append('language', lang);
376
+ categoriesUrl.searchParams.append('platform', getDevice(userAgent));
377
+
378
+ getCategories(categoriesUrl).then((data:CategoriesData) => {
379
+ // create an array of filtered categories
380
+ let arrayFilteredCategories = filteredcategories.split(',');
381
+
382
+ if (data) {
383
+ categoriesData = data.items.filter((item:any) => {
384
+ let filtered:boolean;
385
+ if( item.games.total > 0 ) {
386
+ filtered = true;
387
+
388
+ // exclude filtered categories
389
+ if( filteredcategories ){
390
+ for (let element of arrayFilteredCategories){
391
+ if( item.flags == element ) filtered = false;
392
+ }
393
+ }
394
+ };
395
+ return filtered;
396
+ });
397
+
398
+ shownCategories = categoriesData.filter(category => {
399
+ if (category?.subGroups?.count > 0 && showsubgroups == 'true') {
400
+ return false;
401
+ }
402
+
403
+ return true;
404
+ }).map((category) => category.id);
405
+ // Create a list of all categories to check the activecategory against.
406
+ allCategoriesIds = data.items.map(category => category.id.toString());
407
+ isLoading = false;
408
+ }
409
+ });
410
+
411
+ searchElementWrapper = searchWrapper;
412
+
413
+ if (searchElementWrapper) {
414
+ searchPositionTop = searchElementWrapper.getBoundingClientRect().top - document.body.getBoundingClientRect().top;
415
+ }
416
+ }
417
+ }
418
+
419
+ const setActiveCategory = ():void => {
420
+ activeCategory = activecategory;
421
+ CategoryChangeHandler({ data: { itemId: activeCategory }});
422
+ }
423
+
424
+ const checkExistentCategory = ():void => {
425
+ // Check if the active category is found in the list of available categories. IF not send event to the state manager.
426
+ if (allCategoriesIds && !allCategoriesIds.includes(decodeURI(activeCategory)) && activeCategory != '') {
427
+ window.postMessage({type: 'NonExistentCategory'}, window.location.href);
428
+ }
429
+ }
430
+
431
+ const setSession = ():void => {
432
+ isLoggedIn = true;
433
+ sessionID = session;
434
+ playerID = userid;
435
+ }
436
+
437
+ const startInterval = (e:any):void => {
438
+ timer = 0;
439
+
440
+ timerInterval = setInterval(() => {
441
+ timer += 1;
442
+ panicLoading = true;
443
+
444
+ if (timer >= 3) {
445
+ window.postMessage({type: 'PanicButtonClicked'}, window.location.href);
446
+ clearInterval(timerInterval)
447
+ }
448
+ }, 1000);
449
+ }
450
+
451
+ const endInterval = (e:any):void => {
452
+ if (timer < 3) {
453
+ panicLoading = false;
454
+ }
455
+ clearInterval(timerInterval);
456
+ }
457
+
458
+ const addEventsToDisplayedElements = ():void => {
459
+ panicButton?.addEventListener("mousedown", startInterval, false);
460
+ panicButton?.addEventListener('touchstart', startInterval, false);
461
+
462
+ // on mouseup stop interval count
463
+ panicButton?.addEventListener("mouseup", endInterval, false);
464
+ panicButton?.addEventListener("touchend", endInterval, false);
465
+ }
466
+
467
+ const removeEventsToDisplayedElements = ():void => {
468
+ panicLoading = false;
469
+ panicButton?.removeEventListener("mousedown", startInterval);
470
+ panicButton?.removeEventListener('touchstart', startInterval);
471
+
472
+ // on mouseup stop interval count
473
+ panicButton?.removeEventListener("mouseup", endInterval);
474
+ panicButton?.removeEventListener("touchend", endInterval);
475
+ }
476
+
477
+ const setClientStyling = ():void => {
478
+ let sheet = document.createElement('style');
479
+ sheet.innerHTML = clientstyling;
480
+ customStylingContainer.appendChild(sheet);
481
+ }
482
+
483
+ const setClientStylingURL = ():void => {
484
+ let cssFile:HTMLElement = document.createElement('style');
485
+
486
+ fetch(new URL(clientstylingurl))
487
+ .then((res:any) => res.text())
488
+ .then((data:any) => {
489
+ cssFile.innerHTML = data
490
+
491
+ setTimeout(() => { customStylingContainer.appendChild(cssFile); }, 1);
492
+ });
493
+ }
494
+
495
+ onMount(() => {
496
+ window.addEventListener('scroll', scrollHandler, false);
497
+ window.addEventListener('message', messageHandler, false);
498
+
499
+ return () => {
500
+ window.removeEventListener('scroll', scrollHandler);
501
+ window.removeEventListener('message', messageHandler);
502
+
503
+ removeEventsToDisplayedElements();
504
+ }
505
+ });
506
+
507
+ $: lang && activecategory && setActiveCategory();
508
+ $: session && userid && endpoint && setSession();
509
+ $: activeCategory && allCategoriesIds && checkExistentCategory();
510
+ $: endpoint && datasource && lang && initialSetup();
511
+ $: lang && updateCategoriesLanguage();
512
+ $: translationurl && setTranslationUrl();
513
+ $: clientstyling && customStylingContainer && setClientStyling();
514
+ $: clientstylingurl && customStylingContainer && setClientStylingURL();
515
+ $: panicButton && addEventsToDisplayedElements();
516
+ </script>
517
+
518
+ <svelte:head>
519
+ <script type="module" src="https://unpkg.com/@everymatrix/casino-play-random-game"></script>
520
+ </svelte:head>
521
+
522
+ <div bind:this={customStylingContainer}>
523
+ {#if hasErrors}
524
+ <p class="SearchLoading">{$_('500')}</p>
525
+ {:else}
526
+ <section class="CategoriesLobby">
527
+
528
+ <casino-search
529
+ {endpoint} {datasource} {showgamename} {lang} {clientstyling} {clientstylingurl} {integratedgameframedesktop} {integratedgameframemobile} {translationurl} showfavorites = {favorites}
530
+ ></casino-search>
531
+
532
+ {#if playrandomgame == 'true' && searchFocus == false && !searchIsOn}
533
+ <casino-random-game {datasource} {filteredrandomgamecategories} {endpoint} {lang} {gameevent} {randombuttonicon} {clientstyling} {clientstylingurl}>
534
+ </casino-random-game>
535
+ {/if}
536
+
537
+ {#if randomgameslider == 'true' && searchFocus == false && !searchIsOn}
538
+ <casino-play-random-game {datasource} {endpoint} language={lang} specific-category={specificcategory} icon-visible={iconvisible} icon-visible-on-anim={iconvisibleonanim} launch-by-game-card={launchbygamecard} client-styling={clientstyling} client-styling-url={clientstylingurl} translation-url={translationurl}></casino-play-random-game>
539
+ {/if}
540
+
541
+ {#if isLoading}
542
+ <p class="SearchLoading">{$_('loading')}</p>
543
+ {:else if !searchIsOn}
544
+ {#if lobbyScreen}
545
+ {#each shownCategories as category, index}
546
+ {#if positionwinnerswidget && index == +positionwinnerswidget}
547
+ <div class="CasinoWinners">
548
+ <casino-winners
549
+ {session}
550
+ {userid}
551
+ {periodrecent}
552
+ {periodtop}
553
+ {numberusersrecent}
554
+ {numberuserstop}
555
+ {amountlimit}
556
+ {isrecentavailable}
557
+ {istopavailable}
558
+ {defaultcurrency}
559
+ usercurrency={currency}
560
+ {enableautoscroll}
561
+ {tabsorder}
562
+ {lang}
563
+ {clientstyling}
564
+ {clientstylingurl}
565
+ {endpoint}
566
+ {winnersdatasources}
567
+ />
568
+ </div>
569
+ {/if}
570
+ {#if positioncasinocalendar && index == +positioncasinocalendar}
571
+ <br>
572
+ <casino-calendar
573
+ {userroles}
574
+ {cmsendpoint}
575
+ {env}
576
+ {lang}
577
+ {clientstyling}
578
+ {clientstylingurl}
579
+ />
580
+ {/if}
581
+ {#if positionjelobbywidget && index == +positionjelobbywidget}
582
+ <br>
583
+ <slot name="je-jackpots-widget" class="{isMobile(userAgent) ? '' : 'JackpotsContainer'}"></slot>
584
+ {/if}
585
+ {#if positionjackpotbanners && index == (positionjackpotbanners.split(',')[0] == '' ? shownCategories.length : +positionjackpotbanners.split(',')[0])}
586
+ <br>
587
+ <casino-jackpot-banner
588
+ title="Egypt Quest"
589
+ currency = {currency || 'RON'}
590
+ gameid = "998"
591
+ {endpoint}
592
+ {lang}
593
+ {backgroundsrc}
594
+ {backgroundsrcmobile}
595
+ {titlelogopath}
596
+ {caticon0}
597
+ {caticon1}
598
+ {caticon2}
599
+ {caticon3}
600
+ {iconlabels}
601
+ {visualstructure}
602
+ {clientstyling}
603
+ {clientstylingurl}
604
+ />
605
+ {:else if positionjackpotbanners && index == (positionjackpotbanners.split(',')[1] == '' ? shownCategories.length : +positionjackpotbanners.split(',')[1])}
606
+ <br>
607
+ <casino-jackpot-banner
608
+ title="Jackpot Cards"
609
+ currency = {currency || 'RON'}
610
+ gameid = "999"
611
+ {endpoint}
612
+ {lang}
613
+ backgroundsrc="/assets/background0.jpg"
614
+ backgroundsrcmobile="/assets/background0.jpg"
615
+ titlelogopath = "/assets/jackpots_logo.svg"
616
+ caticon0="/assets/icon0.svg"
617
+ caticon1="/assets/icon1.svg"
618
+ caticon2="/assets/icon2.svg"
619
+ caticon3="/assets/icon3.svg"
620
+ visualstructure="typeSpread"
621
+ {clientstyling}
622
+ {clientstylingurl}
623
+ />
624
+ {/if}
625
+ {#if positioncollections && index ==(positioncollections.split(',')[0] == '' ? shownCategories.length : +positioncollections.split(',')[0])}
626
+ <casino-collections-providers
627
+ {endpoint}
628
+ {datasource}
629
+ {lang}
630
+ {type}
631
+ {collectionprovidersgamenames}
632
+ {titletype}
633
+ {clientstyling}
634
+ {clientstylingurl}>
635
+ </casino-collections-providers>
636
+ {:else if positioncollections && index == (positioncollections.split(',')[1] == '' ? shownCategories.length : +positioncollections.split(',')[1])}
637
+ <casino-collections-providers
638
+ {endpoint}
639
+ {datasource}
640
+ {lang}
641
+ type='vendor'
642
+ titletype="logo"
643
+ {collectionprovidersgamenames}
644
+ {clientstyling}
645
+ {clientstylingurl}>
646
+ </casino-collections-providers>
647
+ {/if}
648
+ <casino-games-category-section-nd
649
+ session={session}
650
+ userid={userid}
651
+ endpoint={endpoint}
652
+ datasource={datasource}
653
+ lang={lang}
654
+ currency={currency}
655
+ use:sendCategoryData={category}
656
+ categoryid={category}
657
+ categoryindex={index}
658
+ categorygames="9"
659
+ fetchviaevent={fetchviaevent}
660
+ favorites={favorites}
661
+ {showgamename}
662
+ {translationurl}
663
+ class="CategoryContainer"
664
+ style="background-color: {(index % 2 !== 0) ? categorybackground : 'transparent'}"
665
+ {clientstyling}
666
+ {clientstylingurl}
667
+ {livecasino}
668
+ {visiblegames}
669
+ {gamepagemodalurl}
670
+ {integratedgameframedesktop}
671
+ {integratedgameframemobile}
672
+ {casinomygames}
673
+ {filterbylogo}
674
+ {addfilterselector}
675
+ {addsortingselector}
676
+ {casinogamesgridslider}
677
+ />
678
+ {/each}
679
+ {:else if myGamesSection}
680
+ <casino-my-games
681
+ userid={userid}
682
+ session={session}
683
+ endpoint={endpoint}
684
+ datasource={datasource}
685
+ lang={lang}
686
+ currency={currency}
687
+ favorites={favorites}
688
+ {clientstyling}
689
+ {clientstylingurl}
690
+ {livecasino}
691
+ {visiblegames}
692
+ {gamepagemodalurl}
693
+ {showgamename}
694
+ {integratedgameframedesktop}
695
+ {integratedgameframemobile}
696
+ {translationurl}
697
+ {mostplayed}
698
+ {lastplayed}
699
+ {filteredcategories}
700
+ {activecategory}
701
+ {lastplayedunique}
702
+ categoryindex="0"
703
+ categoryid="MYGAMES"
704
+ {casinomygames}
705
+ {lastplayedperiod}
706
+ {mostplayedperiod}
707
+ {lastplayedorder}
708
+ {lastplayedlimit}
709
+ {mostplayedrounds}/>
710
+ {:else}
711
+ <casino-games-category-section-nd
712
+ userid={userid}
713
+ endpoint={endpoint}
714
+ datasource={datasource}
715
+ favorites={favorites}
716
+ lang={lang}
717
+ currency={currency}
718
+ session={session}
719
+ categoryid={activeCategory}
720
+ categorygames="9"
721
+ fetchviaevent={fetchviaevent}
722
+ class="CategoryContainer"
723
+ {showgamename}
724
+ {translationurl}
725
+ {clientstyling}
726
+ {clientstylingurl}
727
+ {livecasino}
728
+ {visiblegames}
729
+ {gamepagemodalurl}
730
+ {integratedgameframedesktop}
731
+ {integratedgameframemobile}
732
+ {casinomygames}
733
+ {filterbylogo}
734
+ {addfilterselector}
735
+ {addsortingselector}
736
+ {casinogamesgridslider}/>
737
+ {/if}
738
+ {/if}
739
+ {#if isLoggedIn && haspanicbutton == "true"}
740
+ <div class="PanicSection {(getDevice(userAgent) !== 'PC') ? 'PanicSectionMobile' : ''}">
741
+ <button class="PanicButton {(getDevice(userAgent) !== 'PC') ? 'PanicButtonMobile ' : ''}" class:PanicButtonAnimation={panicLoading} bind:this={panicButton} >{$_('breakButton')}</button>
742
+ </div>
743
+ {/if}
744
+ </section>
745
+ {/if}
746
+ </div>
747
+ <style lang="scss">
748
+
749
+
750
+
751
+ *, *::before, *::after {
752
+ margin: 0;
753
+ padding: 0;
754
+ box-sizing: border-box;
755
+ }
756
+
757
+ .CategoriesLobby {
758
+ margin: 0 auto;
759
+ max-width: 1300px;
760
+ position: relative;
761
+ }
762
+
763
+ .CasinoWinners {
764
+ background: transparent;
765
+ width: 100%;
766
+ min-height: 200px;
767
+ }
768
+
769
+ .PanicSectionMobile {
770
+ flex-direction: column;
771
+ margin: 20px 0;
772
+ }
773
+
774
+ .PanicSection {
775
+ display: flex;
776
+ justify-content: center;
777
+ align-items: center;
778
+ gap: 10px;
779
+ margin-top: 20px;
780
+ }
781
+
782
+ .PanicButton {
783
+ border-radius: 5px;
784
+ border: 1px solid var(--emfe-w-casino-color-primary, var(--emfe-w-color-primary, #D0046C));
785
+ background-color: var(--emfe-w-casino-color-primary, var(--emfe-w-color-primary, #D0046C));
786
+ width: 280px;
787
+ height: 48px;
788
+ line-height: 18px;
789
+ color: var(--emfe-w-button-typography, var(--emfe-w-color-white, #FFFFFF));
790
+ cursor: pointer;
791
+ }
792
+
793
+ .PanicButtonAnimation {
794
+ background: -webkit-linear-gradient(
795
+ 135deg,
796
+ rgba(20, 20, 20, 0) 55%, rgba(20, 20, 20, 0.3) 100%
797
+ );
798
+
799
+ background: -moz-linear-gradient(
800
+ 135deg,
801
+ rgba(20, 20, 20, 0) 55%, rgba(20, 20, 20, 0.3) 100%
802
+ );
803
+
804
+ background: -o-linear-gradient(
805
+ 135deg,
806
+ rgba(20, 20, 20, 0) 55%, rgba(20, 20, 20, 0.3) 100%
807
+ );
808
+
809
+ background-color: var(--emfe-w-casino-color-primary, var(--emfe-w-color-primary, #D0046C));
810
+ width: 280px;
811
+ color: var(--emfe-w-button-typography, var(--emfe-w-color-white, #FFFFFF));
812
+
813
+ -webkit-animation: bar-animation 2s linear;
814
+ }
815
+
816
+ .PanicButtonMobile {
817
+ width: 280px;
818
+ padding: 0 5px;
819
+
820
+ // Remove text selection for panic button on mobile
821
+ -webkit-touch-callout: none; /* iOS Safari */
822
+ -webkit-user-select: none; /* Safari */
823
+ -moz-user-select: none; /* Old versions of Firefox */
824
+ -ms-user-select: none; /* Internet Explorer/Edge */
825
+ user-select: none;
826
+ // End of removing selection properties
827
+ }
828
+
829
+ @-webkit-keyframes bar-animation {
830
+ 0% {
831
+ background-position: 0;
832
+ }
833
+ 100% {
834
+ background-position: 280px;
835
+ }
836
+ }
837
+
838
+
839
+ [type="search"] {
840
+ appearance: none;
841
+ }
842
+
843
+ .CategoryContainer, .JackpotsContainer {
844
+ display: block;
845
+
846
+ @media screen and (max-width: 1300px) {
847
+ padding: 0 2.4%
848
+ }
849
+ }
850
+
851
+ .SearchLoading {
852
+ color: var(--emfe-w-button-typography, var(--emfe-w-color-white, #FFFFFF));
853
+ font-size: 14px;
854
+ margin-top: 16px;
855
+ text-align: center;
856
+ }
857
+ </style>