@everymatrix/casino-play-random-game 1.29.4 → 1.29.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.
- package/dist/casino-play-random-game/casino-play-random-game.esm.js +1 -1
- package/dist/casino-play-random-game/p-51fa7686.entry.js +1 -0
- package/dist/cjs/casino-play-random-game.cjs.entry.js +23 -7
- package/dist/collection/components/casino-play-random-game/casino-play-random-game.js +7 -3
- package/dist/collection/utils/locale.utils.js +17 -4
- package/dist/components/casino-play-random-game.js +23 -7
- package/dist/esm/casino-play-random-game.entry.js +23 -7
- package/package.json +1 -1
- package/dist/casino-play-random-game/p-0f957927.entry.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as i,b as n}from"./p-0f38b3f8.js";(()=>{const n=import.meta.url,a={};return""!==n&&(a.resourcesUrl=new URL(".",n).href),i(a)})().then((i=>n([["p-
|
|
1
|
+
import{p as i,b as n}from"./p-0f38b3f8.js";(()=>{const n=import.meta.url,a={};return""!==n&&(a.resourcesUrl=new URL(".",n).href),i(a)})().then((i=>n([["p-51fa7686",[[1,"casino-play-random-game",{endpoint:[513],datasource:[513],language:[513],specificCategory:[513,"specific-category"],iconVisible:[513,"icon-visible"],iconVisibleOnAnim:[513,"icon-visible-on-anim"],launchByGameCard:[513,"launch-by-game-card"],clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],translationUrl:[513,"translation-url"],hasErrors:[32],limitStylingAppends:[32],isLoading:[32],gamesToShow:[32],selectedGame:[32],animationDone:[32],animationStarted:[32]}]]]],i)));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as n,h as a,g as e}from"./p-0f38b3f8.js";const t={en:{error:"Error",randomGameLoading:"Loading ...",playRandomGame:"Play a random game",playNowRandomGame:"Play now",spinRandomGame:"Spin"},ro:{error:"Error",randomGameLoading:"Loading ...",playRandomGame:"Play a random game",playNowRandomGame:"Play now",spinRandomGame:"Spin"},fr:{error:"Error",randomGameLoading:"Loading ...",playRandomGame:"Play a random game",playNowRandomGame:"Play now",spinRandomGame:"Spin"},hr:{error:"Error",randomGameLoading:"Loading ...",playRandomGame:"Play a random game",playNowRandomGame:"Play now",spinRandomGame:"Spin"},hu:{error:"Error",randomGameLoading:"Loading ...",playRandomGame:"Play a random game",playNowRandomGame:"Play now",spinRandomGame:"Spin"},tr:{error:"Hata",randomGameLoading:"Yükleniyor...",playRandomGame:"Rasgele bir oyun oyna",playNowRandomGame:"Şimdi Oyna",spinRandomGame:"DEĞİŞTİR"}},o=n=>new Promise((a=>{fetch(n).then((n=>n.json())).then((n=>{Object.keys(n).forEach((a=>{a in t||(t[a]={});for(let e in n[a])t[a][e]=n[a][e]})),a(!0)}))})),i=(n,a,e)=>{let o=t[void 0!==a?a:"en"][n];if(void 0!==e)for(const[n,a]of Object.entries(e.values)){const e=new RegExp(`{${n}}`,"g");o=o.replace(e,a)}return o},r=class{constructor(a){n(this,a),this.language="en",this.specificCategory="",this.iconVisible="",this.iconVisibleOnAnim="",this.launchByGameCard="",this.clientStyling="",this.clientStylingUrl="",this.translationUrl="",this.hasErrors=!1,this.limitStylingAppends=!1,this.isLoading=!0,this.selectedGame=null,this.animationDone=!1,this.animationStarted=!1,this.animation=null,this.selectedGameIndex=null,this.selectedGameEl=null,this.iconVisibility=null,this.shuffle=n=>{let a,e=n.length;for(;0!==e;)a=Math.floor(Math.random()*e),e--,[n[e],n[a]]=[n[a],n[e]];return n},this.setClientStyling=()=>{let n=document.createElement("style");n.innerHTML=this.clientStyling,this.host.shadowRoot.prepend(n)},this.setClientStylingURL=()=>{let n=new URL(this.clientStylingUrl),a=document.createElement("style");fetch(n.href).then((n=>n.text())).then((n=>{a.innerHTML=n,this.clientStyling=n,setTimeout((()=>{this.host.shadowRoot.prepend(a)}),1)}))}}watchEndpoint(n,a){n&&n!=a&&this.endpoint&&this.fetchGameList()}handleNewTranslations(){this.isLoading=!0,o(this.translationUrl).then((()=>{this.isLoading=!1}))}connectedCallback(){this.iconVisibility="true"===this.iconVisible}componentWillLoad(){if(this.translationUrl.length>2&&o(this.translationUrl),this.endpoint&&this.language&&this.datasource)return this.fetchGameList()}componentDidLoad(){!this.limitStylingAppends&&this.host&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL(),this.limitStylingAppends=!0)}fetchGameList(){let n=new URL(`${this.endpoint}/v1/casino/games`);return n.searchParams.append("device",(()=>{const n=(()=>{let n=window.navigator.userAgent;return n.toLowerCase().match(/android/i)?"Android":n.toLowerCase().match(/iphone/i)?"iPhone":n.toLowerCase().match(/ipad|ipod/i)?"iPad":"PC"})();if(n)return"PC"===n?"dk":"mtWeb"})()),n.searchParams.append("datasource",this.datasource),n.searchParams.append("fields","gId,id,href,thumbnail,name,vendor,launchUrl,subVendor"),n.searchParams.append("expand","vendor"),n.searchParams.append("pagination","offset=0,limit=423"),n.searchParams.append("language",this.language),this.specificCategory&&n.searchParams.append("filter",`categories(id=${this.specificCategory})`),new Promise(((a,e)=>{this.isLoading=!0,fetch(n.href).then((n=>n.json())).then((n=>{this.gamesToShow=this.setUpGames(null==n?void 0:n.items),a(!0)})).catch((n=>{console.error(n),this.hasErrors=!0,e(n)})).finally((()=>{this.isLoading=!1}))}))}setUpGames(n){const a=this.shuffle(n).slice(0,40);return a.concat(a)}selectRandomGame(){const n=this.gamesToShow.length/2;this.selectedGameIndex=Math.floor(Math.random()*(n-3)),this.selectedGameIndex+=n,this.selectedGameEl=this.gameContainer.children[this.selectedGameIndex]}playRandomGame(){this.animateGames(),"function"==typeof gtag&>ag("event","PlayRandomGame",{context:"CasinoPlayRandomGame"})}respin(){this.animateGames(),"function"==typeof gtag&>ag("event","RespinRandomGame",{context:"CasinoPlayRandomGame"})}animateGames(){this.iconVisibility="true"===this.iconVisibleOnAnim,this.animationStarted=!0,this.animationDone=!1,this.animation&&this.animation.cancel(),this.selectedGameEl&&(this.selectedGameEl.classList.remove("TheRandomGame"),this.selectedGame=null,this.selectedGameIndex=null),this.selectRandomGame();const n=window.getComputedStyle(this.gameContainer).getPropertyValue("gap"),a=parseInt(n,10),e=this.selectedGameEl.offsetWidth;this.animation=this.gameContainer.animate([{transform:"translateX(0px)",scale:1},{scale:.75},{transform:`translateX(-${(e+a)*this.selectedGameIndex+e/2-this.gameContainer.offsetWidth/2}px)`,scale:1}],{duration:3e3,easing:"cubic-bezier(0.5, 0, 0.5, 1.2)",fill:"forwards"}),this.animation.onfinish=()=>{this.animationDone=!0,this.selectedGameEl.classList.add("TheRandomGame"),this.selectedGame=this.gamesToShow[this.selectedGameIndex]}}playGame(){this.selectedGame&&(window.postMessage({type:"PlayRandomGame",gameId:this.selectedGame.id,launchUrl:this.selectedGame.launchUrl,gameName:this.selectedGame.name,subVendor:this.selectedGame.subVendor},window.location.href),"function"==typeof gtag&>ag("event","OpenRandomGame",{context:"CasinoPlayRandomGame"}))}showGameInfo(){window.postMessage({type:"InfoRandomGame",gameId:this.selectedGame.id,launchUrl:this.selectedGame.launchUrl,gameName:this.selectedGame.name,subVendor:this.selectedGame.subVendor},window.location.href),"function"==typeof gtag&>ag("event","OpenRandomGameInfo",{context:"CasinoPlayRandomGame"})}renderGameDetails(){return a("div",{class:"RandomButtonsWrapper"},a("div",{class:"RandomGameDetails"},a("span",{class:"RandomGameTitle"},this.selectedGame.name),a("span",{class:"RandomGameInfo",onClick:()=>this.showGameInfo()},"i")),a("div",{class:"RandomButtons"},a("button",{class:"RandomButton On",onClick:()=>this.respin()},i("spinRandomGame",this.language)),!this.launchByGameCard&&a("button",{class:"RandomButton On",onClick:()=>this.playGame()},i("playNowRandomGame",this.language))))}render(){return this.hasErrors?a("div",{class:"RandomGameError"},a("div",{class:"Title"},i("error",this.language))):this.isLoading?a("div",{class:"RandomGameLoading"},a("div",{class:"Title"},i("randomGameLoading",this.language))):this.isLoading?void 0:a("div",{class:"RandomGameWrapper"},a("div",{class:"GameContainerGradient"}),a("div",{class:"GamesContainer",ref:n=>this.gameContainer=n},this.gamesToShow&&this.gamesToShow.map(((n,e)=>a("div",{class:"RandomGameCard",key:e,onClick:"true"===this.launchByGameCard?()=>this.playGame():null},a("div",{class:"RandomGameVendor"},n.vendor.name),a("img",{class:"RandomGameImage",src:n.thumbnail,alt:n.name,title:n.name}),this.selectedGame&&this.selectedGameIndex===e&&this.renderGameDetails())))),a("div",{class:"ButtonWrapper "+(this.animationDone?"HideAnimation":"")},a("div",{class:"ButtonContainer"},this.iconVisibility&&a("div",{class:"ButtonIcon "+(this.animationStarted?"Flip":"")},a("div",{class:"QustionMark "+(this.animationStarted?"Flip":"")},"?"),a("div",{class:"HexagonMark"},a("div",{class:"HexagonMarkBorder"}))),!this.animationStarted&&a("div",{class:"RandomButton "+(this.animationStarted?"HideAnimation":""),onClick:()=>this.playRandomGame()},i("playRandomGame",this.language)))))}get host(){return e(this)}static get watchers(){return{endpoint:["watchEndpoint"],datasource:["watchEndpoint"],language:["watchEndpoint"],translationUrl:["handleNewTranslations"]}}};r.style=":host {\n display: block;\n font-family: inherit;\n}\n\n.RandomGameWrapper {\n width: 100%;\n overflow: hidden;\n background: transparent;\n position: relative;\n}\n\n.GameContainerGradient {\n position: absolute;\n top: 0;\n left: 0;\n width: 100vw;\n height: 100%;\n background: linear-gradient(90deg, var(--emfe-w-casino-color-bg, var(--emfe-w-color-background, #07072A)) 0%, rgba(7, 7, 42, 0.5) 25%, rgba(7, 7, 42, 0) 50%, rgba(7, 7, 42, 0.5) 75%, var(--emfe-w-casino-color-bg, var(--emfe-w-color-background, #07072A)) 100%);\n pointer-events: none;\n z-index: 1;\n}\n\n.GamesContainer {\n display: flex;\n height: 330px;\n flex-direction: row;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: center;\n align-content: flex-start;\n gap: 20px;\n}\n\n.RandomGameCard {\n position: relative;\n width: 256px;\n height: 170px;\n border-radius: 5px;\n filter: blur(5px);\n}\n.RandomGameCard .RandomGameVendor {\n position: absolute;\n font-size: 12px;\n bottom: 10px;\n left: 10px;\n color: var(--emfe-w-color-white, #FFFFFF);\n}\n\n.TheRandomGame {\n animation-name: ZoomFadeIn;\n animation-duration: 0.5s;\n animation-fill-mode: forwards;\n -webkit-animation-name: ZoomFadeIn;\n -webkit-animation-duration: 0.5s;\n -webkit-animation-fill-mode: forwards;\n opacity: 1;\n cursor: pointer;\n filter: blur(0);\n}\n\n.RandomGameImage {\n width: 256px;\n height: 170px;\n}\n\n.RandomGameDetails {\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n color: var(--emfe-w-casino-typography, var(--emfe-w-color-white, #FFFFFF));\n font-size: 14px;\n width: 100%;\n}\n.RandomGameDetails .RandomGameTitle {\n line-height: 18px;\n}\n.RandomGameDetails .RandomGameInfo {\n border-radius: 50%;\n width: 16px;\n height: 16px;\n font-size: 12px;\n font-weight: 400;\n border: solid 1px var(--emfe-w-casino-typography, var(--emfe-w-color-white, #FFFFFF));\n text-align: center;\n margin: 4px 0;\n line-height: 14px;\n cursor: pointer;\n}\n.RandomGameDetails .RandomGamePlay {\n background: var(--emfe-w-casino-color-primary, var(--emfe-w-color-primary, #D0046C));\n color: var(--emfe-w-button-typography, var(--emfe-w-color-white, #FFFFFF));\n border: none;\n border-radius: 5px;\n width: 200px;\n height: 40px;\n font-size: 14px;\n cursor: pointer;\n}\n\n.ButtonWrapper {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n}\n\n.ButtonContainer {\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n gap: 10px;\n width: 100%;\n}\n\n.ButtonIcon {\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n gap: 5px;\n}\n\n.QustionMark {\n position: relative;\n font-size: 80px;\n font-weight: 700;\n color: var(--emfe-w-color-white, #FFFFFF);\n z-index: 5;\n bottom: 20px;\n text-shadow: 0px 4px 0px var(--emfe-w-color-black, #000000);\n}\n\n.HexagonMark {\n position: absolute;\n width: 70px;\n height: 85px;\n background: linear-gradient(90deg, var(--emfe-w-casino-color-primary, var(--emfe-w-color-primary, #D0046C)) 0%, var(--emfe-w-categories-color-secondary, var(--emfe-w-color-secondary, #FD2839)) 100%);\n clip-path: polygon(50% 0, 100% 30%, 100% 70%, 50% 100%, 0% 70%, 0% 30%);\n}\n\n.HexagonMarkBorder {\n position: relative;\n display: flex;\n justify-content: center;\n align-items: center;\n top: 5px;\n left: 5px;\n width: 60px;\n height: 75px;\n background: linear-gradient(180deg, var(--emfe-w-casino-color-primary, var(--emfe-w-color-primary, #D0046C)) 0%, var(--emfe-w-categories-color-secondary, var(--emfe-w-color-secondary, #FD2839)) 100%);\n clip-path: polygon(50% 0, 100% 30%, 100% 70%, 50% 100%, 0% 70%, 0% 30%);\n}\n\n.RandomButtons {\n display: flex;\n flex-direction: row;\n justify-content: center;\n align-items: center;\n gap: 5px;\n width: 100%;\n}\n\n.RandomButton {\n font-size: 18px;\n text-transform: uppercase;\n width: max-content;\n border-radius: 5px;\n padding: 5px 25px;\n border: solid 3px var(--emfe-w-casino-color-primary, var(--emfe-w-color-primary, #D0046C));\n color: var(--emfe-w-button-typography, var(--emfe-w-color-white, #FFFFFF));\n opacity: 1;\n text-shadow: 1px 1px 2px var(--emfe-w-color-black, #000000);\n animation: ButtonEffect 3s linear infinite;\n background-image: linear-gradient(to right, var(--emfe-w-casino-color-primary, var(--emfe-w-color-primary, #D0046C)), var(--emfe-w-categories-color-secondary, var(--emfe-w-color-secondary, #FD2839)), var(--emfe-w-casino-color-primary, var(--emfe-w-color-primary, #D0046C)));\n background-size: 300% 100%;\n cursor: pointer;\n}\n.RandomButton:hover {\n opacity: 0.8;\n}\n\n.HideAnimation {\n filter: blur(5px);\n animation: AnimateButton 0.2s forwards;\n}\n\n.Flip {\n animation-name: Flip, Blur;\n animation-duration: 0.75s, 3s;\n animation-iteration-count: infinite, 1;\n -webkit-animation-name: Flip, Blur;\n -webkit-animation-duration: 0.75s, 3s;\n -webkit-animation-iteration-count: infinite, 1;\n}\n\n@keyframes ButtonEffect {\n 0% {\n background-position: 0% 50%;\n }\n 33% {\n background-position: 100% 50%;\n }\n 66% {\n background-position: 200% 50%;\n }\n 100% {\n background-position: 300% 50%;\n }\n}\n@keyframes ZoomFadeIn {\n 0% {\n transform: scale(0.2) translateY(0);\n filter: blur(5px);\n opacity: 0.3;\n }\n 50% {\n transform: scale(1.1) translateY(-30px);\n filter: blur(2px);\n opacity: 0.7;\n }\n 100% {\n transform: scale(1) translateY(-30px);\n filter: blur(0px);\n opacity: 1;\n }\n}\n@keyframes AnimateButton {\n 0% {\n opacity: 0.7;\n }\n 50% {\n opacity: 0.4;\n }\n 100% {\n opacity: 0;\n display: none;\n }\n}\n@keyframes Flip {\n 0% {\n transform: rotateY(0deg);\n }\n 50% {\n transform: rotateY(180deg);\n }\n 100% {\n transform: rotateY(360deg);\n }\n}\n@keyframes Blur {\n 0% {\n filter: blur(0);\n }\n 50% {\n filter: blur(1px);\n }\n 100% {\n filter: blur(3px);\n }\n}\n@container (max-width: 475px) {\n .GameContainerGradient {\n position: absolute;\n top: 0;\n left: 0;\n width: 100vw;\n height: 100%;\n background: linear-gradient(90deg, var(--emfe-w-casino-color-bg, var(--emfe-w-color-background, #07072A)) 0%, rgba(7, 7, 42, 0.2) 25%, rgba(7, 7, 42, 0) 50%, rgba(7, 7, 42, 0.2) 75%, var(--emfe-w-casino-color-bg, var(--emfe-w-color-background, #07072A)) 100%);\n pointer-events: none;\n z-index: 1;\n }\n\n .RandomGameCard {\n width: 102px;\n height: 146px;\n border-radius: 5px;\n filter: blur(5px);\n }\n\n .RandomGameImage {\n width: 102px;\n height: 146px;\n }\n\n .RandomGameDetails {\n font-size: 14px;\n width: 100%;\n }\n .RandomGameDetails .RandomGameTitle {\n line-height: 18px;\n width: 75%;\n }\n .RandomGameDetails .RandomGameInfo {\n border-radius: 50%;\n width: 16px;\n height: 16px;\n font-size: 12px;\n line-height: 14px;\n }\n .RandomGameDetails .RandomGamePlay {\n background: var(--emfe-w-casino-color-primary, var(--emfe-w-color-primary, #D0046C));\n color: var(--emfe-w-button-typography, var(--emfe-w-color-white, #FFFFFF));\n border: none;\n border-radius: 5px;\n width: 200px;\n height: 40px;\n font-size: 14px;\n cursor: pointer;\n }\n\n .RandomGameCard .RandomGameVendor {\n font-size: 12px;\n bottom: 5px;\n right: 5px;\n }\n\n .RandomButtons {\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n gap: 5px;\n width: 100%;\n }\n\n .RandomButton {\n font-size: 18px;\n text-transform: uppercase;\n width: max-content;\n border-radius: 5px;\n padding: 5px 25px;\n border: solid 3px var(--emfe-w-casino-color-primary, var(--emfe-w-color-primary, #D0046C));\n color: var(--emfe-w-button-typography, var(--emfe-w-color-white, #FFFFFF));\n opacity: 1;\n text-shadow: 1px 1px 2px var(--emfe-w-color-black, #000000);\n animation: ButtonEffect 3s linear infinite;\n background-image: linear-gradient(to right, var(--emfe-w-casino-color-primary, var(--emfe-w-color-primary, #D0046C)), var(--emfe-w-categories-color-secondary, var(--emfe-w-color-secondary, #FD2839)), var(--emfe-w-casino-color-primary, var(--emfe-w-color-primary, #D0046C)));\n background-size: 300% 100%;\n cursor: pointer;\n }\n .RandomButton:hover {\n opacity: 0.8;\n }\n}";export{r as casino_play_random_game}
|
|
@@ -42,37 +42,50 @@ const TRANSLATIONS = {
|
|
|
42
42
|
spinRandomGame: 'Spin'
|
|
43
43
|
},
|
|
44
44
|
ro: {
|
|
45
|
-
error: '
|
|
45
|
+
error: 'Error',
|
|
46
|
+
randomGameLoading: 'Loading ...',
|
|
46
47
|
playRandomGame: 'Play a random game',
|
|
47
48
|
playNowRandomGame: 'Play now',
|
|
48
49
|
spinRandomGame: 'Spin'
|
|
49
50
|
},
|
|
50
51
|
fr: {
|
|
51
52
|
error: 'Error',
|
|
53
|
+
randomGameLoading: 'Loading ...',
|
|
52
54
|
playRandomGame: 'Play a random game',
|
|
53
55
|
playNowRandomGame: 'Play now',
|
|
54
56
|
spinRandomGame: 'Spin'
|
|
55
57
|
},
|
|
56
58
|
hr: {
|
|
57
|
-
error: '
|
|
59
|
+
error: 'Error',
|
|
60
|
+
randomGameLoading: 'Loading ...',
|
|
58
61
|
playRandomGame: 'Play a random game',
|
|
59
62
|
playNowRandomGame: 'Play now',
|
|
60
63
|
spinRandomGame: 'Spin'
|
|
61
64
|
},
|
|
62
65
|
hu: {
|
|
63
|
-
error: '
|
|
66
|
+
error: 'Error',
|
|
67
|
+
randomGameLoading: 'Loading ...',
|
|
64
68
|
playRandomGame: 'Play a random game',
|
|
65
69
|
playNowRandomGame: 'Play now',
|
|
66
70
|
spinRandomGame: 'Spin'
|
|
71
|
+
},
|
|
72
|
+
tr: {
|
|
73
|
+
error: "Hata",
|
|
74
|
+
randomGameLoading: "Yükleniyor...",
|
|
75
|
+
playRandomGame: "Rasgele bir oyun oyna",
|
|
76
|
+
playNowRandomGame: "Şimdi Oyna",
|
|
77
|
+
spinRandomGame: "DEĞİŞTİR"
|
|
67
78
|
}
|
|
68
79
|
};
|
|
69
80
|
const getTranslations = (url) => {
|
|
70
|
-
// fetch url, get the data, replace the TRANSLATIONS content
|
|
71
81
|
return new Promise((resolve) => {
|
|
72
82
|
fetch(url)
|
|
73
83
|
.then((res) => res.json())
|
|
74
84
|
.then((data) => {
|
|
75
85
|
Object.keys(data).forEach((item) => {
|
|
86
|
+
if (!(item in TRANSLATIONS)) {
|
|
87
|
+
TRANSLATIONS[item] = {};
|
|
88
|
+
}
|
|
76
89
|
for (let key in data[item]) {
|
|
77
90
|
TRANSLATIONS[item][key] = data[item][key];
|
|
78
91
|
}
|
|
@@ -320,15 +333,18 @@ const CasinoPlayRandomGame = class {
|
|
|
320
333
|
}
|
|
321
334
|
}
|
|
322
335
|
renderGameDetails() {
|
|
323
|
-
return index.h("div", { class: "RandomButtonsWrapper" }, index.h("div", { class: "RandomGameDetails" }, index.h("span", { class: "RandomGameTitle" }, this.selectedGame.name), index.h("span", { class: "RandomGameInfo", onClick: () => this.showGameInfo() }, "i")), index.h("div", { class: "RandomButtons" }, index.h("button", { class: "RandomButton On", onClick: () => this.respin() }, translate('spinRandomGame')), !this.launchByGameCard &&
|
|
324
|
-
index.h("button", { class: "RandomButton On", onClick: () => this.playGame() }, translate('playNowRandomGame'))));
|
|
336
|
+
return index.h("div", { class: "RandomButtonsWrapper" }, index.h("div", { class: "RandomGameDetails" }, index.h("span", { class: "RandomGameTitle" }, this.selectedGame.name), index.h("span", { class: "RandomGameInfo", onClick: () => this.showGameInfo() }, "i")), index.h("div", { class: "RandomButtons" }, index.h("button", { class: "RandomButton On", onClick: () => this.respin() }, translate('spinRandomGame', this.language)), !this.launchByGameCard &&
|
|
337
|
+
index.h("button", { class: "RandomButton On", onClick: () => this.playGame() }, translate('playNowRandomGame', this.language))));
|
|
325
338
|
}
|
|
326
339
|
render() {
|
|
327
340
|
if (this.hasErrors) {
|
|
328
341
|
return (index.h("div", { class: "RandomGameError" }, index.h("div", { class: "Title" }, translate('error', this.language))));
|
|
329
342
|
}
|
|
343
|
+
if (this.isLoading) {
|
|
344
|
+
return (index.h("div", { class: "RandomGameLoading" }, index.h("div", { class: "Title" }, translate('randomGameLoading', this.language))));
|
|
345
|
+
}
|
|
330
346
|
if (!this.isLoading) {
|
|
331
|
-
return index.h("div", { class: "RandomGameWrapper" }, index.h("div", { class: 'GameContainerGradient' }), index.h("div", { class: 'GamesContainer', ref: (el) => this.gameContainer = el }, this.gamesToShow && this.gamesToShow.map((game, index$1) => (index.h("div", { class: 'RandomGameCard', key: index$1, onClick: this.launchByGameCard === 'true' ? () => this.playGame() : null }, index.h("div", { class: "RandomGameVendor" }, game.vendor.name), index.h("img", { class: 'RandomGameImage', src: game.thumbnail, alt: game.name, title: game.name }), this.selectedGame && this.selectedGameIndex === index$1 && this.renderGameDetails())))), index.h("div", { class: `ButtonWrapper ${this.animationDone ? 'HideAnimation' : ''}` }, index.h("div", { class: "ButtonContainer" }, this.iconVisibility && index.h("div", { class: `ButtonIcon ${this.animationStarted ? 'Flip' : ''}` }, index.h("div", { class: `QustionMark ${this.animationStarted ? 'Flip' : ''}` }, "?"), index.h("div", { class: "HexagonMark" }, index.h("div", { class: "HexagonMarkBorder" }))), !this.animationStarted && index.h("div", { class: `RandomButton ${this.animationStarted ? 'HideAnimation' : ''}`, onClick: () => this.playRandomGame() }, translate('playRandomGame')))));
|
|
347
|
+
return index.h("div", { class: "RandomGameWrapper" }, index.h("div", { class: 'GameContainerGradient' }), index.h("div", { class: 'GamesContainer', ref: (el) => this.gameContainer = el }, this.gamesToShow && this.gamesToShow.map((game, index$1) => (index.h("div", { class: 'RandomGameCard', key: index$1, onClick: this.launchByGameCard === 'true' ? () => this.playGame() : null }, index.h("div", { class: "RandomGameVendor" }, game.vendor.name), index.h("img", { class: 'RandomGameImage', src: game.thumbnail, alt: game.name, title: game.name }), this.selectedGame && this.selectedGameIndex === index$1 && this.renderGameDetails())))), index.h("div", { class: `ButtonWrapper ${this.animationDone ? 'HideAnimation' : ''}` }, index.h("div", { class: "ButtonContainer" }, this.iconVisibility && index.h("div", { class: `ButtonIcon ${this.animationStarted ? 'Flip' : ''}` }, index.h("div", { class: `QustionMark ${this.animationStarted ? 'Flip' : ''}` }, "?"), index.h("div", { class: "HexagonMark" }, index.h("div", { class: "HexagonMarkBorder" }))), !this.animationStarted && index.h("div", { class: `RandomButton ${this.animationStarted ? 'HideAnimation' : ''}`, onClick: () => this.playRandomGame() }, translate('playRandomGame', this.language)))));
|
|
332
348
|
}
|
|
333
349
|
}
|
|
334
350
|
get host() { return index.getElement(this); }
|
|
@@ -230,15 +230,19 @@ export class CasinoPlayRandomGame {
|
|
|
230
230
|
h("span", { class: "RandomGameTitle" }, this.selectedGame.name),
|
|
231
231
|
h("span", { class: "RandomGameInfo", onClick: () => this.showGameInfo() }, "i")),
|
|
232
232
|
h("div", { class: "RandomButtons" },
|
|
233
|
-
h("button", { class: "RandomButton On", onClick: () => this.respin() }, translate('spinRandomGame')),
|
|
233
|
+
h("button", { class: "RandomButton On", onClick: () => this.respin() }, translate('spinRandomGame', this.language)),
|
|
234
234
|
!this.launchByGameCard &&
|
|
235
|
-
h("button", { class: "RandomButton On", onClick: () => this.playGame() }, translate('playNowRandomGame'))));
|
|
235
|
+
h("button", { class: "RandomButton On", onClick: () => this.playGame() }, translate('playNowRandomGame', this.language))));
|
|
236
236
|
}
|
|
237
237
|
render() {
|
|
238
238
|
if (this.hasErrors) {
|
|
239
239
|
return (h("div", { class: "RandomGameError" },
|
|
240
240
|
h("div", { class: "Title" }, translate('error', this.language))));
|
|
241
241
|
}
|
|
242
|
+
if (this.isLoading) {
|
|
243
|
+
return (h("div", { class: "RandomGameLoading" },
|
|
244
|
+
h("div", { class: "Title" }, translate('randomGameLoading', this.language))));
|
|
245
|
+
}
|
|
242
246
|
if (!this.isLoading) {
|
|
243
247
|
return h("div", { class: "RandomGameWrapper" },
|
|
244
248
|
h("div", { class: 'GameContainerGradient' }),
|
|
@@ -252,7 +256,7 @@ export class CasinoPlayRandomGame {
|
|
|
252
256
|
h("div", { class: `QustionMark ${this.animationStarted ? 'Flip' : ''}` }, "?"),
|
|
253
257
|
h("div", { class: "HexagonMark" },
|
|
254
258
|
h("div", { class: "HexagonMarkBorder" }))),
|
|
255
|
-
!this.animationStarted && h("div", { class: `RandomButton ${this.animationStarted ? 'HideAnimation' : ''}`, onClick: () => this.playRandomGame() }, translate('playRandomGame')))));
|
|
259
|
+
!this.animationStarted && h("div", { class: `RandomButton ${this.animationStarted ? 'HideAnimation' : ''}`, onClick: () => this.playRandomGame() }, translate('playRandomGame', this.language)))));
|
|
256
260
|
}
|
|
257
261
|
}
|
|
258
262
|
static get is() { return "casino-play-random-game"; }
|
|
@@ -8,37 +8,50 @@ const TRANSLATIONS = {
|
|
|
8
8
|
spinRandomGame: 'Spin'
|
|
9
9
|
},
|
|
10
10
|
ro: {
|
|
11
|
-
error: '
|
|
11
|
+
error: 'Error',
|
|
12
|
+
randomGameLoading: 'Loading ...',
|
|
12
13
|
playRandomGame: 'Play a random game',
|
|
13
14
|
playNowRandomGame: 'Play now',
|
|
14
15
|
spinRandomGame: 'Spin'
|
|
15
16
|
},
|
|
16
17
|
fr: {
|
|
17
18
|
error: 'Error',
|
|
19
|
+
randomGameLoading: 'Loading ...',
|
|
18
20
|
playRandomGame: 'Play a random game',
|
|
19
21
|
playNowRandomGame: 'Play now',
|
|
20
22
|
spinRandomGame: 'Spin'
|
|
21
23
|
},
|
|
22
24
|
hr: {
|
|
23
|
-
error: '
|
|
25
|
+
error: 'Error',
|
|
26
|
+
randomGameLoading: 'Loading ...',
|
|
24
27
|
playRandomGame: 'Play a random game',
|
|
25
28
|
playNowRandomGame: 'Play now',
|
|
26
29
|
spinRandomGame: 'Spin'
|
|
27
30
|
},
|
|
28
31
|
hu: {
|
|
29
|
-
error: '
|
|
32
|
+
error: 'Error',
|
|
33
|
+
randomGameLoading: 'Loading ...',
|
|
30
34
|
playRandomGame: 'Play a random game',
|
|
31
35
|
playNowRandomGame: 'Play now',
|
|
32
36
|
spinRandomGame: 'Spin'
|
|
37
|
+
},
|
|
38
|
+
tr: {
|
|
39
|
+
error: "Hata",
|
|
40
|
+
randomGameLoading: "Yükleniyor...",
|
|
41
|
+
playRandomGame: "Rasgele bir oyun oyna",
|
|
42
|
+
playNowRandomGame: "Şimdi Oyna",
|
|
43
|
+
spinRandomGame: "DEĞİŞTİR"
|
|
33
44
|
}
|
|
34
45
|
};
|
|
35
46
|
export const getTranslations = (url) => {
|
|
36
|
-
// fetch url, get the data, replace the TRANSLATIONS content
|
|
37
47
|
return new Promise((resolve) => {
|
|
38
48
|
fetch(url)
|
|
39
49
|
.then((res) => res.json())
|
|
40
50
|
.then((data) => {
|
|
41
51
|
Object.keys(data).forEach((item) => {
|
|
52
|
+
if (!(item in TRANSLATIONS)) {
|
|
53
|
+
TRANSLATIONS[item] = {};
|
|
54
|
+
}
|
|
42
55
|
for (let key in data[item]) {
|
|
43
56
|
TRANSLATIONS[item][key] = data[item][key];
|
|
44
57
|
}
|
|
@@ -38,37 +38,50 @@ const TRANSLATIONS = {
|
|
|
38
38
|
spinRandomGame: 'Spin'
|
|
39
39
|
},
|
|
40
40
|
ro: {
|
|
41
|
-
error: '
|
|
41
|
+
error: 'Error',
|
|
42
|
+
randomGameLoading: 'Loading ...',
|
|
42
43
|
playRandomGame: 'Play a random game',
|
|
43
44
|
playNowRandomGame: 'Play now',
|
|
44
45
|
spinRandomGame: 'Spin'
|
|
45
46
|
},
|
|
46
47
|
fr: {
|
|
47
48
|
error: 'Error',
|
|
49
|
+
randomGameLoading: 'Loading ...',
|
|
48
50
|
playRandomGame: 'Play a random game',
|
|
49
51
|
playNowRandomGame: 'Play now',
|
|
50
52
|
spinRandomGame: 'Spin'
|
|
51
53
|
},
|
|
52
54
|
hr: {
|
|
53
|
-
error: '
|
|
55
|
+
error: 'Error',
|
|
56
|
+
randomGameLoading: 'Loading ...',
|
|
54
57
|
playRandomGame: 'Play a random game',
|
|
55
58
|
playNowRandomGame: 'Play now',
|
|
56
59
|
spinRandomGame: 'Spin'
|
|
57
60
|
},
|
|
58
61
|
hu: {
|
|
59
|
-
error: '
|
|
62
|
+
error: 'Error',
|
|
63
|
+
randomGameLoading: 'Loading ...',
|
|
60
64
|
playRandomGame: 'Play a random game',
|
|
61
65
|
playNowRandomGame: 'Play now',
|
|
62
66
|
spinRandomGame: 'Spin'
|
|
67
|
+
},
|
|
68
|
+
tr: {
|
|
69
|
+
error: "Hata",
|
|
70
|
+
randomGameLoading: "Yükleniyor...",
|
|
71
|
+
playRandomGame: "Rasgele bir oyun oyna",
|
|
72
|
+
playNowRandomGame: "Şimdi Oyna",
|
|
73
|
+
spinRandomGame: "DEĞİŞTİR"
|
|
63
74
|
}
|
|
64
75
|
};
|
|
65
76
|
const getTranslations = (url) => {
|
|
66
|
-
// fetch url, get the data, replace the TRANSLATIONS content
|
|
67
77
|
return new Promise((resolve) => {
|
|
68
78
|
fetch(url)
|
|
69
79
|
.then((res) => res.json())
|
|
70
80
|
.then((data) => {
|
|
71
81
|
Object.keys(data).forEach((item) => {
|
|
82
|
+
if (!(item in TRANSLATIONS)) {
|
|
83
|
+
TRANSLATIONS[item] = {};
|
|
84
|
+
}
|
|
72
85
|
for (let key in data[item]) {
|
|
73
86
|
TRANSLATIONS[item][key] = data[item][key];
|
|
74
87
|
}
|
|
@@ -318,15 +331,18 @@ const CasinoPlayRandomGame$1 = /*@__PURE__*/ proxyCustomElement(class extends HT
|
|
|
318
331
|
}
|
|
319
332
|
}
|
|
320
333
|
renderGameDetails() {
|
|
321
|
-
return h("div", { class: "RandomButtonsWrapper" }, h("div", { class: "RandomGameDetails" }, h("span", { class: "RandomGameTitle" }, this.selectedGame.name), h("span", { class: "RandomGameInfo", onClick: () => this.showGameInfo() }, "i")), h("div", { class: "RandomButtons" }, h("button", { class: "RandomButton On", onClick: () => this.respin() }, translate('spinRandomGame')), !this.launchByGameCard &&
|
|
322
|
-
h("button", { class: "RandomButton On", onClick: () => this.playGame() }, translate('playNowRandomGame'))));
|
|
334
|
+
return h("div", { class: "RandomButtonsWrapper" }, h("div", { class: "RandomGameDetails" }, h("span", { class: "RandomGameTitle" }, this.selectedGame.name), h("span", { class: "RandomGameInfo", onClick: () => this.showGameInfo() }, "i")), h("div", { class: "RandomButtons" }, h("button", { class: "RandomButton On", onClick: () => this.respin() }, translate('spinRandomGame', this.language)), !this.launchByGameCard &&
|
|
335
|
+
h("button", { class: "RandomButton On", onClick: () => this.playGame() }, translate('playNowRandomGame', this.language))));
|
|
323
336
|
}
|
|
324
337
|
render() {
|
|
325
338
|
if (this.hasErrors) {
|
|
326
339
|
return (h("div", { class: "RandomGameError" }, h("div", { class: "Title" }, translate('error', this.language))));
|
|
327
340
|
}
|
|
341
|
+
if (this.isLoading) {
|
|
342
|
+
return (h("div", { class: "RandomGameLoading" }, h("div", { class: "Title" }, translate('randomGameLoading', this.language))));
|
|
343
|
+
}
|
|
328
344
|
if (!this.isLoading) {
|
|
329
|
-
return h("div", { class: "RandomGameWrapper" }, h("div", { class: 'GameContainerGradient' }), h("div", { class: 'GamesContainer', ref: (el) => this.gameContainer = el }, this.gamesToShow && this.gamesToShow.map((game, index) => (h("div", { class: 'RandomGameCard', key: index, onClick: this.launchByGameCard === 'true' ? () => this.playGame() : null }, h("div", { class: "RandomGameVendor" }, game.vendor.name), h("img", { class: 'RandomGameImage', src: game.thumbnail, alt: game.name, title: game.name }), this.selectedGame && this.selectedGameIndex === index && this.renderGameDetails())))), h("div", { class: `ButtonWrapper ${this.animationDone ? 'HideAnimation' : ''}` }, h("div", { class: "ButtonContainer" }, this.iconVisibility && h("div", { class: `ButtonIcon ${this.animationStarted ? 'Flip' : ''}` }, h("div", { class: `QustionMark ${this.animationStarted ? 'Flip' : ''}` }, "?"), h("div", { class: "HexagonMark" }, h("div", { class: "HexagonMarkBorder" }))), !this.animationStarted && h("div", { class: `RandomButton ${this.animationStarted ? 'HideAnimation' : ''}`, onClick: () => this.playRandomGame() }, translate('playRandomGame')))));
|
|
345
|
+
return h("div", { class: "RandomGameWrapper" }, h("div", { class: 'GameContainerGradient' }), h("div", { class: 'GamesContainer', ref: (el) => this.gameContainer = el }, this.gamesToShow && this.gamesToShow.map((game, index) => (h("div", { class: 'RandomGameCard', key: index, onClick: this.launchByGameCard === 'true' ? () => this.playGame() : null }, h("div", { class: "RandomGameVendor" }, game.vendor.name), h("img", { class: 'RandomGameImage', src: game.thumbnail, alt: game.name, title: game.name }), this.selectedGame && this.selectedGameIndex === index && this.renderGameDetails())))), h("div", { class: `ButtonWrapper ${this.animationDone ? 'HideAnimation' : ''}` }, h("div", { class: "ButtonContainer" }, this.iconVisibility && h("div", { class: `ButtonIcon ${this.animationStarted ? 'Flip' : ''}` }, h("div", { class: `QustionMark ${this.animationStarted ? 'Flip' : ''}` }, "?"), h("div", { class: "HexagonMark" }, h("div", { class: "HexagonMarkBorder" }))), !this.animationStarted && h("div", { class: `RandomButton ${this.animationStarted ? 'HideAnimation' : ''}`, onClick: () => this.playRandomGame() }, translate('playRandomGame', this.language)))));
|
|
330
346
|
}
|
|
331
347
|
}
|
|
332
348
|
get host() { return this; }
|
|
@@ -38,37 +38,50 @@ const TRANSLATIONS = {
|
|
|
38
38
|
spinRandomGame: 'Spin'
|
|
39
39
|
},
|
|
40
40
|
ro: {
|
|
41
|
-
error: '
|
|
41
|
+
error: 'Error',
|
|
42
|
+
randomGameLoading: 'Loading ...',
|
|
42
43
|
playRandomGame: 'Play a random game',
|
|
43
44
|
playNowRandomGame: 'Play now',
|
|
44
45
|
spinRandomGame: 'Spin'
|
|
45
46
|
},
|
|
46
47
|
fr: {
|
|
47
48
|
error: 'Error',
|
|
49
|
+
randomGameLoading: 'Loading ...',
|
|
48
50
|
playRandomGame: 'Play a random game',
|
|
49
51
|
playNowRandomGame: 'Play now',
|
|
50
52
|
spinRandomGame: 'Spin'
|
|
51
53
|
},
|
|
52
54
|
hr: {
|
|
53
|
-
error: '
|
|
55
|
+
error: 'Error',
|
|
56
|
+
randomGameLoading: 'Loading ...',
|
|
54
57
|
playRandomGame: 'Play a random game',
|
|
55
58
|
playNowRandomGame: 'Play now',
|
|
56
59
|
spinRandomGame: 'Spin'
|
|
57
60
|
},
|
|
58
61
|
hu: {
|
|
59
|
-
error: '
|
|
62
|
+
error: 'Error',
|
|
63
|
+
randomGameLoading: 'Loading ...',
|
|
60
64
|
playRandomGame: 'Play a random game',
|
|
61
65
|
playNowRandomGame: 'Play now',
|
|
62
66
|
spinRandomGame: 'Spin'
|
|
67
|
+
},
|
|
68
|
+
tr: {
|
|
69
|
+
error: "Hata",
|
|
70
|
+
randomGameLoading: "Yükleniyor...",
|
|
71
|
+
playRandomGame: "Rasgele bir oyun oyna",
|
|
72
|
+
playNowRandomGame: "Şimdi Oyna",
|
|
73
|
+
spinRandomGame: "DEĞİŞTİR"
|
|
63
74
|
}
|
|
64
75
|
};
|
|
65
76
|
const getTranslations = (url) => {
|
|
66
|
-
// fetch url, get the data, replace the TRANSLATIONS content
|
|
67
77
|
return new Promise((resolve) => {
|
|
68
78
|
fetch(url)
|
|
69
79
|
.then((res) => res.json())
|
|
70
80
|
.then((data) => {
|
|
71
81
|
Object.keys(data).forEach((item) => {
|
|
82
|
+
if (!(item in TRANSLATIONS)) {
|
|
83
|
+
TRANSLATIONS[item] = {};
|
|
84
|
+
}
|
|
72
85
|
for (let key in data[item]) {
|
|
73
86
|
TRANSLATIONS[item][key] = data[item][key];
|
|
74
87
|
}
|
|
@@ -316,15 +329,18 @@ const CasinoPlayRandomGame = class {
|
|
|
316
329
|
}
|
|
317
330
|
}
|
|
318
331
|
renderGameDetails() {
|
|
319
|
-
return h("div", { class: "RandomButtonsWrapper" }, h("div", { class: "RandomGameDetails" }, h("span", { class: "RandomGameTitle" }, this.selectedGame.name), h("span", { class: "RandomGameInfo", onClick: () => this.showGameInfo() }, "i")), h("div", { class: "RandomButtons" }, h("button", { class: "RandomButton On", onClick: () => this.respin() }, translate('spinRandomGame')), !this.launchByGameCard &&
|
|
320
|
-
h("button", { class: "RandomButton On", onClick: () => this.playGame() }, translate('playNowRandomGame'))));
|
|
332
|
+
return h("div", { class: "RandomButtonsWrapper" }, h("div", { class: "RandomGameDetails" }, h("span", { class: "RandomGameTitle" }, this.selectedGame.name), h("span", { class: "RandomGameInfo", onClick: () => this.showGameInfo() }, "i")), h("div", { class: "RandomButtons" }, h("button", { class: "RandomButton On", onClick: () => this.respin() }, translate('spinRandomGame', this.language)), !this.launchByGameCard &&
|
|
333
|
+
h("button", { class: "RandomButton On", onClick: () => this.playGame() }, translate('playNowRandomGame', this.language))));
|
|
321
334
|
}
|
|
322
335
|
render() {
|
|
323
336
|
if (this.hasErrors) {
|
|
324
337
|
return (h("div", { class: "RandomGameError" }, h("div", { class: "Title" }, translate('error', this.language))));
|
|
325
338
|
}
|
|
339
|
+
if (this.isLoading) {
|
|
340
|
+
return (h("div", { class: "RandomGameLoading" }, h("div", { class: "Title" }, translate('randomGameLoading', this.language))));
|
|
341
|
+
}
|
|
326
342
|
if (!this.isLoading) {
|
|
327
|
-
return h("div", { class: "RandomGameWrapper" }, h("div", { class: 'GameContainerGradient' }), h("div", { class: 'GamesContainer', ref: (el) => this.gameContainer = el }, this.gamesToShow && this.gamesToShow.map((game, index) => (h("div", { class: 'RandomGameCard', key: index, onClick: this.launchByGameCard === 'true' ? () => this.playGame() : null }, h("div", { class: "RandomGameVendor" }, game.vendor.name), h("img", { class: 'RandomGameImage', src: game.thumbnail, alt: game.name, title: game.name }), this.selectedGame && this.selectedGameIndex === index && this.renderGameDetails())))), h("div", { class: `ButtonWrapper ${this.animationDone ? 'HideAnimation' : ''}` }, h("div", { class: "ButtonContainer" }, this.iconVisibility && h("div", { class: `ButtonIcon ${this.animationStarted ? 'Flip' : ''}` }, h("div", { class: `QustionMark ${this.animationStarted ? 'Flip' : ''}` }, "?"), h("div", { class: "HexagonMark" }, h("div", { class: "HexagonMarkBorder" }))), !this.animationStarted && h("div", { class: `RandomButton ${this.animationStarted ? 'HideAnimation' : ''}`, onClick: () => this.playRandomGame() }, translate('playRandomGame')))));
|
|
343
|
+
return h("div", { class: "RandomGameWrapper" }, h("div", { class: 'GameContainerGradient' }), h("div", { class: 'GamesContainer', ref: (el) => this.gameContainer = el }, this.gamesToShow && this.gamesToShow.map((game, index) => (h("div", { class: 'RandomGameCard', key: index, onClick: this.launchByGameCard === 'true' ? () => this.playGame() : null }, h("div", { class: "RandomGameVendor" }, game.vendor.name), h("img", { class: 'RandomGameImage', src: game.thumbnail, alt: game.name, title: game.name }), this.selectedGame && this.selectedGameIndex === index && this.renderGameDetails())))), h("div", { class: `ButtonWrapper ${this.animationDone ? 'HideAnimation' : ''}` }, h("div", { class: "ButtonContainer" }, this.iconVisibility && h("div", { class: `ButtonIcon ${this.animationStarted ? 'Flip' : ''}` }, h("div", { class: `QustionMark ${this.animationStarted ? 'Flip' : ''}` }, "?"), h("div", { class: "HexagonMark" }, h("div", { class: "HexagonMarkBorder" }))), !this.animationStarted && h("div", { class: `RandomButton ${this.animationStarted ? 'HideAnimation' : ''}`, onClick: () => this.playRandomGame() }, translate('playRandomGame', this.language)))));
|
|
328
344
|
}
|
|
329
345
|
}
|
|
330
346
|
get host() { return getElement(this); }
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as n,h as a,g as e}from"./p-0f38b3f8.js";const t={en:{error:"Error",randomGameLoading:"Loading ...",playRandomGame:"Play a random game",playNowRandomGame:"Play now",spinRandomGame:"Spin"},ro:{error:"Eroare",playRandomGame:"Play a random game",playNowRandomGame:"Play now",spinRandomGame:"Spin"},fr:{error:"Error",playRandomGame:"Play a random game",playNowRandomGame:"Play now",spinRandomGame:"Spin"},hr:{error:"Greška",playRandomGame:"Play a random game",playNowRandomGame:"Play now",spinRandomGame:"Spin"},hu:{error:"Greška",playRandomGame:"Play a random game",playNowRandomGame:"Play now",spinRandomGame:"Spin"}},o=n=>new Promise((a=>{fetch(n).then((n=>n.json())).then((n=>{Object.keys(n).forEach((a=>{for(let e in n[a])t[a][e]=n[a][e]})),a(!0)}))})),i=(n,a,e)=>{let o=t[void 0!==a?a:"en"][n];if(void 0!==e)for(const[n,a]of Object.entries(e.values)){const e=new RegExp(`{${n}}`,"g");o=o.replace(e,a)}return o},r=class{constructor(a){n(this,a),this.language="en",this.specificCategory="",this.iconVisible="",this.iconVisibleOnAnim="",this.launchByGameCard="",this.clientStyling="",this.clientStylingUrl="",this.translationUrl="",this.hasErrors=!1,this.limitStylingAppends=!1,this.isLoading=!0,this.selectedGame=null,this.animationDone=!1,this.animationStarted=!1,this.animation=null,this.selectedGameIndex=null,this.selectedGameEl=null,this.iconVisibility=null,this.shuffle=n=>{let a,e=n.length;for(;0!==e;)a=Math.floor(Math.random()*e),e--,[n[e],n[a]]=[n[a],n[e]];return n},this.setClientStyling=()=>{let n=document.createElement("style");n.innerHTML=this.clientStyling,this.host.shadowRoot.prepend(n)},this.setClientStylingURL=()=>{let n=new URL(this.clientStylingUrl),a=document.createElement("style");fetch(n.href).then((n=>n.text())).then((n=>{a.innerHTML=n,this.clientStyling=n,setTimeout((()=>{this.host.shadowRoot.prepend(a)}),1)}))}}watchEndpoint(n,a){n&&n!=a&&this.endpoint&&this.fetchGameList()}handleNewTranslations(){this.isLoading=!0,o(this.translationUrl).then((()=>{this.isLoading=!1}))}connectedCallback(){this.iconVisibility="true"===this.iconVisible}componentWillLoad(){if(this.translationUrl.length>2&&o(this.translationUrl),this.endpoint&&this.language&&this.datasource)return this.fetchGameList()}componentDidLoad(){!this.limitStylingAppends&&this.host&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL(),this.limitStylingAppends=!0)}fetchGameList(){let n=new URL(`${this.endpoint}/v1/casino/games`);return n.searchParams.append("device",(()=>{const n=(()=>{let n=window.navigator.userAgent;return n.toLowerCase().match(/android/i)?"Android":n.toLowerCase().match(/iphone/i)?"iPhone":n.toLowerCase().match(/ipad|ipod/i)?"iPad":"PC"})();if(n)return"PC"===n?"dk":"mtWeb"})()),n.searchParams.append("datasource",this.datasource),n.searchParams.append("fields","gId,id,href,thumbnail,name,vendor,launchUrl,subVendor"),n.searchParams.append("expand","vendor"),n.searchParams.append("pagination","offset=0,limit=423"),n.searchParams.append("language",this.language),this.specificCategory&&n.searchParams.append("filter",`categories(id=${this.specificCategory})`),new Promise(((a,e)=>{this.isLoading=!0,fetch(n.href).then((n=>n.json())).then((n=>{this.gamesToShow=this.setUpGames(null==n?void 0:n.items),a(!0)})).catch((n=>{console.error(n),this.hasErrors=!0,e(n)})).finally((()=>{this.isLoading=!1}))}))}setUpGames(n){const a=this.shuffle(n).slice(0,40);return a.concat(a)}selectRandomGame(){const n=this.gamesToShow.length/2;this.selectedGameIndex=Math.floor(Math.random()*(n-3)),this.selectedGameIndex+=n,this.selectedGameEl=this.gameContainer.children[this.selectedGameIndex]}playRandomGame(){this.animateGames(),"function"==typeof gtag&>ag("event","PlayRandomGame",{context:"CasinoPlayRandomGame"})}respin(){this.animateGames(),"function"==typeof gtag&>ag("event","RespinRandomGame",{context:"CasinoPlayRandomGame"})}animateGames(){this.iconVisibility="true"===this.iconVisibleOnAnim,this.animationStarted=!0,this.animationDone=!1,this.animation&&this.animation.cancel(),this.selectedGameEl&&(this.selectedGameEl.classList.remove("TheRandomGame"),this.selectedGame=null,this.selectedGameIndex=null),this.selectRandomGame();const n=window.getComputedStyle(this.gameContainer).getPropertyValue("gap"),a=parseInt(n,10),e=this.selectedGameEl.offsetWidth;this.animation=this.gameContainer.animate([{transform:"translateX(0px)",scale:1},{scale:.75},{transform:`translateX(-${(e+a)*this.selectedGameIndex+e/2-this.gameContainer.offsetWidth/2}px)`,scale:1}],{duration:3e3,easing:"cubic-bezier(0.5, 0, 0.5, 1.2)",fill:"forwards"}),this.animation.onfinish=()=>{this.animationDone=!0,this.selectedGameEl.classList.add("TheRandomGame"),this.selectedGame=this.gamesToShow[this.selectedGameIndex]}}playGame(){this.selectedGame&&(window.postMessage({type:"PlayRandomGame",gameId:this.selectedGame.id,launchUrl:this.selectedGame.launchUrl,gameName:this.selectedGame.name,subVendor:this.selectedGame.subVendor},window.location.href),"function"==typeof gtag&>ag("event","OpenRandomGame",{context:"CasinoPlayRandomGame"}))}showGameInfo(){window.postMessage({type:"InfoRandomGame",gameId:this.selectedGame.id,launchUrl:this.selectedGame.launchUrl,gameName:this.selectedGame.name,subVendor:this.selectedGame.subVendor},window.location.href),"function"==typeof gtag&>ag("event","OpenRandomGameInfo",{context:"CasinoPlayRandomGame"})}renderGameDetails(){return a("div",{class:"RandomButtonsWrapper"},a("div",{class:"RandomGameDetails"},a("span",{class:"RandomGameTitle"},this.selectedGame.name),a("span",{class:"RandomGameInfo",onClick:()=>this.showGameInfo()},"i")),a("div",{class:"RandomButtons"},a("button",{class:"RandomButton On",onClick:()=>this.respin()},i("spinRandomGame")),!this.launchByGameCard&&a("button",{class:"RandomButton On",onClick:()=>this.playGame()},i("playNowRandomGame"))))}render(){return this.hasErrors?a("div",{class:"RandomGameError"},a("div",{class:"Title"},i("error",this.language))):this.isLoading?void 0:a("div",{class:"RandomGameWrapper"},a("div",{class:"GameContainerGradient"}),a("div",{class:"GamesContainer",ref:n=>this.gameContainer=n},this.gamesToShow&&this.gamesToShow.map(((n,e)=>a("div",{class:"RandomGameCard",key:e,onClick:"true"===this.launchByGameCard?()=>this.playGame():null},a("div",{class:"RandomGameVendor"},n.vendor.name),a("img",{class:"RandomGameImage",src:n.thumbnail,alt:n.name,title:n.name}),this.selectedGame&&this.selectedGameIndex===e&&this.renderGameDetails())))),a("div",{class:"ButtonWrapper "+(this.animationDone?"HideAnimation":"")},a("div",{class:"ButtonContainer"},this.iconVisibility&&a("div",{class:"ButtonIcon "+(this.animationStarted?"Flip":"")},a("div",{class:"QustionMark "+(this.animationStarted?"Flip":"")},"?"),a("div",{class:"HexagonMark"},a("div",{class:"HexagonMarkBorder"}))),!this.animationStarted&&a("div",{class:"RandomButton "+(this.animationStarted?"HideAnimation":""),onClick:()=>this.playRandomGame()},i("playRandomGame")))))}get host(){return e(this)}static get watchers(){return{endpoint:["watchEndpoint"],datasource:["watchEndpoint"],language:["watchEndpoint"],translationUrl:["handleNewTranslations"]}}};r.style=":host {\n display: block;\n font-family: inherit;\n}\n\n.RandomGameWrapper {\n width: 100%;\n overflow: hidden;\n background: transparent;\n position: relative;\n}\n\n.GameContainerGradient {\n position: absolute;\n top: 0;\n left: 0;\n width: 100vw;\n height: 100%;\n background: linear-gradient(90deg, var(--emfe-w-casino-color-bg, var(--emfe-w-color-background, #07072A)) 0%, rgba(7, 7, 42, 0.5) 25%, rgba(7, 7, 42, 0) 50%, rgba(7, 7, 42, 0.5) 75%, var(--emfe-w-casino-color-bg, var(--emfe-w-color-background, #07072A)) 100%);\n pointer-events: none;\n z-index: 1;\n}\n\n.GamesContainer {\n display: flex;\n height: 330px;\n flex-direction: row;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: center;\n align-content: flex-start;\n gap: 20px;\n}\n\n.RandomGameCard {\n position: relative;\n width: 256px;\n height: 170px;\n border-radius: 5px;\n filter: blur(5px);\n}\n.RandomGameCard .RandomGameVendor {\n position: absolute;\n font-size: 12px;\n bottom: 10px;\n left: 10px;\n color: var(--emfe-w-color-white, #FFFFFF);\n}\n\n.TheRandomGame {\n animation-name: ZoomFadeIn;\n animation-duration: 0.5s;\n animation-fill-mode: forwards;\n -webkit-animation-name: ZoomFadeIn;\n -webkit-animation-duration: 0.5s;\n -webkit-animation-fill-mode: forwards;\n opacity: 1;\n cursor: pointer;\n filter: blur(0);\n}\n\n.RandomGameImage {\n width: 256px;\n height: 170px;\n}\n\n.RandomGameDetails {\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n color: var(--emfe-w-casino-typography, var(--emfe-w-color-white, #FFFFFF));\n font-size: 14px;\n width: 100%;\n}\n.RandomGameDetails .RandomGameTitle {\n line-height: 18px;\n}\n.RandomGameDetails .RandomGameInfo {\n border-radius: 50%;\n width: 16px;\n height: 16px;\n font-size: 12px;\n font-weight: 400;\n border: solid 1px var(--emfe-w-casino-typography, var(--emfe-w-color-white, #FFFFFF));\n text-align: center;\n margin: 4px 0;\n line-height: 14px;\n cursor: pointer;\n}\n.RandomGameDetails .RandomGamePlay {\n background: var(--emfe-w-casino-color-primary, var(--emfe-w-color-primary, #D0046C));\n color: var(--emfe-w-button-typography, var(--emfe-w-color-white, #FFFFFF));\n border: none;\n border-radius: 5px;\n width: 200px;\n height: 40px;\n font-size: 14px;\n cursor: pointer;\n}\n\n.ButtonWrapper {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n}\n\n.ButtonContainer {\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n gap: 10px;\n width: 100%;\n}\n\n.ButtonIcon {\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n gap: 5px;\n}\n\n.QustionMark {\n position: relative;\n font-size: 80px;\n font-weight: 700;\n color: var(--emfe-w-color-white, #FFFFFF);\n z-index: 5;\n bottom: 20px;\n text-shadow: 0px 4px 0px var(--emfe-w-color-black, #000000);\n}\n\n.HexagonMark {\n position: absolute;\n width: 70px;\n height: 85px;\n background: linear-gradient(90deg, var(--emfe-w-casino-color-primary, var(--emfe-w-color-primary, #D0046C)) 0%, var(--emfe-w-categories-color-secondary, var(--emfe-w-color-secondary, #FD2839)) 100%);\n clip-path: polygon(50% 0, 100% 30%, 100% 70%, 50% 100%, 0% 70%, 0% 30%);\n}\n\n.HexagonMarkBorder {\n position: relative;\n display: flex;\n justify-content: center;\n align-items: center;\n top: 5px;\n left: 5px;\n width: 60px;\n height: 75px;\n background: linear-gradient(180deg, var(--emfe-w-casino-color-primary, var(--emfe-w-color-primary, #D0046C)) 0%, var(--emfe-w-categories-color-secondary, var(--emfe-w-color-secondary, #FD2839)) 100%);\n clip-path: polygon(50% 0, 100% 30%, 100% 70%, 50% 100%, 0% 70%, 0% 30%);\n}\n\n.RandomButtons {\n display: flex;\n flex-direction: row;\n justify-content: center;\n align-items: center;\n gap: 5px;\n width: 100%;\n}\n\n.RandomButton {\n font-size: 18px;\n text-transform: uppercase;\n width: max-content;\n border-radius: 5px;\n padding: 5px 25px;\n border: solid 3px var(--emfe-w-casino-color-primary, var(--emfe-w-color-primary, #D0046C));\n color: var(--emfe-w-button-typography, var(--emfe-w-color-white, #FFFFFF));\n opacity: 1;\n text-shadow: 1px 1px 2px var(--emfe-w-color-black, #000000);\n animation: ButtonEffect 3s linear infinite;\n background-image: linear-gradient(to right, var(--emfe-w-casino-color-primary, var(--emfe-w-color-primary, #D0046C)), var(--emfe-w-categories-color-secondary, var(--emfe-w-color-secondary, #FD2839)), var(--emfe-w-casino-color-primary, var(--emfe-w-color-primary, #D0046C)));\n background-size: 300% 100%;\n cursor: pointer;\n}\n.RandomButton:hover {\n opacity: 0.8;\n}\n\n.HideAnimation {\n filter: blur(5px);\n animation: AnimateButton 0.2s forwards;\n}\n\n.Flip {\n animation-name: Flip, Blur;\n animation-duration: 0.75s, 3s;\n animation-iteration-count: infinite, 1;\n -webkit-animation-name: Flip, Blur;\n -webkit-animation-duration: 0.75s, 3s;\n -webkit-animation-iteration-count: infinite, 1;\n}\n\n@keyframes ButtonEffect {\n 0% {\n background-position: 0% 50%;\n }\n 33% {\n background-position: 100% 50%;\n }\n 66% {\n background-position: 200% 50%;\n }\n 100% {\n background-position: 300% 50%;\n }\n}\n@keyframes ZoomFadeIn {\n 0% {\n transform: scale(0.2) translateY(0);\n filter: blur(5px);\n opacity: 0.3;\n }\n 50% {\n transform: scale(1.1) translateY(-30px);\n filter: blur(2px);\n opacity: 0.7;\n }\n 100% {\n transform: scale(1) translateY(-30px);\n filter: blur(0px);\n opacity: 1;\n }\n}\n@keyframes AnimateButton {\n 0% {\n opacity: 0.7;\n }\n 50% {\n opacity: 0.4;\n }\n 100% {\n opacity: 0;\n display: none;\n }\n}\n@keyframes Flip {\n 0% {\n transform: rotateY(0deg);\n }\n 50% {\n transform: rotateY(180deg);\n }\n 100% {\n transform: rotateY(360deg);\n }\n}\n@keyframes Blur {\n 0% {\n filter: blur(0);\n }\n 50% {\n filter: blur(1px);\n }\n 100% {\n filter: blur(3px);\n }\n}\n@container (max-width: 475px) {\n .GameContainerGradient {\n position: absolute;\n top: 0;\n left: 0;\n width: 100vw;\n height: 100%;\n background: linear-gradient(90deg, var(--emfe-w-casino-color-bg, var(--emfe-w-color-background, #07072A)) 0%, rgba(7, 7, 42, 0.2) 25%, rgba(7, 7, 42, 0) 50%, rgba(7, 7, 42, 0.2) 75%, var(--emfe-w-casino-color-bg, var(--emfe-w-color-background, #07072A)) 100%);\n pointer-events: none;\n z-index: 1;\n }\n\n .RandomGameCard {\n width: 102px;\n height: 146px;\n border-radius: 5px;\n filter: blur(5px);\n }\n\n .RandomGameImage {\n width: 102px;\n height: 146px;\n }\n\n .RandomGameDetails {\n font-size: 14px;\n width: 100%;\n }\n .RandomGameDetails .RandomGameTitle {\n line-height: 18px;\n width: 75%;\n }\n .RandomGameDetails .RandomGameInfo {\n border-radius: 50%;\n width: 16px;\n height: 16px;\n font-size: 12px;\n line-height: 14px;\n }\n .RandomGameDetails .RandomGamePlay {\n background: var(--emfe-w-casino-color-primary, var(--emfe-w-color-primary, #D0046C));\n color: var(--emfe-w-button-typography, var(--emfe-w-color-white, #FFFFFF));\n border: none;\n border-radius: 5px;\n width: 200px;\n height: 40px;\n font-size: 14px;\n cursor: pointer;\n }\n\n .RandomGameCard .RandomGameVendor {\n font-size: 12px;\n bottom: 5px;\n right: 5px;\n }\n\n .RandomButtons {\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n gap: 5px;\n width: 100%;\n }\n\n .RandomButton {\n font-size: 18px;\n text-transform: uppercase;\n width: max-content;\n border-radius: 5px;\n padding: 5px 25px;\n border: solid 3px var(--emfe-w-casino-color-primary, var(--emfe-w-color-primary, #D0046C));\n color: var(--emfe-w-button-typography, var(--emfe-w-color-white, #FFFFFF));\n opacity: 1;\n text-shadow: 1px 1px 2px var(--emfe-w-color-black, #000000);\n animation: ButtonEffect 3s linear infinite;\n background-image: linear-gradient(to right, var(--emfe-w-casino-color-primary, var(--emfe-w-color-primary, #D0046C)), var(--emfe-w-categories-color-secondary, var(--emfe-w-color-secondary, #FD2839)), var(--emfe-w-casino-color-primary, var(--emfe-w-color-primary, #D0046C)));\n background-size: 300% 100%;\n cursor: pointer;\n }\n .RandomButton:hover {\n opacity: 0.8;\n }\n}";export{r as casino_play_random_game}
|