@everymatrix/casino-random-game 0.0.257

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 ADDED
@@ -0,0 +1,41 @@
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-random-game
9
+ </title>
10
+ <link rel="stylesheet" href="public/reset.css">
11
+ <script src='dist/casino-random-game.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-random-game
29
+ </h1>
30
+ </header>
31
+
32
+ <div class="webcomponent">
33
+ <casino-random-game
34
+ endpoint="https://demo-api.stage.norway.everymatrix.com/v1"
35
+ datasource="RNG"
36
+ gameevent="ShowGameModal"
37
+ ></casino-random-game>
38
+ </div>
39
+
40
+ </body>
41
+ </html>
package/index.js ADDED
@@ -0,0 +1 @@
1
+ import './dist/casino-random-game.js';
package/package.json ADDED
@@ -0,0 +1,40 @@
1
+ {
2
+ "name": "@everymatrix/casino-random-game",
3
+ "version": "0.0.257",
4
+ "main": "dist/casino-random-game.js",
5
+ "svelte": "src/index.ts",
6
+ "scripts": {
7
+ "start": "sirv public",
8
+ "build": "cross-env NODE_ENV=\"production\" && rollup -c",
9
+ "dev": "cross-env NODE_ENV=\"development\" rollup -c -w",
10
+ "validate": "svelte-check",
11
+ "test": "echo"
12
+ },
13
+ "devDependencies": {
14
+ "@rollup/plugin-babel": "^5.3.0",
15
+ "@rollup/plugin-commonjs": "^16.0.0",
16
+ "@rollup/plugin-node-resolve": "^10.0.0",
17
+ "@rollup/plugin-typescript": "^6.0.0",
18
+ "@tsconfig/svelte": "^1.0.0",
19
+ "node-sass": "^5.0.0",
20
+ "rollup": "^2.3.4",
21
+ "rollup-plugin-dev-server": "^0.4.3",
22
+ "rollup-plugin-livereload": "^2.0.0",
23
+ "rollup-plugin-svelte": "^7.0.0",
24
+ "rollup-plugin-terser": "^7.0.0",
25
+ "rollup-plugin-uglify": "^6.0.4",
26
+ "svelte-check": "^1.0.0",
27
+ "svelte-preprocess": "^4.0.0",
28
+ "tslib": "^2.0.0",
29
+ "typescript": "^3.9.3"
30
+ },
31
+ "dependencies": {
32
+ "cross-env": "^7.0.3",
33
+ "sirv-cli": "^1.0.0",
34
+ "svelte": "^3.0.0"
35
+ },
36
+ "publishConfig": {
37
+ "access": "public"
38
+ },
39
+ "gitHead": "fb390d6a11e469b9d59db7cf11f59937a32a2555"
40
+ }
Binary file
@@ -0,0 +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;
48
+ }
@@ -0,0 +1,59 @@
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-random-game.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
+ };
@@ -0,0 +1,321 @@
1
+ <svelte:options tag={null} />
2
+
3
+ <script lang="ts">
4
+ import { getDevice } from 'rvhelper';
5
+ import { _, setupI18n, addNewMessages, setLocale } from './i18n';
6
+ import { CasinoRandomGameTranslations } from './translations';
7
+
8
+ export let endpoint:string = '';
9
+ export let datasource:string = '';
10
+ export let gameevent:string = '';
11
+ export let lang:string = '';
12
+
13
+ let games:any = [];
14
+ let randomGame:any = '';
15
+ let gamesToShow:any;
16
+ let show:boolean = false;
17
+ let offset:number = 0;
18
+ let count:number = 0;
19
+ let slotDone:boolean = false;
20
+
21
+ let userAgent:string = window.navigator.userAgent;
22
+
23
+ // setupI18n({ withLocale: 'en', translations: {}});
24
+
25
+ Object.keys(CasinoRandomGameTranslations).forEach((item:any) => {
26
+ addNewMessages(item, CasinoRandomGameTranslations[item]);
27
+ });
28
+
29
+ const getRandomGame = ():void => {
30
+ offset = 0;
31
+ count = 0;
32
+ slotDone = false;
33
+ randomGame = games[Math.floor(Math.random() * games.length)];
34
+ show = true;
35
+
36
+ let interval = setInterval(() => {
37
+ offset -= 100;
38
+ count++;
39
+
40
+ if (count == 20) {
41
+ slotDone = true;
42
+ clearInterval(interval);
43
+ }
44
+ }, 100);
45
+ }
46
+
47
+ const playGame = ():void => {
48
+ window.postMessage({ type: gameevent, gameId: randomGame.gId }, window.location.href);
49
+ show = false;
50
+ }
51
+
52
+ const closeModal = ():void => {
53
+ show = false;
54
+ }
55
+
56
+ const fetchGameList = ():void => {
57
+ let url = new URL(`${endpoint}/casino/games`);
58
+
59
+ url.searchParams.append('platform', getDevice(userAgent));
60
+ url.searchParams.append('datasource', datasource);
61
+ url.searchParams.append('fields', 'gId,href,thumbnail,name,vendor')
62
+ url.searchParams.append('expand', 'vendor');
63
+
64
+ fetch(url.href)
65
+ .then((res:any) => res.json())
66
+ .then((data:any) => {
67
+ games = data.items;
68
+ gamesToShow = games.slice(0, 19);
69
+ })
70
+ }
71
+
72
+ const initialLoad = () => {
73
+ setLocale(lang);
74
+ }
75
+
76
+ $: lang && initialLoad();
77
+ $:endpoint && datasource && fetchGameList();
78
+ </script>
79
+
80
+ <div part="CustomStylingContainer">
81
+ <div>
82
+ {#if show}
83
+ <div class="ModalWindow" part="ModalWindow">
84
+ <div class="ModalContainer" part="ModalContainer" >
85
+ <span class="ModalCloseBtn" part="ModalCloseBtn" on:click={closeModal} role="button">
86
+ <slot name="close">
87
+ <svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"></path></svg>
88
+ </slot>
89
+ </span>
90
+
91
+ {#if !slotDone}
92
+ <div class="RandomGameWrapper" part="RandomGameWrapper">
93
+ <main class="RandomGamesSliderWrapper" part="RandomGamesSliderWrapper">
94
+ <div class="items" part="items" style="transform: translateY({offset}px);">
95
+ {#each gamesToShow as game, i}
96
+ <div class="item" part="item">
97
+ <img class="RandomGameImage" part="RandomGameImage" src={game.thumbnail} alt={game.name} title={game.name}/>
98
+ </div>
99
+ {/each}
100
+ </div>
101
+ </main>
102
+ <p class="RandomGameLoading" part="RandomGameLoading">{$_('randomGame.randomGameLoading')}</p>
103
+ </div>
104
+ {/if}
105
+
106
+ {#if slotDone}
107
+ <div class="RandomGameWrapper" part="RandomGameWrapper">
108
+ <div class="item" part="item">
109
+ <img class="RandomGameImage" part="RandomGameImage" src={randomGame.thumbnail} alt={randomGame.name} title={randomGame.name}/>
110
+ <button class="RandomTryAgain" part="RandomTryAgain" on:click={() => getRandomGame()}>
111
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" id="Layer_1" x="0px" y="0px" viewBox="0 0 200 200" style="enable-background:new 0 0 200 200;" xml:space="preserve">
112
+ <style type="text/css">
113
+ .st0{fill:var(--emfe-w-color-white, #FFFFFF);;}
114
+ </style>
115
+ <path class="st0" d="M162.4,161.2C145.3,178.5,122.7,187,100,187c-19.1,0-38.2-6.2-54-18.4l2.2,24c0.4,3.6-2.4,6.9-6,7.3h-0.7 c-3.3,0-6.2-2.7-6.7-6l-3.8-41.1c-0.4-3.6,2.4-6.9,6-7.3l40.9-3.8c3.6-0.4,6.9,2.4,7.3,6c0.4,3.6-2.4,6.9-6,7.3l-26,2.4 c29.3,23.3,72.4,21.6,99.5-5.6c19.8-19.8,26.9-48.7,18.4-75.3c-1.1-3.6,0.9-7.3,4.4-8.4c3.6-1.1,7.3,0.9,8.4,4.4 C194,103.9,185.8,137.9,162.4,161.2L162.4,161.2z M47.1,47.9c27.1-27.1,70.2-29.1,99.5-5.6l-26,2.4c-3.6,0.4-6.4,3.6-6,7.3 c0.2,3.6,3.3,6,6.7,6h0.7l40.9-3.8c3.6-0.4,6.4-3.6,6-7.3l-4-41.1c-0.4-3.6-3.6-6.4-7.3-6c-3.6,0.4-6.4,3.6-6,7.3l2.2,24 C119.3,4.4,69.3,6.8,37.6,38.6C14.2,61.9,6,95.9,15.8,127.2c0.9,2.9,3.6,4.7,6.4,4.7c0.7,0,1.3,0,2-0.2c3.6-1.1,5.6-4.9,4.4-8.4 C20.2,96.6,27.4,67.7,47.1,47.9L47.1,47.9z"/>
116
+ </svg>
117
+ </button>
118
+ </div>
119
+ <div class="RandomGameDetails" part="RandomGameDetails">
120
+ <p class="RandomGameTitle" part="RandomGameTitle">{randomGame.name}</p>
121
+ <p class="RandomGameVendor" part="RandomGameVendor">{randomGame.vendor.name}</p>
122
+ <button class="RandomGamePlay" part="RandomGamePlay" on:click={() => playGame()}>{$_('randomGame.playNowRandomGame')}</button>
123
+ </div>
124
+ </div>
125
+ {/if}
126
+
127
+ </div>
128
+ </div>
129
+ {/if}
130
+ <div class="RandomButtonWrapper" part="RandomButtonWrapper">
131
+ <button class="RandomButton" part="RandomButton" on:click={() => getRandomGame()}>
132
+ <span>{$_('randomGame.playRandomGame')}</span>
133
+ <span>
134
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" id="Layer_1" x="0px" y="0px" viewBox="0 0 200 200" style="enable-background:new 0 0 200 200;" xml:space="preserve">
135
+ <style type="text/css">
136
+ .st0{fill-rule:evenodd;clip-rule:evenodd;fill:var(--emfe-w-color-white, #FFFFFF);;}
137
+ </style>
138
+ <path class="st0" d="M161,16.7c-2.7,0-5.5,0.5-8.1,1.6l-44.2,18.3C98.1,41,93,53.2,97.4,63.8l18.3,44.2 c4.4,10.6,16.6,15.7,27.2,11.3l44.2-18.3c10.6-4.4,15.7-16.6,11.3-27.2l-18.3-44.2C176.8,21.6,169.1,16.7,161,16.7L161,16.7z M161,25c4.9,0,9.4,2.9,11.4,7.8l18.3,44.2c2.7,6.5-0.3,13.7-6.8,16.3l-44.2,18.3c-6.5,2.7-13.7-0.3-16.3-6.8l-18.3-44.2 c-2.7-6.5,0.3-13.7,6.8-16.3L156.1,26C157.7,25.3,159.4,25,161,25L161,25z M127.1,54.2c-1.7,0-3.2,0.7-4.4,1.8 c-1.2,1.2-1.8,2.8-1.8,4.4s0.7,3.2,1.8,4.4c1.2,1.2,2.8,1.8,4.4,1.8s3.2-0.7,4.4-1.8c1.2-1.2,1.8-2.8,1.8-4.4s-0.7-3.2-1.8-4.4 C130.3,54.8,128.7,54.2,127.1,54.2z M147.9,62.5c-1.7,0-3.2,0.7-4.4,1.8c-1.2,1.2-1.8,2.8-1.8,4.4s0.7,3.2,1.8,4.4 c1.2,1.2,2.8,1.8,4.4,1.8s3.2-0.7,4.4-1.8c1.2-1.2,1.8-2.8,1.8-4.4s-0.7-3.2-1.8-4.4C151.2,63.2,149.6,62.5,147.9,62.5z M168.8,70.8 c-1.7,0-3.2,0.7-4.4,1.8c-1.2,1.2-1.8,2.8-1.8,4.4s0.7,3.2,1.8,4.4c1.2,1.2,2.8,1.8,4.4,1.8s3.2-0.7,4.4-1.8 c1.2-1.2,1.8-2.8,1.8-4.4s-0.7-3.2-1.8-4.4C172,71.5,170.4,70.8,168.8,70.8L168.8,70.8z M39,79.2c-8.1,0.1-15.8,4.9-19.1,12.9 L1.6,136.2c-4.4,10.6,0.7,22.8,11.3,27.2l44.2,18.3c10.6,4.4,22.8-0.7,27.2-11.3l18.3-44.2c4.4-10.6-0.7-22.8-11.3-27.2L47.1,80.8 C44.5,79.7,41.7,79.1,39,79.2L39,79.2z M39,87.5c1.6,0,3.3,0.3,4.9,1l44.2,18.3c6.5,2.7,9.4,9.9,6.8,16.3l-18.3,44.2 c-2.7,6.5-9.9,9.4-16.3,6.8l-44.2-18.3c-6.5-2.7-9.4-9.9-6.8-16.3l18.3-44.2C29.6,90.4,34.1,87.5,39,87.5L39,87.5z M44.7,99.4 c-1.7,0-3.2,0.7-4.4,1.8c-1.2,1.2-1.8,2.8-1.8,4.4c0,1.7,0.7,3.2,1.8,4.4c1.2,1.2,2.8,1.8,4.4,1.8s3.2-0.7,4.4-1.8 c1.2-1.2,1.8-2.8,1.8-4.4c0-1.7-0.7-3.2-1.8-4.4C47.9,100,46.3,99.4,44.7,99.4z M75.5,112.1c-1.7,0-3.2,0.7-4.4,1.8 c-1.2,1.2-1.8,2.8-1.8,4.4c0,1.7,0.7,3.2,1.8,4.4c1.2,1.2,2.8,1.8,4.4,1.8c1.7,0,3.2-0.7,4.4-1.8c1.2-1.2,1.8-2.8,1.8-4.4 c0-1.7-0.7-3.2-1.8-4.4C78.7,112.8,77.1,112.1,75.5,112.1z M36.7,118.6c-1.7,0-3.2,0.7-4.4,1.8c-1.2,1.2-1.8,2.8-1.8,4.4 s0.7,3.2,1.8,4.4c1.2,1.2,2.8,1.8,4.4,1.8c1.7,0,3.2-0.7,4.4-1.8c1.2-1.2,1.8-2.8,1.8-4.4s-0.7-3.2-1.8-4.4 C39.9,119.3,38.3,118.6,36.7,118.6z M67.5,131.4c-1.7,0-3.2,0.7-4.4,1.8c-1.2,1.2-1.8,2.8-1.8,4.4s0.7,3.2,1.8,4.4 c1.2,1.2,2.8,1.8,4.4,1.8c1.7,0,3.2-0.7,4.4-1.8c1.2-1.2,1.8-2.8,1.8-4.4s-0.7-3.2-1.8-4.4C70.7,132,69.1,131.4,67.5,131.4z M28.7,137.9c-1.7,0-3.2,0.7-4.4,1.8c-1.2,1.2-1.8,2.8-1.8,4.4c0,1.7,0.7,3.2,1.8,4.4c1.2,1.2,2.8,1.8,4.4,1.8 c1.7,0,3.2-0.7,4.4-1.8c1.2-1.2,1.8-2.8,1.8-4.4c0-1.7-0.7-3.2-1.8-4.4C32,138.5,30.4,137.9,28.7,137.9z M59.5,150.6 c-1.7,0-3.2,0.7-4.4,1.8c-1.2,1.2-1.8,2.8-1.8,4.4c0,1.7,0.7,3.2,1.8,4.4c1.2,1.2,2.8,1.8,4.4,1.8s3.2-0.7,4.4-1.8 c1.2-1.2,1.8-2.8,1.8-4.4c0-1.7-0.7-3.2-1.8-4.4C62.8,151.3,61.2,150.6,59.5,150.6z"/>
139
+ </svg>
140
+ </span>
141
+ </button>
142
+ </div>
143
+ </div>
144
+ </div>
145
+
146
+ <style lang="scss">
147
+ :host {
148
+ font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji';
149
+ }
150
+
151
+ *,
152
+ *::before,
153
+ *::after {
154
+ margin: 0;
155
+ padding: 0;
156
+ list-style: none;
157
+ text-decoration: none;
158
+ outline: none;
159
+ box-sizing: border-box;
160
+ }
161
+
162
+ .ModalWindow {
163
+ display: flex;
164
+ position: fixed;
165
+ align-items: center;
166
+ justify-content: center;
167
+ width: 100%;
168
+ height: 100%;
169
+ z-index: 100;
170
+ top: 0;
171
+ left: 0;
172
+ background-color: rgba(0, 0, 0, .9);
173
+ .ModalContainer {
174
+ display: flex;
175
+ flex-direction: column;
176
+ align-items: center;
177
+ justify-content: center;
178
+ gap: 10px;
179
+ width: 90vw;
180
+ min-height: 380px;
181
+ max-width: 500px;
182
+ padding: 40px 40px 16px 40px;
183
+ border-top: 3px solid var(--emfe-w-color-secondary, #FD2839);
184
+ border-radius: 5px;
185
+ position: relative;
186
+ background: var(--emfe-w-color-white, #FFFFFF);
187
+ }
188
+ .ModalCloseBtn {
189
+ position: absolute;
190
+ top: 10px;
191
+ right: 10px;
192
+ border-radius: 50%;
193
+ color: var(--emfe-w-color-secondary, #FD2839);
194
+ background: rgba(255, 255, 255, .1);
195
+ cursor: pointer;
196
+ transition: all 150ms ease-in-out;
197
+ width: 28px;
198
+ height: 28px;
199
+ svg {
200
+ width: 28px;
201
+ height: 28px;
202
+ }
203
+
204
+ &:hover {
205
+ background: rgba(255, 255, 255, .2);
206
+ }
207
+ }
208
+ .ModalMobileContainer {
209
+ padding: 10px;
210
+ border-top: none;
211
+ .ModalCloseBtn {
212
+ margin: 10px;
213
+ svg {
214
+ width: 24px;
215
+ height: 24px;
216
+ }
217
+ }
218
+ }
219
+ }
220
+
221
+ .RandomGameWrapper {
222
+ display: flex;
223
+ flex-direction: column;
224
+ align-items: center;
225
+ justify-content: center;
226
+ gap: 10px;
227
+ }
228
+
229
+ .RandomGamesSliderWrapper {
230
+ height: 170px;
231
+ overflow: hidden;
232
+ }
233
+
234
+ .items {
235
+ gap: 5px;
236
+ transition: transform 0.3s ease-in-out;
237
+ transform: translateY(0px);
238
+ }
239
+
240
+ .RandomGameLoading {
241
+ padding: 30px 0;
242
+ }
243
+
244
+ .RandomGameImage {
245
+ width: 256px;
246
+ height: 170px;
247
+ border-radius: 5px;
248
+ }
249
+
250
+ .RandomTryAgain {
251
+ position: absolute;
252
+ bottom: -10px;
253
+ right: -10px;
254
+ background: var(--emfe-w-color-primary, #D0046C);
255
+ color: var(--emfe-w-color-white, #FFFFFF);
256
+ display: flex;
257
+ align-items: center;
258
+ padding: 6px;
259
+ border: none;
260
+ border-radius: 50%;
261
+ cursor: pointer;
262
+ svg {
263
+ width: 22px;
264
+ height: 22px;
265
+ }
266
+ }
267
+
268
+ .item {
269
+ position: relative;
270
+ }
271
+
272
+ .RandomGameDetails {
273
+ display: flex;
274
+ flex-direction: column;
275
+ justify-content: center;
276
+ align-items: center;
277
+ gap: 5px;
278
+ .RandomGameTitle {
279
+ font-size: 16px;
280
+ line-height: 18px;
281
+ text-align: center;
282
+ }
283
+ .RandomGameVendor {
284
+ font-size: 10px;
285
+ margin-bottom: 10px;
286
+ }
287
+ .RandomGamePlay {
288
+ background: var(--emfe-w-color-primary, #D0046C);
289
+ color: var(--emfe-w-color-white, #FFFFFF);
290
+ border: none;
291
+ border-radius: 5px;
292
+ width: 200px;
293
+ height: 40px;
294
+ font-size: 14px;
295
+ cursor: pointer;
296
+ }
297
+ }
298
+
299
+ .RandomButtonWrapper {
300
+ display: flex;
301
+ justify-content: center;
302
+ width: 100%;
303
+ .RandomButton {
304
+ display: flex;
305
+ align-items: center;
306
+ gap: 5px;
307
+ background: var(--emfe-w-color-primary, #D0046C);
308
+ color: var(--emfe-w-color-white, #FFFFFF);
309
+ border: none;
310
+ border-radius: 5px;
311
+ padding: 0 30px;
312
+ height: 50px;
313
+ font-size: 16px;
314
+ cursor: pointer;
315
+ svg {
316
+ width: 35px;
317
+ height: 35px;
318
+ }
319
+ }
320
+ }
321
+ </style>
package/src/i18n.js ADDED
@@ -0,0 +1,27 @@
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 ADDED
@@ -0,0 +1,4 @@
1
+ import CasinoRandomGame from './CasinoRandomGame.svelte';
2
+
3
+ !customElements.get('casino-random-game') && customElements.define('casino-random-game', CasinoRandomGame);
4
+ export default CasinoRandomGame;
@@ -0,0 +1,16 @@
1
+ export const CasinoRandomGameTranslations = {
2
+ en: {
3
+ randomGame: {
4
+ playRandomGame: 'Play a random game',
5
+ randomGameLoading: 'Selecting ...',
6
+ playNowRandomGame: 'Play Now'
7
+ }
8
+ },
9
+ ro: {
10
+ randomGame: {
11
+ playRandomGame: 'Joaca-te un joc aleatoriu',
12
+ randomGameLoading: 'Se selecteaza ...',
13
+ playNowRandomGame: 'Joaca-te Acum'
14
+ }
15
+ }
16
+ };
@@ -0,0 +1,13 @@
1
+ import { html } from 'lit-element';
2
+
3
+ import CasinoRandomGame from '../src/CasinoRandomGame';
4
+
5
+ // This default export determines where your story goes in the story list
6
+ export default {
7
+ title: 'CasinoRandomGame',
8
+ };
9
+
10
+ // 👇 We create a “template” of how args map to rendering
11
+ const CasinoRandomGame = ({ aProperty }) => html`<casino-random-game></casino-random-game>`;
12
+
13
+ export const FirstStory = CasinoRandomGame.bind({});
package/tsconfig.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "extends": "@tsconfig/svelte/tsconfig.json",
3
+
4
+ "include": ["src/**/*"],
5
+ "exclude": ["node_modules/*", "__sapper__/*", "public/*"]
6
+ }