@everymatrix/casino-categories 1.44.0 → 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/index.html DELETED
@@ -1,98 +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>casino-categories</title>
8
- <link rel="stylesheet" href="public/reset.css" />
9
- <script src="dist/casino-categories.js"></script>
10
- </head>
11
-
12
- <body>
13
- <style>
14
- html,
15
- body {
16
- margin: 0;
17
- padding: 0;
18
- height: 100%;
19
- font-family: "Helvetica Neue", "Helvetica", sans-serif;
20
- }
21
- .header {
22
- display: flex;
23
- justify-content: center;
24
- align-items: center;
25
- padding: 10px 20px;
26
- margin-bottom: 20px;
27
- background: #42a3e2;
28
- box-shadow: 3px 4px 5px 0px rgba(0, 0, 0, 0.2);
29
- }
30
- .header__logo svg {
31
- height: 50px;
32
- width: 50px;
33
- margin-right: 5px;
34
- }
35
- .header__name {
36
- color: #fff;
37
- }
38
- .header__name span {
39
- margin-right: 10px;
40
- font-weight: bold;
41
- }
42
- </style>
43
- <header class="header">
44
- <div class="header__logo">
45
- <svg
46
- xmlns="http://www.w3.org/2000/svg"
47
- width="161"
48
- height="132"
49
- viewBox="0 0 161 132"
50
- >
51
- <defs>
52
- <linearGradient x1="0%" y1="50%" y2="50%" id="a">
53
- <stop stop-color="#2A3B8F" offset="0%" />
54
- <stop stop-color="#29ABE2" offset="100%" />
55
- </linearGradient>
56
- <linearGradient x1="100%" y1="50%" x2="0%" y2="50%" id="c">
57
- <stop stop-color="#B4D44E" offset="0%" />
58
- <stop stop-color="#E7F716" offset="100%" />
59
- </linearGradient>
60
- </defs>
61
- <g fill="none" fill-rule="evenodd">
62
- <path
63
- fill="#166DA5"
64
- d="M160.6 65.9l-17.4 29.3-24.4-29.7 24.4-28.9z"
65
- />
66
- <path
67
- fill="#8FDB69"
68
- d="M141.3 100.2l-26.5-31.7-15.9 26.6 24.7 36.1z"
69
- />
70
- <path fill="#166DA5" d="M141 31.4l-26.2 31.8-15.9-26.6L123.6.9z" />
71
- <path
72
- fill="url(#a)"
73
- opacity=".95"
74
- d="M61.1 31.4H141L123.4.7H78.7z M114.8 63.3H159l-15.9-26.8H98.8"
75
- />
76
- <path
77
- fill="url(#c)"
78
- opacity=".95"
79
- d="M141.3 100.3H61l17.6 30.5h45z M114.8 68.4H159l-15.9 26.8H98.8"
80
- />
81
- <path
82
- fill="#010101"
83
- d="M78.6 130.8L41 65.8 79.1.8H37.9L.4 65.8l37.5 65z"
84
- />
85
- </g>
86
- </svg>
87
- </div>
88
- <h1 class="header__name"><span>WEBCOMPONENT:</span> casino-categories</h1>
89
- </header>
90
-
91
- <casino-categories
92
- endpoint="https://demo-api.stage.norway.everymatrix.com/v2/"
93
- datasource="RNG"
94
- activecategory="RNG$popular-games"
95
- excludedflags="vendor, collection"
96
- ></casino-categories>
97
- </body>
98
- </html>
package/index.js DELETED
@@ -1 +0,0 @@
1
- import './dist/casino-categories.js';
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-categories.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,197 +0,0 @@
1
- <svelte:options tag={null} />
2
- <script lang="ts">
3
- import { _, addNewMessages, setLocale } from './i18n';
4
- import { TRANSLATIONS } from './translations';
5
-
6
- export let endpoint:string = '';
7
- export let datasource:string = '';
8
- export let lang:string = 'en';
9
- export let activecategory:string = '';
10
- export let excludedflags:string = '';
11
- export let clientstyling:string = '';
12
- export let clientstylingurl:string = '';
13
- export let translationurl:string = '';
14
-
15
- let customStylingContainer:HTMLElement;
16
- let displayNone:boolean = false;
17
- let isLoading:boolean = false;
18
- const categories:Array<any> = [];
19
- let topCategories:Array<any> = [];
20
- let otherCategories:Array<any> = [];
21
-
22
- Object.keys(TRANSLATIONS).forEach((item:any):void => {
23
- addNewMessages(item, TRANSLATIONS[item]);
24
- });
25
-
26
- const setTranslationUrl = ():void => {
27
- let url:string = translationurl;
28
-
29
- fetch(url).then((res:any) => res.json())
30
- .then((res) => {
31
- Object.keys(res).forEach((item:any):void => {
32
- addNewMessages(item, res[item]);
33
- });
34
- }).catch((err:any) => {
35
- console.log(err);
36
- });
37
- }
38
-
39
- const getCategories = ():void => {
40
- isLoading = true;
41
-
42
- const url:URL = new URL(`${endpoint}/v1/casino/groups/${datasource}`);
43
-
44
- url.searchParams.append("language", lang);
45
-
46
- fetch(url)
47
- .then((res:any) => res.json())
48
- .then((data:any) => {
49
- isLoading = false;
50
- const excludedFlagsArray = excludedflags.split(',').map(flag => flag.trim());
51
-
52
- categories.push(...data.items)
53
-
54
- // remove those items which have a flag matching the excluded flags
55
- const itemsAfterFlagExclusion = categories.filter((item) => !excludedFlagsArray.some(flag => item.flags?.indexOf(flag) >= 0));
56
-
57
- topCategories = itemsAfterFlagExclusion.filter(category => category.isTopCategory === true)
58
- otherCategories = itemsAfterFlagExclusion.filter(category => category.isTopCategory === false)
59
- });
60
- }
61
-
62
- const openGameCategory = (categoryId:any):void => {
63
- window.postMessage({ type: 'OpenGameCategory', categoryId }, window.location.href);
64
- };
65
-
66
- const setActiveLanguage = ():void => {
67
- setLocale(lang);
68
- }
69
-
70
- const setClientStyling = ():void => {
71
- let sheet = document.createElement('style');
72
- sheet.innerHTML = clientstyling;
73
- customStylingContainer.appendChild(sheet);
74
- }
75
-
76
- const setClientStylingURL = ():void => {
77
- displayNone = true;
78
-
79
- let url:URL = new URL(clientstylingurl);
80
- let cssFile:HTMLElement = document.createElement('style');
81
-
82
- fetch(url.href)
83
- .then((res:any) => res.text())
84
- .then((data:any) => {
85
- cssFile.innerHTML = data;
86
-
87
- setTimeout(() => { customStylingContainer.appendChild(cssFile) }, 1);
88
- setTimeout(() => { displayNone = false; }, 500);
89
- });
90
- }
91
-
92
- $: endpoint && datasource && getCategories();
93
- $: translationurl && setTranslationUrl();
94
- $: lang && setActiveLanguage();
95
- $: clientstyling && customStylingContainer && setClientStyling();
96
- $: clientstylingurl && customStylingContainer && setClientStylingURL();
97
-
98
- </script>
99
- <div bind:this={customStylingContainer}>
100
- {#if isLoading}
101
- <p class="Message">Loading, please wait...</p>
102
- {:else}
103
- <div class="CasinoCategories">
104
- <h4 class="CategoryTitle">{$_('topCategories')}</h4>
105
- {#each topCategories as category}
106
- <div on:click={() => openGameCategory(category.id)} class="Category {activecategory === category.id ? "Active" : ""}">
107
- <img src={category.icon} alt="{category.name}" class="CategoryImage" >
108
- <div class="CategoryTextContainer">
109
- <p>{category.name}</p>
110
- <p>{category.games.count} {$_('games')}</p>
111
- </div>
112
- </div>
113
- {/each}
114
- <h4 class="CategoryTitle">{$_('otherCategories')}</h4>
115
- {#each otherCategories as category}
116
- <div on:click={() => openGameCategory(category.id)} class="Category {activecategory === category.id ? "Active" : ""}">
117
- <img src={category.icon} alt="{category.name}" class="CategoryImage">
118
- <div class="CategoryTextContainer">
119
- <p>{category.name}</p>
120
- <p>{category.games.count} {$_('games')}</p>
121
- </div>
122
- </div>
123
- {/each}
124
- </div>
125
- {/if}
126
- </div>
127
-
128
- <style lang="scss">
129
-
130
-
131
- *,
132
- *::before,
133
- *::after {
134
- margin: 0;
135
- padding: 0;
136
- box-sizing: border-box;
137
- }
138
-
139
- .CasinoCategories {
140
- display: flex;
141
- flex-direction: column;
142
- gap: 1rem;
143
- padding: 10px 60px;
144
- }
145
-
146
- .CategoryTitle {
147
- font-weight: 500;
148
- position: relative;
149
- right: 30px;
150
- margin: 10px 0;
151
- font-size: 18px;
152
- color: var(--emfe-w-casino-typography, var(--emfe-w-color-white, #FFFFFF));
153
- }
154
-
155
- .Category{
156
- border-radius: 7px;
157
- display: flex;
158
- align-items: center;
159
- gap: 16px;
160
- max-width: 300px;
161
- &.Active{
162
- box-shadow: 15px 15px 30px var(--emfe-w-color-gray-100, #E6E6E6);
163
- }
164
-
165
- &TextContainer {
166
- display: flex;
167
- flex-direction: column;
168
- justify-content: center;
169
- gap: 10px;
170
- font-size: 15px;
171
- color: var(--emfe-w-casino-typography, var(--emfe-w-color-white, #FFFFFF));
172
- & p:first-child {
173
- font-weight: 600;
174
- color: var(--emfe-w-casino-typography, var(--emfe-w-color-white, #FFFFFF));
175
- }
176
- & p:last-child {
177
- color: var(--emfe-w-color-gray-150, #828282);
178
- font-weight:300;
179
- }
180
- }
181
-
182
- &Image {
183
- border-radius: 4px;
184
- object-fit:cover;
185
- height: 64px;
186
- width: 64px;
187
- font-weight: 100;
188
- }
189
- }
190
- .Message {
191
- position: absolute;
192
- top: 50%;
193
- left: 50%;
194
- transform: translate(-50%, -50%);
195
- font-weight: 600;
196
- }
197
- </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
@@ -1,4 +0,0 @@
1
- import CasinoCategories from './CasinoCategories.svelte';
2
-
3
- !customElements.get('casino-categories') && customElements.define('casino-categories', CasinoCategories);
4
- export default CasinoCategories;
@@ -1,104 +0,0 @@
1
- export const TRANSLATIONS = {
2
- "en": {
3
- "topCategories": "Top Categories",
4
- "otherCategories": "Other Categories",
5
- "loading": "Loading, please wait...",
6
- "games": "games"
7
- },
8
- "zh-hk": {
9
- "topCategories": "热门类别",
10
- "otherCategories": "其他类别",
11
- "loading": "加载请稍候...",
12
- "games": "游戏"
13
- },
14
- "de": {
15
- "topCategories": "Top Kategorien",
16
- "otherCategories": "Andere Kategorien",
17
- "loading": "Es lädt, bitte warten...",
18
- "games": "Spiele"
19
- },
20
- "it": {
21
- "topCategories": "Top Categories",
22
- "otherCategories": "Other Categories",
23
- "loading": "Loading, please wait...",
24
- "games": "games"
25
- },
26
- "fr": {
27
- "topCategories": "Catégories principales",
28
- "otherCategories": "Autres catégories",
29
- "loading": "Chargement, veuillez patienter...",
30
- "games": "jeux"
31
- },
32
- "es": {
33
- "topCategories": "Categorias Top",
34
- "otherCategories": "Otras Categorias",
35
- "loading": "Cargando...",
36
- "games": "juegos"
37
- },
38
- "tr": {
39
- "topCategories": "En İyi Kategoriler",
40
- "otherCategories": "Diğer Kategoriler",
41
- "loading": "Yükleniyor, lütfen bekleyin...",
42
- "games": "oyunlar"
43
- },
44
- "ru": {
45
- "topCategories": "Top Categories",
46
- "otherCategories": "Other Categories",
47
- "loading": "Loading, please wait...",
48
- "games": "games"
49
- },
50
- "ro": {
51
- "topCategories": "Categorii de top",
52
- "otherCategories": "Alte categorii",
53
- "loading": "Se incarca, te rugam asteapta…",
54
- "games": "jocuri"
55
- },
56
- "hr": {
57
- "topCategories": "Najbolje kategorije",
58
- "otherCategories": "Ostale kategorije",
59
- "loading": "Učitavam",
60
- "games": "Igre"
61
- },
62
- "hu": {
63
- "topCategories": "Top Categories",
64
- "otherCategories": "Other Categories",
65
- "loading": "Loading, please wait...",
66
- "games": "games"
67
- },
68
- "pl": {
69
- "topCategories": "Top Categories",
70
- "otherCategories": "Other Categories",
71
- "loading": "Loading, please wait...",
72
- "games": "games"
73
- },
74
- "pt": {
75
- "topCategories": "Top Categories",
76
- "otherCategories": "Other Categories",
77
- "loading": "Loading, please wait...",
78
- "games": "games"
79
- },
80
- "sl": {
81
- "topCategories": "Top Categories",
82
- "otherCategories": "Other Categories",
83
- "loading": "Loading, please wait...",
84
- "games": "games"
85
- },
86
- "sr": {
87
- "topCategories": "Top Categories",
88
- "otherCategories": "Other Categories",
89
- "loading": "Loading, please wait...",
90
- "games": "games"
91
- },
92
- "pt-br": {
93
- "topCategories": "Categorias Principais",
94
- "otherCategories": "Outras Categorias",
95
- "Loading": "Carregando, por favor espere...",
96
- "games": "jogos"
97
- },
98
- "es-mx": {
99
- "topCategories": "Categorias Principales",
100
- "otherCategories": "Otras Categorias",
101
- "Loading": "Cargando, por favor espere...",
102
- "games": "juegos"
103
- }
104
- }
@@ -1,13 +0,0 @@
1
- import { html } from 'lit-element';
2
-
3
- import CasinoCategories from '../src/CasinoCategories';
4
-
5
- // This default export determines where your story goes in the story list
6
- export default {
7
- title: 'CasinoCategories',
8
- };
9
-
10
- // 👇 We create a “template” of how args map to rendering
11
- const CasinoCategories = ({ aProperty }) => html`<casino-categories></casino-categories>`;
12
-
13
- export const FirstStory = CasinoCategories.bind({});
package/tsconfig.json DELETED
@@ -1,6 +0,0 @@
1
- {
2
- "extends": "@tsconfig/svelte/tsconfig.json",
3
-
4
- "include": ["src/**/*"],
5
- "exclude": ["node_modules/*", "__sapper__/*", "public/*"]
6
- }