@everymatrix/casino-integrated-game-page 0.0.272

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,710 @@
1
+ <svelte:options tag={null} />
2
+ <script lang="ts">
3
+ import { onMount } from "svelte";
4
+ import { isMobile, checkSession, getDevice } from 'rvhelper';
5
+ import { _, addNewMessages, setLocale, setupI18n } from './i18n';
6
+ import { IntegratedGamePageTranslations } from './translations';
7
+
8
+ // Native bridge
9
+ import {
10
+ isNative,
11
+ call as callNative,
12
+ registerEventListener as registerNativeEventListener,
13
+ } from 'js-native-bridge';
14
+
15
+ import moment from 'moment';
16
+
17
+ export let endpoint:string = '';
18
+ export let lang:string = ''; // Language
19
+ export let session:string = ''; // Value for sessionID
20
+ export let userid:string = ''; // Value for UserID;
21
+ export let clientstyling:string = '';
22
+ export let clientstylingurl:string = '';
23
+ export let favorites:string = '';
24
+
25
+ export let loginurl:string = '';
26
+ export let registerurl:string = '';
27
+ export let depositurl:string = '';
28
+ export let loginevent:string = '';
29
+ export let registerevent:string = '';
30
+ export let depositevent:string = '';
31
+
32
+ export let clockformat:string = '';
33
+ export let haspanicbutton:string = 'false';
34
+ export let playforfun:string = 'true';
35
+ export let checksession:string = 'true';
36
+
37
+ export let gameid:string = '';
38
+
39
+ let time:Object;
40
+ let iframe:any;
41
+
42
+ let isLoggedIn:boolean = false;
43
+ let hasErrors:boolean = false;
44
+ let isLoading:boolean = true;
45
+
46
+ let playerID:string;
47
+ let sessionID:string;
48
+
49
+ let game:any;
50
+ let detailsObtained:boolean = false;
51
+ let funMode:boolean = false;
52
+ let anonymousFunMode:boolean = false;
53
+ let isModal:boolean = true;
54
+
55
+ let gameFrameContainer:HTMLElement;
56
+ let gameInnerContainer:HTMLElement;
57
+ let isFullscreen:boolean = false;
58
+ let modalFrameWidth:number;
59
+ let modalFrameHeight:number;
60
+ let gameFrameWidth:number;
61
+ let gameFrameHeight:number;
62
+ let definitiveIframeWidth:string;
63
+ let definitiveIframeHeight:string;
64
+ let userAgent:any = window.navigator.userAgent;
65
+ let mobileView:boolean = false;
66
+ let customStylingContainer:HTMLElement;
67
+ let buttonsContainer:HTMLElement;
68
+ let timeContainer:HTMLElement;
69
+ let isOnNative:boolean = false;
70
+
71
+ setupI18n({ withLocale: 'en', translations: {}});
72
+
73
+ Object.keys(IntegratedGamePageTranslations).forEach((item) => {
74
+ addNewMessages(item, IntegratedGamePageTranslations[item]);
75
+ });
76
+
77
+ // @TODO game typescript model type
78
+ const formatGameLaunchUrl = (game:any):void => {
79
+ let url:URL = new URL(game.launchUrl);
80
+
81
+ url.searchParams.append('language', lang);
82
+ // @TODO wtf? session check or go home
83
+ // Maybe we should check if the session is valid, somehow?
84
+ if (sessionID && sessionID.length > 0) {
85
+ isLoggedIn = true;
86
+
87
+ url.searchParams.append('_sid', sessionID)
88
+ url.searchParams.append('funMode', 'false')
89
+ }
90
+ game.launchUrl = url;
91
+
92
+ return game;
93
+ }
94
+
95
+ const createGameURL = (gameId:string, modal?):void => {
96
+ let url:URL = new URL(`${endpoint}/casino/games/${gameId}`);
97
+
98
+ url.searchParams.append('language', lang);
99
+ url.searchParams.append('expand', 'vendor');
100
+
101
+ isModal = modal || false;
102
+
103
+ fetch(url.href)
104
+ .then((res:any) => res.json())
105
+ .then((data:any) => {
106
+ game = formatGameLaunchUrl(data[0]);
107
+
108
+ if (game.launchUrl) {
109
+ detailsObtained = true;
110
+ funMode = playforfun == 'true' ? game.hasFunMode : false;
111
+ anonymousFunMode = playforfun == 'true' ? game.hasAnonymousFunMode : false;
112
+ }
113
+ }, (err:any) => {
114
+ console.error('There was an error', err);
115
+
116
+ hasErrors = true;
117
+ }).then(() => {
118
+ if (gameFrameContainer) {
119
+ if (isModal) {
120
+ keepIframeRatio();
121
+ } else {
122
+ maximizeGameFrame();
123
+ }
124
+ }
125
+ });
126
+
127
+ window.postMessage({ type: 'RequestModalSize' }, window.location.href);
128
+ }
129
+
130
+ const messageHandler = (e:any):void => {
131
+ switch (e.data.type) {
132
+ case 'GameLaunchID':
133
+ createGameURL(e.data.gameId, true);
134
+ break;
135
+
136
+ case 'LaunchGameFrame':
137
+ openGameFrame(e.data.gameId, e.data.gameFunMode);
138
+ break;
139
+
140
+ case 'ModalClosed':
141
+ setTimeout(() => { // the timeout is necessary in order to sync with the closing of the modal frame and provide a smoother transition
142
+ detailsObtained = false;
143
+ }, 500);
144
+ break;
145
+
146
+ case 'UserSessionID':
147
+ if (e.data.session.length > 0) {
148
+ sessionID = e.data.session;
149
+ playerID = e.data.userID;
150
+ isLoggedIn = true;
151
+
152
+ let interval = setInterval(() => {
153
+ if (game) {
154
+ let url:any = new URL(game.launchUrl);
155
+
156
+ if (!url.searchParams.get('_sid')) {
157
+ url.searchParams.append('_sid', sessionID);
158
+ }
159
+
160
+ if (!url.searchParams.get('funMode')) {
161
+ url.searchParams.append('funMode', false);
162
+ }
163
+
164
+ if (!url.searchParams.get('_sid')) {
165
+ url.searchParams.append('language', lang);
166
+ }
167
+
168
+ game.launchUrl = url;
169
+
170
+ clearInterval(interval);
171
+ }
172
+ }, 250);
173
+ }
174
+ break;
175
+
176
+ case 'ModalSize':
177
+ modalFrameWidth = e.data.modalContainerSize.modalWidth;
178
+ modalFrameHeight = e.data.modalContainerSize.modalHeight;
179
+ break;
180
+
181
+ case 'UpdateCategoryFavoriteGames':
182
+ if (e.data.receivedFavoriteResults) {
183
+ favoriteGames = e.data.receivedFavoriteResults.items;
184
+ }
185
+ break;
186
+ }
187
+ }
188
+
189
+ const checkFavorite = (gameId:string):boolean => {
190
+ if (favoriteGames.findIndex(obj => obj.id == gameId) !== -1) {
191
+ return true;
192
+ } else {
193
+ return false;
194
+ }
195
+ }
196
+
197
+ const toggleFavoriteGame = (id:any):void => {
198
+ let triggerFactor = "gamepage";
199
+
200
+ if (game.isFavored) {
201
+ window.postMessage({ type: 'SetUnfavoredGame', id, triggerFactor }, window.location.href);
202
+ game.isFavored = false;
203
+ } else {
204
+ window.postMessage({ type: 'SetFavoredGame', id, triggerFactor }, window.location.href);
205
+ game.isFavored = true;
206
+ }
207
+ }
208
+
209
+ const setGameData = (game, gameFunMode) => {
210
+ anonymousFunMode = playforfun == 'true' ? game.hasAnonymousFunMode : false;
211
+ funMode = playforfun == 'true' ? gameFunMode : false;
212
+ detailsObtained = true;
213
+ return checkFavorite(game.id);
214
+ }
215
+
216
+ const openGameFrame = (gameId:string, gameFunMode:boolean):void => {
217
+ let url:URL = new URL(`${endpoint}/casino/games/${gameId}`);
218
+
219
+ url.searchParams.append('language', lang);
220
+
221
+ fetch(url.href)
222
+ .then((res:any) => res.json())
223
+ .then((data:any) => {
224
+ game = formatGameLaunchUrl(data[0]);
225
+ if (game.launchUrl) {
226
+ game.isFavored = setGameData(game, gameFunMode);
227
+ }
228
+ });
229
+ }
230
+
231
+ const goBack = () => {
232
+ window.postMessage({ type: 'GoToPreviousRoute' }, window.location.href);
233
+ }
234
+
235
+ const maximizeGameFrame = ():void => {
236
+ modalFrameWidth = game.width;
237
+ modalFrameHeight = game.height;
238
+
239
+ definitiveIframeWidth = game.width;
240
+ definitiveIframeHeight = game.height;
241
+
242
+ gameFrameWidth = game.width;
243
+ gameFrameHeight = game.height;
244
+ }
245
+
246
+ // Start section: keep aspect ratio for iframe on resize
247
+ const keepIframeRatio = ():void => {
248
+ let iframeContainer = getComputedStyle(gameFrameContainer);
249
+ let gameFrame = getComputedStyle(gameInnerContainer);
250
+ let gameContainerWidth = parseInt(iframeContainer.width.slice(0, -2));
251
+ let gameContainerHeight = parseInt(iframeContainer.height.slice(0, -2));
252
+ const iframeRatio = game.width/(game.height + 100);
253
+
254
+ gameFrameWidth = parseInt(gameFrame.width);
255
+ gameFrameHeight = parseInt(gameFrame.height);
256
+ // resize logic for maintaining game ratio when resizing
257
+ if ((gameContainerWidth / iframeRatio) > (gameContainerHeight - buttonsContainer.clientHeight - timeContainer.clientHeight)){
258
+ gameFrameHeight = gameContainerHeight - buttonsContainer.clientHeight - timeContainer.clientHeight;
259
+ gameFrameWidth = gameContainerHeight * iframeRatio;
260
+ } else {
261
+ gameFrameWidth = gameContainerWidth;
262
+ gameFrameHeight = gameContainerWidth / iframeRatio;
263
+ }
264
+
265
+ definitiveIframeWidth = gameFrameWidth ? Math.floor(gameFrameWidth) + "px" : "1280px";
266
+ definitiveIframeHeight = gameFrameHeight ? Math.floor(gameFrameHeight) + "px" : "720px";
267
+ }
268
+
269
+ const openGameWindow = (game:any):void => {
270
+ if (isOnNative) {
271
+ let data = {
272
+ url: game.launchUrl,
273
+ id: game.id,
274
+ vendor: game.vendor.name
275
+ }
276
+
277
+ callNative('OPEN_GAME', data);
278
+ } else if(integratedgameframe == 'false') {
279
+ window.open(game.launchUrl, '_blank');
280
+ } else if(integratedgameframe == 'true') {
281
+ console.log("gameid here ", gameid);
282
+ window.postMessage({ type: 'OpenIntegratedGameFrame' }, window.location.href);
283
+ }
284
+ }
285
+
286
+ const resizeHandler = ():void => {
287
+ // sent to modal component a flag (detailsObtained) by witch to determine if a game is open
288
+ window.postMessage({ type: 'GameStateOnResize', detailsObtained }, window.location.href);
289
+ // make sure that a game is open before trying to get the element properties
290
+ if (detailsObtained) {
291
+ if (gameFrameContainer) {
292
+ keepIframeRatio();
293
+ }
294
+ window.addEventListener('ModalSize', messageHandler, false);
295
+ }
296
+ }
297
+
298
+ // End section: keep aspect ratio for iframe on resize
299
+ const toggleLogin = ():void => {
300
+ if (loginevent) {
301
+ window.postMessage({ type: loginevent, transition: 'Login' }, window.location.href);
302
+ window.postMessage({ type: 'ModalClosed' }, window.location.href);
303
+ }
304
+
305
+ if (loginurl) {
306
+ // @ts-ignore
307
+ window.location = loginurl;
308
+ }
309
+ }
310
+
311
+ const toggleRegister = ():void => {
312
+ if (registerevent) {
313
+ window.postMessage({ type: registerevent, transition: 'Register' }, window.location.href);
314
+ window.postMessage({ type: 'ModalClosed' }, window.location.href);
315
+ }
316
+
317
+ if (registerurl) {
318
+ // @ts-ignore
319
+ window.location = registerurl;
320
+ }
321
+ }
322
+
323
+ const toggleDeposit = ():void => {
324
+ if (depositevent) {
325
+ window.postMessage({ type: depositevent }, window.location.href);
326
+ window.postMessage({ type: 'ModalClosed' }, window.location.href);
327
+ }
328
+
329
+ if (depositurl) {
330
+ // @ts-ignore
331
+ window.location = depositurl;
332
+ }
333
+ }
334
+
335
+ if (document.addEventListener) {
336
+ document.addEventListener('webkitfullscreenchange', exitHandler, false);
337
+ document.addEventListener('mozfullscreenchange', exitHandler, false);
338
+ document.addEventListener('fullscreenchange', exitHandler, false);
339
+ document.addEventListener('MSFullscreenChange', exitHandler, false);
340
+ }
341
+
342
+ function exitHandler() {
343
+ if (!document.webkitIsFullScreen && !document.mozFullScreen && !document.msFullscreenElement && isFullscreen) {
344
+ handleIframeSize();
345
+ }
346
+ }
347
+
348
+ const handleIframeSize = () => {
349
+ if ((document as any).fullscreenEnabled ||
350
+ (document as any).webkitFullscreenEnabled ||
351
+ (document as any).mozFullScreenEnabled ||
352
+ (document as any).msFullscreenEnabled) {
353
+ if (isFullscreen) {
354
+ if (document.exitFullscreen) {
355
+ document.exitFullscreen(); // firefox uses the same exit function
356
+ } else if ( document.webkitExitFullscreen) {
357
+ document.webkitExitFullscreen();
358
+ } else if ( document.msExitFullscreen) {
359
+ document.msExitFullscreen();
360
+ }
361
+ isFullscreen = false;
362
+ } else {
363
+ if (gameFrameContainer.requestFullscreen) {
364
+ gameFrameContainer.requestFullscreen();
365
+ } else if (gameFrameContainer.webkitRequestFullscreen) {
366
+ gameFrameContainer.webkitRequestFullscreen();
367
+ } else if (gameFrameContainer.mozRequestFullScreen) {
368
+ gameFrameContainer.mozRequestFullScreen();
369
+ } else if (gameFrameContainer.msRequestFullscreen) {
370
+ gameFrameContainer.msRequestFullscreen();
371
+ }
372
+ isFullscreen = true;
373
+ }
374
+ }
375
+ }
376
+
377
+ const panicAction = ():void => {
378
+ window.postMessage({ type: 'PanicButtonClicked' }, window.location.href);
379
+ }
380
+
381
+ const refreshTime = ():void => {
382
+ if (clockformat) {
383
+ time = moment().format(clockformat);
384
+ } else {
385
+ time = moment().format('LTS');
386
+ }
387
+ }
388
+
389
+ const timeInterval = setInterval(():void => {
390
+ refreshTime();
391
+ }, 100);
392
+
393
+ const setActiveLanguage = ():void => {
394
+ setLocale(lang);
395
+
396
+ isLoading = false;
397
+ mobileView = isMobile(userAgent);
398
+ }
399
+
400
+ const setSession = ():void => {
401
+ if (checksession == 'true') {
402
+ checkSession(endpoint, session).then((res:any) => {
403
+ sessionID = res.Guid;
404
+ playerID = res.UserID;
405
+ isLoggedIn = true;
406
+ }, (err:any) => {
407
+ isLoggedIn = false;
408
+ console.error('err on session', err);
409
+ });
410
+ } else {
411
+ sessionID = session;
412
+ playerID = userid;
413
+ }
414
+ }
415
+
416
+ const setClientStyling = ():void => {
417
+ let sheet = document.createElement('style');
418
+ sheet.innerHTML = clientstyling;
419
+ customStylingContainer.appendChild(sheet);
420
+ }
421
+
422
+ const setClientStylingURL = ():void => {
423
+ let cssFile:HTMLElement = document.createElement('style');
424
+
425
+ if (clientstylingurl) {
426
+ let url:URL = new URL(clientstylingurl);
427
+
428
+ fetch(url.href)
429
+ .then((res:any) => res.text())
430
+ .then((data:any) => {
431
+ cssFile.innerHTML = data
432
+
433
+ if (customStylingContainer) {
434
+ setTimeout(() => { customStylingContainer.appendChild(cssFile); }, 1);
435
+ }
436
+ });
437
+ }
438
+ }
439
+
440
+ onMount(() => {
441
+ window.addEventListener('resize', resizeHandler, false);
442
+ window.addEventListener('message', messageHandler, false);
443
+
444
+ isOnNative = !!isNative(userAgent);
445
+
446
+ return () => {
447
+ window.removeEventListener('resize', resizeHandler);
448
+ window.removeEventListener('message', messageHandler);
449
+
450
+ clearInterval(timeInterval);
451
+ }
452
+ });
453
+
454
+ $: lang && setActiveLanguage();
455
+ $: endpoint && gameid && lang && createGameURL(gameid);
456
+ $: session && userid && endpoint && setSession();
457
+ $: clientstyling && setClientStyling();
458
+ $: clientstylingurl && setClientStylingURL();
459
+
460
+ </script>
461
+
462
+ {#if isLoading}
463
+ <p class="SearchLoading" part="SearchLoading">Loading, please wait ...</p>
464
+ {:else}
465
+ {#if hasErrors}
466
+ <p class="SearchLoading" part="SearchLoading">500 Error - Internal Server Error.</p>
467
+ {:else}
468
+ <div class="CasinoIntegratedGamePage" part="CasinoIntegratedGamePage" bind:this={customStylingContainer}>
469
+ {#if detailsObtained}
470
+ {#if mobileView}
471
+ {#if isLoggedIn}
472
+ <div class="GamePageIntegratedTopSection" part="GamePageIntegratedTopSection">
473
+ <button class="backButton" part="backButton" on:click={() => goBack()}>
474
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><defs><style>.a{fill:var(--emfe-w-color-primary, #D0046C);}</style></defs><path class="a" d="M12,0,9.818,2.182l8.26,8.26H0v3.117H18.078l-8.26,8.26L12,24,24,12Z" transform="translate(24 24) rotate(180)"/></svg>
475
+ </button>
476
+ <p class="Time" part="Time" bind:this={timeContainer}><span>{time}</span></p>
477
+ <button class="DepositButton" part="DepositButton" on:click='{() => toggleDeposit()}'>{$_('gamePage.deposit')}</button>
478
+ </div>
479
+ <div id="IframeContainer" part="IframeContainer" bind:this={gameFrameContainer} class:FullsScreenLayout={isFullscreen} style="width: {modalFrameWidth}; height: {modalFrameHeight}">
480
+ <div id="IframeGame" part="IframeGame" bind:this={gameInnerContainer} style="width: {isFullscreen ? '100%' : definitiveIframeWidth}; height: {isFullscreen ? '100%' : definitiveIframeHeight}; max-width: {isFullscreen ? 'none' : (game.width ? game.width + 'px' : '1280px')}; max-height: {isFullscreen ? 'none' : (game.height ? (Math.floor(game.height) + 100) + 'px' : '720px')}">
481
+ <iframe title="Games" id="IframeGame" class="GamesContainer" part="GamesContainer" aria-hidden="false" src={game.launchUrl} bind:this={iframe}/>
482
+ <div class="BottomGame" part="BottomGame" bind:this={buttonsContainer}>
483
+ <button class="DepositButton" part="DepositButton" on:click='{() => toggleDeposit()}'>{$_('gamePage.deposit')}</button>
484
+ {#if haspanicbutton === "true"}
485
+ <div class="PanicSection" part="PanicSection">
486
+ <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>
487
+ <p>{$_('gamePage.break')}</p>
488
+ <button class="Button" part="Button" on:click={() => panicAction()}>{$_('gamePage.breakButton')}</button>
489
+ </div>
490
+ {/if}
491
+ {#if isFullscreen}
492
+ <button class="FullscreenButton" part="FullscreenButton" on:click='{() => handleIframeSize()}'>
493
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="24" height="24" viewBox="0 0 31 31"><polygon style="fill:#fff;" points="24.586,27.414 29.172,32 32,29.172 27.414,24.586 32,20 20,20 20,32 "/><polygon style="fill:#fff;" points="0,12 12,12 12,0 7.414,4.586 2.875,0.043 0.047,2.871 4.586,7.414 "/><polygon style="fill:#fff;" points="0,29.172 2.828,32 7.414,27.414 12,32 12,20 0,20 4.586,24.586 "/><polygon style="fill:#fff;" points="20,12 32,12 27.414,7.414 31.961,2.871 29.133,0.043 24.586,4.586 20,0 "/></svg>
494
+ </button>
495
+ {:else}
496
+ <button class="FullscreenButton" part="FullscreenButton" on:click='{() => handleIframeSize()}'>
497
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M21.414 18.586l2.586-2.586v8h-8l2.586-2.586-5.172-5.172 2.828-2.828 5.172 5.172zm-13.656-8l2.828-2.828-5.172-5.172 2.586-2.586h-8v8l2.586-2.586 5.172 5.172zm10.828-8l-2.586-2.586h8v8l-2.586-2.586-5.172 5.172-2.828-2.828 5.172-5.172zm-8 13.656l-2.828-2.828-5.172 5.172-2.586-2.586v8h8l-2.586-2.586 5.172-5.172z"/></svg>
498
+ </button>
499
+ {/if}
500
+ </div>
501
+ <div class="BannerSection" part="BannerSection"></div>
502
+ </div>
503
+ </div>
504
+ {:else}
505
+ {#if funMode}
506
+ <div class="GamePageIntegratedTopSection" part="GamePageIntegratedTopSection">
507
+ <button class="backButton" part="backButton" on:click={() => goBack()}>
508
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><defs><style>.a{fill:var(--emfe-w-color-primary, #D0046C);}</style></defs><path class="a" d="M12,0,9.818,2.182l8.26,8.26H0v3.117H18.078l-8.26,8.26L12,24,24,12Z" transform="translate(24 24) rotate(180)"/></svg>
509
+ </button>
510
+ <p class="Time" part="Time" bind:this={timeContainer}><span>{time}</span></p>
511
+ <button class="DepositButton" part="DepositButton" on:click='{() => toggleDeposit()}'>{$_('gamePage.deposit')}</button>
512
+ </div>
513
+ <div id="IframeContainer" part="IframeContainer" bind:this={gameFrameContainer} class:FullsScreenLayout={isFullscreen} style="width: {modalFrameWidth}; height: {modalFrameHeight}">
514
+ <div id="IframeGame" part="IframeGame" bind:this={gameInnerContainer} style="width: {isFullscreen ? '100%' : definitiveIframeWidth}; height: {isFullscreen ? '100%' : definitiveIframeHeight}; max-width: {isFullscreen || !isModal ? 'none' : (game.width ? Math.floor(game.width) + 'px' : '1280px')}; max-height: {isFullscreen || !isModal ? 'none' : (game.height ? (Math.floor(game.height) + 100) + 'px' : '720px')}">
515
+ <iframe title="Games" class="GamesContainer" part="GamesContainer" aria-hidden="false" src={game.launchUrl} bind:this={iframe}/>
516
+ <div class="BottomGame" part="BottomGame" bind:this={buttonsContainer}>
517
+ <div class="ButtonsContainer" part="ButtonsContainer">
518
+ <button class="LoginButton" part="LoginButton" on:click='{() => toggleLogin()}'>{$_('gamePage.signIn')}</button>
519
+ <button class="RegisterButton" part="RegisterButton" on:click='{() => toggleRegister()}'>{$_('gamePage.register')}</button>
520
+ </div>
521
+ {#if isFullscreen}
522
+ <button class="FullscreenButton" part="FullscreenButton" on:click='{() => handleIframeSize()}'>
523
+ <svg width="24" height="24" viewBox="0 0 31 31"><polygon style="fill:#fff;" points="24.586,27.414 29.172,32 32,29.172 27.414,24.586 32,20 20,20 20,32 "/><polygon style="fill:#fff;" points="0,12 12,12 12,0 7.414,4.586 2.875,0.043 0.047,2.871 4.586,7.414 "/><polygon style="fill:#fff;" points="0,29.172 2.828,32 7.414,27.414 12,32 12,20 0,20 4.586,24.586 "/><polygon style="fill:#fff;" points="20,12 32,12 27.414,7.414 31.961,2.871 29.133,0.043 24.586,4.586 20,0 "/></svg>
524
+ </button>
525
+ {:else}
526
+ <button class="FullscreenButton" part="FullscreenButton" on:click='{() => handleIframeSize()}'>
527
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M21.414 18.586l2.586-2.586v8h-8l2.586-2.586-5.172-5.172 2.828-2.828 5.172 5.172zm-13.656-8l2.828-2.828-5.172-5.172 2.586-2.586h-8v8l2.586-2.586 5.172 5.172zm10.828-8l-2.586-2.586h8v8l-2.586-2.586-5.172 5.172-2.828-2.828 5.172-5.172zm-8 13.656l-2.828-2.828-5.172 5.172-2.586-2.586v8h8l-2.586-2.586 5.172-5.172z"/></svg>
528
+ </button>
529
+ {/if}
530
+ </div>
531
+ <div class="BannerSection" part="BannerSection"></div>
532
+ </div>
533
+ </div>
534
+ {/if}
535
+ {/if}
536
+ {/if}
537
+ {/if}
538
+ </div>
539
+ {/if}
540
+ {/if}
541
+
542
+
543
+ <style lang="scss">
544
+ :host {
545
+ font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji';
546
+ }
547
+ .CasinoIntegratedGamePage {
548
+ height: 100%;
549
+ }
550
+ .GamePageIntegratedTopSection {
551
+
552
+ }
553
+
554
+ .BottomGame {
555
+ padding-left: 60px;
556
+ padding-right: 60px;
557
+ min-height: 85px;
558
+ background-color: var(--emfe-w-color-contrast, #07072A);
559
+ display: flex;
560
+ justify-content: space-between;
561
+ align-items: center;
562
+ }
563
+ .DepositButton, .PlayNowButton {
564
+ border: none;
565
+ width: 130px;
566
+ height: 60px;
567
+ background-color: var(--emfe-w-color-green, #48952a);
568
+ color: var(--emfe-w-color-white, #FFFFFF);
569
+ border-radius: 2px;
570
+ cursor: pointer;
571
+ }
572
+ .PlayNowButton {
573
+ background-color: var(--emfe-w-color-primary, #D0046C);
574
+ }
575
+ .GameThumbnail {
576
+ border-radius: 2px;
577
+ width: 270px;
578
+ height: 180px;
579
+ }
580
+ .FullscreenButton {
581
+ border-radius: 5px;
582
+ border: none;
583
+ width: 60px;
584
+ height: 60px;
585
+ background-color: var(--emfe-w-color-primary, #D0046C);
586
+ float: right;
587
+ }
588
+ .GameDetails {
589
+ display: flex;
590
+ flex-direction: column;
591
+ align-items: center;
592
+ }
593
+ .GameDetails h3 {
594
+ color: var(--emfe-w-color-white, #FFFFFF);
595
+ font-size: 18px;
596
+ text-align: center;
597
+ padding: 0 10px;
598
+ }
599
+ .ButtonsContainer {
600
+ width: 275px;
601
+ margin-top: 20px;
602
+ display: flex;
603
+ flex-direction: row;
604
+ justify-content: space-between;
605
+ }
606
+ .RegisterButton {
607
+ color: var(--emfe-w-color-white, #FFFFFF);
608
+ background-color: var(--emfe-w-color-primary, #D0046C);
609
+ border-radius: 5px;
610
+ border: none;
611
+ width: 129px;
612
+ height: 60px;
613
+ }
614
+ .LoginButton {
615
+ color: var(--emfe-w-color-primary, #D0046C);
616
+ background-color: var(--emfe-w-color-contrast, #07072A);
617
+ border-radius: 5px;
618
+ border: 1px solid var(--emfe-w-color-primary, #D0046C);
619
+ width: 129px;
620
+ height: 60px;
621
+ }
622
+ .FullWidthButton {
623
+ color: var(--emfe-w-color-primary, #D0046C);
624
+ background-color: var(--emfe-w-color-contrast, #07072A);
625
+ border-radius: 5px;
626
+ border: 1px solid var(--emfe-w-color-primary, #D0046C);
627
+ width: 100%;
628
+ height: 60px;
629
+ margin-top: 20px;
630
+ }
631
+ .GamesContainer {
632
+ width: 100%;
633
+ height: 100%;
634
+ max-width: calc(100% - 4px);
635
+ max-height: calc(100% - 100px);
636
+ }
637
+ .Time {
638
+ height: 20px;
639
+ margin: 0;
640
+ display: flex;
641
+ align-items: center;
642
+ justify-content: center;
643
+ }
644
+ svg {
645
+ fill: var(--emfe-w-color-white, #FFFFFF);
646
+ }
647
+ p {
648
+ color: var(--emfe-w-color-white, #FFFFFF);
649
+ }
650
+ #IframeContainer {
651
+ height:100%;
652
+ width:100%;
653
+ display: flex;
654
+ align-items: center;
655
+ justify-content: center;
656
+ }
657
+ #IframeGame {
658
+ width: 100%;
659
+ height: 100%;
660
+ }
661
+ .FullsScreenLayout .GamesContainer {
662
+ // the use of !important is necessary in order to override the dynamic inline width/height, when in fullscreen mode
663
+ width: 100%!important;
664
+ height: calc(100% - 100px)!important;
665
+ }
666
+ .FavoredIcon, .UnfavoredIcon {
667
+ width: 35px;
668
+ height: 35px;
669
+ }
670
+ .FavIconContainer {
671
+ position: absolute;
672
+ top: 15px;
673
+ left: 15px;
674
+ cursor: pointer;
675
+ }
676
+ .PanicSectionMobile {
677
+ flex-direction: column;
678
+ margin: 20px 0;
679
+ }
680
+ .PanicText {
681
+ display: flex;
682
+ align-items: center;
683
+ }
684
+ .PanicSection {
685
+ display: flex;
686
+ align-items: center;
687
+ gap: 10px;
688
+ margin: 20px 0;
689
+
690
+ svg {
691
+ fill: none;
692
+ }
693
+ p {
694
+ font-size: 16px;
695
+ color: var(--emfe-w-color-white, #FFFFFF);
696
+ }
697
+ .Button {
698
+ border-radius: 5px;
699
+ border: 1px solid var(--emfe-w-color-primary, #D0046C);
700
+ background-color: var(--emfe-w-color-primary, #D0046C);
701
+ width: 240px;
702
+ height: 60px;
703
+ color: var(--emfe-w-color-white, #FFFFFF);
704
+ cursor: pointer;
705
+ }
706
+ }
707
+ .BannerSection {
708
+ height: 150px;
709
+ }
710
+ </style>