@everymatrix/tournament-details 0.1.0 → 0.1.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.
@@ -0,0 +1,24 @@
1
+ {
2
+ "name": "@everymatrix/tournament-details",
3
+ "version": "0.0.1",
4
+ "type": "module",
5
+ "main": "./client/index.js",
6
+ "module": "./client/index.js",
7
+ "types": "./client/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./client/index.d.ts",
11
+ "node": "./server/index.js",
12
+ "default": "./client/index.js"
13
+ },
14
+ "./wc": { "default": "./wc/tournament-details.js" }
15
+ }
16
+ ,
17
+ "files": ["client/", "server/", "wc/"],
18
+ "peerDependencies": {
19
+ "svelte": "^5.0.0"
20
+ },
21
+ "publishConfig": {
22
+ "access": "public"
23
+ }
24
+ }
@@ -0,0 +1 @@
1
+ .svelte-uizvrn,.svelte-uizvrn:before,.svelte-uizvrn:after{margin:0;padding:0;list-style:none;text-decoration:none;outline:none;box-sizing:border-box;font-family:inherit}:host{height:100%}.Hidden.svelte-uizvrn{display:none}.TournamentGamesWrapper.svelte-uizvrn{display:grid;gap:12px;grid-template-columns:repeat(auto-fit,minmax(min(150px,100%),1fr))}.TournamentDetailsWrapper.svelte-uizvrn{background-color:var(--emw-color-bg-secondary, #333232);border-radius:6px;padding:16px 16px 0;height:100%;display:flex;flex-direction:column}.TournamentDetailsWrapper.svelte-uizvrn .TournamentImageWrapper:where(.svelte-uizvrn){position:relative;border-radius:14px;background-color:var(--emw-color-bg-primary, #212121);max-width:370px}.TournamentDetailsWrapper.svelte-uizvrn .TournamentImageWrapper:where(.svelte-uizvrn) .StatusBadgesWrapper:where(.svelte-uizvrn){position:absolute;top:10px;right:10px;display:flex;gap:10px}.TournamentDetailsWrapper.svelte-uizvrn .TournamentImageWrapper:where(.svelte-uizvrn) .StatusBadgesWrapper:where(.svelte-uizvrn) .StatusBadge:where(.svelte-uizvrn){background-color:var(--emw-color-primary, #FF1D4E);color:var(--emw-color-typography, #ffffff);font-size:14px;border-radius:14px;padding:5px 10px;z-index:1}.TournamentDetailsWrapper.svelte-uizvrn .TournamentImageWrapper:where(.svelte-uizvrn) .StatusBadgesWrapper:where(.svelte-uizvrn) .StatusBadge:where(.svelte-uizvrn).Live{background-color:var(--emw-color-green, #2DCB70)}.TournamentDetailsWrapper.svelte-uizvrn .TournamentImageWrapper:where(.svelte-uizvrn) .StatusBadgesWrapper:where(.svelte-uizvrn) .StatusBadge:where(.svelte-uizvrn).Upcoming{background-color:var(--emw-color-green, #5A88D7)}.TournamentDetailsWrapper.svelte-uizvrn .TournamentImageWrapper:where(.svelte-uizvrn) .StatusBadgesWrapper:where(.svelte-uizvrn) .StatusBadge:where(.svelte-uizvrn).Ended{background-color:var(--emw-color-green, #F3514B)}.TournamentDetailsWrapper.svelte-uizvrn .TournamentImageWrapper:where(.svelte-uizvrn) img:where(.svelte-uizvrn){border-radius:6px;width:100%;min-height:200px;height:200px;object-fit:cover}.TournamentDetailsWrapper.svelte-uizvrn .TournamentDetails:where(.svelte-uizvrn){color:var(--emw-color-typography, #ffffff);margin-top:10px;display:flex;flex-direction:column;gap:10px;height:-webkit-fill-available;justify-content:space-between}.TournamentDetailsWrapper.svelte-uizvrn .TournamentDetails:where(.svelte-uizvrn) .TournamentStartDate:where(.svelte-uizvrn){font-size:12px;opacity:70%;font-weight:300}.TournamentDetailsWrapper.svelte-uizvrn .TournamentDetails:where(.svelte-uizvrn) .TournamentTitle:where(.svelte-uizvrn){font-size:20px;font-weight:500;word-wrap:break-word}.TournamentDetailsWrapper.svelte-uizvrn .TournamentDetails:where(.svelte-uizvrn) .TournamentCriteria:where(.svelte-uizvrn){font-size:12px;opacity:70%;font-weight:200;padding:0;margin:0}.TournamentDetailsWrapper.svelte-uizvrn .ViewPrizesContainer:where(.svelte-uizvrn){display:flex;justify-content:space-between;align-items:center;background-color:var(--emw-color-bg-elements, #4A4A4A);color:var(--emw-color-typography, #ffffff);border-radius:6px;width:100%;margin:10px 0;padding:10px}.TournamentDetailsWrapper.svelte-uizvrn .ViewPrizesContainer:where(.svelte-uizvrn) p:where(.svelte-uizvrn){opacity:70%;font-size:14px;font-weight:400}.TournamentDetailsWrapper.svelte-uizvrn .ViewPrizesContainer:where(.svelte-uizvrn) .ViewPrizeButton:where(.svelte-uizvrn){background-color:transparent;border-radius:6px;color:var(--emw-color-typography, #ffffff);border:1px solid var(--emw-color-primary, #FF1D4E);padding:6px 12px;display:flex;align-items:center;font-size:12px;margin-left:6px;transition:background-color .2s ease,transform .15s ease,box-shadow .15s ease}.TournamentDetailsWrapper.svelte-uizvrn .ViewPrizesContainer:where(.svelte-uizvrn) .ViewPrizeButton:where(.svelte-uizvrn):hover{box-shadow:0 0 8px 0 var(--emw-color-primary, #FF1D4E);transform:scale(1.05);cursor:pointer}.TournamentDetailsWrapper.svelte-uizvrn .ViewPrizesContainer:where(.svelte-uizvrn) .ViewPrizeButton:where(.svelte-uizvrn):active{transform:scale(.95)}.TournamentDetailsWrapper.svelte-uizvrn .ViewPrizesContainer:where(.svelte-uizvrn) .ViewPrizeButton:where(.svelte-uizvrn) svg:where(.svelte-uizvrn){margin-left:5px;justify-self:center}.TournamentDetailsWrapper.svelte-uizvrn .TimeSegment:where(.svelte-uizvrn){background-color:var(--emw-color-bg-elements, #4A4A4A);color:var(--emw-color-typography, #ffffff);padding:6px;border-radius:6px}.TournamentDetailsWrapper.svelte-uizvrn .TimeToEndTournament:where(.svelte-uizvrn)>p:where(.svelte-uizvrn){margin-bottom:6px;font-size:12px;font-weight:400;opacity:70%}.TournamentDetailsWrapper.svelte-uizvrn .TimeToEndTournament:where(.svelte-uizvrn){display:flex;flex-direction:column;gap:6px}.TournamentDetailsWrapper.svelte-uizvrn .ViewDetailsButton:where(.svelte-uizvrn){width:100%;background-color:var(--emw-color-bg-elements, #4A4A4A);color:var(--emw-color-typography, #ffffff);border-radius:6px;padding:8px 0;border:none;outline:none}
package/package.json CHANGED
@@ -1,25 +1,26 @@
1
1
  {
2
2
  "name": "@everymatrix/tournament-details",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "type": "module",
5
- "main": "es2015/tournament-details.cjs",
6
- "module": "esnext/tournament-details.js",
5
+ "main": "./client/index.js",
6
+ "module": "./client/index.js",
7
+ "types": "./client/index.d.ts",
7
8
  "exports": {
8
9
  ".": {
9
- "import": "./esnext/tournament-details.js",
10
- "require": "./es2015/tournament-details.cjs"
10
+ "types": "./client/index.d.ts",
11
+ "node": "./server/index.js",
12
+ "default": "./client/index.js"
11
13
  },
12
- "./es2015/tournament-details.cjs": "./es2015/tournament-details.cjs",
13
- "./es2015/tournament-details.js": "./es2015/tournament-details.js"
14
+ "./wc": {
15
+ "default": "./wc/tournament-details.js"
16
+ }
14
17
  },
15
18
  "files": [
16
- "components/",
17
- "es2015/",
18
- "stencil",
19
- "angular",
20
- "esnext/"
19
+ "client/",
20
+ "server/",
21
+ "wc/"
21
22
  ],
22
23
  "publishConfig": {
23
24
  "access": "public"
24
25
  }
25
- }
26
+ }
@@ -0,0 +1,108 @@
1
+ import * as $ from "svelte/internal/server";
2
+ import { onDestroy } from "svelte";
3
+ import dayjs from "dayjs";
4
+ import customParseFormat from "dayjs/plugin/customParseFormat.js";
5
+ import { addMessages, _ } from "svelte-i18n";
6
+ import duration from "dayjs/plugin/duration.js";
7
+ dayjs.extend(customParseFormat);
8
+ const getFormattedDate = (date) => {
9
+ const formatted = dayjs(date).format("MMMM D, HH:mm");
10
+ return formatted;
11
+ };
12
+ function addNewMessages(lang, dict) {
13
+ addMessages(lang, dict);
14
+ }
15
+ const TRANSLATIONS = {
16
+ en: {
17
+ Unstarted: "Coming soon",
18
+ Running: "Live",
19
+ Closed: "Ended",
20
+ Closing: "Ended",
21
+ startDateLabel: "Start Date:",
22
+ viewDetailsButton: "View Details",
23
+ detailsButton: "Details",
24
+ loginButton: "Login",
25
+ registerButton: "Register",
26
+ endsInLabel: "Ends in:",
27
+ joinButton: "Join",
28
+ daysLabel: "Days",
29
+ enrolledLabel: "Enrolled",
30
+ topPrize: "Top prize",
31
+ viewPrizes: "View Prizes",
32
+ enrolled: "Enrolled",
33
+ scoreCriteria: "Score Criteria",
34
+ BetCount: "Number of Bets",
35
+ MaxWinStakeRatio: "Max Win per Stake",
36
+ WinStakeRatio: "Total Win per Stake",
37
+ MostRounds: "Most Rounds",
38
+ WinBetCount: "Winnings and Number of Rounds",
39
+ Stake: "Turnover",
40
+ Win: "Winnings",
41
+ minbet: "Min Bet Count"
42
+ },
43
+ tr: {
44
+ Unstarted: "Yakında",
45
+ Running: "Devam Ediyor",
46
+ Closed: "Sona Erdi",
47
+ Closing: "Sona Erdi",
48
+ startDateLabel: "Başlangıç Tarihi:",
49
+ viewDetailsButton: "Detayları Görüntüle",
50
+ detailsButton: "Detaylar",
51
+ loginButton: "Giriş Yap",
52
+ registerButton: "Kayıt Ol",
53
+ endsInLabel: "Bitiş:",
54
+ joinButton: "Katıl",
55
+ daysLabel: "Gün",
56
+ enrolledLabel: "Kayıtlı",
57
+ topPrize: "Top prize",
58
+ viewPrizes: "Ödülleri Görüntüle",
59
+ enrolled: "Kayıtlı",
60
+ scoreCriteria: "Puan Kriterleri",
61
+ BetCount: "Bahis Sayısı",
62
+ MaxWinStakeRatio: "Bahis Başına Maksimum Kazanç",
63
+ MostRounds: "En Çok Tur",
64
+ WinStakeRatio: "Bahis Başına Toplam Kazanç",
65
+ WinBetCount: "Winnings and Number of Rounds",
66
+ Stake: "Devir",
67
+ Win: "Winnings",
68
+ minbet: "Min Bet Count"
69
+ }
70
+ };
71
+ const placeholderImg = "/assets/placeholder-B9CooiZk.png";
72
+ function TournamentDetails_impl($$renderer, $$props) {
73
+ $$renderer.component(($$renderer2) => {
74
+ var _a;
75
+ var $$store_subs;
76
+ dayjs.extend(duration);
77
+ const { tournament, language = "en", enrolled } = $$props;
78
+ let timeRemaining = {};
79
+ Object.keys(TRANSLATIONS).forEach((item) => {
80
+ addNewMessages(item, TRANSLATIONS[item]);
81
+ });
82
+ const statusCssClassMap = {
83
+ Unstarted: "Upcoming",
84
+ Running: "Live",
85
+ Closed: "Ended",
86
+ Closing: "Ended"
87
+ };
88
+ onDestroy(() => {
89
+ });
90
+ $$renderer2.push(`<div class="TournamentDetailsWrapper svelte-uizvrn"><div class="TournamentImageWrapper svelte-uizvrn"><div class="StatusBadgesWrapper svelte-uizvrn"><div${$.attr_class(`StatusBadge ${statusCssClassMap[tournament.state]}`, "svelte-uizvrn")}>${$.escape($.store_get($$store_subs ?? ($$store_subs = {}), "$_", _)(tournament.state))}</div> `);
91
+ if (enrolled) {
92
+ $$renderer2.push("<!--[-->");
93
+ $$renderer2.push(`<div${$.attr_class(`StatusBadge Enrolled`, "svelte-uizvrn")}>${$.escape($.store_get($$store_subs ?? ($$store_subs = {}), "$_", _)("enrolled"))}</div>`);
94
+ } else {
95
+ $$renderer2.push("<!--[!-->");
96
+ }
97
+ $$renderer2.push(`<!--]--></div> <img${$.attr("src", ((_a = tournament == null ? void 0 : tournament.thumbnail) == null ? void 0 : _a.length) > 0 ? tournament == null ? void 0 : tournament.thumbnail : placeholderImg)} alt="TournamentThumbnail"${$.attr_style(tournament.state === "Closed" && "filter: saturate(30%)")} class="svelte-uizvrn"/></div> <div class="TournamentDetails svelte-uizvrn"><p class="TournamentStartDate svelte-uizvrn">${$.escape($.store_get($$store_subs ?? ($$store_subs = {}), "$_", _)("startDateLabel"))} ${$.escape(getFormattedDate(tournament.startDate))}</p> <p class="TournamentTitle svelte-uizvrn">${$.escape(tournament.nameOrTitle)}</p> <div class="TournamentCriteria svelte-uizvrn"><p class="svelte-uizvrn">${$.escape($.store_get($$store_subs ?? ($$store_subs = {}), "$_", _)("scoreCriteria"))}: ${$.escape($.store_get($$store_subs ?? ($$store_subs = {}), "$_", _)(`${tournament.scoreCriteria}`))}</p> <p class="svelte-uizvrn">(${$.escape($.store_get($$store_subs ?? ($$store_subs = {}), "$_", _)("minbet"))} ${$.escape(tournament.minBetCount)})</p></div> `);
98
+ {
99
+ $$renderer2.push("<!--[-->");
100
+ $$renderer2.push(`<div class="TimeToEndTournament svelte-uizvrn"><p class="svelte-uizvrn">${$.escape($.store_get($$store_subs ?? ($$store_subs = {}), "$_", _)("endsInLabel"))}</p> <div class="svelte-uizvrn"><span${$.attr_class(`TimeSegment ${timeRemaining.days === 0 ? "Hidden" : ""}`, "svelte-uizvrn")}>${$.escape(timeRemaining.days > 0 ? `${timeRemaining.days} ${$.store_get($$store_subs ?? ($$store_subs = {}), "$_", _)("daysLabel")}` : null)}</span> <span${$.attr_class($.clsx(timeRemaining.days === 0 ? "Hidden" : ""), "svelte-uizvrn")}>${$.escape(timeRemaining.days > 0 ? " - " : null)}</span> <span class="TimeSegment svelte-uizvrn">${$.escape(timeRemaining.hours)}</span> : <span class="TimeSegment svelte-uizvrn">${$.escape(timeRemaining.minutes)}</span> : <span class="TimeSegment svelte-uizvrn">${$.escape(timeRemaining.seconds)}</span></div></div>`);
101
+ }
102
+ $$renderer2.push(`<!--]--> <div class="ViewPrizesContainer svelte-uizvrn"><p class="svelte-uizvrn">${$.escape($.store_get($$store_subs ?? ($$store_subs = {}), "$_", _)("topPrize"))}: ${$.escape(tournament.prizes[0].name)}</p> <button class="ViewPrizeButton svelte-uizvrn">${$.escape($.store_get($$store_subs ?? ($$store_subs = {}), "$_", _)("viewPrizes"))} <svg width="6" height="10" viewBox="0 0 6 10" fill="none" xmlns="http://www.w3.org/2000/svg" class="svelte-uizvrn"><path d="M0 8.54661L3.70929 4.84143L0 1.13793L1.14214 0L6.00021 4.84143L1.14214 9.68455L0 8.54661Z" fill="white" class="svelte-uizvrn"></path></svg></button></div></div></div>`);
103
+ if ($$store_subs) $.unsubscribe_stores($$store_subs);
104
+ });
105
+ }
106
+ export {
107
+ TournamentDetails_impl as default
108
+ };
@@ -0,0 +1,24 @@
1
+ {
2
+ "name": "@everymatrix/tournament-details",
3
+ "version": "0.0.1",
4
+ "type": "module",
5
+ "main": "./client/index.js",
6
+ "module": "./client/index.js",
7
+ "types": "./client/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./client/index.d.ts",
11
+ "node": "./server/index.js",
12
+ "default": "./client/index.js"
13
+ },
14
+ "./wc": { "default": "./wc/tournament-details.js" }
15
+ }
16
+ ,
17
+ "files": ["client/", "server/", "wc/"],
18
+ "peerDependencies": {
19
+ "svelte": "^5.0.0"
20
+ },
21
+ "publishConfig": {
22
+ "access": "public"
23
+ }
24
+ }