@everymatrix/casino-engagement-suite-tournament 1.59.2 → 1.59.3
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-engagement-suite-tournament/casino-engagement-suite-tournament.esm.js +1 -1
- package/dist/casino-engagement-suite-tournament/index.esm.js +1 -1
- package/dist/casino-engagement-suite-tournament/{p-1cdbfb3e.entry.js → p-10e1f844.entry.js} +1 -1
- package/dist/casino-engagement-suite-tournament/p-94a5935e.js +15 -0
- package/dist/cjs/casino-engagement-suite-progress-bar_3.cjs.entry.js +1 -1
- package/dist/cjs/{casino-engagement-suite-tournament-21274e02.js → casino-engagement-suite-tournament-9276045b.js} +113 -81
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/collection/components/casino-engagement-suite-tournament/casino-engagement-suite-tournament.css +87 -10
- package/dist/collection/components/casino-engagement-suite-tournament/casino-engagement-suite-tournament.js +4 -3
- package/dist/collection/shared/renders.page.js +20 -16
- package/dist/collection/shared/renders.tab.js +15 -8
- package/dist/collection/shared/renders.util.js +14 -15
- package/dist/collection/utils/message.js +1 -1
- package/dist/collection/utils/translations.js +1 -1
- package/dist/collection/utils/util.date.js +7 -0
- package/dist/collection/utils/utils.js +28 -0
- package/dist/esm/casino-engagement-suite-progress-bar_3.entry.js +1 -1
- package/dist/esm/{casino-engagement-suite-tournament-75dbe0da.js → casino-engagement-suite-tournament-e9186545.js} +113 -81
- package/dist/esm/index.js +1 -1
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/casino-engagement-suite-tournament/.stencil/packages/stencil/casino-engagement-suite-tournament/stencil.config.d.ts +2 -0
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/casino-engagement-suite-tournament/.stencil/packages/stencil/casino-engagement-suite-tournament/stencil.config.dev.d.ts +2 -0
- package/dist/types/components/casino-engagement-suite-tournament/casino-engagement-suite-tournament.d.ts +2 -0
- package/dist/types/shared/renders.page.d.ts +1 -1
- package/dist/types/shared/renders.tab.d.ts +2 -2
- package/dist/types/shared/renders.util.d.ts +2 -2
- package/dist/types/utils/api.apdater.d.ts +1 -0
- package/dist/types/utils/bussiness.d.ts +1 -0
- package/dist/types/utils/translations.d.ts +2 -0
- package/dist/types/utils/types.d.ts +3 -2
- package/dist/types/utils/util.date.d.ts +1 -0
- package/dist/types/utils/utils.d.ts +8 -0
- package/package.json +1 -1
- package/dist/casino-engagement-suite-tournament/p-376260a6.js +0 -15
- package/dist/types/Users/maria.bumbar/Desktop/widgets-monorepo/packages/stencil/casino-engagement-suite-tournament/.stencil/packages/stencil/casino-engagement-suite-tournament/stencil.config.d.ts +0 -2
- package/dist/types/Users/maria.bumbar/Desktop/widgets-monorepo/packages/stencil/casino-engagement-suite-tournament/.stencil/packages/stencil/casino-engagement-suite-tournament/stencil.config.dev.d.ts +0 -2
- /package/dist/types/Users/{maria.bumbar/Desktop → adrian.pripon/Documents/Work}/widgets-monorepo/packages/stencil/casino-engagement-suite-tournament/.stencil/libs/common/src/storybook/storybook-utils.d.ts +0 -0
- /package/dist/types/Users/{maria.bumbar/Desktop → adrian.pripon/Documents/Work}/widgets-monorepo/packages/stencil/casino-engagement-suite-tournament/.stencil/packages/stencil/casino-engagement-suite-tournament/storybook/main.d.ts +0 -0
- /package/dist/types/Users/{maria.bumbar/Desktop → adrian.pripon/Documents/Work}/widgets-monorepo/packages/stencil/casino-engagement-suite-tournament/.stencil/packages/stencil/casino-engagement-suite-tournament/storybook/preview.d.ts +0 -0
- /package/dist/types/Users/{maria.bumbar/Desktop → adrian.pripon/Documents/Work}/widgets-monorepo/packages/stencil/casino-engagement-suite-tournament/.stencil/tools/plugins/index.d.ts +0 -0
- /package/dist/types/Users/{maria.bumbar/Desktop → adrian.pripon/Documents/Work}/widgets-monorepo/packages/stencil/casino-engagement-suite-tournament/.stencil/tools/plugins/stencil-clean-deps-plugin.d.ts +0 -0
- /package/dist/types/Users/{maria.bumbar/Desktop → adrian.pripon/Documents/Work}/widgets-monorepo/packages/stencil/casino-engagement-suite-tournament/.stencil/tools/plugins/vite-chunk-plugin.d.ts +0 -0
- /package/dist/types/Users/{maria.bumbar/Desktop → adrian.pripon/Documents/Work}/widgets-monorepo/packages/stencil/casino-engagement-suite-tournament/.stencil/tools/plugins/vite-clean-deps-plugin.d.ts +0 -0
|
@@ -32,7 +32,8 @@
|
|
|
32
32
|
margin-bottom: 20px;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
.WrapperBarLeft,
|
|
35
|
+
.WrapperBarLeft,
|
|
36
|
+
.WrapperBarRight {
|
|
36
37
|
cursor: pointer;
|
|
37
38
|
z-index: 1;
|
|
38
39
|
}
|
|
@@ -184,21 +185,72 @@
|
|
|
184
185
|
font-weight: 400;
|
|
185
186
|
}
|
|
186
187
|
|
|
187
|
-
.
|
|
188
|
-
|
|
189
|
-
|
|
188
|
+
.InfoContainer {
|
|
189
|
+
flex: 1;
|
|
190
|
+
display: flex;
|
|
191
|
+
flex-direction: column;
|
|
192
|
+
position: relative;
|
|
193
|
+
overflow: hidden;
|
|
190
194
|
}
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
195
|
+
|
|
196
|
+
.ContentScrollContainer {
|
|
197
|
+
flex: 1;
|
|
198
|
+
display: flex;
|
|
199
|
+
flex-direction: column;
|
|
200
|
+
overflow-y: auto;
|
|
201
|
+
position: relative;
|
|
202
|
+
height: auto;
|
|
194
203
|
}
|
|
195
|
-
.
|
|
204
|
+
.ContentScrollContainer.expanded {
|
|
205
|
+
height: 100%;
|
|
206
|
+
max-height: 100%;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
.PrizesContainer {
|
|
210
|
+
flex: 1;
|
|
211
|
+
display: flex;
|
|
212
|
+
flex-direction: column;
|
|
213
|
+
min-height: 100px;
|
|
214
|
+
max-height: calc(100% - 20px);
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
.PrizesHeader {
|
|
196
218
|
align-items: center;
|
|
197
219
|
display: flex;
|
|
220
|
+
background-color: var(--emw--color-background, hsl(254, 44%, 15%));
|
|
221
|
+
padding: 5px 0;
|
|
222
|
+
z-index: 1;
|
|
223
|
+
margin: 0 20px;
|
|
198
224
|
}
|
|
199
|
-
.
|
|
225
|
+
.PrizesHeader img {
|
|
200
226
|
width: 12px;
|
|
201
227
|
}
|
|
228
|
+
.PrizesHeader .PrizesText {
|
|
229
|
+
margin-left: 3px;
|
|
230
|
+
font-weight: 600;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
.Prizes {
|
|
234
|
+
margin: 24px 0;
|
|
235
|
+
padding: 0 20px;
|
|
236
|
+
flex: 1;
|
|
237
|
+
overflow-y: auto;
|
|
238
|
+
margin-bottom: 0;
|
|
239
|
+
padding-right: 10px;
|
|
240
|
+
max-height: 300px;
|
|
241
|
+
margin-top: 10px;
|
|
242
|
+
}
|
|
243
|
+
.Prizes::-webkit-scrollbar {
|
|
244
|
+
width: 4px;
|
|
245
|
+
}
|
|
246
|
+
.Prizes::-webkit-scrollbar-track {
|
|
247
|
+
background: rgba(0, 0, 0, 0.1);
|
|
248
|
+
border-radius: 2px;
|
|
249
|
+
}
|
|
250
|
+
.Prizes::-webkit-scrollbar-thumb {
|
|
251
|
+
background: var(--emw--color-primary, rgb(255, 214, 47));
|
|
252
|
+
border-radius: 2px;
|
|
253
|
+
}
|
|
202
254
|
.Prizes .Prize {
|
|
203
255
|
margin: 8px 0;
|
|
204
256
|
}
|
|
@@ -207,6 +259,10 @@
|
|
|
207
259
|
font-weight: 400;
|
|
208
260
|
}
|
|
209
261
|
|
|
262
|
+
.InfoContainer section.Info {
|
|
263
|
+
margin-bottom: 12px;
|
|
264
|
+
}
|
|
265
|
+
|
|
210
266
|
* {
|
|
211
267
|
box-sizing: border-box;
|
|
212
268
|
}
|
|
@@ -240,7 +296,8 @@
|
|
|
240
296
|
border-radius: 11px;
|
|
241
297
|
}
|
|
242
298
|
.Leaderboards tr.isMe td {
|
|
243
|
-
color:
|
|
299
|
+
color: #FFD029;
|
|
300
|
+
font-weight: var(--emw--font-weight-semibold, 500);
|
|
244
301
|
}
|
|
245
302
|
|
|
246
303
|
.LeaderboardLabels {
|
|
@@ -271,6 +328,13 @@
|
|
|
271
328
|
color: var(--emw--color-background, #1E1638);
|
|
272
329
|
}
|
|
273
330
|
|
|
331
|
+
.LeaderboardUnstarted {
|
|
332
|
+
margin: 24px 0;
|
|
333
|
+
padding: 0 20px;
|
|
334
|
+
color: var(--emw--color-secondary, rgb(187, 185, 195));
|
|
335
|
+
font-size: var(--emw--font-size-medium, 16px);
|
|
336
|
+
}
|
|
337
|
+
|
|
274
338
|
.Games {
|
|
275
339
|
margin: 24px 0;
|
|
276
340
|
padding: 0 20px;
|
|
@@ -406,4 +470,17 @@ dialog > div {
|
|
|
406
470
|
background: -webkit-linear-gradient(98.25deg, rgb(255, 148, 0) 22.48%, rgb(254, 247, 70) 131.02%, rgb(255, 226, 74) 131.9%);
|
|
407
471
|
-webkit-background-clip: text;
|
|
408
472
|
-webkit-text-fill-color: transparent;
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
.WrapperUtil .GradientRounded .WrapperBar {
|
|
476
|
+
margin-bottom: 0;
|
|
477
|
+
padding-bottom: 0;
|
|
478
|
+
}
|
|
479
|
+
.WrapperUtil .GradientRounded .Tip {
|
|
480
|
+
padding-top: 0;
|
|
481
|
+
padding-bottom: 40px;
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
.LeaderboardsItem .LeaderboardsItemContainer .TitleContainer {
|
|
485
|
+
margin-bottom: 16px;
|
|
409
486
|
}
|
|
@@ -39,6 +39,7 @@ export class CasinoEngagementSuiteTournament {
|
|
|
39
39
|
showPropWatcher(newValue, oldValue) {
|
|
40
40
|
if (oldValue == false && newValue == true) {
|
|
41
41
|
this.checkGift();
|
|
42
|
+
this.page = LeaderboardPage.list;
|
|
42
43
|
}
|
|
43
44
|
}
|
|
44
45
|
addLabel(tag) {
|
|
@@ -53,7 +54,7 @@ export class CasinoEngagementSuiteTournament {
|
|
|
53
54
|
}
|
|
54
55
|
setTimeInterval() {
|
|
55
56
|
this.timeHolder = setInterval(() => {
|
|
56
|
-
this.time =
|
|
57
|
+
this.time = this.tournamentList || this.tournamentItem ? this.time + 1 : 0;
|
|
57
58
|
}, 1000);
|
|
58
59
|
}
|
|
59
60
|
checkGift() {
|
|
@@ -85,7 +86,7 @@ export class CasinoEngagementSuiteTournament {
|
|
|
85
86
|
return;
|
|
86
87
|
this.isActionJoinPending = true;
|
|
87
88
|
try {
|
|
88
|
-
if (tournament.
|
|
89
|
+
if (tournament.isPlayerAcknowledged) {
|
|
89
90
|
messageSender.UnjoinTournamentReq(tournament);
|
|
90
91
|
}
|
|
91
92
|
else {
|
|
@@ -111,7 +112,7 @@ export class CasinoEngagementSuiteTournament {
|
|
|
111
112
|
this.page = page;
|
|
112
113
|
}
|
|
113
114
|
render() {
|
|
114
|
-
return (h(Host, { key: '
|
|
115
|
+
return (h(Host, { key: 'b070d8a83bcd801d5daeb4edfe87ad0159da4e7c' }, h("general-styling-wrapper", { key: '7454fdab7ee55ab95a39adb3c8b51aed0b78f534', clientStylingUrl: this.clientStylingUrl, clientStyling: this.clientStyling,
|
|
115
116
|
// @ts-ignore
|
|
116
117
|
targetTranslations: TRANSLATIONS, translationUrl: this.translationUrl }), this.renders.page[this.page]()));
|
|
117
118
|
}
|
|
@@ -12,16 +12,16 @@ export const page = {
|
|
|
12
12
|
list(instance) {
|
|
13
13
|
var _a;
|
|
14
14
|
if (!instance.tournamentList) {
|
|
15
|
-
instance.tournamentList = (_a = instance.leaderboardsInit) === null || _a === void 0 ? void 0 : _a.map(item => tournamentAdapter(item));
|
|
15
|
+
instance.tournamentList = (_a = instance.leaderboardsInit) === null || _a === void 0 ? void 0 : _a.map((item) => tournamentAdapter(item));
|
|
16
16
|
return h("general-animation-loading", null);
|
|
17
17
|
}
|
|
18
18
|
const { locale } = instance;
|
|
19
19
|
if (instance.tournamentList.length) {
|
|
20
20
|
const onClickListItemChangePage = (tournament) => {
|
|
21
21
|
instance.setPage(LeaderboardPage.item, { tournament });
|
|
22
|
-
instance.newIdList = instance.newIdList.filter(id => id !== tournament.id);
|
|
22
|
+
instance.newIdList = instance.newIdList.filter((id) => id !== tournament.id);
|
|
23
23
|
};
|
|
24
|
-
return renderLeaderboardContainer(instance, h("div", { class: "Leaderboards Row" }, instance.tournamentList.map(_tournament => (h("div", { class: classnames(
|
|
24
|
+
return renderLeaderboardContainer(instance, h("div", { class: "Leaderboards Row" }, instance.tournamentList.map((_tournament) => (h("div", { class: classnames('LeaderboardsItem', _tournament.isPlayerAcknowledged ? ' GradientRounded Hollow' : ''), onClick: () => onClickListItemChangePage(_tournament) }, h("div", { class: "LeaderboardsItemContainer" }, renderTitleContainer(instance, _tournament), renderTimeBar(_tournament)), h("div", { class: "LeaderboardLabels" }, instance.newIdList.includes(_tournament.id) && (h("div", { class: "LeaderboardLabel" }, h("span", null, "new")))))))));
|
|
25
25
|
}
|
|
26
26
|
else {
|
|
27
27
|
return renderLeaderboardContainer(instance, h("div", { class: "NoLeaderboards Row" }, h("div", null, locale.NoLeaderboards), h("div", null, locale.NoLeaderboardsTip)));
|
|
@@ -52,12 +52,12 @@ export const page = {
|
|
|
52
52
|
renderTabs(),
|
|
53
53
|
instance.renders.tab[instance.tab]()
|
|
54
54
|
]);
|
|
55
|
-
}
|
|
55
|
+
}
|
|
56
56
|
};
|
|
57
57
|
const renderTitleContainer = (instance, tournament) => {
|
|
58
58
|
const { locale } = instance;
|
|
59
59
|
const onClickItemJoin = (tournament) => {
|
|
60
|
-
if (tournament.
|
|
60
|
+
if (tournament.isPlayerAcknowledged) {
|
|
61
61
|
instance.openDialog(DialogType.unjoin, tournament);
|
|
62
62
|
}
|
|
63
63
|
else {
|
|
@@ -67,27 +67,29 @@ const renderTitleContainer = (instance, tournament) => {
|
|
|
67
67
|
};
|
|
68
68
|
return (h("div", { class: "TitleContainer" }, h("div", { class: "Title" }, tournament.nameOrTitle), tournament.state !== TournamentState.Closed && (h("div", null, renderGradientRoundedButton({
|
|
69
69
|
statedClasses: {
|
|
70
|
-
isHollow: tournament.
|
|
71
|
-
isPending: instance.isActionJoinPending
|
|
70
|
+
isHollow: tournament.isPlayerAcknowledged,
|
|
71
|
+
isPending: instance.isActionJoinPending
|
|
72
72
|
},
|
|
73
73
|
onClick: (e) => {
|
|
74
74
|
e.stopPropagation();
|
|
75
|
-
|
|
75
|
+
if (!instance.isActionJoinPending) {
|
|
76
|
+
onClickItemJoin(tournament);
|
|
77
|
+
}
|
|
76
78
|
},
|
|
77
|
-
innerHTML: tournament.
|
|
79
|
+
innerHTML: tournament.isPlayerAcknowledged ? locale.Unjoin : locale.Join
|
|
78
80
|
})))));
|
|
79
81
|
};
|
|
80
82
|
const renderLeaderboardContainer = (instance, render) => {
|
|
81
83
|
const { dialog: { isOpen } } = instance;
|
|
82
84
|
const renderBar = renderCloseBar({
|
|
83
|
-
right:
|
|
85
|
+
right: h("span", { onClick: () => instance.closeDialog() }, iconClose)
|
|
84
86
|
});
|
|
85
87
|
const renderDialogContent = () => {
|
|
86
88
|
switch (instance.dialog.type) {
|
|
87
89
|
case DialogType.unjoin:
|
|
88
90
|
return instance.renders.dialog.unjoin(); //renderDialogContentUnjoin()
|
|
89
91
|
case DialogType.tip:
|
|
90
|
-
return
|
|
92
|
+
return h("div", { class: "Tip" }, instance.locale.Tip);
|
|
91
93
|
case DialogType.gift:
|
|
92
94
|
return instance.renders.dialog.gift();
|
|
93
95
|
}
|
|
@@ -102,16 +104,18 @@ const renderLeaderboardContainer = (instance, render) => {
|
|
|
102
104
|
};
|
|
103
105
|
case LeaderboardPage.item:
|
|
104
106
|
return {
|
|
105
|
-
left:
|
|
106
|
-
middle:
|
|
107
|
+
left: h("span", { onClick: () => instance.setPage(LeaderboardPage.list) }, iconBack),
|
|
108
|
+
middle: locale.Leaderboards
|
|
107
109
|
};
|
|
108
110
|
}
|
|
109
111
|
};
|
|
110
112
|
const renderCloseBarInLayout = () => {
|
|
111
113
|
const { left, middle } = getWrapperBarData();
|
|
112
|
-
return renderCloseBar({
|
|
113
|
-
|
|
114
|
+
return renderCloseBar({
|
|
115
|
+
left,
|
|
116
|
+
middle,
|
|
117
|
+
right: h("span", { onClick: () => instance.close.emit() }, iconClose)
|
|
114
118
|
});
|
|
115
119
|
};
|
|
116
|
-
return (h("div", { class: `Wrapper ${instance.device}` }, h("div", { class: classnames(
|
|
120
|
+
return (h("div", { class: `Wrapper ${instance.device}` }, h("div", { class: classnames('WrapperContent', { faded: isOpen }) }, renderCloseBarInLayout(), h("div", { class: "Root" }, h("div", { class: "Main" }, render))), h("div", { class: "WrapperUtil" }, h("dialog", { open: isOpen }, h("div", { class: "GradientRounded Hollow" }, renderBar, isOpen && renderDialogContent())))));
|
|
117
121
|
};
|
|
@@ -1,30 +1,37 @@
|
|
|
1
1
|
import { h } from "@stencil/core";
|
|
2
2
|
import { localePostprocess } from "../utils/translations";
|
|
3
3
|
import { iconEyeClose, iconEyeOpen, iconReward } from "./icons";
|
|
4
|
-
import { classnames } from "../utils/utils";
|
|
4
|
+
import { classnames, truncateNumber } from "../utils/utils";
|
|
5
5
|
import { renderTimeBar } from "./renders.util";
|
|
6
6
|
import { isTournamentClosed } from "../utils/bussiness";
|
|
7
|
+
import { getTimeDifference } from "../utils/util.date";
|
|
7
8
|
export const tab = {
|
|
8
9
|
info(instance) {
|
|
9
10
|
var _a, _b;
|
|
10
11
|
const { locale, tournamentItem: tournament, isShowInfo } = instance;
|
|
11
|
-
return (h("div", { class: "InfoContainer" }, renderTimeBar(
|
|
12
|
+
return (h("div", { class: "InfoContainer" }, renderTimeBar(tournament), h("section", { class: "ShowInfo", onClick: () => (instance.isShowInfo = !instance.isShowInfo) }, h("p", null, h("span", null, isShowInfo ? iconEyeClose : iconEyeOpen), h("span", null, locale.LeaderboardDetails))), h("div", { class: `ContentScrollContainer ${isShowInfo ? 'expanded' : ''}` }, isShowInfo && (h("section", { class: "Info" }, h("div", null, tournament.description), h("div", { class: "Criterias" }, h("div", null, locale.ScoreCriteria, ": ", h("span", null, tournament.scoreCriteria)), h("div", null, locale.MinimumBetCriteria, ": ", h("span", null, tournament.minBetCount))), !!tournament.termsUrl && (h("div", { class: "TC" }, h("a", { href: tournament.termsUrl, target: "_blank" }, locale.TC))))), isTournamentClosed(instance.tournamentItem) && ((_a = instance.leaderboards) === null || _a === void 0 ? void 0 : _a.find((l) => l.isMe)) && (h("section", { class: "ResultPrize", innerHTML: localePostprocess(locale.TipPrize, getResultPrize((_b = instance.leaderboards) === null || _b === void 0 ? void 0 : _b.find((l) => l.isMe))) })), h("section", { class: "PrizesContainer" }, h("div", { class: "PrizesHeader" }, iconReward, h("span", { class: "PrizesText" }, locale.Prizes)), h("div", { class: "Prizes" }, tournament.prizes.map((prize, index) => (h("div", { class: "Prize" }, index + 1, " ", locale.Place, ": ", h("span", { class: "PrizeText" }, prize.name)))))))));
|
|
12
13
|
},
|
|
13
14
|
leaderboard(instance) {
|
|
15
|
+
const { locale, tournamentItem } = instance;
|
|
16
|
+
if ((tournamentItem === null || tournamentItem === void 0 ? void 0 : tournamentItem.state) === 'Unstarted') {
|
|
17
|
+
const startTime = getTimeDifference(tournamentItem === null || tournamentItem === void 0 ? void 0 : tournamentItem.startTime, new Date());
|
|
18
|
+
return (h("div", { class: "LeaderboardUnstarted", innerHTML: localePostprocess(locale.TournamentNotStarted, { startTime }) }));
|
|
19
|
+
}
|
|
14
20
|
if (!instance.leaderboards)
|
|
15
21
|
return h("general-animation-loading", null);
|
|
16
|
-
if (!instance.leaderboards.length)
|
|
17
|
-
return
|
|
18
|
-
|
|
22
|
+
if (!instance.leaderboards.length) {
|
|
23
|
+
return h("div", { class: "LeaderboardUnstarted" }, locale.BeOne);
|
|
24
|
+
}
|
|
25
|
+
return (h("table", { class: "Leaderboards" }, instance.leaderboards.map((leaderboard) => (h("tr", { class: classnames({ isMe: leaderboard.isMe }) }, h("td", { class: "LeaderboardRank" }, h("span", null, leaderboard.rank)), h("td", { class: "LeaderboardName" }, leaderboard.shortName), h("td", { class: "LeaderboardScore" }, truncateNumber(leaderboard.score, 2, true)), h("td", { class: "LeaderboardPrize" }, leaderboard.prizeName))))));
|
|
19
26
|
},
|
|
20
27
|
games(instance) {
|
|
21
28
|
var _a;
|
|
22
|
-
return (h("div", { class: "Games" }, (_a = instance.tournamentItem.games) === null || _a === void 0 ? void 0 : _a.map(game => (h("div", null, h("img", { src: game.defaultThumbnail, alt: "" }))))));
|
|
23
|
-
}
|
|
29
|
+
return (h("div", { class: "Games" }, (_a = instance.tournamentItem.games) === null || _a === void 0 ? void 0 : _a.map((game) => (h("div", null, h("img", { src: game.defaultThumbnail, alt: "" }))))));
|
|
30
|
+
}
|
|
24
31
|
};
|
|
25
32
|
const getResultPrize = (leaderboard) => {
|
|
26
33
|
return {
|
|
27
34
|
prize: leaderboard.prizeName,
|
|
28
|
-
place: leaderboard.rank
|
|
35
|
+
place: leaderboard.rank
|
|
29
36
|
};
|
|
30
37
|
};
|
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
import { h } from "@stencil/core";
|
|
2
|
-
import {
|
|
2
|
+
import { getTimeDifference, formatDate, getProgress } from "../utils/util.date";
|
|
3
3
|
import { renderGradientRoundedButton } from "./GradientRoundedButton";
|
|
4
|
-
export const renderTimeBar = (
|
|
5
|
-
return (h("section", { class: "TimeContainer" }, h("div", { class:
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
h("div", null, formatDate(tournament.endTime))
|
|
17
|
-
])), h("casino-engagement-suite-progress-bar", { value: Number(getProgress(tournament.startTime, tournament.endTime)), "hide-percent": true })));
|
|
4
|
+
export const renderTimeBar = (tournament) => {
|
|
5
|
+
return (h("section", { class: "TimeContainer" }, h("div", { class: "Time" }, tournament.state === 'Running'
|
|
6
|
+
? [
|
|
7
|
+
h("div", null, getTimeDifference(new Date(), tournament.endTime)),
|
|
8
|
+
h("div", null, renderGradientRoundedButton({
|
|
9
|
+
statedClasses: {
|
|
10
|
+
isHollow: true,
|
|
11
|
+
isPendding: false
|
|
12
|
+
},
|
|
13
|
+
innerHTML: `${getProgress(tournament.startTime, tournament.endTime)}%`
|
|
14
|
+
}))
|
|
15
|
+
]
|
|
16
|
+
: [h("div", null, formatDate(tournament.startTime)), h("div", null, formatDate(tournament.endTime))]), h("casino-engagement-suite-progress-bar", { value: Number(getProgress(tournament.startTime, tournament.endTime)), "hide-percent": true })));
|
|
18
17
|
};
|
|
@@ -112,7 +112,7 @@ const handleLeaderboardLiveEvent = (instance, rest) => {
|
|
|
112
112
|
const commonJoinRes = (instance, rest) => {
|
|
113
113
|
const { success } = rest;
|
|
114
114
|
if (success) {
|
|
115
|
-
instance.tournamentItem = Object.assign(Object.assign({}, instance.tournamentItem), {
|
|
115
|
+
instance.tournamentItem = Object.assign(Object.assign({}, instance.tournamentItem), { isPlayerAcknowledged: !!!instance.tournamentItem.isPlayerAcknowledged });
|
|
116
116
|
switch (instance.page) {
|
|
117
117
|
case LeaderboardPage.item: {
|
|
118
118
|
break;
|
|
@@ -24,4 +24,4 @@ export const TRANSLATIONS = Object.assign(Object.assign(Object.assign({ Join: 'J
|
|
|
24
24
|
Tile: 'Congratulations!',
|
|
25
25
|
Description: 'You won <span>{tournamentName}</span>!',
|
|
26
26
|
ButtonContinue: 'Continue'
|
|
27
|
-
}, NoLeaderboards: 'No Leaderboards yet', NoLeaderboardsTip: 'Try winning tickets to Leaderboards as rewards or launching other booster games', Leaderboards: 'Leaderboards', TipPrize: 'You took <span>{place}</span> place and win <span>{prize}</span>', Tip: 'Competition where your real money bets contribute towards the leaderboard score calculation to win the leaderboard reward.' });
|
|
27
|
+
}, NoLeaderboards: 'No Leaderboards yet', NoLeaderboardsTip: 'Try winning tickets to Leaderboards as rewards or launching other booster games', Leaderboards: 'Leaderboards', TipPrize: 'You took <span>{place}</span> place and win <span>{prize}</span>', Tip: 'Competition where your real money bets contribute towards the leaderboard score calculation to win the leaderboard reward.', TournamentNotStarted: 'The leaderboard is not started yet. <br> It will start in {startTime}.', BeOne: 'No winners for the time being. Be one of them!' });
|
|
@@ -36,3 +36,10 @@ export function getDifference(startDate, endDate) {
|
|
|
36
36
|
export function getProgress(startDate, endDate) {
|
|
37
37
|
return ((100 * (new Date().getTime() - startDate.getTime())) / (endDate.getTime() - startDate.getTime())).toFixed(0);
|
|
38
38
|
}
|
|
39
|
+
export function getTimeDifference(startDate, endDate) {
|
|
40
|
+
const diffMs = Math.abs(endDate.getTime() - startDate.getTime()); // Difference in milliseconds
|
|
41
|
+
const diffDays = Math.floor(diffMs / (1000 * 60 * 60 * 24)); // Difference in days
|
|
42
|
+
const diffHours = Math.floor((diffMs % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); // Remaining hours
|
|
43
|
+
const diffMinutes = Math.floor((diffMs % (1000 * 60 * 60)) / (1000 * 60)); // Remaining minutes
|
|
44
|
+
return `${String(diffDays).padStart(2, '0')}d:${String(diffHours).padStart(2, '0')}h:${String(diffMinutes).padStart(2, '0')}m`;
|
|
45
|
+
}
|
|
@@ -20,3 +20,31 @@ export const getNewItems = (newList, oldList, getCondition) => {
|
|
|
20
20
|
const newItems = newList.filter((newItem) => !oldList.some((oldItem) => getCondition(newItem, oldItem)));
|
|
21
21
|
return newItems;
|
|
22
22
|
};
|
|
23
|
+
/**
|
|
24
|
+
* Truncate number to specified decimal places (without rounding)
|
|
25
|
+
* @param {number|string} value - The number to be truncated, can be number or string
|
|
26
|
+
* @param {number} decimals - Number of decimal places to truncate to
|
|
27
|
+
* @returns {string|number} - Truncated value, returns string to preserve trailing zeros if has decimals, otherwise returns number
|
|
28
|
+
* @param {boolean} isInteger - Whether to force return integer
|
|
29
|
+
*/
|
|
30
|
+
export const truncateNumber = (value, decimals, isInteger = false) => {
|
|
31
|
+
// Try to convert input to number
|
|
32
|
+
const numValue = Number(value);
|
|
33
|
+
// Check if valid number
|
|
34
|
+
if (isNaN(numValue)) {
|
|
35
|
+
throw new Error('Input must be a valid number or string that can be converted to number');
|
|
36
|
+
}
|
|
37
|
+
if (isInteger && !numValue.toString().includes('.')) {
|
|
38
|
+
return value;
|
|
39
|
+
}
|
|
40
|
+
// When decimals is 0, return integer part directly
|
|
41
|
+
if (decimals === 0) {
|
|
42
|
+
return Math.floor(numValue);
|
|
43
|
+
}
|
|
44
|
+
// Calculate factor for given decimal places
|
|
45
|
+
const factor = Math.pow(10, decimals);
|
|
46
|
+
// Multiply by factor, truncate integer part, then divide by factor
|
|
47
|
+
const truncated = Math.floor(numValue * factor) / factor;
|
|
48
|
+
// Return string representation with fixed decimals to preserve trailing zeros
|
|
49
|
+
return truncated.toFixed(decimals);
|
|
50
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, h, g as getElement } from './index-e8e1e68e.js';
|
|
2
|
-
export { C as casino_engagement_suite_tournament } from './casino-engagement-suite-tournament-
|
|
2
|
+
export { C as casino_engagement_suite_tournament } from './casino-engagement-suite-tournament-e9186545.js';
|
|
3
3
|
import '@everymatrix/general-animation-loading/dist';
|
|
4
4
|
|
|
5
5
|
const casinoEngagementSuiteProgressBarCss = ":host{display:block;font-family:inherit}:host(.Desktop) .ProgressBarPercent{font-size:var(--emw--font-size-small, 14px);line-height:14px}@keyframes indeterminate{0%{left:-200%;right:100%}60%{left:110%;right:-10%}to{left:110%;right:-10%}}.ProgressBarBackground{height:8px;background-color:var(--emw--color-gray-300, #666178);border-radius:var(--emw--border-radius-small, 4px);position:relative;overflow:hidden}.ProgressBarLine{position:absolute;left:0;top:0;bottom:0;border-radius:var(--emw--border-radius-small, 4px);background:var(--emw--engagement-suite-gradient-button, linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%));transition:width ease-out 0.3s}.ProgressBarLine.Indeterminate{animation:indeterminate 1s linear infinite}.ProgressBarInfo{margin-bottom:8px;display:flex;justify-content:space-between;align-items:center}.ProgressBarPercent{font-weight:var(--emw--font-weight-bold, 700);font-size:var(--emw--font-size-x-small, 12px);line-height:12px}.HidePercent .ProgressBarPercent{display:none}.ProgressBar:not(.Disabled) .ProgressBarPercent{background:var(--emw--engagement-suite-gradient-button, linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%));-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent}.ProgressBar.Disabled .ProgressBarPercent{color:var(--emw--color-gray-300, #666178)}.ProgressBar.Disabled .ProgressBarLine{background:var(--emw--color-background-secondary, #474668)}";
|