@everymatrix/casino-most-played-section 1.43.4 → 1.45.0
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/components/CasinoFilter-BA6RsRdQ.js +4975 -0
- package/components/CasinoFilter-BcZN9Fwc.cjs +5 -0
- package/components/CasinoGameThumbnail-DP_N0Utt.js +4404 -0
- package/components/CasinoGameThumbnail-KSNIbeh_.cjs +47 -0
- package/components/CasinoGamesCategorySection-BqPidgQt.js +3022 -0
- package/components/CasinoGamesCategorySection-C-EDsc7x.cjs +1 -0
- package/components/CasinoMostPlayedSection-DItMviDj.js +595 -0
- package/components/CasinoMostPlayedSection-Dh2nzc19.cjs +1 -0
- package/components/CasinoSort-Cj2B7na1.cjs +1 -0
- package/components/CasinoSort-D-ElrcU-.js +425 -0
- package/es2015/casino-most-played-section.cjs +1 -0
- package/es2015/casino-most-played-section.js +16 -0
- package/package.json +17 -32
- package/CHANGELOG.md +0 -7
- package/README.md +0 -30
- package/dist/casino-most-played-section.js +0 -1466
- package/dist/casino-most-played-section.js.map +0 -1
- package/index.html +0 -37
- package/index.js +0 -1
- package/public/favicon.png +0 -0
- package/public/reset.css +0 -48
- package/rollup.config.js +0 -59
- package/src/CasinoMostPlayedSection.svelte +0 -232
- package/src/i18n.js +0 -27
- package/src/index.ts +0 -4
- package/src/translations.js +0 -53
- package/stories/CasinoMostPlayedSection.stories.js +0 -13
- package/tsconfig.json +0 -6
package/index.html
DELETED
@@ -1,37 +0,0 @@
|
|
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-most-played-section
|
9
|
-
</title>
|
10
|
-
<link rel="stylesheet" href="public/reset.css">
|
11
|
-
<script src='dist/casino-most-played-section.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-most-played-section
|
29
|
-
</h1>
|
30
|
-
</header>
|
31
|
-
|
32
|
-
<div class="webcomponent">
|
33
|
-
<casino-most-played-section></casino-most-played-section>
|
34
|
-
</div>
|
35
|
-
|
36
|
-
</body>
|
37
|
-
</html>
|
package/index.js
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
import './dist/casino-most-played-section.js';
|
package/public/favicon.png
DELETED
Binary file
|
package/public/reset.css
DELETED
@@ -1,48 +0,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
|
-
}
|
package/rollup.config.js
DELETED
@@ -1,59 +0,0 @@
|
|
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
|
-
const production = process.env.NODE_ENV === 'production';
|
10
|
-
const dev = process.env.NODE_ENV === 'development';
|
11
|
-
|
12
|
-
export default {
|
13
|
-
input: 'src/index.ts',
|
14
|
-
output: {
|
15
|
-
sourcemap: true,
|
16
|
-
format: 'umd',
|
17
|
-
name: 'app',
|
18
|
-
file: 'dist/casino-most-played-section.js'
|
19
|
-
},
|
20
|
-
plugins: [
|
21
|
-
svelte({
|
22
|
-
preprocess: sveltePreprocess(),
|
23
|
-
compilerOptions: {
|
24
|
-
// enable run-time checks when not in production
|
25
|
-
customElement: true,
|
26
|
-
dev: !production
|
27
|
-
}
|
28
|
-
}),
|
29
|
-
commonjs(),
|
30
|
-
resolve({
|
31
|
-
browser: true,
|
32
|
-
dedupe: ['svelte']
|
33
|
-
}),
|
34
|
-
dev && serve({
|
35
|
-
open: true,
|
36
|
-
verbose: true,
|
37
|
-
allowCrossOrigin: true,
|
38
|
-
historyApiFallback: false,
|
39
|
-
host: 'localhost',
|
40
|
-
port: 5050,
|
41
|
-
}),
|
42
|
-
dev && livereload({ watch: ['', 'dist'] }),
|
43
|
-
typescript({
|
44
|
-
sourceMap: !production,
|
45
|
-
inlineSources: !production,
|
46
|
-
}),
|
47
|
-
// If we're building for production (npm run build
|
48
|
-
// instead of npm run dev), minify
|
49
|
-
production &&
|
50
|
-
terser({
|
51
|
-
output: {
|
52
|
-
comments: "all"
|
53
|
-
},
|
54
|
-
})
|
55
|
-
],
|
56
|
-
watch: {
|
57
|
-
clearScreen: false
|
58
|
-
}
|
59
|
-
};
|
@@ -1,232 +0,0 @@
|
|
1
|
-
<svelte:options tag={null} />
|
2
|
-
<script lang="ts">
|
3
|
-
|
4
|
-
import { getDevice } from 'rvhelper';
|
5
|
-
import { _, setLocale, addNewMessages } from './i18n';
|
6
|
-
import { TRANSLATIONS } from './translations';
|
7
|
-
import '@everymatrix/casino-games-category-section'
|
8
|
-
|
9
|
-
export let endpoint:string = '';
|
10
|
-
export let datasource:string = '';
|
11
|
-
export let currency:string = '';
|
12
|
-
export let lang:string = ''; // Language
|
13
|
-
export let session:string = ''; // Value for sessionID
|
14
|
-
export let userid:string = ''; // Value for UserID;
|
15
|
-
export let clientstyling:string = '';
|
16
|
-
export let clientstylingurl:string = '';
|
17
|
-
|
18
|
-
export let livecasino:string = 'false';
|
19
|
-
export let integratedgameframemobile:string = 'false';
|
20
|
-
export let integratedgameframedesktop:string = 'false';
|
21
|
-
export let gamepagemodalurl:string = 'false';
|
22
|
-
export let showgamename:string = '';
|
23
|
-
export let visiblegames:string;
|
24
|
-
export let favorites:string = '';
|
25
|
-
export let translationurl:string = '';
|
26
|
-
export let casinomygames:string = 'false';
|
27
|
-
export let mostplayedperiod:string = 'Last30Days';
|
28
|
-
export let mostplayedrounds: string = '10';
|
29
|
-
export let fetchviaevent:string = 'true';
|
30
|
-
|
31
|
-
|
32
|
-
let userAgent:any = window.navigator.userAgent;
|
33
|
-
let lobbyView:boolean = false;
|
34
|
-
|
35
|
-
const setTranslationUrl = ():void => {
|
36
|
-
let url:string = translationurl;
|
37
|
-
|
38
|
-
fetch(url).then((res:any) => res.json())
|
39
|
-
.then((res) => {
|
40
|
-
Object.keys(res).forEach((item:any):void => {
|
41
|
-
addNewMessages(item, res[item]);
|
42
|
-
});
|
43
|
-
}).catch((err:any) => {
|
44
|
-
console.log(err);
|
45
|
-
});
|
46
|
-
}
|
47
|
-
|
48
|
-
Object.keys(TRANSLATIONS).forEach((item) => {
|
49
|
-
addNewMessages(item, TRANSLATIONS[item]);
|
50
|
-
});
|
51
|
-
|
52
|
-
let mostPlayedGames:Array<any> = [];
|
53
|
-
let playerID:string;
|
54
|
-
let urlCasino:any;
|
55
|
-
let activeCategory:string;
|
56
|
-
let isLoading:boolean = false;
|
57
|
-
let mostPlayedEmpty:boolean = false;
|
58
|
-
|
59
|
-
let customStylingContainer:HTMLElement;
|
60
|
-
|
61
|
-
const getMostPlayedGames = (options:any) => {
|
62
|
-
let url = new URL(`${endpoint}/v1/player/${userid}/games/most-played`);
|
63
|
-
|
64
|
-
if (options.limit) {
|
65
|
-
url.searchParams.append('limit', options.limit);
|
66
|
-
}
|
67
|
-
|
68
|
-
if (options.order) {
|
69
|
-
url.searchParams.append('order', options.order);
|
70
|
-
}
|
71
|
-
|
72
|
-
url.searchParams.append('expand', 'games')
|
73
|
-
|
74
|
-
url.searchParams.append('period', mostplayedperiod);
|
75
|
-
|
76
|
-
let device = options.device;
|
77
|
-
|
78
|
-
if (device) {
|
79
|
-
if (device === 'PC') {
|
80
|
-
url.searchParams.append('device', 'Desktop');
|
81
|
-
} else {
|
82
|
-
url.searchParams.append('device', 'Mobile');
|
83
|
-
}
|
84
|
-
} else {
|
85
|
-
url.searchParams.append('device', 'All');
|
86
|
-
}
|
87
|
-
|
88
|
-
if (options.rounds) {
|
89
|
-
url.searchParams.append('rounds', options.rounds);
|
90
|
-
}
|
91
|
-
|
92
|
-
urlCasino = livecasino ? url : url.href;
|
93
|
-
return new Promise((resolve, reject) => {
|
94
|
-
fetch(urlCasino)
|
95
|
-
.then((res:any) => res.json())
|
96
|
-
.then((data:any) => {
|
97
|
-
|
98
|
-
data.items = data.items.filter((item):boolean => {
|
99
|
-
let dataGameCode: boolean = true;
|
100
|
-
if (item.gameCode == 'OddsMatrix2') {
|
101
|
-
data.count--;
|
102
|
-
dataGameCode = false;
|
103
|
-
} return dataGameCode;
|
104
|
-
});
|
105
|
-
|
106
|
-
resolve(data);
|
107
|
-
|
108
|
-
}).catch((err:any) => {
|
109
|
-
console.error(err);
|
110
|
-
|
111
|
-
reject(err);
|
112
|
-
});
|
113
|
-
});
|
114
|
-
}
|
115
|
-
|
116
|
-
isLoading = true;
|
117
|
-
|
118
|
-
const initialLoad = (): void => {
|
119
|
-
getMostPlayedGames({
|
120
|
-
limit: 100,
|
121
|
-
device: getDevice(userAgent),
|
122
|
-
rounds: mostplayedrounds
|
123
|
-
}).then((res:any) => {
|
124
|
-
isLoading = false;
|
125
|
-
if (res.count > 0) {
|
126
|
-
let promises:any = [];
|
127
|
-
|
128
|
-
res.items.forEach((item:any) => {
|
129
|
-
let url:URL = new URL(`${endpoint}/v1/casino/games/${item.gameId}`);
|
130
|
-
|
131
|
-
url.searchParams.append('datasource', datasource);
|
132
|
-
if (livecasino) {
|
133
|
-
promises.push(fetch(url.href).then((res:any) => res.json()));
|
134
|
-
} else {
|
135
|
-
promises.push(fetch(url.href).then((res:any) => res.json()));
|
136
|
-
}
|
137
|
-
});
|
138
|
-
|
139
|
-
Promise.all(promises).then((values) => {
|
140
|
-
mostPlayedGames = values.filter((item) => !('error' in item)).map((item) => item[0]);
|
141
|
-
|
142
|
-
if (casinomygames === "true") {
|
143
|
-
mostPlayedGames = mostPlayedGames.slice(0, JSON.parse(visiblegames));
|
144
|
-
}
|
145
|
-
|
146
|
-
window.postMessage({ type: 'MostPlayedData', mostPlayedGames }, window.location.href);
|
147
|
-
});
|
148
|
-
} else {
|
149
|
-
mostPlayedEmpty = true;
|
150
|
-
}
|
151
|
-
});
|
152
|
-
}
|
153
|
-
|
154
|
-
const setActiveLanguage = ():void => {
|
155
|
-
setLocale(lang);
|
156
|
-
}
|
157
|
-
|
158
|
-
const setClientStyling = () => {
|
159
|
-
let sheet = document.createElement('style');
|
160
|
-
sheet.innerHTML = clientstyling;
|
161
|
-
customStylingContainer.appendChild(sheet);
|
162
|
-
}
|
163
|
-
|
164
|
-
const setClientStylingURL = () => {
|
165
|
-
let cssFile:HTMLElement = document.createElement('style');
|
166
|
-
|
167
|
-
fetch(new URL(clientstylingurl))
|
168
|
-
.then((res:any) => res.text())
|
169
|
-
.then((data:any) => {
|
170
|
-
cssFile.innerHTML = data
|
171
|
-
|
172
|
-
setTimeout(() => { customStylingContainer.appendChild(cssFile); }, 1);
|
173
|
-
});
|
174
|
-
}
|
175
|
-
|
176
|
-
$: endpoint && userid && lang && initialLoad();
|
177
|
-
$: clientstyling && customStylingContainer && setClientStyling();
|
178
|
-
$: clientstylingurl && customStylingContainer && setClientStylingURL();
|
179
|
-
$: translationurl && setTranslationUrl();
|
180
|
-
$: lang && setActiveLanguage();
|
181
|
-
</script>
|
182
|
-
|
183
|
-
<div class="CasinoGamesCategorySectionContainer" bind:this={customStylingContainer}>
|
184
|
-
<div class="casino-most-played-section">
|
185
|
-
{#if mostPlayedEmpty}
|
186
|
-
<p class="SearchLoading">{$_('noGames')}</p>
|
187
|
-
{:else}
|
188
|
-
<casino-games-category-section
|
189
|
-
session={session}
|
190
|
-
userid={userid}
|
191
|
-
endpoint={endpoint}
|
192
|
-
datasource={datasource}
|
193
|
-
lang={lang}
|
194
|
-
currency={currency}
|
195
|
-
favorites={favorites}
|
196
|
-
fetchviaevent={fetchviaevent}
|
197
|
-
categoryid="MOSTPLAYED"
|
198
|
-
categoryindex="1"
|
199
|
-
categorygames="9"
|
200
|
-
class="CategoryContainer"
|
201
|
-
{showgamename}
|
202
|
-
{clientstyling}
|
203
|
-
{clientstylingurl}
|
204
|
-
{livecasino}
|
205
|
-
{visiblegames}
|
206
|
-
{gamepagemodalurl}
|
207
|
-
{integratedgameframedesktop}
|
208
|
-
{integratedgameframemobile}
|
209
|
-
{casinomygames} />
|
210
|
-
{/if}
|
211
|
-
</div>
|
212
|
-
</div>
|
213
|
-
|
214
|
-
<style lang="scss">
|
215
|
-
|
216
|
-
|
217
|
-
*,
|
218
|
-
*::before,
|
219
|
-
*::after {
|
220
|
-
margin: 0;
|
221
|
-
padding: 0;
|
222
|
-
list-style: none;
|
223
|
-
text-decoration: none;
|
224
|
-
outline: none;
|
225
|
-
box-sizing: border-box;
|
226
|
-
}
|
227
|
-
|
228
|
-
.casino-most-played-section {
|
229
|
-
background: var(--emfe-w-casino-color-bg, var(--emfe-w-color-background, #07072A));
|
230
|
-
color: var(--emfe-w-casino-typography, var(--emfe-w-color-white, #FFFFFF));
|
231
|
-
}
|
232
|
-
</style>
|
package/src/i18n.js
DELETED
@@ -1,27 +0,0 @@
|
|
1
|
-
import {
|
2
|
-
dictionary,
|
3
|
-
locale,
|
4
|
-
addMessages,
|
5
|
-
_
|
6
|
-
} from 'svelte-i18n';
|
7
|
-
|
8
|
-
function setupI18n({ withLocale: _locale, translations }) {
|
9
|
-
locale.subscribe((data) => {
|
10
|
-
if (data == null) {
|
11
|
-
dictionary.set(translations);
|
12
|
-
locale.set(_locale);
|
13
|
-
}
|
14
|
-
}); // maybe we will need this to make sure that the i18n is set up only once
|
15
|
-
/*dictionary.set(translations);
|
16
|
-
locale.set(_locale);*/
|
17
|
-
}
|
18
|
-
|
19
|
-
function addNewMessages(lang, dict) {
|
20
|
-
addMessages(lang, dict);
|
21
|
-
}
|
22
|
-
|
23
|
-
function setLocale(_locale) {
|
24
|
-
locale.set(_locale);
|
25
|
-
}
|
26
|
-
|
27
|
-
export { _, setupI18n, addNewMessages, setLocale };
|
package/src/index.ts
DELETED
package/src/translations.js
DELETED
@@ -1,53 +0,0 @@
|
|
1
|
-
export const TRANSLATIONS = {
|
2
|
-
"en": {
|
3
|
-
"noGames": "No games in most played"
|
4
|
-
},
|
5
|
-
"zh-hk": {
|
6
|
-
"noGames": "No games in most played"
|
7
|
-
},
|
8
|
-
"de": {
|
9
|
-
"noGames": "No games in most played"
|
10
|
-
},
|
11
|
-
"it": {
|
12
|
-
"noGames": "No games in most played"
|
13
|
-
},
|
14
|
-
"fr": {
|
15
|
-
"noGames": "No games in most played"
|
16
|
-
},
|
17
|
-
"es": {
|
18
|
-
"noGames": "No hay juegos en más jugados."
|
19
|
-
},
|
20
|
-
"tr": {
|
21
|
-
"noGames": "En çok oynananlarda oyun yok"
|
22
|
-
},
|
23
|
-
"ru": {
|
24
|
-
"noGames": "No games in most played"
|
25
|
-
},
|
26
|
-
"ro": {
|
27
|
-
"noGames": "No games in most played"
|
28
|
-
},
|
29
|
-
"hr": {
|
30
|
-
"noGames": "Nema igara u najigranijim"
|
31
|
-
},
|
32
|
-
"hu": {
|
33
|
-
"noGames": "No games in most played"
|
34
|
-
},
|
35
|
-
"pl": {
|
36
|
-
"noGames": "No games in most played"
|
37
|
-
},
|
38
|
-
"pt": {
|
39
|
-
"noGames": "No games in most played"
|
40
|
-
},
|
41
|
-
"sl": {
|
42
|
-
"noGames": "No games in most played"
|
43
|
-
},
|
44
|
-
"sr": {
|
45
|
-
"noGames": "No games in most played"
|
46
|
-
},
|
47
|
-
"pt-br": {
|
48
|
-
"noGames": "Não há jogos nos mais jogados"
|
49
|
-
},
|
50
|
-
"es-mx": {
|
51
|
-
"noGames": "No hay juegos en los más jugados"
|
52
|
-
}
|
53
|
-
}
|
@@ -1,13 +0,0 @@
|
|
1
|
-
import { html } from 'lit-element';
|
2
|
-
|
3
|
-
import CasinoMostPlayedSection from '../src/CasinoMostPlayedSection';
|
4
|
-
|
5
|
-
// This default export determines where your story goes in the story list
|
6
|
-
export default {
|
7
|
-
title: 'CasinoMostPlayedSection',
|
8
|
-
};
|
9
|
-
|
10
|
-
// 👇 We create a “template” of how args map to rendering
|
11
|
-
const CasinoMostPlayedSection = ({ aProperty }) => html`<casino-most-played-section></casino-most-played-section>`;
|
12
|
-
|
13
|
-
export const FirstStory = CasinoMostPlayedSection.bind({});
|