@everymatrix/casino-tournament-slider 1.16.1
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-tournament-slider/casino-tournament-slider.esm.js +1 -0
- package/dist/casino-tournament-slider/index.esm.js +0 -0
- package/dist/casino-tournament-slider/p-3af7237d.entry.js +1 -0
- package/dist/casino-tournament-slider/p-7bade785.js +1 -0
- package/dist/cjs/casino-tournament-slider.cjs.js +19 -0
- package/dist/cjs/casino-tournament-slider_2.cjs.entry.js +293 -0
- package/dist/cjs/index-f60eba31.js +1263 -0
- package/dist/cjs/index.cjs.js +2 -0
- package/dist/cjs/loader.cjs.js +21 -0
- package/dist/collection/collection-manifest.json +19 -0
- package/dist/collection/components/casino-tournament-slider/casino-tournament-slider.css +62 -0
- package/dist/collection/components/casino-tournament-slider/casino-tournament-slider.js +328 -0
- package/dist/collection/index.js +1 -0
- package/dist/collection/utils/locale.utils.js +36 -0
- package/dist/collection/utils/utils.js +3 -0
- package/dist/components/casino-tournament-slider.d.ts +11 -0
- package/dist/components/casino-tournament-slider.js +169 -0
- package/dist/components/general-slider.js +6 -0
- package/dist/components/general-slider2.js +189 -0
- package/dist/components/index.d.ts +26 -0
- package/dist/components/index.js +1 -0
- package/dist/esm/casino-tournament-slider.js +17 -0
- package/dist/esm/casino-tournament-slider_2.entry.js +288 -0
- package/dist/esm/index-c48feefa.js +1237 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/loader.js +17 -0
- package/dist/esm/polyfills/core-js.js +11 -0
- package/dist/esm/polyfills/css-shim.js +1 -0
- package/dist/esm/polyfills/dom.js +79 -0
- package/dist/esm/polyfills/es5-html-element.js +1 -0
- package/dist/esm/polyfills/index.js +34 -0
- package/dist/esm/polyfills/system.js +6 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/stencil.config.js +22 -0
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-stencil/packages/casino-tournament-slider/.stencil/packages/casino-tournament-slider/stencil.config.d.ts +2 -0
- package/dist/types/components/casino-tournament-slider/casino-tournament-slider.d.ts +30 -0
- package/dist/types/components.d.ts +61 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/stencil-public-runtime.d.ts +1565 -0
- package/dist/types/utils/locale.utils.d.ts +1 -0
- package/dist/types/utils/utils.d.ts +1 -0
- package/loader/cdn.js +3 -0
- package/loader/index.cjs.js +3 -0
- package/loader/index.d.ts +12 -0
- package/loader/index.es2017.js +3 -0
- package/loader/index.js +4 -0
- package/loader/package.json +10 -0
- package/package.json +19 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-f60eba31.js');
|
|
6
|
+
|
|
7
|
+
/*
|
|
8
|
+
Stencil Client Patch Esm v2.15.2 | MIT Licensed | https://stenciljs.com
|
|
9
|
+
*/
|
|
10
|
+
const patchEsm = () => {
|
|
11
|
+
return index.promiseResolve();
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
const defineCustomElements = (win, options) => {
|
|
15
|
+
if (typeof window === 'undefined') return Promise.resolve();
|
|
16
|
+
return patchEsm().then(() => {
|
|
17
|
+
return index.bootstrapLazy([["casino-tournament-slider_2.cjs",[[1,"casino-tournament-slider",{"useEvent":[1,"use-event"],"endpoint":[1],"tournamentId":[1,"tournament-id"],"session":[1],"language":[1],"gamesLimit":[2,"games-limit"],"offset":[2],"slideNumber":[2,"slide-number"],"slideShow":[2,"slide-show"],"clientStyling":[1,"client-styling"],"clientStylingUrl":[1,"client-styling-url"],"showTitle":[4,"show-title"],"limitStylingAppends":[32],"stylingContainer":[32],"games":[32],"hover":[32],"hoverIndex":[32]},[[8,"getTournamentInfoCompleted","todoCompletedHandler"]]],[1,"general-slider",{"showStatus":[4,"show-status"],"slideNumber":[2,"slide-number"],"slideShow":[2,"slide-show"],"showArrow":[4,"show-arrow"],"showButton":[4,"show-button"],"autoSlide":[4,"auto-slide"],"loopTime":[2,"loop-time"],"autoItemHeight":[4,"auto-item-height"],"currentSlideNumber":[32]}]]]], options);
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
exports.defineCustomElements = defineCustomElements;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"entries": [
|
|
3
|
+
"./components/casino-tournament-slider/casino-tournament-slider.js"
|
|
4
|
+
],
|
|
5
|
+
"compiler": {
|
|
6
|
+
"name": "@stencil/core",
|
|
7
|
+
"version": "2.15.2",
|
|
8
|
+
"typescriptVersion": "4.5.4"
|
|
9
|
+
},
|
|
10
|
+
"collections": [
|
|
11
|
+
{
|
|
12
|
+
"name": "@everymatrix/general-slider",
|
|
13
|
+
"tags": [
|
|
14
|
+
"general-slider"
|
|
15
|
+
]
|
|
16
|
+
}
|
|
17
|
+
],
|
|
18
|
+
"bundles": []
|
|
19
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
display: block;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.Item {
|
|
6
|
+
color: white;
|
|
7
|
+
display: flex;
|
|
8
|
+
justify-content: center;
|
|
9
|
+
align-items: center;
|
|
10
|
+
font-weight: bold;
|
|
11
|
+
font-size: 10rem;
|
|
12
|
+
user-select: none;
|
|
13
|
+
overflow: hidden;
|
|
14
|
+
}
|
|
15
|
+
.Item .Img {
|
|
16
|
+
width: 100%;
|
|
17
|
+
height: 100%;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.PlayNowButton {
|
|
21
|
+
position: absolute;
|
|
22
|
+
background: var(--emfe-w-color-green, #48952a);
|
|
23
|
+
display: block;
|
|
24
|
+
box-sizing: border-box;
|
|
25
|
+
padding: 0.8rem 0.5rem;
|
|
26
|
+
color: var(--emfe-w-color-white, #FFFFFF);
|
|
27
|
+
text-transform: uppercase;
|
|
28
|
+
text-align: center;
|
|
29
|
+
font-weight: 600;
|
|
30
|
+
font-size: 0.7rem;
|
|
31
|
+
cursor: pointer;
|
|
32
|
+
transition: opacity 0.4s linear;
|
|
33
|
+
opacity: 0;
|
|
34
|
+
text-overflow: ellipsis;
|
|
35
|
+
white-space: nowrap;
|
|
36
|
+
overflow: hidden;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.ItemHover {
|
|
40
|
+
opacity: 1;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.Items .Item:first-child {
|
|
44
|
+
margin-left: 0;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.Items .Item:last-child {
|
|
48
|
+
margin-right: 0;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.SliderTitle {
|
|
52
|
+
display: flex;
|
|
53
|
+
align-items: center;
|
|
54
|
+
padding: 6px 0;
|
|
55
|
+
gap: 11px;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.Title {
|
|
59
|
+
color: #fff;
|
|
60
|
+
font-size: 14px;
|
|
61
|
+
font-weight: 600;
|
|
62
|
+
}
|
|
@@ -0,0 +1,328 @@
|
|
|
1
|
+
import { Component, Prop, h, State, Listen } from '@stencil/core';
|
|
2
|
+
import '@everymatrix/general-slider';
|
|
3
|
+
import { translate } from '../../utils/locale.utils';
|
|
4
|
+
export class CasinoTournamentSlider {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.gamesLimit = 30;
|
|
7
|
+
this.offset = 0;
|
|
8
|
+
this.slideNumber = 3;
|
|
9
|
+
this.slideShow = 3;
|
|
10
|
+
this.clientStyling = '';
|
|
11
|
+
this.clientStylingUrl = '';
|
|
12
|
+
this.showTitle = false;
|
|
13
|
+
this.limitStylingAppends = false;
|
|
14
|
+
this.enter = (index) => {
|
|
15
|
+
this.hover = true;
|
|
16
|
+
this.hoverIndex = index;
|
|
17
|
+
};
|
|
18
|
+
this.leave = () => {
|
|
19
|
+
this.hover = false;
|
|
20
|
+
this.hoverIndex = -1;
|
|
21
|
+
};
|
|
22
|
+
this.gameClicked = (item) => {
|
|
23
|
+
window.postMessage({ type: 'TournamentGameAction', gameId: item.id, name: item.name }, window.location.href);
|
|
24
|
+
};
|
|
25
|
+
this.setClientStyling = () => {
|
|
26
|
+
let sheet = document.createElement('style');
|
|
27
|
+
sheet.innerHTML = this.clientStyling;
|
|
28
|
+
this.stylingContainer.prepend(sheet);
|
|
29
|
+
};
|
|
30
|
+
this.setClientStylingURL = () => {
|
|
31
|
+
let cssFile = document.createElement('style');
|
|
32
|
+
setTimeout(() => {
|
|
33
|
+
cssFile.innerHTML = this.clientStylingUrl;
|
|
34
|
+
this.stylingContainer.prepend(cssFile);
|
|
35
|
+
}, 1);
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
todoCompletedHandler(event) {
|
|
39
|
+
if (event.detail && this.useEvent) {
|
|
40
|
+
if (!event.detail.games)
|
|
41
|
+
return;
|
|
42
|
+
this.games = event.detail.games.items;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
getTournamentInfo() {
|
|
46
|
+
let url = new URL(this.endpoint + `/tournaments/${this.tournamentId}`);
|
|
47
|
+
let reqHeaders = new Headers();
|
|
48
|
+
url.searchParams.append('expand', 'games');
|
|
49
|
+
url.searchParams.append('language', this.language);
|
|
50
|
+
url.searchParams.append('pagination', `games(limit=${this.gamesLimit},offset=${this.offset})`);
|
|
51
|
+
url.searchParams.append('fields', 'games(id,name,thumbnail)');
|
|
52
|
+
if (this.session) {
|
|
53
|
+
reqHeaders.append('X-SessionId', this.session);
|
|
54
|
+
}
|
|
55
|
+
let requestOptions = {
|
|
56
|
+
method: 'GET',
|
|
57
|
+
headers: reqHeaders,
|
|
58
|
+
};
|
|
59
|
+
fetch(url.href, requestOptions).then((res) => res.json())
|
|
60
|
+
.then((res) => {
|
|
61
|
+
this.games = res.item.games.items;
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
componentWillLoad() {
|
|
65
|
+
if (!this.useEvent && this.endpoint && this.tournamentId) {
|
|
66
|
+
this.getTournamentInfo();
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
componentDidRender() {
|
|
70
|
+
if (!this.limitStylingAppends && this.stylingContainer) {
|
|
71
|
+
if (this.clientStyling)
|
|
72
|
+
this.setClientStyling();
|
|
73
|
+
if (this.clientStylingUrl)
|
|
74
|
+
this.setClientStylingURL();
|
|
75
|
+
this.limitStylingAppends = true;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
render() {
|
|
79
|
+
return h("div", { ref: el => this.stylingContainer = el },
|
|
80
|
+
h("div", { class: "TournamentSlider" },
|
|
81
|
+
this.showTitle && this.games &&
|
|
82
|
+
h("div", { class: "SliderTitle" },
|
|
83
|
+
h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "21", height: "25", viewBox: "0 0 21 25", fill: "none" },
|
|
84
|
+
h("path", { d: "M6.1774 22.1728C6.36493 22.2725 6.56274 22.0566 6.44793 21.8779C5.82475 20.908 5.23463 19.2759 6.17483 17.174C7.74273 13.6689 8.6968 11.8535 8.6968 11.8535C8.6968 11.8535 9.20426 13.9721 10.5799 15.8558C11.9038 17.6687 12.6285 19.9488 11.4602 21.8482C11.3506 22.0265 11.5439 22.2368 11.7302 22.1415C13.1763 21.4017 14.7983 19.9179 14.9813 16.965C15.0488 16.0627 14.9476 14.7995 14.4416 13.2054C13.791 11.185 12.9911 10.2423 12.5283 9.83741C12.3899 9.71629 12.1746 9.82363 12.1859 10.0072C12.3208 12.1872 11.5007 12.7404 11.0339 11.4937C10.8474 10.9957 10.7387 10.1344 10.7387 9.08558C10.7387 7.3394 10.2321 5.54188 9.1152 4.0812C8.82475 3.70134 8.4849 3.3464 8.09498 3.04372C7.95382 2.93411 7.74919 3.04428 7.76212 3.22252C7.84788 4.40628 7.77018 7.79884 4.79383 11.8519C2.09515 15.6115 3.14088 18.4989 3.51195 19.281C4.2214 20.7791 5.21098 21.6589 6.1774 22.1728Z", fill: "white" })),
|
|
85
|
+
h("span", { class: "Title" }, translate('sliderTitle', this.language))),
|
|
86
|
+
h("div", { class: "Items" }, this.games &&
|
|
87
|
+
h("general-slider", { "slide-number": this.slideNumber, "slide-show": this.slideShow }, this.games && this.games.map((game, i) => {
|
|
88
|
+
return h("li", { class: "Item", onMouseEnter: () => this.enter(i), onMouseLeave: () => this.leave() },
|
|
89
|
+
h("span", { class: `PlayNowButton ${this.hoverIndex == i ? 'ItemHover' : ''}`, onClick: () => { this.gameClicked(game); } }, translate('playNow', this.language)),
|
|
90
|
+
h("img", { class: "Img", src: game.thumbnail, alt: game.name, title: game.name }));
|
|
91
|
+
})))));
|
|
92
|
+
}
|
|
93
|
+
static get is() { return "casino-tournament-slider"; }
|
|
94
|
+
static get encapsulation() { return "shadow"; }
|
|
95
|
+
static get originalStyleUrls() { return {
|
|
96
|
+
"$": ["casino-tournament-slider.scss"]
|
|
97
|
+
}; }
|
|
98
|
+
static get styleUrls() { return {
|
|
99
|
+
"$": ["casino-tournament-slider.css"]
|
|
100
|
+
}; }
|
|
101
|
+
static get properties() { return {
|
|
102
|
+
"useEvent": {
|
|
103
|
+
"type": "string",
|
|
104
|
+
"mutable": false,
|
|
105
|
+
"complexType": {
|
|
106
|
+
"original": "string",
|
|
107
|
+
"resolved": "string",
|
|
108
|
+
"references": {}
|
|
109
|
+
},
|
|
110
|
+
"required": false,
|
|
111
|
+
"optional": false,
|
|
112
|
+
"docs": {
|
|
113
|
+
"tags": [],
|
|
114
|
+
"text": ""
|
|
115
|
+
},
|
|
116
|
+
"attribute": "use-event",
|
|
117
|
+
"reflect": false
|
|
118
|
+
},
|
|
119
|
+
"endpoint": {
|
|
120
|
+
"type": "string",
|
|
121
|
+
"mutable": false,
|
|
122
|
+
"complexType": {
|
|
123
|
+
"original": "string",
|
|
124
|
+
"resolved": "string",
|
|
125
|
+
"references": {}
|
|
126
|
+
},
|
|
127
|
+
"required": false,
|
|
128
|
+
"optional": false,
|
|
129
|
+
"docs": {
|
|
130
|
+
"tags": [],
|
|
131
|
+
"text": ""
|
|
132
|
+
},
|
|
133
|
+
"attribute": "endpoint",
|
|
134
|
+
"reflect": false
|
|
135
|
+
},
|
|
136
|
+
"tournamentId": {
|
|
137
|
+
"type": "string",
|
|
138
|
+
"mutable": false,
|
|
139
|
+
"complexType": {
|
|
140
|
+
"original": "string",
|
|
141
|
+
"resolved": "string",
|
|
142
|
+
"references": {}
|
|
143
|
+
},
|
|
144
|
+
"required": false,
|
|
145
|
+
"optional": false,
|
|
146
|
+
"docs": {
|
|
147
|
+
"tags": [],
|
|
148
|
+
"text": ""
|
|
149
|
+
},
|
|
150
|
+
"attribute": "tournament-id",
|
|
151
|
+
"reflect": false
|
|
152
|
+
},
|
|
153
|
+
"session": {
|
|
154
|
+
"type": "string",
|
|
155
|
+
"mutable": false,
|
|
156
|
+
"complexType": {
|
|
157
|
+
"original": "string",
|
|
158
|
+
"resolved": "string",
|
|
159
|
+
"references": {}
|
|
160
|
+
},
|
|
161
|
+
"required": false,
|
|
162
|
+
"optional": false,
|
|
163
|
+
"docs": {
|
|
164
|
+
"tags": [],
|
|
165
|
+
"text": ""
|
|
166
|
+
},
|
|
167
|
+
"attribute": "session",
|
|
168
|
+
"reflect": false
|
|
169
|
+
},
|
|
170
|
+
"language": {
|
|
171
|
+
"type": "string",
|
|
172
|
+
"mutable": false,
|
|
173
|
+
"complexType": {
|
|
174
|
+
"original": "string",
|
|
175
|
+
"resolved": "string",
|
|
176
|
+
"references": {}
|
|
177
|
+
},
|
|
178
|
+
"required": false,
|
|
179
|
+
"optional": false,
|
|
180
|
+
"docs": {
|
|
181
|
+
"tags": [],
|
|
182
|
+
"text": ""
|
|
183
|
+
},
|
|
184
|
+
"attribute": "language",
|
|
185
|
+
"reflect": false
|
|
186
|
+
},
|
|
187
|
+
"gamesLimit": {
|
|
188
|
+
"type": "number",
|
|
189
|
+
"mutable": false,
|
|
190
|
+
"complexType": {
|
|
191
|
+
"original": "number",
|
|
192
|
+
"resolved": "number",
|
|
193
|
+
"references": {}
|
|
194
|
+
},
|
|
195
|
+
"required": false,
|
|
196
|
+
"optional": false,
|
|
197
|
+
"docs": {
|
|
198
|
+
"tags": [],
|
|
199
|
+
"text": ""
|
|
200
|
+
},
|
|
201
|
+
"attribute": "games-limit",
|
|
202
|
+
"reflect": false,
|
|
203
|
+
"defaultValue": "30"
|
|
204
|
+
},
|
|
205
|
+
"offset": {
|
|
206
|
+
"type": "number",
|
|
207
|
+
"mutable": false,
|
|
208
|
+
"complexType": {
|
|
209
|
+
"original": "number",
|
|
210
|
+
"resolved": "number",
|
|
211
|
+
"references": {}
|
|
212
|
+
},
|
|
213
|
+
"required": false,
|
|
214
|
+
"optional": false,
|
|
215
|
+
"docs": {
|
|
216
|
+
"tags": [],
|
|
217
|
+
"text": ""
|
|
218
|
+
},
|
|
219
|
+
"attribute": "offset",
|
|
220
|
+
"reflect": false,
|
|
221
|
+
"defaultValue": "0"
|
|
222
|
+
},
|
|
223
|
+
"slideNumber": {
|
|
224
|
+
"type": "number",
|
|
225
|
+
"mutable": false,
|
|
226
|
+
"complexType": {
|
|
227
|
+
"original": "number",
|
|
228
|
+
"resolved": "number",
|
|
229
|
+
"references": {}
|
|
230
|
+
},
|
|
231
|
+
"required": false,
|
|
232
|
+
"optional": false,
|
|
233
|
+
"docs": {
|
|
234
|
+
"tags": [],
|
|
235
|
+
"text": ""
|
|
236
|
+
},
|
|
237
|
+
"attribute": "slide-number",
|
|
238
|
+
"reflect": false,
|
|
239
|
+
"defaultValue": "3"
|
|
240
|
+
},
|
|
241
|
+
"slideShow": {
|
|
242
|
+
"type": "number",
|
|
243
|
+
"mutable": false,
|
|
244
|
+
"complexType": {
|
|
245
|
+
"original": "number",
|
|
246
|
+
"resolved": "number",
|
|
247
|
+
"references": {}
|
|
248
|
+
},
|
|
249
|
+
"required": false,
|
|
250
|
+
"optional": false,
|
|
251
|
+
"docs": {
|
|
252
|
+
"tags": [],
|
|
253
|
+
"text": ""
|
|
254
|
+
},
|
|
255
|
+
"attribute": "slide-show",
|
|
256
|
+
"reflect": false,
|
|
257
|
+
"defaultValue": "3"
|
|
258
|
+
},
|
|
259
|
+
"clientStyling": {
|
|
260
|
+
"type": "string",
|
|
261
|
+
"mutable": false,
|
|
262
|
+
"complexType": {
|
|
263
|
+
"original": "string",
|
|
264
|
+
"resolved": "string",
|
|
265
|
+
"references": {}
|
|
266
|
+
},
|
|
267
|
+
"required": false,
|
|
268
|
+
"optional": false,
|
|
269
|
+
"docs": {
|
|
270
|
+
"tags": [],
|
|
271
|
+
"text": ""
|
|
272
|
+
},
|
|
273
|
+
"attribute": "client-styling",
|
|
274
|
+
"reflect": false,
|
|
275
|
+
"defaultValue": "''"
|
|
276
|
+
},
|
|
277
|
+
"clientStylingUrl": {
|
|
278
|
+
"type": "string",
|
|
279
|
+
"mutable": false,
|
|
280
|
+
"complexType": {
|
|
281
|
+
"original": "string",
|
|
282
|
+
"resolved": "string",
|
|
283
|
+
"references": {}
|
|
284
|
+
},
|
|
285
|
+
"required": false,
|
|
286
|
+
"optional": false,
|
|
287
|
+
"docs": {
|
|
288
|
+
"tags": [],
|
|
289
|
+
"text": ""
|
|
290
|
+
},
|
|
291
|
+
"attribute": "client-styling-url",
|
|
292
|
+
"reflect": false,
|
|
293
|
+
"defaultValue": "''"
|
|
294
|
+
},
|
|
295
|
+
"showTitle": {
|
|
296
|
+
"type": "boolean",
|
|
297
|
+
"mutable": false,
|
|
298
|
+
"complexType": {
|
|
299
|
+
"original": "boolean",
|
|
300
|
+
"resolved": "boolean",
|
|
301
|
+
"references": {}
|
|
302
|
+
},
|
|
303
|
+
"required": false,
|
|
304
|
+
"optional": false,
|
|
305
|
+
"docs": {
|
|
306
|
+
"tags": [],
|
|
307
|
+
"text": ""
|
|
308
|
+
},
|
|
309
|
+
"attribute": "show-title",
|
|
310
|
+
"reflect": false,
|
|
311
|
+
"defaultValue": "false"
|
|
312
|
+
}
|
|
313
|
+
}; }
|
|
314
|
+
static get states() { return {
|
|
315
|
+
"limitStylingAppends": {},
|
|
316
|
+
"stylingContainer": {},
|
|
317
|
+
"games": {},
|
|
318
|
+
"hover": {},
|
|
319
|
+
"hoverIndex": {}
|
|
320
|
+
}; }
|
|
321
|
+
static get listeners() { return [{
|
|
322
|
+
"name": "getTournamentInfoCompleted",
|
|
323
|
+
"method": "todoCompletedHandler",
|
|
324
|
+
"target": "window",
|
|
325
|
+
"capture": false,
|
|
326
|
+
"passive": false
|
|
327
|
+
}]; }
|
|
328
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './components';
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
const DEFAULT_LANGUAGE = 'en';
|
|
2
|
+
const SUPPORTED_LANGUAGES = ['ro', 'en', 'zh-hk', 'fr', 'hu', 'tr', 'el', 'es', 'pt'];
|
|
3
|
+
const TRANSLATIONS = {
|
|
4
|
+
en: {
|
|
5
|
+
playNow: 'Play now',
|
|
6
|
+
sliderTitle: 'Participanting games'
|
|
7
|
+
},
|
|
8
|
+
'zh-hk': {
|
|
9
|
+
playNow: '现在播放',
|
|
10
|
+
},
|
|
11
|
+
fr: {
|
|
12
|
+
playNow: 'Joue maintenant',
|
|
13
|
+
},
|
|
14
|
+
ro: {
|
|
15
|
+
playNow: 'Joaca acum',
|
|
16
|
+
},
|
|
17
|
+
hu: {
|
|
18
|
+
playNow: 'Játsszon most',
|
|
19
|
+
},
|
|
20
|
+
tr: {
|
|
21
|
+
playNow: 'Şimdi oyna',
|
|
22
|
+
},
|
|
23
|
+
el: {
|
|
24
|
+
playNow: 'Παίξε τώρα',
|
|
25
|
+
},
|
|
26
|
+
es: {
|
|
27
|
+
playNow: 'Jugar Ya',
|
|
28
|
+
},
|
|
29
|
+
pt: {
|
|
30
|
+
playNow: 'Jogue agora',
|
|
31
|
+
},
|
|
32
|
+
};
|
|
33
|
+
export const translate = (key, customLang) => {
|
|
34
|
+
const lang = customLang;
|
|
35
|
+
return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
|
|
36
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface CasinoTournamentSlider extends Components.CasinoTournamentSlider, HTMLElement {}
|
|
4
|
+
export const CasinoTournamentSlider: {
|
|
5
|
+
prototype: CasinoTournamentSlider;
|
|
6
|
+
new (): CasinoTournamentSlider;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
|
|
2
|
+
import { d as defineCustomElement$2 } from './general-slider2.js';
|
|
3
|
+
|
|
4
|
+
const DEFAULT_LANGUAGE = 'en';
|
|
5
|
+
const SUPPORTED_LANGUAGES = ['ro', 'en', 'zh-hk', 'fr', 'hu', 'tr', 'el', 'es', 'pt'];
|
|
6
|
+
const TRANSLATIONS = {
|
|
7
|
+
en: {
|
|
8
|
+
playNow: 'Play now',
|
|
9
|
+
sliderTitle: 'Participanting games'
|
|
10
|
+
},
|
|
11
|
+
'zh-hk': {
|
|
12
|
+
playNow: '现在播放',
|
|
13
|
+
},
|
|
14
|
+
fr: {
|
|
15
|
+
playNow: 'Joue maintenant',
|
|
16
|
+
},
|
|
17
|
+
ro: {
|
|
18
|
+
playNow: 'Joaca acum',
|
|
19
|
+
},
|
|
20
|
+
hu: {
|
|
21
|
+
playNow: 'Játsszon most',
|
|
22
|
+
},
|
|
23
|
+
tr: {
|
|
24
|
+
playNow: 'Şimdi oyna',
|
|
25
|
+
},
|
|
26
|
+
el: {
|
|
27
|
+
playNow: 'Παίξε τώρα',
|
|
28
|
+
},
|
|
29
|
+
es: {
|
|
30
|
+
playNow: 'Jugar Ya',
|
|
31
|
+
},
|
|
32
|
+
pt: {
|
|
33
|
+
playNow: 'Jogue agora',
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
const translate = (key, customLang) => {
|
|
37
|
+
const lang = customLang;
|
|
38
|
+
return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
const casinoTournamentSliderCss = ":host{display:block}.Item{color:white;display:flex;justify-content:center;align-items:center;font-weight:bold;font-size:10rem;user-select:none;overflow:hidden}.Item .Img{width:100%;height:100%}.PlayNowButton{position:absolute;background:var(--emfe-w-color-green, #48952a);display:block;box-sizing:border-box;padding:0.8rem 0.5rem;color:var(--emfe-w-color-white, #FFFFFF);text-transform:uppercase;text-align:center;font-weight:600;font-size:0.7rem;cursor:pointer;transition:opacity 0.4s linear;opacity:0;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.ItemHover{opacity:1}.Items .Item:first-child{margin-left:0}.Items .Item:last-child{margin-right:0}.SliderTitle{display:flex;align-items:center;padding:6px 0;gap:11px}.Title{color:#fff;font-size:14px;font-weight:600}";
|
|
42
|
+
|
|
43
|
+
const CasinoTournamentSlider$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
44
|
+
constructor() {
|
|
45
|
+
super();
|
|
46
|
+
this.__registerHost();
|
|
47
|
+
this.__attachShadow();
|
|
48
|
+
this.gamesLimit = 30;
|
|
49
|
+
this.offset = 0;
|
|
50
|
+
this.slideNumber = 3;
|
|
51
|
+
this.slideShow = 3;
|
|
52
|
+
this.clientStyling = '';
|
|
53
|
+
this.clientStylingUrl = '';
|
|
54
|
+
this.showTitle = false;
|
|
55
|
+
this.limitStylingAppends = false;
|
|
56
|
+
this.enter = (index) => {
|
|
57
|
+
this.hover = true;
|
|
58
|
+
this.hoverIndex = index;
|
|
59
|
+
};
|
|
60
|
+
this.leave = () => {
|
|
61
|
+
this.hover = false;
|
|
62
|
+
this.hoverIndex = -1;
|
|
63
|
+
};
|
|
64
|
+
this.gameClicked = (item) => {
|
|
65
|
+
window.postMessage({ type: 'TournamentGameAction', gameId: item.id, name: item.name }, window.location.href);
|
|
66
|
+
};
|
|
67
|
+
this.setClientStyling = () => {
|
|
68
|
+
let sheet = document.createElement('style');
|
|
69
|
+
sheet.innerHTML = this.clientStyling;
|
|
70
|
+
this.stylingContainer.prepend(sheet);
|
|
71
|
+
};
|
|
72
|
+
this.setClientStylingURL = () => {
|
|
73
|
+
let cssFile = document.createElement('style');
|
|
74
|
+
setTimeout(() => {
|
|
75
|
+
cssFile.innerHTML = this.clientStylingUrl;
|
|
76
|
+
this.stylingContainer.prepend(cssFile);
|
|
77
|
+
}, 1);
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
todoCompletedHandler(event) {
|
|
81
|
+
if (event.detail && this.useEvent) {
|
|
82
|
+
if (!event.detail.games)
|
|
83
|
+
return;
|
|
84
|
+
this.games = event.detail.games.items;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
getTournamentInfo() {
|
|
88
|
+
let url = new URL(this.endpoint + `/tournaments/${this.tournamentId}`);
|
|
89
|
+
let reqHeaders = new Headers();
|
|
90
|
+
url.searchParams.append('expand', 'games');
|
|
91
|
+
url.searchParams.append('language', this.language);
|
|
92
|
+
url.searchParams.append('pagination', `games(limit=${this.gamesLimit},offset=${this.offset})`);
|
|
93
|
+
url.searchParams.append('fields', 'games(id,name,thumbnail)');
|
|
94
|
+
if (this.session) {
|
|
95
|
+
reqHeaders.append('X-SessionId', this.session);
|
|
96
|
+
}
|
|
97
|
+
let requestOptions = {
|
|
98
|
+
method: 'GET',
|
|
99
|
+
headers: reqHeaders,
|
|
100
|
+
};
|
|
101
|
+
fetch(url.href, requestOptions).then((res) => res.json())
|
|
102
|
+
.then((res) => {
|
|
103
|
+
this.games = res.item.games.items;
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
componentWillLoad() {
|
|
107
|
+
if (!this.useEvent && this.endpoint && this.tournamentId) {
|
|
108
|
+
this.getTournamentInfo();
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
componentDidRender() {
|
|
112
|
+
if (!this.limitStylingAppends && this.stylingContainer) {
|
|
113
|
+
if (this.clientStyling)
|
|
114
|
+
this.setClientStyling();
|
|
115
|
+
if (this.clientStylingUrl)
|
|
116
|
+
this.setClientStylingURL();
|
|
117
|
+
this.limitStylingAppends = true;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
render() {
|
|
121
|
+
return h("div", { ref: el => this.stylingContainer = el }, h("div", { class: "TournamentSlider" }, this.showTitle && this.games &&
|
|
122
|
+
h("div", { class: "SliderTitle" }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "21", height: "25", viewBox: "0 0 21 25", fill: "none" }, h("path", { d: "M6.1774 22.1728C6.36493 22.2725 6.56274 22.0566 6.44793 21.8779C5.82475 20.908 5.23463 19.2759 6.17483 17.174C7.74273 13.6689 8.6968 11.8535 8.6968 11.8535C8.6968 11.8535 9.20426 13.9721 10.5799 15.8558C11.9038 17.6687 12.6285 19.9488 11.4602 21.8482C11.3506 22.0265 11.5439 22.2368 11.7302 22.1415C13.1763 21.4017 14.7983 19.9179 14.9813 16.965C15.0488 16.0627 14.9476 14.7995 14.4416 13.2054C13.791 11.185 12.9911 10.2423 12.5283 9.83741C12.3899 9.71629 12.1746 9.82363 12.1859 10.0072C12.3208 12.1872 11.5007 12.7404 11.0339 11.4937C10.8474 10.9957 10.7387 10.1344 10.7387 9.08558C10.7387 7.3394 10.2321 5.54188 9.1152 4.0812C8.82475 3.70134 8.4849 3.3464 8.09498 3.04372C7.95382 2.93411 7.74919 3.04428 7.76212 3.22252C7.84788 4.40628 7.77018 7.79884 4.79383 11.8519C2.09515 15.6115 3.14088 18.4989 3.51195 19.281C4.2214 20.7791 5.21098 21.6589 6.1774 22.1728Z", fill: "white" })), h("span", { class: "Title" }, translate('sliderTitle', this.language))), h("div", { class: "Items" }, this.games &&
|
|
123
|
+
h("general-slider", { "slide-number": this.slideNumber, "slide-show": this.slideShow }, this.games && this.games.map((game, i) => {
|
|
124
|
+
return h("li", { class: "Item", onMouseEnter: () => this.enter(i), onMouseLeave: () => this.leave() }, h("span", { class: `PlayNowButton ${this.hoverIndex == i ? 'ItemHover' : ''}`, onClick: () => { this.gameClicked(game); } }, translate('playNow', this.language)), h("img", { class: "Img", src: game.thumbnail, alt: game.name, title: game.name }));
|
|
125
|
+
})))));
|
|
126
|
+
}
|
|
127
|
+
static get style() { return casinoTournamentSliderCss; }
|
|
128
|
+
}, [1, "casino-tournament-slider", {
|
|
129
|
+
"useEvent": [1, "use-event"],
|
|
130
|
+
"endpoint": [1],
|
|
131
|
+
"tournamentId": [1, "tournament-id"],
|
|
132
|
+
"session": [1],
|
|
133
|
+
"language": [1],
|
|
134
|
+
"gamesLimit": [2, "games-limit"],
|
|
135
|
+
"offset": [2],
|
|
136
|
+
"slideNumber": [2, "slide-number"],
|
|
137
|
+
"slideShow": [2, "slide-show"],
|
|
138
|
+
"clientStyling": [1, "client-styling"],
|
|
139
|
+
"clientStylingUrl": [1, "client-styling-url"],
|
|
140
|
+
"showTitle": [4, "show-title"],
|
|
141
|
+
"limitStylingAppends": [32],
|
|
142
|
+
"stylingContainer": [32],
|
|
143
|
+
"games": [32],
|
|
144
|
+
"hover": [32],
|
|
145
|
+
"hoverIndex": [32]
|
|
146
|
+
}, [[8, "getTournamentInfoCompleted", "todoCompletedHandler"]]]);
|
|
147
|
+
function defineCustomElement$1() {
|
|
148
|
+
if (typeof customElements === "undefined") {
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
const components = ["casino-tournament-slider", "general-slider"];
|
|
152
|
+
components.forEach(tagName => { switch (tagName) {
|
|
153
|
+
case "casino-tournament-slider":
|
|
154
|
+
if (!customElements.get(tagName)) {
|
|
155
|
+
customElements.define(tagName, CasinoTournamentSlider$1);
|
|
156
|
+
}
|
|
157
|
+
break;
|
|
158
|
+
case "general-slider":
|
|
159
|
+
if (!customElements.get(tagName)) {
|
|
160
|
+
defineCustomElement$2();
|
|
161
|
+
}
|
|
162
|
+
break;
|
|
163
|
+
} });
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
const CasinoTournamentSlider = CasinoTournamentSlider$1;
|
|
167
|
+
const defineCustomElement = defineCustomElement$1;
|
|
168
|
+
|
|
169
|
+
export { CasinoTournamentSlider, defineCustomElement };
|