@everymatrix/casino-tournaments-page-controller 0.0.259 → 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 +384 -51
- 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 = '';
|
|
@@ -24,6 +31,11 @@
|
|
|
24
31
|
export let tablelimit: string = '30';
|
|
25
32
|
export let namemask: string = '';
|
|
26
33
|
export let mobiletablelimit:string = '15';
|
|
34
|
+
export let updatetableintime:string = 'true';
|
|
35
|
+
export let viewmode:string = '';
|
|
36
|
+
|
|
37
|
+
export let leaderboardoffset:string = '0';
|
|
38
|
+
export let leaderboardlimit:string = '15';
|
|
27
39
|
// Variables of topics for communication
|
|
28
40
|
let sessionTopic;
|
|
29
41
|
|
|
@@ -32,6 +44,7 @@
|
|
|
32
44
|
let playerID: string = '';
|
|
33
45
|
let isLoading: boolean = true;
|
|
34
46
|
let tournamentDescription: Array<any> = [];
|
|
47
|
+
let tournamentProducts:any;
|
|
35
48
|
|
|
36
49
|
let tournamentDetails: any = undefined;
|
|
37
50
|
let tournamentTableData: any = undefined;
|
|
@@ -42,10 +55,17 @@
|
|
|
42
55
|
let firstRowData: any = {};
|
|
43
56
|
let firstRowAvailable: boolean = false;
|
|
44
57
|
|
|
45
|
-
let tableUpdateEventSource:
|
|
58
|
+
let tableUpdateEventSource: any;
|
|
59
|
+
let tournamentUpdateEventSource:EventSourcePolyfill;
|
|
46
60
|
|
|
47
61
|
let currentUserData:any = {};
|
|
48
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
|
+
|
|
49
69
|
setupI18n({ withLocale: 'en', translations: {}});
|
|
50
70
|
|
|
51
71
|
Object.keys(TournamentsPageTranslations).forEach((item: any) => {
|
|
@@ -54,7 +74,6 @@
|
|
|
54
74
|
|
|
55
75
|
// @TODO this must be configurable
|
|
56
76
|
const tableColumns = ['Rank', 'Player', 'Points','Prize'];
|
|
57
|
-
|
|
58
77
|
// data for current user
|
|
59
78
|
const transFormCurrentUserData = (item:any) => {
|
|
60
79
|
let userData = {
|
|
@@ -64,6 +83,7 @@
|
|
|
64
83
|
Prize: item.prizeName,
|
|
65
84
|
Unqualified: item.unqualified,
|
|
66
85
|
BetCount: item.betCount,
|
|
86
|
+
userID: item.userID
|
|
67
87
|
};
|
|
68
88
|
return userData;
|
|
69
89
|
}
|
|
@@ -74,46 +94,85 @@
|
|
|
74
94
|
|
|
75
95
|
if (data && data.length > 0) {
|
|
76
96
|
data.forEach((item:any) => {
|
|
77
|
-
if
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
currentUserInPage = true;
|
|
81
|
-
}
|
|
82
|
-
// added duplicated properties for mobile version, requirement more information for desktop version
|
|
83
|
-
tableData.push({
|
|
84
|
-
Rank: item.rank,
|
|
85
|
-
Player: item.shortName,
|
|
86
|
-
Points: item.score,
|
|
87
|
-
Prize: item.prizeName,
|
|
88
|
-
Unqualified: item.unqualified,
|
|
89
|
-
BetCount: item.betCount,
|
|
90
|
-
userID: item.userID
|
|
91
|
-
});
|
|
97
|
+
if(item.userID == playerID){
|
|
98
|
+
currentUserData = item;
|
|
99
|
+
currentUserInPage = true;
|
|
92
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
|
+
});
|
|
93
110
|
});
|
|
94
111
|
}
|
|
95
112
|
|
|
96
|
-
|
|
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
|
+
}
|
|
130
|
+
},
|
|
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
|
+
}
|
|
97
141
|
},
|
|
98
|
-
tableUpdateMessageHandler = (message:
|
|
99
|
-
if
|
|
142
|
+
tableUpdateMessageHandler = (message:any)=>{
|
|
143
|
+
if(!message.data){
|
|
100
144
|
return;
|
|
101
145
|
}
|
|
102
|
-
try
|
|
103
|
-
let messageData:
|
|
104
|
-
let updateTableData:
|
|
105
|
-
if
|
|
146
|
+
try{
|
|
147
|
+
let messageData:any = message.data;
|
|
148
|
+
let updateTableData:any = JSON.parse(messageData);
|
|
149
|
+
if(!updateTableData || !updateTableData.items){
|
|
106
150
|
return;
|
|
107
151
|
}
|
|
108
|
-
let newTableData = transformTableData(updateTableData.
|
|
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;
|
|
109
157
|
if(updateTableData.item && !currentUserInPage){
|
|
110
158
|
firstRowAvailable = true;
|
|
111
159
|
firstRowData = transFormCurrentUserData(updateTableData.item);
|
|
160
|
+
if(firstRowData){
|
|
161
|
+
window.postMessage({ type: 'CasinoTableFirstRowData', tableData: firstRowData }, window.location.href);
|
|
162
|
+
}
|
|
112
163
|
}
|
|
113
|
-
|
|
114
|
-
|
|
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;
|
|
115
174
|
}
|
|
116
|
-
|
|
175
|
+
|
|
117
176
|
if(currentUserInPage){
|
|
118
177
|
window.postMessage({ type: 'CasinoTableCurrentUserData', tableData: currentUserData }, window.location.href);
|
|
119
178
|
}
|
|
@@ -122,27 +181,50 @@
|
|
|
122
181
|
}
|
|
123
182
|
},
|
|
124
183
|
startupTableDataChangeListener = (tournamentID: String, searchParams: any) => {
|
|
125
|
-
let endpointURL: String = `${endpoint}/tournaments/${tournamentID}/leaderboard/updates?HeartBeat=false
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
184
|
+
let endpointURL: String = `${endpoint}/tournaments/${tournamentID}/leaderboard/updates?HeartBeat=false&XSessionId=${session}`;
|
|
185
|
+
if(tableUpdateEventSource){
|
|
186
|
+
return;
|
|
187
|
+
}
|
|
188
|
+
if(!EventSource){
|
|
189
|
+
tableUpdateEventSource = new EventSourcePolyfill(endpointURL,{headers: {'accept': 'text/event-stream'}});
|
|
190
|
+
}else{
|
|
191
|
+
tableUpdateEventSource = new EventSource(endpointURL);
|
|
192
|
+
}
|
|
133
193
|
if (typeof (tableUpdateEventSource) != "undefined") {
|
|
194
|
+
tableUpdateEventSource.addEventListener('open', tableUpdateMessageHandler);
|
|
134
195
|
tableUpdateEventSource.addEventListener('message', tableUpdateMessageHandler);
|
|
196
|
+
tableUpdateEventSource.addEventListener('error', tableUpdateMessageHandler);
|
|
135
197
|
}
|
|
136
|
-
|
|
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
|
+
}
|
|
137
220
|
|
|
138
221
|
const getData = (endpointURL: String, tourID: String) => {
|
|
139
222
|
let url = new URL(endpointURL + `/tournaments/${tourID}`);
|
|
140
|
-
let reqHeaders = new Headers();
|
|
223
|
+
let reqHeaders = new Headers({'X-SessionId': session});
|
|
141
224
|
|
|
142
225
|
url.searchParams.append('expand', 'games');
|
|
143
226
|
url.searchParams.append('language', lang);
|
|
144
|
-
|
|
145
|
-
reqHeaders.append('platform', getDevice(userAgent));
|
|
227
|
+
url.searchParams.append('platform', getDevice(userAgent));
|
|
146
228
|
|
|
147
229
|
let requestOptions = {
|
|
148
230
|
method: 'GET',
|
|
@@ -153,6 +235,8 @@
|
|
|
153
235
|
.then((res: any) => res.json())
|
|
154
236
|
.then((res: any) => {
|
|
155
237
|
tournamentDetails = res.item;
|
|
238
|
+
transformTournamentData(tournamentDetails);
|
|
239
|
+
startupTournamentUpdateListener(tourid, url.searchParams);
|
|
156
240
|
});
|
|
157
241
|
}
|
|
158
242
|
|
|
@@ -169,9 +253,10 @@
|
|
|
169
253
|
if (session) {
|
|
170
254
|
let limit = isMobile(userAgent) == true? mobiletablelimit : tablelimit;
|
|
171
255
|
url.searchParams.append('pagination', `offset=0,limit=${limit}`);
|
|
172
|
-
reqHeaders.append('X-
|
|
256
|
+
reqHeaders.append('X-SessionId', session);
|
|
173
257
|
}
|
|
174
|
-
|
|
258
|
+
|
|
259
|
+
url.searchParams.append('platform', getDevice(userAgent));
|
|
175
260
|
|
|
176
261
|
let requestOptions = {
|
|
177
262
|
method: 'GET',
|
|
@@ -187,6 +272,8 @@
|
|
|
187
272
|
firstRowData = transFormCurrentUserData(res.item);
|
|
188
273
|
}
|
|
189
274
|
showTable = true;
|
|
275
|
+
latestRank = currentUserInPage ? currentUserData.Rank : firstRowData.Rank
|
|
276
|
+
overallRank = res.total;
|
|
190
277
|
|
|
191
278
|
// @TODO data is not iterable error fix
|
|
192
279
|
window.postMessage({
|
|
@@ -197,7 +284,9 @@
|
|
|
197
284
|
if (firstRowAvailable) {
|
|
198
285
|
window.postMessage({type: 'CasinoTableFirstRowData', tableData: firstRowData}, window.location.href);
|
|
199
286
|
}
|
|
200
|
-
|
|
287
|
+
if(updatetableintime === 'true'){
|
|
288
|
+
startupTableDataChangeListener(tourID, url.searchParams);
|
|
289
|
+
}
|
|
201
290
|
if (currentUserInPage){
|
|
202
291
|
window.postMessage({ type: 'CasinoTableCurrentUserData', tableData: currentUserData }, window.location.href);
|
|
203
292
|
}
|
|
@@ -213,6 +302,23 @@
|
|
|
213
302
|
if (e.data && e.data.type == 'PlayerID') {
|
|
214
303
|
playerID = e.data.playerID;
|
|
215
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
|
+
}
|
|
216
322
|
}
|
|
217
323
|
|
|
218
324
|
const goBack = () => {
|
|
@@ -225,6 +331,12 @@
|
|
|
225
331
|
window.history.back();
|
|
226
332
|
}
|
|
227
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
|
+
}
|
|
228
340
|
|
|
229
341
|
const setSession = () => {
|
|
230
342
|
if (session.length > 0 && session != 'false') {
|
|
@@ -255,13 +367,24 @@
|
|
|
255
367
|
}
|
|
256
368
|
});
|
|
257
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
|
+
}
|
|
258
375
|
|
|
259
376
|
onMount(() => {
|
|
260
377
|
window.addEventListener('message', messageHandler, false);
|
|
261
|
-
|
|
262
378
|
return () => {
|
|
263
379
|
window.removeEventListener('message', messageHandler);
|
|
264
|
-
tableUpdateEventSource
|
|
380
|
+
if(tableUpdateEventSource){
|
|
381
|
+
tableUpdateEventSource.removeEventListener('open', tableUpdateMessageHandler);
|
|
382
|
+
tableUpdateEventSource.removeEventListener('message', tableUpdateMessageHandler);
|
|
383
|
+
tableUpdateEventSource.removeEventListener('error', tableUpdateMessageHandler);
|
|
384
|
+
}
|
|
385
|
+
if(tournamentUpdateEventSource){
|
|
386
|
+
tournamentUpdateEventSource.removeEventListener('message', tournamentUpdateMessageHandler);
|
|
387
|
+
}
|
|
265
388
|
}
|
|
266
389
|
});
|
|
267
390
|
|
|
@@ -270,11 +393,13 @@
|
|
|
270
393
|
$: initialParameters = tourid && endpoint && session && lang;
|
|
271
394
|
$: initialParameters && initialLoad();
|
|
272
395
|
$: tourid && cmsendpoint && getDataFromCMS();
|
|
396
|
+
$: isMiniMode = (viewmode == 'miniThumbnail') && isMobile(userAgent); // forward this page from tournamentslider
|
|
273
397
|
</script>
|
|
274
398
|
|
|
275
399
|
{#if isLoading}
|
|
276
400
|
<p>{$_('tournamentsPage.loading')}</p>
|
|
277
|
-
{
|
|
401
|
+
{/if}
|
|
402
|
+
{#if !isMiniMode}
|
|
278
403
|
<div class="TournamentsPage" part="TournamentsPage">
|
|
279
404
|
<div class="TournamentsSectionWrapper" part="TournamentsSectionWrapper">
|
|
280
405
|
|
|
@@ -342,7 +467,81 @@
|
|
|
342
467
|
</div>
|
|
343
468
|
</div>
|
|
344
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>
|
|
345
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}
|
|
346
545
|
<style lang="scss">
|
|
347
546
|
:host {
|
|
348
547
|
font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji';
|
|
@@ -446,5 +645,139 @@
|
|
|
446
645
|
.TournamentTableDetails {
|
|
447
646
|
width: 100%;
|
|
448
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
|
+
}
|
|
449
782
|
|
|
450
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};
|