@everymatrix/casino-tournaments-list-controller 0.0.367 → 0.0.368
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/.eslintrc +84 -84
- package/README.md +30 -30
- package/dist/casino-tournaments-list-controller.js +1 -1
- package/dist/casino-tournaments-list-controller.js.map +1 -1
- package/index.html +37 -37
- package/index.js +1 -1
- package/package.json +2 -2
- package/public/reset.css +47 -47
- package/rollup.config.js +67 -67
- package/src/CasinoTournamentsListController.svelte +161 -161
- package/src/i18n.js +27 -27
- package/src/index.ts +4 -4
- package/src/translations.js +47 -47
- package/stories/CasinoTournamentsListController.stories.js +13 -13
- package/tsconfig.json +6 -6
package/index.html
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset='utf-8'>
|
|
5
|
-
<meta name='viewport' content='width=device-width,initial-scale=1'>
|
|
6
|
-
|
|
7
|
-
<title>
|
|
8
|
-
casino-tournaments-list-controller
|
|
9
|
-
</title>
|
|
10
|
-
<link rel="stylesheet" href="public/reset.css">
|
|
11
|
-
<script src='dist/casino-tournaments-list-controller.js'></script>
|
|
12
|
-
</head>
|
|
13
|
-
|
|
14
|
-
<body>
|
|
15
|
-
<style>
|
|
16
|
-
html,body { margin: 0; padding: 0; height: 100%; font-family: "Helvetica Neue", "Helvetica", sans-serif; }
|
|
17
|
-
.header { display: flex; justify-content: center; align-items: center; padding: 10px 20px; margin-bottom: 20px; background: #42a3e2; box-shadow: 3px 4px 5px 0px rgba(0,0,0, .2); }
|
|
18
|
-
.header__logo svg { height: 50px; width: 50px; margin-right: 5px; }
|
|
19
|
-
.header__name { color: #fff; }
|
|
20
|
-
.header__name span { margin-right: 10px; font-weight: bold; }
|
|
21
|
-
.webcomponent { padding: 10px 20px; }
|
|
22
|
-
</style>
|
|
23
|
-
<header class="header">
|
|
24
|
-
<div class="header__logo">
|
|
25
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="161" height="132" viewBox="0 0 161 132"><defs><linearGradient x1="0%" y1="50%" y2="50%" id="a"><stop stop-color="#2A3B8F" offset="0%"/><stop stop-color="#29ABE2" offset="100%"/></linearGradient><linearGradient x1="100%" y1="50%" x2="0%" y2="50%" id="c"><stop stop-color="#B4D44E" offset="0%"/><stop stop-color="#E7F716" offset="100%"/></linearGradient></defs><g fill="none" fill-rule="evenodd"><path fill="#166DA5" d="M160.6 65.9l-17.4 29.3-24.4-29.7 24.4-28.9z"/><path fill="#8FDB69" d="M141.3 100.2l-26.5-31.7-15.9 26.6 24.7 36.1z"/><path fill="#166DA5" d="M141 31.4l-26.2 31.8-15.9-26.6L123.6.9z"/><path fill="url(#a)" opacity=".95" d="M61.1 31.4H141L123.4.7H78.7z M114.8 63.3H159l-15.9-26.8H98.8"/><path fill="url(#c)" opacity=".95" d="M141.3 100.3H61l17.6 30.5h45z M114.8 68.4H159l-15.9 26.8H98.8"/><path fill="#010101" d="M78.6 130.8L41 65.8 79.1.8H37.9L.4 65.8l37.5 65z"/></g></svg>
|
|
26
|
-
</div>
|
|
27
|
-
<h1 class="header__name">
|
|
28
|
-
<span>WEBCOMPONENT:</span> casino-tournaments-list-controller
|
|
29
|
-
</h1>
|
|
30
|
-
</header>
|
|
31
|
-
|
|
32
|
-
<div class="webcomponent">
|
|
33
|
-
<casino-tournaments-list-controller></casino-tournaments-list-controller>
|
|
34
|
-
</div>
|
|
35
|
-
|
|
36
|
-
</body>
|
|
37
|
-
</html>
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset='utf-8'>
|
|
5
|
+
<meta name='viewport' content='width=device-width,initial-scale=1'>
|
|
6
|
+
|
|
7
|
+
<title>
|
|
8
|
+
casino-tournaments-list-controller
|
|
9
|
+
</title>
|
|
10
|
+
<link rel="stylesheet" href="public/reset.css">
|
|
11
|
+
<script src='dist/casino-tournaments-list-controller.js'></script>
|
|
12
|
+
</head>
|
|
13
|
+
|
|
14
|
+
<body>
|
|
15
|
+
<style>
|
|
16
|
+
html,body { margin: 0; padding: 0; height: 100%; font-family: "Helvetica Neue", "Helvetica", sans-serif; }
|
|
17
|
+
.header { display: flex; justify-content: center; align-items: center; padding: 10px 20px; margin-bottom: 20px; background: #42a3e2; box-shadow: 3px 4px 5px 0px rgba(0,0,0, .2); }
|
|
18
|
+
.header__logo svg { height: 50px; width: 50px; margin-right: 5px; }
|
|
19
|
+
.header__name { color: #fff; }
|
|
20
|
+
.header__name span { margin-right: 10px; font-weight: bold; }
|
|
21
|
+
.webcomponent { padding: 10px 20px; }
|
|
22
|
+
</style>
|
|
23
|
+
<header class="header">
|
|
24
|
+
<div class="header__logo">
|
|
25
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="161" height="132" viewBox="0 0 161 132"><defs><linearGradient x1="0%" y1="50%" y2="50%" id="a"><stop stop-color="#2A3B8F" offset="0%"/><stop stop-color="#29ABE2" offset="100%"/></linearGradient><linearGradient x1="100%" y1="50%" x2="0%" y2="50%" id="c"><stop stop-color="#B4D44E" offset="0%"/><stop stop-color="#E7F716" offset="100%"/></linearGradient></defs><g fill="none" fill-rule="evenodd"><path fill="#166DA5" d="M160.6 65.9l-17.4 29.3-24.4-29.7 24.4-28.9z"/><path fill="#8FDB69" d="M141.3 100.2l-26.5-31.7-15.9 26.6 24.7 36.1z"/><path fill="#166DA5" d="M141 31.4l-26.2 31.8-15.9-26.6L123.6.9z"/><path fill="url(#a)" opacity=".95" d="M61.1 31.4H141L123.4.7H78.7z M114.8 63.3H159l-15.9-26.8H98.8"/><path fill="url(#c)" opacity=".95" d="M141.3 100.3H61l17.6 30.5h45z M114.8 68.4H159l-15.9 26.8H98.8"/><path fill="#010101" d="M78.6 130.8L41 65.8 79.1.8H37.9L.4 65.8l37.5 65z"/></g></svg>
|
|
26
|
+
</div>
|
|
27
|
+
<h1 class="header__name">
|
|
28
|
+
<span>WEBCOMPONENT:</span> casino-tournaments-list-controller
|
|
29
|
+
</h1>
|
|
30
|
+
</header>
|
|
31
|
+
|
|
32
|
+
<div class="webcomponent">
|
|
33
|
+
<casino-tournaments-list-controller></casino-tournaments-list-controller>
|
|
34
|
+
</div>
|
|
35
|
+
|
|
36
|
+
</body>
|
|
37
|
+
</html>
|
package/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import './dist/casino-tournaments-list-controller.js';
|
|
1
|
+
import './dist/casino-tournaments-list-controller.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@everymatrix/casino-tournaments-list-controller",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.368",
|
|
4
4
|
"main": "dist/casino-tournaments-list-controller.js",
|
|
5
5
|
"svelte": "src/index.ts",
|
|
6
6
|
"scripts": {
|
|
@@ -36,5 +36,5 @@
|
|
|
36
36
|
"publishConfig": {
|
|
37
37
|
"access": "public"
|
|
38
38
|
},
|
|
39
|
-
"gitHead": "
|
|
39
|
+
"gitHead": "8de3cc787cc97aec99916dfedb01ec69ac55ba98"
|
|
40
40
|
}
|
package/public/reset.css
CHANGED
|
@@ -1,48 +1,48 @@
|
|
|
1
|
-
/* http://meyerweb.com/eric/tools/css/reset/
|
|
2
|
-
v2.0 | 20110126
|
|
3
|
-
License: none (public domain)
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
html, body, div, span, applet, object, iframe,
|
|
7
|
-
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
|
|
8
|
-
a, abbr, acronym, address, big, cite, code,
|
|
9
|
-
del, dfn, em, img, ins, kbd, q, s, samp,
|
|
10
|
-
small, strike, strong, sub, sup, tt, var,
|
|
11
|
-
b, u, i, center,
|
|
12
|
-
dl, dt, dd, ol, ul, li,
|
|
13
|
-
fieldset, form, label, legend,
|
|
14
|
-
table, caption, tbody, tfoot, thead, tr, th, td,
|
|
15
|
-
article, aside, canvas, details, embed,
|
|
16
|
-
figure, figcaption, footer, header, hgroup,
|
|
17
|
-
menu, nav, output, ruby, section, summary,
|
|
18
|
-
time, mark, audio, video {
|
|
19
|
-
margin: 0;
|
|
20
|
-
padding: 0;
|
|
21
|
-
border: 0;
|
|
22
|
-
font-size: 100%;
|
|
23
|
-
font: inherit;
|
|
24
|
-
vertical-align: baseline;
|
|
25
|
-
}
|
|
26
|
-
/* HTML5 display-role reset for older browsers */
|
|
27
|
-
article, aside, details, figcaption, figure,
|
|
28
|
-
footer, header, hgroup, menu, nav, section {
|
|
29
|
-
display: block;
|
|
30
|
-
}
|
|
31
|
-
body {
|
|
32
|
-
line-height: 1;
|
|
33
|
-
}
|
|
34
|
-
ol, ul {
|
|
35
|
-
list-style: none;
|
|
36
|
-
}
|
|
37
|
-
blockquote, q {
|
|
38
|
-
quotes: none;
|
|
39
|
-
}
|
|
40
|
-
blockquote:before, blockquote:after,
|
|
41
|
-
q:before, q:after {
|
|
42
|
-
content: '';
|
|
43
|
-
content: none;
|
|
44
|
-
}
|
|
45
|
-
table {
|
|
46
|
-
border-collapse: collapse;
|
|
47
|
-
border-spacing: 0;
|
|
1
|
+
/* http://meyerweb.com/eric/tools/css/reset/
|
|
2
|
+
v2.0 | 20110126
|
|
3
|
+
License: none (public domain)
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
html, body, div, span, applet, object, iframe,
|
|
7
|
+
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
|
|
8
|
+
a, abbr, acronym, address, big, cite, code,
|
|
9
|
+
del, dfn, em, img, ins, kbd, q, s, samp,
|
|
10
|
+
small, strike, strong, sub, sup, tt, var,
|
|
11
|
+
b, u, i, center,
|
|
12
|
+
dl, dt, dd, ol, ul, li,
|
|
13
|
+
fieldset, form, label, legend,
|
|
14
|
+
table, caption, tbody, tfoot, thead, tr, th, td,
|
|
15
|
+
article, aside, canvas, details, embed,
|
|
16
|
+
figure, figcaption, footer, header, hgroup,
|
|
17
|
+
menu, nav, output, ruby, section, summary,
|
|
18
|
+
time, mark, audio, video {
|
|
19
|
+
margin: 0;
|
|
20
|
+
padding: 0;
|
|
21
|
+
border: 0;
|
|
22
|
+
font-size: 100%;
|
|
23
|
+
font: inherit;
|
|
24
|
+
vertical-align: baseline;
|
|
25
|
+
}
|
|
26
|
+
/* HTML5 display-role reset for older browsers */
|
|
27
|
+
article, aside, details, figcaption, figure,
|
|
28
|
+
footer, header, hgroup, menu, nav, section {
|
|
29
|
+
display: block;
|
|
30
|
+
}
|
|
31
|
+
body {
|
|
32
|
+
line-height: 1;
|
|
33
|
+
}
|
|
34
|
+
ol, ul {
|
|
35
|
+
list-style: none;
|
|
36
|
+
}
|
|
37
|
+
blockquote, q {
|
|
38
|
+
quotes: none;
|
|
39
|
+
}
|
|
40
|
+
blockquote:before, blockquote:after,
|
|
41
|
+
q:before, q:after {
|
|
42
|
+
content: '';
|
|
43
|
+
content: none;
|
|
44
|
+
}
|
|
45
|
+
table {
|
|
46
|
+
border-collapse: collapse;
|
|
47
|
+
border-spacing: 0;
|
|
48
48
|
}
|
package/rollup.config.js
CHANGED
|
@@ -1,67 +1,67 @@
|
|
|
1
|
-
import svelte from 'rollup-plugin-svelte';
|
|
2
|
-
import commonjs from '@rollup/plugin-commonjs';
|
|
3
|
-
import resolve from '@rollup/plugin-node-resolve';
|
|
4
|
-
import serve from 'rollup-plugin-dev-server';
|
|
5
|
-
import livereload from 'rollup-plugin-livereload';
|
|
6
|
-
import { terser } from 'rollup-plugin-terser';
|
|
7
|
-
import sveltePreprocess from 'svelte-preprocess';
|
|
8
|
-
import typescript from '@rollup/plugin-typescript';
|
|
9
|
-
import uglify from 'rollup-plugin-uglify';
|
|
10
|
-
import image from '@rollup/plugin-image';
|
|
11
|
-
|
|
12
|
-
const production = process.env.NODE_ENV == 'production';
|
|
13
|
-
const dev = process.env.NODE_ENV == 'development';
|
|
14
|
-
|
|
15
|
-
export default {
|
|
16
|
-
input: 'src/index.ts',
|
|
17
|
-
output: {
|
|
18
|
-
sourcemap: true,
|
|
19
|
-
format: 'umd',
|
|
20
|
-
name: 'app',
|
|
21
|
-
file: 'dist/casino-tournaments-list-controller.js',
|
|
22
|
-
},
|
|
23
|
-
plugins: [
|
|
24
|
-
svelte({
|
|
25
|
-
preprocess: sveltePreprocess(),
|
|
26
|
-
compilerOptions: {
|
|
27
|
-
// @TODO check generate and hydratable
|
|
28
|
-
// generate: 'ssr',
|
|
29
|
-
// hydratable: true,
|
|
30
|
-
// enable run-time checks when not in production
|
|
31
|
-
customElement: true,
|
|
32
|
-
dev: !production
|
|
33
|
-
}
|
|
34
|
-
}),
|
|
35
|
-
image(),
|
|
36
|
-
commonjs(),
|
|
37
|
-
resolve({
|
|
38
|
-
browser: true,
|
|
39
|
-
dedupe: ['svelte']
|
|
40
|
-
}),
|
|
41
|
-
dev && serve({
|
|
42
|
-
open: true,
|
|
43
|
-
verbose: true,
|
|
44
|
-
allowCrossOrigin: true,
|
|
45
|
-
historyApiFallback: false,
|
|
46
|
-
host: 'localhost',
|
|
47
|
-
port: 5050,
|
|
48
|
-
}),
|
|
49
|
-
dev && livereload({ watch: ['', 'dist'] }),
|
|
50
|
-
typescript({
|
|
51
|
-
sourceMap: !production,
|
|
52
|
-
inlineSources: !production,
|
|
53
|
-
}),
|
|
54
|
-
// If we're building for production (npm run build
|
|
55
|
-
// instead of npm run dev), minify
|
|
56
|
-
production &&
|
|
57
|
-
terser({
|
|
58
|
-
output: {
|
|
59
|
-
comments: "all"
|
|
60
|
-
},
|
|
61
|
-
}),
|
|
62
|
-
production && uglify.uglify()
|
|
63
|
-
],
|
|
64
|
-
watch: {
|
|
65
|
-
clearScreen: false
|
|
66
|
-
}
|
|
67
|
-
};
|
|
1
|
+
import svelte from 'rollup-plugin-svelte';
|
|
2
|
+
import commonjs from '@rollup/plugin-commonjs';
|
|
3
|
+
import resolve from '@rollup/plugin-node-resolve';
|
|
4
|
+
import serve from 'rollup-plugin-dev-server';
|
|
5
|
+
import livereload from 'rollup-plugin-livereload';
|
|
6
|
+
import { terser } from 'rollup-plugin-terser';
|
|
7
|
+
import sveltePreprocess from 'svelte-preprocess';
|
|
8
|
+
import typescript from '@rollup/plugin-typescript';
|
|
9
|
+
import uglify from 'rollup-plugin-uglify';
|
|
10
|
+
import image from '@rollup/plugin-image';
|
|
11
|
+
|
|
12
|
+
const production = process.env.NODE_ENV == 'production';
|
|
13
|
+
const dev = process.env.NODE_ENV == 'development';
|
|
14
|
+
|
|
15
|
+
export default {
|
|
16
|
+
input: 'src/index.ts',
|
|
17
|
+
output: {
|
|
18
|
+
sourcemap: true,
|
|
19
|
+
format: 'umd',
|
|
20
|
+
name: 'app',
|
|
21
|
+
file: 'dist/casino-tournaments-list-controller.js',
|
|
22
|
+
},
|
|
23
|
+
plugins: [
|
|
24
|
+
svelte({
|
|
25
|
+
preprocess: sveltePreprocess(),
|
|
26
|
+
compilerOptions: {
|
|
27
|
+
// @TODO check generate and hydratable
|
|
28
|
+
// generate: 'ssr',
|
|
29
|
+
// hydratable: true,
|
|
30
|
+
// enable run-time checks when not in production
|
|
31
|
+
customElement: true,
|
|
32
|
+
dev: !production
|
|
33
|
+
}
|
|
34
|
+
}),
|
|
35
|
+
image(),
|
|
36
|
+
commonjs(),
|
|
37
|
+
resolve({
|
|
38
|
+
browser: true,
|
|
39
|
+
dedupe: ['svelte']
|
|
40
|
+
}),
|
|
41
|
+
dev && serve({
|
|
42
|
+
open: true,
|
|
43
|
+
verbose: true,
|
|
44
|
+
allowCrossOrigin: true,
|
|
45
|
+
historyApiFallback: false,
|
|
46
|
+
host: 'localhost',
|
|
47
|
+
port: 5050,
|
|
48
|
+
}),
|
|
49
|
+
dev && livereload({ watch: ['', 'dist'] }),
|
|
50
|
+
typescript({
|
|
51
|
+
sourceMap: !production,
|
|
52
|
+
inlineSources: !production,
|
|
53
|
+
}),
|
|
54
|
+
// If we're building for production (npm run build
|
|
55
|
+
// instead of npm run dev), minify
|
|
56
|
+
production &&
|
|
57
|
+
terser({
|
|
58
|
+
output: {
|
|
59
|
+
comments: "all"
|
|
60
|
+
},
|
|
61
|
+
}),
|
|
62
|
+
production && uglify.uglify()
|
|
63
|
+
],
|
|
64
|
+
watch: {
|
|
65
|
+
clearScreen: false
|
|
66
|
+
}
|
|
67
|
+
};
|
|
@@ -1,161 +1,161 @@
|
|
|
1
|
-
<svelte:options tag={null} />
|
|
2
|
-
|
|
3
|
-
<script lang="ts">
|
|
4
|
-
import { onMount } from 'svelte';
|
|
5
|
-
import moment from 'moment';
|
|
6
|
-
import { _, addNewMessages } from './i18n';
|
|
7
|
-
import { TournamentsListTranslations } from './translations';
|
|
8
|
-
|
|
9
|
-
import '@everymatrix/casino-tournaments-thumbnail-controller';
|
|
10
|
-
|
|
11
|
-
export let session:String = '';
|
|
12
|
-
export let userid:String = '';
|
|
13
|
-
export let numberoftournaments:String = '6';
|
|
14
|
-
export let endpoint:String = '';
|
|
15
|
-
export let loginevent:String = '';
|
|
16
|
-
export let registerevent:String = '';
|
|
17
|
-
export let loginurl:String = '';
|
|
18
|
-
export let registerurl:String = '';
|
|
19
|
-
export let currency:String = '';
|
|
20
|
-
export let lang:String = 'en';
|
|
21
|
-
export let keepbrowsercontext:string = 'false';
|
|
22
|
-
|
|
23
|
-
let isLoading:Boolean = false;
|
|
24
|
-
let currentDate:any = moment(); // current day
|
|
25
|
-
// Variables of topics for communication
|
|
26
|
-
let isLoggedIn:Boolean = true;
|
|
27
|
-
let sessionID:String = '';
|
|
28
|
-
let playerID:String = '';
|
|
29
|
-
let tournamentList:any = '';
|
|
30
|
-
|
|
31
|
-
Object.keys(TournamentsListTranslations).forEach((item) => {
|
|
32
|
-
addNewMessages(item, TournamentsListTranslations[item]);
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
const messageHandler = (e:any) => {
|
|
36
|
-
if (e.data && e.data.type == 'TournamentList') {
|
|
37
|
-
tournamentList = [];
|
|
38
|
-
isLoading = true;
|
|
39
|
-
// Small hack to refresh the list
|
|
40
|
-
let finishedTournamentsCounter:number = 0;
|
|
41
|
-
|
|
42
|
-
tournamentList = e.data.tournamentList;
|
|
43
|
-
|
|
44
|
-
setTimeout(() => {
|
|
45
|
-
isLoading = false;
|
|
46
|
-
}, 10)
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
if (e.data && e.data.type == 'TournamentListShowMore') {
|
|
50
|
-
tournamentList = [...tournamentList, ...e.data.tournamentList]
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
if(e.data.type == 'UpdateTournamentView'){
|
|
54
|
-
if(!tournamentList){
|
|
55
|
-
return;
|
|
56
|
-
}
|
|
57
|
-
let isNewTournament:boolean = tournamentList.filter( (item) =>{
|
|
58
|
-
return item.id == e.data.tournamentData.id;
|
|
59
|
-
}).length == 0;
|
|
60
|
-
if( isNewTournament ){
|
|
61
|
-
tournamentList.pop();
|
|
62
|
-
tournamentList=[e.data.tournamentData, ...tournamentList];
|
|
63
|
-
setTimeout(()=>{
|
|
64
|
-
tournamentList.forEach((item, idx)=>{
|
|
65
|
-
window.postMessage({ type: `UpdateSingleTournament_${idx+1}`, tournamentData: item }, window.location.href);
|
|
66
|
-
})
|
|
67
|
-
}, 100)
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
if (e.data && e.data.type == 'UserSessionID') {
|
|
71
|
-
isLoggedIn = true;
|
|
72
|
-
sessionID = e.data.session;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
const setSession = () => {
|
|
77
|
-
if (session.length > 0 && session != 'false') {
|
|
78
|
-
sessionID = session;
|
|
79
|
-
isLoggedIn = true;
|
|
80
|
-
} else {
|
|
81
|
-
isLoggedIn = false;
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
const setPlayerID = () => {
|
|
86
|
-
playerID = userid;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
onMount(() => {
|
|
90
|
-
window.addEventListener('message', messageHandler, true);
|
|
91
|
-
|
|
92
|
-
return () => {
|
|
93
|
-
window.removeEventListener('message', messageHandler, true);
|
|
94
|
-
}
|
|
95
|
-
});
|
|
96
|
-
|
|
97
|
-
$: session && setSession();
|
|
98
|
-
$: userid && setPlayerID();
|
|
99
|
-
</script>
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
<div class="TournamentList" part="TournamentList">
|
|
103
|
-
{#if !isLoading}
|
|
104
|
-
{#each tournamentList as tournament, i}
|
|
105
|
-
<casino-tournaments-thumbnail-controller
|
|
106
|
-
touridx={i+1}
|
|
107
|
-
session={session}
|
|
108
|
-
userid={userid}
|
|
109
|
-
endpoint={endpoint}
|
|
110
|
-
showdetails="true"
|
|
111
|
-
showslider="false"
|
|
112
|
-
tournamenturl={tournament.href}
|
|
113
|
-
maxwidth={tournamentList.length <= 2}
|
|
114
|
-
loginurl={loginurl}
|
|
115
|
-
loginevent={loginevent}
|
|
116
|
-
registerurl={registerurl}
|
|
117
|
-
registerevent={registerevent}
|
|
118
|
-
{lang}
|
|
119
|
-
{currency}
|
|
120
|
-
{keepbrowsercontext}
|
|
121
|
-
exportparts="Thumbnail, Status, Enrolled, CardImg, CardImgFinished, Details, Title, Date, ScoreCriteria, ScoreCriteriaP, ScoreCriteriaSpan, Games, GamesP, GamesAnchor, TournamentPrizes, TournamentPrizesSvg, a, TournamentPrizesSvgA, PrizesTitle, Prizes, Prize, PrizeText, PrizeRank,
|
|
122
|
-
TournamentDuration, TournamentDates, StartDate, EndDate, ProgressBar, ProgressBarFillEnd, Finished, ProgressBarFillStarting, Remaining, ProgressBarFill,
|
|
123
|
-
TournamentsGamesSlider, SliderNavButton, items, item, PlayNowButton, itemHover, SliderNavButton
|
|
124
|
-
TournamentCard, CardMaxWidth, CardFullSize, elementToFadeOut, elementToFadeIn, ph-item, ph-col-12, ph-picture, ph-row, ph-col-6, big, ph-col-4, empty, ph-col-8, TournamentButtons, LoginButton, RegisterButton, DetailsButton, EnrolledButton, JoinButton, JoinButtonSpan, JoinButtonSvg, JoinButtonSvgA, JoinButtonFullSize, spinner, DetailsLargeButton, ErrorText, StatusUnstarted, StatusRunning, StatusClosed, StatusClosing, TournamentPrizesIconSection, TournamentPrizesIconWrapper"
|
|
125
|
-
></casino-tournaments-thumbnail-controller>
|
|
126
|
-
{:else}
|
|
127
|
-
<p>{$_('tournamentsList.nothing')}</p>
|
|
128
|
-
{/each}
|
|
129
|
-
{/if}
|
|
130
|
-
</div>
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
<style lang="scss">
|
|
134
|
-
|
|
135
|
-
:host {
|
|
136
|
-
font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji';
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
*,
|
|
140
|
-
*::before,
|
|
141
|
-
*::after {
|
|
142
|
-
margin: 0;
|
|
143
|
-
padding: 0;
|
|
144
|
-
list-style: none;
|
|
145
|
-
text-decoration: none;
|
|
146
|
-
outline: none;
|
|
147
|
-
box-sizing: border-box;
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
$grid-gap: 32px;
|
|
151
|
-
$grid-cell-size: 480px;
|
|
152
|
-
|
|
153
|
-
.TournamentList {
|
|
154
|
-
width: 100%;
|
|
155
|
-
display: grid;
|
|
156
|
-
grid-template-columns: repeat(auto-fit, minmax(Min(380px, 100%), 1fr));
|
|
157
|
-
grid-auto-flow: dense;
|
|
158
|
-
gap: 25px;
|
|
159
|
-
|
|
160
|
-
}
|
|
161
|
-
</style>
|
|
1
|
+
<svelte:options tag={null} />
|
|
2
|
+
|
|
3
|
+
<script lang="ts">
|
|
4
|
+
import { onMount } from 'svelte';
|
|
5
|
+
import moment from 'moment';
|
|
6
|
+
import { _, addNewMessages } from './i18n';
|
|
7
|
+
import { TournamentsListTranslations } from './translations';
|
|
8
|
+
|
|
9
|
+
import '@everymatrix/casino-tournaments-thumbnail-controller';
|
|
10
|
+
|
|
11
|
+
export let session:String = '';
|
|
12
|
+
export let userid:String = '';
|
|
13
|
+
export let numberoftournaments:String = '6';
|
|
14
|
+
export let endpoint:String = '';
|
|
15
|
+
export let loginevent:String = '';
|
|
16
|
+
export let registerevent:String = '';
|
|
17
|
+
export let loginurl:String = '';
|
|
18
|
+
export let registerurl:String = '';
|
|
19
|
+
export let currency:String = '';
|
|
20
|
+
export let lang:String = 'en';
|
|
21
|
+
export let keepbrowsercontext:string = 'false';
|
|
22
|
+
|
|
23
|
+
let isLoading:Boolean = false;
|
|
24
|
+
let currentDate:any = moment(); // current day
|
|
25
|
+
// Variables of topics for communication
|
|
26
|
+
let isLoggedIn:Boolean = true;
|
|
27
|
+
let sessionID:String = '';
|
|
28
|
+
let playerID:String = '';
|
|
29
|
+
let tournamentList:any = '';
|
|
30
|
+
|
|
31
|
+
Object.keys(TournamentsListTranslations).forEach((item) => {
|
|
32
|
+
addNewMessages(item, TournamentsListTranslations[item]);
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
const messageHandler = (e:any) => {
|
|
36
|
+
if (e.data && e.data.type == 'TournamentList') {
|
|
37
|
+
tournamentList = [];
|
|
38
|
+
isLoading = true;
|
|
39
|
+
// Small hack to refresh the list
|
|
40
|
+
let finishedTournamentsCounter:number = 0;
|
|
41
|
+
|
|
42
|
+
tournamentList = e.data.tournamentList;
|
|
43
|
+
|
|
44
|
+
setTimeout(() => {
|
|
45
|
+
isLoading = false;
|
|
46
|
+
}, 10)
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
if (e.data && e.data.type == 'TournamentListShowMore') {
|
|
50
|
+
tournamentList = [...tournamentList, ...e.data.tournamentList]
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
if(e.data.type == 'UpdateTournamentView'){
|
|
54
|
+
if(!tournamentList){
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
let isNewTournament:boolean = tournamentList.filter( (item) =>{
|
|
58
|
+
return item.id == e.data.tournamentData.id;
|
|
59
|
+
}).length == 0;
|
|
60
|
+
if( isNewTournament ){
|
|
61
|
+
tournamentList.pop();
|
|
62
|
+
tournamentList=[e.data.tournamentData, ...tournamentList];
|
|
63
|
+
setTimeout(()=>{
|
|
64
|
+
tournamentList.forEach((item, idx)=>{
|
|
65
|
+
window.postMessage({ type: `UpdateSingleTournament_${idx+1}`, tournamentData: item }, window.location.href);
|
|
66
|
+
})
|
|
67
|
+
}, 100)
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
if (e.data && e.data.type == 'UserSessionID') {
|
|
71
|
+
isLoggedIn = true;
|
|
72
|
+
sessionID = e.data.session;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
const setSession = () => {
|
|
77
|
+
if (session.length > 0 && session != 'false') {
|
|
78
|
+
sessionID = session;
|
|
79
|
+
isLoggedIn = true;
|
|
80
|
+
} else {
|
|
81
|
+
isLoggedIn = false;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
const setPlayerID = () => {
|
|
86
|
+
playerID = userid;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
onMount(() => {
|
|
90
|
+
window.addEventListener('message', messageHandler, true);
|
|
91
|
+
|
|
92
|
+
return () => {
|
|
93
|
+
window.removeEventListener('message', messageHandler, true);
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
$: session && setSession();
|
|
98
|
+
$: userid && setPlayerID();
|
|
99
|
+
</script>
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
<div class="TournamentList" part="TournamentList">
|
|
103
|
+
{#if !isLoading}
|
|
104
|
+
{#each tournamentList as tournament, i}
|
|
105
|
+
<casino-tournaments-thumbnail-controller
|
|
106
|
+
touridx={i+1}
|
|
107
|
+
session={session}
|
|
108
|
+
userid={userid}
|
|
109
|
+
endpoint={endpoint}
|
|
110
|
+
showdetails="true"
|
|
111
|
+
showslider="false"
|
|
112
|
+
tournamenturl={tournament.href}
|
|
113
|
+
maxwidth={tournamentList.length <= 2}
|
|
114
|
+
loginurl={loginurl}
|
|
115
|
+
loginevent={loginevent}
|
|
116
|
+
registerurl={registerurl}
|
|
117
|
+
registerevent={registerevent}
|
|
118
|
+
{lang}
|
|
119
|
+
{currency}
|
|
120
|
+
{keepbrowsercontext}
|
|
121
|
+
exportparts="Thumbnail, Status, Enrolled, CardImg, CardImgFinished, Details, Title, Date, ScoreCriteria, ScoreCriteriaP, ScoreCriteriaSpan, Games, GamesP, GamesAnchor, TournamentPrizes, TournamentPrizesSvg, a, TournamentPrizesSvgA, PrizesTitle, Prizes, Prize, PrizeText, PrizeRank,
|
|
122
|
+
TournamentDuration, TournamentDates, StartDate, EndDate, ProgressBar, ProgressBarFillEnd, Finished, ProgressBarFillStarting, Remaining, ProgressBarFill,
|
|
123
|
+
TournamentsGamesSlider, SliderNavButton, items, item, PlayNowButton, itemHover, SliderNavButton
|
|
124
|
+
TournamentCard, CardMaxWidth, CardFullSize, elementToFadeOut, elementToFadeIn, ph-item, ph-col-12, ph-picture, ph-row, ph-col-6, big, ph-col-4, empty, ph-col-8, TournamentButtons, LoginButton, RegisterButton, DetailsButton, EnrolledButton, JoinButton, JoinButtonSpan, JoinButtonSvg, JoinButtonSvgA, JoinButtonFullSize, spinner, DetailsLargeButton, ErrorText, StatusUnstarted, StatusRunning, StatusClosed, StatusClosing, TournamentPrizesIconSection, TournamentPrizesIconWrapper"
|
|
125
|
+
></casino-tournaments-thumbnail-controller>
|
|
126
|
+
{:else}
|
|
127
|
+
<p>{$_('tournamentsList.nothing')}</p>
|
|
128
|
+
{/each}
|
|
129
|
+
{/if}
|
|
130
|
+
</div>
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
<style lang="scss">
|
|
134
|
+
|
|
135
|
+
:host {
|
|
136
|
+
font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji';
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
*,
|
|
140
|
+
*::before,
|
|
141
|
+
*::after {
|
|
142
|
+
margin: 0;
|
|
143
|
+
padding: 0;
|
|
144
|
+
list-style: none;
|
|
145
|
+
text-decoration: none;
|
|
146
|
+
outline: none;
|
|
147
|
+
box-sizing: border-box;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
$grid-gap: 32px;
|
|
151
|
+
$grid-cell-size: 480px;
|
|
152
|
+
|
|
153
|
+
.TournamentList {
|
|
154
|
+
width: 100%;
|
|
155
|
+
display: grid;
|
|
156
|
+
grid-template-columns: repeat(auto-fit, minmax(Min(380px, 100%), 1fr));
|
|
157
|
+
grid-auto-flow: dense;
|
|
158
|
+
gap: 25px;
|
|
159
|
+
|
|
160
|
+
}
|
|
161
|
+
</style>
|