@everymatrix/casino-tournaments-page-controller 0.0.261 → 0.0.262
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-tournaments-page-controller.js +1 -1
- package/dist/casino-tournaments-page-controller.js.map +1 -1
- package/package.json +2 -2
- package/src/CasinoTournamentsPageController.svelte +357 -34
- package/src/i18n.js +2 -1
- package/src/images/game-casino.svg +684 -0
- package/src/images/game-sports.svg +485 -0
- package/src/translations.js +36 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@everymatrix/casino-tournaments-page-controller",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.262",
|
|
4
4
|
"main": "dist/casino-tournaments-page-controller.js",
|
|
5
5
|
"svelte": "src/index.ts",
|
|
6
6
|
"scripts": {
|
|
@@ -37,5 +37,5 @@
|
|
|
37
37
|
"publishConfig": {
|
|
38
38
|
"access": "public"
|
|
39
39
|
},
|
|
40
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "63a3c79f8f47451d7ca7f8c1dc77bb78bee91df2"
|
|
41
41
|
}
|
|
@@ -1,16 +1,23 @@
|
|
|
1
1
|
<svelte:options tag={null}/>
|
|
2
2
|
|
|
3
3
|
<script lang="ts">
|
|
4
|
-
import {onMount} from 'svelte';
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
4
|
+
import { onMount } from 'svelte';
|
|
5
|
+
import moment from 'moment';
|
|
6
|
+
import { isMobile, getDevice, checkSession } from 'rvhelper';
|
|
7
|
+
import { _, addNewMessages, date, setLocale, setupI18n } from './i18n';
|
|
8
|
+
import { TournamentsPageTranslations } from './translations';
|
|
9
|
+
import { EventSourcePolyfill } from 'event-source-polyfill';
|
|
10
|
+
|
|
11
|
+
import gameCasinoSvg from './images/game-casino.svg';
|
|
12
|
+
import gameSportsSvg from './images/game-sports.svg'
|
|
9
13
|
|
|
10
14
|
import '@everymatrix/casino-tournaments-page';
|
|
11
15
|
import '@everymatrix/casino-tournaments-details';
|
|
12
16
|
import '@everymatrix/casino-tournaments-thumbnail-controller';
|
|
13
17
|
import '@everymatrix/casino-tournaments-table';
|
|
18
|
+
import '@everymatrix/casino-tournaments-tab';
|
|
19
|
+
import '@everymatrix/casino-tournaments-thumbnail-rule';
|
|
20
|
+
import '@everymatrix/casino-tournaments-rank';
|
|
14
21
|
|
|
15
22
|
export let session: string = '';
|
|
16
23
|
export let userid: string = '';
|
|
@@ -25,6 +32,10 @@
|
|
|
25
32
|
export let namemask: string = '';
|
|
26
33
|
export let mobiletablelimit:string = '15';
|
|
27
34
|
export let updatetableintime:string = 'true';
|
|
35
|
+
export let viewmode:string = '';
|
|
36
|
+
|
|
37
|
+
export let leaderboardoffset:string = '0';
|
|
38
|
+
export let leaderboardlimit:string = '15';
|
|
28
39
|
// Variables of topics for communication
|
|
29
40
|
let sessionTopic;
|
|
30
41
|
|
|
@@ -33,6 +44,7 @@
|
|
|
33
44
|
let playerID: string = '';
|
|
34
45
|
let isLoading: boolean = true;
|
|
35
46
|
let tournamentDescription: Array<any> = [];
|
|
47
|
+
let tournamentProducts:any;
|
|
36
48
|
|
|
37
49
|
let tournamentDetails: any = undefined;
|
|
38
50
|
let tournamentTableData: any = undefined;
|
|
@@ -44,9 +56,16 @@
|
|
|
44
56
|
let firstRowAvailable: boolean = false;
|
|
45
57
|
|
|
46
58
|
let tableUpdateEventSource: any;
|
|
59
|
+
let tournamentUpdateEventSource:EventSourcePolyfill;
|
|
47
60
|
|
|
48
61
|
let currentUserData:any = {};
|
|
49
62
|
let currentUserInPage:Boolean = false;
|
|
63
|
+
let activeTab = 'leaderboard';
|
|
64
|
+
let overallRank:number;
|
|
65
|
+
let latestRank:number;
|
|
66
|
+
let isMiniMode:boolean;
|
|
67
|
+
let shownStatus:any = '';
|
|
68
|
+
|
|
50
69
|
setupI18n({ withLocale: 'en', translations: {}});
|
|
51
70
|
|
|
52
71
|
Object.keys(TournamentsPageTranslations).forEach((item: any) => {
|
|
@@ -55,7 +74,6 @@
|
|
|
55
74
|
|
|
56
75
|
// @TODO this must be configurable
|
|
57
76
|
const tableColumns = ['Rank', 'Player', 'Points','Prize'];
|
|
58
|
-
|
|
59
77
|
// data for current user
|
|
60
78
|
const transFormCurrentUserData = (item:any) => {
|
|
61
79
|
let userData = {
|
|
@@ -65,6 +83,7 @@
|
|
|
65
83
|
Prize: item.prizeName,
|
|
66
84
|
Unqualified: item.unqualified,
|
|
67
85
|
BetCount: item.betCount,
|
|
86
|
+
userID: item.userID
|
|
68
87
|
};
|
|
69
88
|
return userData;
|
|
70
89
|
}
|
|
@@ -75,29 +94,53 @@
|
|
|
75
94
|
|
|
76
95
|
if (data && data.length > 0) {
|
|
77
96
|
data.forEach((item:any) => {
|
|
78
|
-
if
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
currentUserInPage = true;
|
|
82
|
-
}
|
|
83
|
-
// added duplicated properties for mobile version, requirement more information for desktop version
|
|
84
|
-
tableData.push({
|
|
85
|
-
Rank: item.rank,
|
|
86
|
-
Player: item.shortName,
|
|
87
|
-
Points: item.score,
|
|
88
|
-
Prize: item.prizeName,
|
|
89
|
-
Unqualified: item.unqualified,
|
|
90
|
-
BetCount: item.betCount,
|
|
91
|
-
userID: item.userID
|
|
92
|
-
});
|
|
97
|
+
if(item.userID == playerID){
|
|
98
|
+
currentUserData = item;
|
|
99
|
+
currentUserInPage = true;
|
|
93
100
|
}
|
|
101
|
+
tableData.push({
|
|
102
|
+
Rank: item.rank,
|
|
103
|
+
Player: item.shortName,
|
|
104
|
+
Points: item.score,
|
|
105
|
+
Prize: item.prizeName,
|
|
106
|
+
Unqualified: item.unqualified,
|
|
107
|
+
BetCount: item.betCount,
|
|
108
|
+
userID: item.userID
|
|
109
|
+
});
|
|
94
110
|
});
|
|
95
111
|
}
|
|
96
112
|
|
|
97
|
-
|
|
113
|
+
return tableData;
|
|
114
|
+
},
|
|
115
|
+
tournamentUpdateMessageHandler= (message:any) =>{
|
|
116
|
+
if(!message.data){
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
try{
|
|
120
|
+
let messagDataAsJson = JSON.parse(message.data);
|
|
121
|
+
if(messagDataAsJson.messageType == 'TournamentUpdate'){
|
|
122
|
+
window.postMessage({type: 'UpdateTournamentView', tournamentData: messagDataAsJson.item}, window.location.href);
|
|
123
|
+
tournamentDetails = messagDataAsJson.item;
|
|
124
|
+
transformTournamentData(messagDataAsJson.item);
|
|
125
|
+
matchStatus();
|
|
126
|
+
}
|
|
127
|
+
}catch (e){
|
|
128
|
+
console.error(e);
|
|
129
|
+
}
|
|
98
130
|
},
|
|
99
|
-
|
|
100
|
-
|
|
131
|
+
startupTournamentUpdateListener = (tournamentID: string, searchParams:any)=>{
|
|
132
|
+
let endpointURL:string = `${endpoint}/tournaments/updates?filter=id=${tournamentID}&${searchParams.toString()}&XSessionId=${session}`;
|
|
133
|
+
if(!EventSource){
|
|
134
|
+
tournamentUpdateEventSource = new EventSourcePolyfill(endpointURL,{headers: {'accept': 'text/event-stream'}});
|
|
135
|
+
}else{
|
|
136
|
+
tournamentUpdateEventSource = new EventSource(endpointURL);
|
|
137
|
+
}
|
|
138
|
+
if (!typeof (tournamentUpdateEventSource) != 'undefined'){
|
|
139
|
+
tournamentUpdateEventSource.addEventListener('message', tournamentUpdateMessageHandler);
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
tableUpdateMessageHandler = (message:any)=>{
|
|
143
|
+
if(!message.data){
|
|
101
144
|
return;
|
|
102
145
|
}
|
|
103
146
|
try{
|
|
@@ -106,15 +149,30 @@
|
|
|
106
149
|
if(!updateTableData || !updateTableData.items){
|
|
107
150
|
return;
|
|
108
151
|
}
|
|
109
|
-
let newTableData = transformTableData(updateTableData.items);
|
|
152
|
+
let newTableData: Array<LeaderboardRow> = transformTableData(updateTableData.items);
|
|
153
|
+
window.postMessage({ type: 'CasinoTableData', tableData: newTableData }, window.location.href);
|
|
154
|
+
currentUserInPage = newTableData.filter((item)=>{
|
|
155
|
+
return item.userID = playerID;
|
|
156
|
+
}).length > 0;
|
|
110
157
|
if(updateTableData.item && !currentUserInPage){
|
|
111
158
|
firstRowAvailable = true;
|
|
112
159
|
firstRowData = transFormCurrentUserData(updateTableData.item);
|
|
160
|
+
if(firstRowData){
|
|
161
|
+
window.postMessage({ type: 'CasinoTableFirstRowData', tableData: firstRowData }, window.location.href);
|
|
162
|
+
}
|
|
113
163
|
}
|
|
114
|
-
|
|
115
|
-
|
|
164
|
+
|
|
165
|
+
let newUserRank = currentUserInPage ? currentUserData.Rank : firstRowData.Rank;
|
|
166
|
+
if(newUserRank != latestRank || overallRank != updateTableData.items.length){
|
|
167
|
+
overallRank = updateTableData.items.length;//new player joined and spined
|
|
168
|
+
window.postMessage({type: `TournamentRankInfo_${tourid}`, rankInfo:{
|
|
169
|
+
rank: newUserRank,
|
|
170
|
+
overallRank: overallRank,
|
|
171
|
+
prize: currentUserInPage ? (currentUserData.Prize || '-') : (firstRowData.Prize || '-')
|
|
172
|
+
}});
|
|
173
|
+
latestRank = newUserRank;
|
|
116
174
|
}
|
|
117
|
-
|
|
175
|
+
|
|
118
176
|
if(currentUserInPage){
|
|
119
177
|
window.postMessage({ type: 'CasinoTableCurrentUserData', tableData: currentUserData }, window.location.href);
|
|
120
178
|
}
|
|
@@ -137,11 +195,32 @@
|
|
|
137
195
|
tableUpdateEventSource.addEventListener('message', tableUpdateMessageHandler);
|
|
138
196
|
tableUpdateEventSource.addEventListener('error', tableUpdateMessageHandler);
|
|
139
197
|
}
|
|
140
|
-
|
|
198
|
+
},
|
|
199
|
+
transformTournamentData = (data:any)=>{
|
|
200
|
+
let productInfo={};
|
|
201
|
+
if(data.wallet){
|
|
202
|
+
let wallet = data.wallet;
|
|
203
|
+
if(wallet.casino){
|
|
204
|
+
productInfo['casino'] = {
|
|
205
|
+
name: 'Casino',
|
|
206
|
+
minbet: wallet.casino.minStake && wallet.casino.minStake.amount ? wallet.casino.minStake.amount.EUR : $_('tournamentsPage.unlimited'),
|
|
207
|
+
maxbet: wallet.casino.maxStake && wallet.casino.maxStake.amount ? wallet.casino.maxStake.amount.EUR : $_('tournamentsPage.unlimited')
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
if(wallet.sports){
|
|
211
|
+
productInfo['sports'] = {
|
|
212
|
+
name: 'Sports',
|
|
213
|
+
minbet: wallet.sports.minStake && wallet.sports.minStake.amount ? wallet.sports.minStake.amount.EUR : $_('tournamentsPage.unlimited'),
|
|
214
|
+
maxbet: wallet.sports.maxStake && wallet.sports.maxStake.amount ? wallet.sports.maxStake.amount.EUR : $_('tournamentsPage.unlimited')
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
tournamentProducts = productInfo;
|
|
218
|
+
}
|
|
219
|
+
}
|
|
141
220
|
|
|
142
221
|
const getData = (endpointURL: String, tourID: String) => {
|
|
143
222
|
let url = new URL(endpointURL + `/tournaments/${tourID}`);
|
|
144
|
-
let reqHeaders = new Headers();
|
|
223
|
+
let reqHeaders = new Headers({'X-SessionId': session});
|
|
145
224
|
|
|
146
225
|
url.searchParams.append('expand', 'games');
|
|
147
226
|
url.searchParams.append('language', lang);
|
|
@@ -156,6 +235,8 @@
|
|
|
156
235
|
.then((res: any) => res.json())
|
|
157
236
|
.then((res: any) => {
|
|
158
237
|
tournamentDetails = res.item;
|
|
238
|
+
transformTournamentData(tournamentDetails);
|
|
239
|
+
startupTournamentUpdateListener(tourid, url.searchParams);
|
|
159
240
|
});
|
|
160
241
|
}
|
|
161
242
|
|
|
@@ -172,9 +253,9 @@
|
|
|
172
253
|
if (session) {
|
|
173
254
|
let limit = isMobile(userAgent) == true? mobiletablelimit : tablelimit;
|
|
174
255
|
url.searchParams.append('pagination', `offset=0,limit=${limit}`);
|
|
175
|
-
reqHeaders.append('X-
|
|
256
|
+
reqHeaders.append('X-SessionId', session);
|
|
176
257
|
}
|
|
177
|
-
|
|
258
|
+
|
|
178
259
|
url.searchParams.append('platform', getDevice(userAgent));
|
|
179
260
|
|
|
180
261
|
let requestOptions = {
|
|
@@ -191,6 +272,8 @@
|
|
|
191
272
|
firstRowData = transFormCurrentUserData(res.item);
|
|
192
273
|
}
|
|
193
274
|
showTable = true;
|
|
275
|
+
latestRank = currentUserInPage ? currentUserData.Rank : firstRowData.Rank
|
|
276
|
+
overallRank = res.total;
|
|
194
277
|
|
|
195
278
|
// @TODO data is not iterable error fix
|
|
196
279
|
window.postMessage({
|
|
@@ -219,6 +302,23 @@
|
|
|
219
302
|
if (e.data && e.data.type == 'PlayerID') {
|
|
220
303
|
playerID = e.data.playerID;
|
|
221
304
|
}
|
|
305
|
+
if(e.data && e.data.type == 'TournamentsTabSwitch'){
|
|
306
|
+
activeTab = e.data.tab;
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
const matchStatus = () => {
|
|
311
|
+
if (tournamentDetails.state == 'Unstarted') {
|
|
312
|
+
shownStatus = $_('tournamentsPage.scheduled');
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
if (tournamentDetails.state == 'Running') {
|
|
316
|
+
shownStatus = $_('tournamentsPage.ongoing');
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
if (tournamentDetails.state == 'Closed' || tournamentDetails.state == 'Closing') {
|
|
320
|
+
shownStatus = $_('tournamentsPage.finished');
|
|
321
|
+
}
|
|
222
322
|
}
|
|
223
323
|
|
|
224
324
|
const goBack = () => {
|
|
@@ -231,6 +331,12 @@
|
|
|
231
331
|
window.history.back();
|
|
232
332
|
}
|
|
233
333
|
}
|
|
334
|
+
const closeThumbnail = () =>{
|
|
335
|
+
window.postMessage({ type: 'OnCloseThumbnail' }, window.location.href);
|
|
336
|
+
}
|
|
337
|
+
const gotoFromTournamentsPage = (pageType: string) =>{
|
|
338
|
+
window.postMessage({ type: 'GotoFromTournamentsPage', pageType }, window.location.href);
|
|
339
|
+
}
|
|
234
340
|
|
|
235
341
|
const setSession = () => {
|
|
236
342
|
if (session.length > 0 && session != 'false') {
|
|
@@ -261,10 +367,14 @@
|
|
|
261
367
|
}
|
|
262
368
|
});
|
|
263
369
|
}
|
|
370
|
+
const initTabTitle= () =>{
|
|
371
|
+
window.postMessage({type: 'TournamentsTabLocaleTextUpdate','state': 'leaderboard', 'text': $_('tournamentsPage.leaderBoard')}, window.location.href)
|
|
372
|
+
window.postMessage({type: 'TournamentsTabLocaleTextUpdate','state': 'rules', 'text': $_('tournamentsPage.rules')}, window.location.href)
|
|
373
|
+
window.postMessage({type: 'TournamentsTabLocaleTextUpdate','state': 'games', 'text': $_('tournamentsPage.games')}, window.location.href)
|
|
374
|
+
}
|
|
264
375
|
|
|
265
376
|
onMount(() => {
|
|
266
377
|
window.addEventListener('message', messageHandler, false);
|
|
267
|
-
|
|
268
378
|
return () => {
|
|
269
379
|
window.removeEventListener('message', messageHandler);
|
|
270
380
|
if(tableUpdateEventSource){
|
|
@@ -272,6 +382,9 @@
|
|
|
272
382
|
tableUpdateEventSource.removeEventListener('message', tableUpdateMessageHandler);
|
|
273
383
|
tableUpdateEventSource.removeEventListener('error', tableUpdateMessageHandler);
|
|
274
384
|
}
|
|
385
|
+
if(tournamentUpdateEventSource){
|
|
386
|
+
tournamentUpdateEventSource.removeEventListener('message', tournamentUpdateMessageHandler);
|
|
387
|
+
}
|
|
275
388
|
}
|
|
276
389
|
});
|
|
277
390
|
|
|
@@ -280,11 +393,13 @@
|
|
|
280
393
|
$: initialParameters = tourid && endpoint && session && lang;
|
|
281
394
|
$: initialParameters && initialLoad();
|
|
282
395
|
$: tourid && cmsendpoint && getDataFromCMS();
|
|
396
|
+
$: isMiniMode = (viewmode == 'miniThumbnail') && isMobile(userAgent); // forward this page from tournamentslider
|
|
283
397
|
</script>
|
|
284
398
|
|
|
285
399
|
{#if isLoading}
|
|
286
400
|
<p>{$_('tournamentsPage.loading')}</p>
|
|
287
|
-
{
|
|
401
|
+
{/if}
|
|
402
|
+
{#if !isMiniMode}
|
|
288
403
|
<div class="TournamentsPage" part="TournamentsPage">
|
|
289
404
|
<div class="TournamentsSectionWrapper" part="TournamentsSectionWrapper">
|
|
290
405
|
|
|
@@ -352,7 +467,81 @@
|
|
|
352
467
|
</div>
|
|
353
468
|
</div>
|
|
354
469
|
{/if}
|
|
470
|
+
{#if isMiniMode }
|
|
471
|
+
<div class="TournamentsPage MiniMode {tournamentDetails ? 'hidden':''}" part="MiniTournamentPage">
|
|
472
|
+
<div class="TournamentContentDetails {isMobile(userAgent) ? 'MobileClass' : ''}" part="TournamentContentDetails">
|
|
473
|
+
<div class="{isMobile(userAgent) ? 'MobileClass' : ''}{showleaderboard == 'true' ? ' TournamentCardDetails' : ' FullSize'}" part="MobileTournamentCardDetails">
|
|
474
|
+
{#if !tournamentDetails}
|
|
475
|
+
<div class="Thumbnail MiniMode" part="MiniThumbnail">
|
|
476
|
+
<img part="CardImg" class="CardImg {(status == 'Closing' || status == 'Closed') ? 'CardImgFinished' : ''}" src="https://i.stack.imgur.com/y9DpT.jpg"
|
|
477
|
+
width="65px" height="40px" title="">
|
|
478
|
+
<div class="MobileRight" part="ThumbnailRight">
|
|
479
|
+
<div class="Title"> </div>
|
|
480
|
+
<div>
|
|
481
|
+
</div>
|
|
482
|
+
</div>
|
|
483
|
+
<div class="CloseButton" part="CloseButton" on:click='{()=>closeThumbnail()}'>X</div>
|
|
484
|
+
</div>
|
|
485
|
+
<casino-tournaments-rank prize="-"></casino-tournaments-rank>
|
|
486
|
+
{/if}
|
|
487
|
+
{#if tournamentDetails}
|
|
488
|
+
<div class="Thumbnail MiniMode" part="MiniThumbnail">
|
|
489
|
+
{#if tournamentDetails.thumbnail}
|
|
490
|
+
<img use:matchStatus part="CardImg" class="Mobile CardImg {(tournamentDetails.state == 'Closing' || tournamentDetails.state == 'Closed') ? 'CardImgFinished' : ''}"
|
|
491
|
+
src="{tournamentDetails.thumbnail}" width="65px" height="40px" title="{tournamentDetails.nameOrTitle}">
|
|
492
|
+
{:else}
|
|
493
|
+
<img use:matchStatus part="CardImg" class="CardImg {(tournamentDetails.state == 'Closing' || tournamentDetails.state == 'Closed') ? 'CardImgFinished' : ''}" src="https://i.stack.imgur.com/y9DpT.jpg"
|
|
494
|
+
width="65px" height="40px" title="{tournamentDetails.nameOrTitle}">
|
|
495
|
+
{/if}
|
|
496
|
+
<div class="MobileRight" part="ThumbnailRight">
|
|
497
|
+
<div class="Title" part="ThumbnailRight_Title">{tournamentDetails.nameOrTitle}</div>
|
|
498
|
+
<div part="ThumbnailRight_Period">
|
|
499
|
+
{#if tournamentDetails.startTime}
|
|
500
|
+
{$_('tournamentsPage.activePeriod', {values: {startdate: moment(tournamentDetails.startTime).format('DD/MM/YYYY HH:mm'), enddate:moment(tournamentDetails.endTime).format('DD/MM/YYYY HH:mm')}})}
|
|
501
|
+
{/if}
|
|
502
|
+
</div>
|
|
503
|
+
</div>
|
|
504
|
+
<div class="CloseButton" part="CloseButton" on:click='{()=>closeThumbnail()}'>X</div>
|
|
505
|
+
</div>
|
|
355
506
|
|
|
507
|
+
<casino-tournaments-rank part="ThumbnailRank" userrank="{currentUserInPage ? currentUserData.Rank : firstRowData.Rank}" overallrank="{overallRank}"
|
|
508
|
+
prize="{currentUserInPage ? (currentUserData.Prize || '-') : (firstRowData.Prize || '-')}" tournamentid="{tourid}" ></casino-tournaments-rank>
|
|
509
|
+
{/if}
|
|
510
|
+
</div>
|
|
511
|
+
<casino-tournaments-tab part="ThumbnailTab" use:initTabTitle tabs="leaderboard,rules,games" tab="leaderboard"></casino-tournaments-tab>
|
|
512
|
+
<div class="TabContent {showleaderboard == 'true' ? 'TournamentTableDetails ' : 'DisplayNone'} { activeTab != 'leaderboard' ? 'hidden' : ''}" part="ThumbnailTabContent">
|
|
513
|
+
<casino-tournaments-table firstrow="true" sortable="false" {lang}></casino-tournaments-table>
|
|
514
|
+
</div>
|
|
515
|
+
<div class="TabContent Rules { activeTab != 'rules' ? 'hidden' : ''}" part="ThumbnailTabContent">
|
|
516
|
+
{#if tournamentDetails}
|
|
517
|
+
<casino-tournaments-thumbnail-rule lang="{lang}" tcurl="{tournamentDetails.termsUrl||'#'}" scorecriterial="{tournamentDetails.scoreCriteria}" betcount="{tournamentDetails.minBetCount || $_('tournamentsPage.unlimited')}"
|
|
518
|
+
starttime="{moment(tournamentDetails.startTime).format('DD/MM/YYYY HH:mm:ss')}"
|
|
519
|
+
endtime="{moment(tournamentDetails.endTime).format('DD/MM/YYYY HH:mm:ss')}"
|
|
520
|
+
products="{tournamentProducts}"></casino-tournaments-thumbnail-rule>
|
|
521
|
+
{/if}
|
|
522
|
+
</div>
|
|
523
|
+
<div class="TabContent Games { activeTab != 'games' ? 'hidden' : ''}" part="ThumbnailTabContent">
|
|
524
|
+
{#if tournamentProducts}
|
|
525
|
+
<div class="GameItems {tournamentProducts.casino && tournamentProducts.sports ? 'TwoGames' : 'OneGame'}" part="ThumbnailTabContent_Games">
|
|
526
|
+
{#if tournamentProducts.casino}
|
|
527
|
+
<div part="ThumbnailTabContent_Casino">
|
|
528
|
+
<img class="svg" part="ThumbnailTabContent_Games_Casino_Svg" src="{gameCasinoSvg}" width="78" height="75"/>
|
|
529
|
+
<span part="ThumbnailTabContent_Games_Casino_Label" on:click='{() => gotoFromTournamentsPage("Casino")}'>{$_('tournamentsPage.forwardCasino')}</span>
|
|
530
|
+
</div>
|
|
531
|
+
{/if}
|
|
532
|
+
{#if tournamentProducts.sports}
|
|
533
|
+
<div class="SportsItems" part="ThumbnailTabContent_Sports">
|
|
534
|
+
<img class="svg" part="ThumbnailTabContent_Games_Sports_Svg" src="{gameSportsSvg}" width="68" height="65"/>
|
|
535
|
+
<span part="ThumbnailTabContent_Games_Sports_Label" on:click='{() => gotoFromTournamentsPage("Sports")}'>{$_('tournamentsPage.forwardSports')}</span>
|
|
536
|
+
</div>
|
|
537
|
+
{/if}
|
|
538
|
+
</div>
|
|
539
|
+
{/if}
|
|
540
|
+
</div>
|
|
541
|
+
<div class="BottomButton" part="ThumbnailGotoTournamentsButton" on:click='{()=>{gotoFromTournamentsPage("MyTournaments")}}' >{$_('tournamentsPage.forwardMyTournaments')}</div>
|
|
542
|
+
</div>
|
|
543
|
+
</div>
|
|
544
|
+
{/if}
|
|
356
545
|
<style lang="scss">
|
|
357
546
|
:host {
|
|
358
547
|
font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji';
|
|
@@ -456,5 +645,139 @@
|
|
|
456
645
|
.TournamentTableDetails {
|
|
457
646
|
width: 100%;
|
|
458
647
|
}
|
|
648
|
+
.TournamentsPage.MiniMode{
|
|
649
|
+
height: max-content;
|
|
650
|
+
.MobileClass.TournamentCardDetails{
|
|
651
|
+
padding: 5px 5px 0px 5px;
|
|
652
|
+
background-color: #333333;
|
|
653
|
+
padding-bottom: 12px;
|
|
654
|
+
casino-tournaments-rank{display: block;}
|
|
655
|
+
}
|
|
656
|
+
.CloseButton{position: absolute; right: 3px; top: 3px; font-size: 11px; cursor: pointer}
|
|
657
|
+
casino-tournaments-rank::part(Rank), casino-tournaments-rank::part(Prize){
|
|
658
|
+
color: #0a0c19;
|
|
659
|
+
font-size: 12px;
|
|
660
|
+
margin: 0px 0px 0px 5px;
|
|
661
|
+
padding: 2px;
|
|
662
|
+
}
|
|
663
|
+
casino-tournaments-rank::part(Rank){margin-left: 0px; }
|
|
664
|
+
casino-tournaments-rank::part(Prize){margin-right: 0px;}
|
|
665
|
+
casino-tournaments-rank::part(RankText), casino-tournaments-rank::part(PrizeText){font-weight: 400;}
|
|
666
|
+
|
|
667
|
+
.hidden{display: none}
|
|
668
|
+
casino-tournaments-thumbnail-controller::part(TournamentCard){
|
|
669
|
+
padding: 5px 5px 0px 5px;
|
|
670
|
+
background-color: #333333;
|
|
671
|
+
}
|
|
672
|
+
casino-tournaments-tab::part(LiText){
|
|
673
|
+
height: 22px;
|
|
674
|
+
top: calc(50% - 22px/2);
|
|
675
|
+
font-style: normal;
|
|
676
|
+
font-weight: 600;
|
|
677
|
+
font-size: 14px;
|
|
678
|
+
line-height: 22px;
|
|
679
|
+
text-align: center;
|
|
680
|
+
letter-spacing: -0.1px;
|
|
681
|
+
}
|
|
682
|
+
casino-tournaments-tab::part(CustomStylingContainer){
|
|
683
|
+
margin-top: 0px;
|
|
684
|
+
cursor: pointer;
|
|
685
|
+
}
|
|
686
|
+
.TabContent, casino-tournaments-tab{padding: 0 16px}
|
|
687
|
+
.TabContent.Rules{
|
|
688
|
+
padding-bottom: 28px;
|
|
689
|
+
}
|
|
690
|
+
.TabContent.Games{
|
|
691
|
+
padding-bottom: 30px;
|
|
692
|
+
.GameItems{
|
|
693
|
+
&.OneGame{width: 100%;}
|
|
694
|
+
&.TwoGames{width: 100%; display: flex; div{width: 50%}}
|
|
695
|
+
text-align: center;
|
|
696
|
+
margin: auto;
|
|
697
|
+
margin-top: 39px;
|
|
698
|
+
span{color: #FF8364; font-size: 12px; text-align: center; text-decoration-line: underline; cursor: pointer; margin-top: 5px}
|
|
699
|
+
svg, .svg{height: 70px;display: block;margin: auto;}
|
|
700
|
+
svg.ball, .svg.ball{width: 98px}
|
|
701
|
+
}
|
|
702
|
+
}
|
|
703
|
+
.BottomButton{
|
|
704
|
+
font-weight: 600;
|
|
705
|
+
font-size: 15px;
|
|
706
|
+
text-align: center;
|
|
707
|
+
height: 35px;
|
|
708
|
+
width: 60%;
|
|
709
|
+
margin:20px auto;
|
|
710
|
+
align-items: center;
|
|
711
|
+
padding: 8.72351px 12.6887px;
|
|
712
|
+
background: #FF8364;
|
|
713
|
+
box-shadow: 0px 0.793047px 2.37914px rgba(0, 0, 0, 0.1), 0px 1.58609px 0.793047px rgba(0, 0, 0, 0.06), 0px 0.793047px 0.793047px rgba(0, 0, 0, 0.07);
|
|
714
|
+
border-radius: 4.75828px;
|
|
715
|
+
}
|
|
716
|
+
|
|
717
|
+
.Thumbnail {
|
|
718
|
+
position: relative;
|
|
719
|
+
&.Mobile{border: 0px none;
|
|
720
|
+
padding: 6px 5px 10px;
|
|
721
|
+
background: #333333;}
|
|
722
|
+
&.MiniMode .CardImg{margin-bottom: 5px; width: 65px; height: 40px}
|
|
723
|
+
|
|
724
|
+
.CardImg {
|
|
725
|
+
height: 300px;
|
|
726
|
+
width: 100%;
|
|
727
|
+
background: url('https://breakthrough.org/wp-content/uploads/2018/10/default-placeholder-image.png');
|
|
728
|
+
background-repeat: no-repeat;
|
|
729
|
+
background-position: center;
|
|
730
|
+
background-size: auto;
|
|
731
|
+
&.CardImgFinished {
|
|
732
|
+
filter: grayscale(1);
|
|
733
|
+
}
|
|
734
|
+
&.Mobile{
|
|
735
|
+
width: 65px;
|
|
736
|
+
height: 40px;
|
|
737
|
+
display: inline-block;
|
|
738
|
+
}
|
|
739
|
+
}
|
|
740
|
+
.MobileRight{
|
|
741
|
+
display: inline-block;
|
|
742
|
+
line-height: 20px;
|
|
743
|
+
font-size: 11px;
|
|
744
|
+
padding: 2px 3px;
|
|
745
|
+
vertical-align: top;
|
|
746
|
+
width: calc(100% - 70px);
|
|
747
|
+
.Title{text-transform: capitalize; font-size: 14px; font-weight: 600}
|
|
748
|
+
}
|
|
749
|
+
|
|
750
|
+
.Status {
|
|
751
|
+
background: #000000;
|
|
752
|
+
display: flex;
|
|
753
|
+
justify-content: center;
|
|
754
|
+
align-items: center;
|
|
755
|
+
position: absolute;
|
|
756
|
+
top: 20px;
|
|
757
|
+
right: 20px;
|
|
758
|
+
min-height: 30px;
|
|
759
|
+
padding: 0 10px;
|
|
760
|
+
font-size: 12px;
|
|
761
|
+
text-transform: uppercase;
|
|
762
|
+
z-index: 1;
|
|
763
|
+
}
|
|
764
|
+
|
|
765
|
+
.Enrolled {
|
|
766
|
+
background: #2B2B5D;
|
|
767
|
+
color: #aaaabe;
|
|
768
|
+
display: flex;
|
|
769
|
+
justify-content: center;
|
|
770
|
+
align-items: center;
|
|
771
|
+
position: absolute;
|
|
772
|
+
top: 20px;
|
|
773
|
+
left: 20px;
|
|
774
|
+
min-height: 30px;
|
|
775
|
+
padding: 0 10px;
|
|
776
|
+
font-size: 12px;
|
|
777
|
+
text-transform: uppercase;
|
|
778
|
+
z-index: 1;
|
|
779
|
+
}
|
|
780
|
+
}
|
|
781
|
+
}
|
|
459
782
|
|
|
460
783
|
</style>
|
package/src/i18n.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
dictionary,
|
|
3
3
|
locale,
|
|
4
|
+
date,
|
|
4
5
|
addMessages,
|
|
5
6
|
_
|
|
6
7
|
} from 'svelte-i18n';
|
|
@@ -24,4 +25,4 @@ function setLocale(_locale) {
|
|
|
24
25
|
locale.set(_locale);
|
|
25
26
|
}
|
|
26
27
|
|
|
27
|
-
export { _, setupI18n, addNewMessages, setLocale };
|
|
28
|
+
export { _, setupI18n, addNewMessages, setLocale , date};
|