@everymatrix/player-bonus-card 0.0.367 → 0.0.369
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/README.md +30 -30
- package/dist/player-bonus-card.js.map +1 -1
- package/index.html +21 -21
- package/index.js +1 -1
- package/package.json +2 -2
- package/public/reset.css +47 -47
- package/rollup.config.js +67 -67
- package/src/PlayerBonusCard.svelte +164 -164
- package/src/i18n.js +27 -27
- package/src/index.ts +4 -4
- package/src/translations.js +68 -68
- package/stories/PlayerBonusCard.stories.js +13 -13
- package/tsconfig.json +6 -6
package/index.html
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
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
|
-
player-bonus-card
|
|
9
|
-
</title>
|
|
10
|
-
<link rel="stylesheet" href="public/reset.css">
|
|
11
|
-
<script src='dist/player-bonus-card.js'></script>
|
|
12
|
-
</head>
|
|
13
|
-
|
|
14
|
-
<body>
|
|
15
|
-
|
|
16
|
-
<div class="webcomponent">
|
|
17
|
-
<player-bonus-card></player-bonus-card>
|
|
18
|
-
</div>
|
|
19
|
-
|
|
20
|
-
</body>
|
|
21
|
-
</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
|
+
player-bonus-card
|
|
9
|
+
</title>
|
|
10
|
+
<link rel="stylesheet" href="public/reset.css">
|
|
11
|
+
<script src='dist/player-bonus-card.js'></script>
|
|
12
|
+
</head>
|
|
13
|
+
|
|
14
|
+
<body>
|
|
15
|
+
|
|
16
|
+
<div class="webcomponent">
|
|
17
|
+
<player-bonus-card></player-bonus-card>
|
|
18
|
+
</div>
|
|
19
|
+
|
|
20
|
+
</body>
|
|
21
|
+
</html>
|
package/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import './dist/player-bonus-card.js';
|
|
1
|
+
import './dist/player-bonus-card.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@everymatrix/player-bonus-card",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.369",
|
|
4
4
|
"main": "dist/player-bonus-card",
|
|
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": "ea5f5a546598be579d9b1f0b547a8b82de54163d"
|
|
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/player-bonus-card.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/player-bonus-card.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,164 +1,164 @@
|
|
|
1
|
-
<svelte:options tag={null} />
|
|
2
|
-
<script lang="ts">
|
|
3
|
-
import { getDevice } from 'rvhelper';
|
|
4
|
-
import { _, addNewMessages, setLocale } from './i18n';
|
|
5
|
-
import { PlayerBonusCardTranslations } from './translations';
|
|
6
|
-
|
|
7
|
-
import moment from 'moment';
|
|
8
|
-
|
|
9
|
-
export let bonuswalletid:string = '';
|
|
10
|
-
export let bonusdate:string = '';
|
|
11
|
-
export let bonusstatus:string = '';
|
|
12
|
-
export let bonusname:string = '';
|
|
13
|
-
export let bonustype:string = '';
|
|
14
|
-
export let bonusamount:string = '';
|
|
15
|
-
export let bonuswageringamount:string = '';
|
|
16
|
-
export let bonusremainingamount:string = '';
|
|
17
|
-
export let bonuscurrency:string = '';
|
|
18
|
-
export let lang:string = 'en';
|
|
19
|
-
|
|
20
|
-
let userAgent:string = window.navigator.userAgent;
|
|
21
|
-
let isMobile:boolean = (getDevice(userAgent) === 'PC') ? false : true;
|
|
22
|
-
|
|
23
|
-
let bonusTypeText:string = '';
|
|
24
|
-
|
|
25
|
-
Object.keys(PlayerBonusCardTranslations).forEach((item:any) => {
|
|
26
|
-
addNewMessages(item, PlayerBonusCardTranslations[item]);
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
const bonusTypeRewrite = () => {
|
|
30
|
-
bonusTypeText = bonustype;
|
|
31
|
-
|
|
32
|
-
if (bonusTypeText === 'freeRound') {
|
|
33
|
-
bonusTypeText = 'Free Spins';
|
|
34
|
-
} else if (bonusTypeText === 'freeBet') {
|
|
35
|
-
bonusTypeText = 'Free Bet';
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
const deleteBonus = () => {
|
|
40
|
-
window.postMessage({ type: 'DeleteActiveBonus', bonuswalletid }, window.location.href);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
const initialLoad = () => {
|
|
44
|
-
setLocale(lang);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
$: lang && initialLoad();
|
|
48
|
-
$: bonustype && bonusTypeRewrite();
|
|
49
|
-
</script>
|
|
50
|
-
|
|
51
|
-
<div class="BonusCard" part="BonusCard">
|
|
52
|
-
<div class="BonusCardInfo" part="BonusCardInfo">
|
|
53
|
-
<div class="BonusCardRow" part="BonusCardRow">
|
|
54
|
-
<p class="BonusCardRowTitle" part="BonusCardRowTitle">{$_('bonusCard.date')} <span>{moment(bonusdate).format('DD/MM/YYYY h:mm A')}</span></p>
|
|
55
|
-
<p class="BonusCardRowText BonusCardStatus TextCapitalize {bonusstatus === 'active' || bonusstatus === 'released' ? 'StatusActive' : ''} {bonusstatus === 'expired' ? 'StatusExpired' : ''} {bonusstatus === 'forfeited' ? 'StatusForfeited' : ''}"
|
|
56
|
-
part="BonusCardRowText BonusCardStatus TextCapitalize {bonusstatus === 'active' || bonusstatus === 'released' ? 'StatusActive' : ''} {bonusstatus === 'expired' ? 'StatusExpired' : ''} {bonusstatus === 'forfeited' ? 'StatusForfeited' : ''}">{bonusstatus}</p>
|
|
57
|
-
</div>
|
|
58
|
-
<div class="BonusCardRow" part="BonusCardRow">
|
|
59
|
-
<p class="BonusCardRowTitle" part="BonusCardRowTitle">{$_('bonusCard.bonusName')}</p>
|
|
60
|
-
<p class="BonusCardRowText" part="BonusCardRowText">{bonusname}</p>
|
|
61
|
-
</div>
|
|
62
|
-
<div class="BonusCardRow" part="BonusCardRow">
|
|
63
|
-
<p class="BonusCardRowTitle" part="BonusCardRowTitle">{$_('bonusCard.bonusType')}</p>
|
|
64
|
-
<p class="BonusCardRowText TextCapitalize" part="BonusCardRowText TextCapitalize">{bonusTypeText}</p>
|
|
65
|
-
</div>
|
|
66
|
-
{#if bonusamount}
|
|
67
|
-
<div class="BonusCardRow" part="BonusCardRow">
|
|
68
|
-
<p class="BonusCardRowTitle" part="BonusCardRowTitle">{$_('bonusCard.bonusAmount')}</p>
|
|
69
|
-
<p class="BonusCardRowText" part="BonusCardRowText">{bonusamount} {bonuscurrency}</p>
|
|
70
|
-
</div>
|
|
71
|
-
{/if}
|
|
72
|
-
{#if bonuswageringamount}
|
|
73
|
-
<div class="BonusCardRow" part="BonusCardRow">
|
|
74
|
-
<p class="BonusCardRowTitle" part="BonusCardRowTitle">{$_('bonusCard.wageringAmount')}</p>
|
|
75
|
-
<p class="BonusCardRowText" part="BonusCardRowText">{bonuswageringamount} {bonuscurrency}</p>
|
|
76
|
-
</div>
|
|
77
|
-
{/if}
|
|
78
|
-
{#if bonusremainingamount}
|
|
79
|
-
<div class="BonusCardRow" part="BonusCardRow">
|
|
80
|
-
<p class="BonusCardRowTitle" part="BonusCardRowTitle">{$_('bonusCard.remainingBonus')}</p>
|
|
81
|
-
<p class="BonusCardRowText" part="BonusCardRowText">{bonusremainingamount} {bonuscurrency}</p>
|
|
82
|
-
</div>
|
|
83
|
-
{/if}
|
|
84
|
-
</div>
|
|
85
|
-
{#if bonusstatus === 'active'}
|
|
86
|
-
<button class="DeleteBonus {isMobile ? 'DeleteBonusMobile' : ''}" part="DeleteBonus {isMobile ? 'DeleteBonusMobile' : ''}" on:click={deleteBonus}>{$_('bonusCard.forfeitBonus')}</button>
|
|
87
|
-
{/if}
|
|
88
|
-
</div>
|
|
89
|
-
|
|
90
|
-
<style lang="scss">
|
|
91
|
-
|
|
92
|
-
:host {
|
|
93
|
-
font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji';
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
.BonusCard {
|
|
97
|
-
background-color: var(--emfe-w-color-white, #FFFFFF);
|
|
98
|
-
padding: 10px 20px 20px;
|
|
99
|
-
border-radius: 5px;
|
|
100
|
-
box-shadow: 0px 3px 12px var(--emfe-w-color-gray-100, #E6E6E6);
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
.BonusCardRow {
|
|
104
|
-
display: flex;
|
|
105
|
-
justify-content: space-between;
|
|
106
|
-
align-items: center;
|
|
107
|
-
padding: 2px 10px;
|
|
108
|
-
font-size: 14px;
|
|
109
|
-
.BonusCardRowTitle {
|
|
110
|
-
color: var(--emfe-w-color-black, #000000);
|
|
111
|
-
font-weight: 700;
|
|
112
|
-
span {
|
|
113
|
-
font-weight: 400;
|
|
114
|
-
color: var(--emfe-w-color-gray-300, #58586B);
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
.BonusCardRowText {
|
|
118
|
-
color: var(--emfe-w-color-gray-300, #58586B);
|
|
119
|
-
&.BonusCardStatus {
|
|
120
|
-
font-weight: 700;
|
|
121
|
-
color: var(--emfe-w-color-black, #000000);
|
|
122
|
-
}
|
|
123
|
-
&.StatusActive {
|
|
124
|
-
color: #0AA543;
|
|
125
|
-
}
|
|
126
|
-
&.StatusExpired {
|
|
127
|
-
color: #FD2839;
|
|
128
|
-
}
|
|
129
|
-
&.StatusForfeited {
|
|
130
|
-
color: #fd8c2d;
|
|
131
|
-
}
|
|
132
|
-
&.TextCapitalize {
|
|
133
|
-
text-transform: capitalize;
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
&:nth-child(even) {
|
|
137
|
-
background-color: var(--emfe-w-color-gray-50, #F9F8F8);
|
|
138
|
-
border-radius: 5px;
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
.DeleteBonus {
|
|
143
|
-
background: var(--emfe-w-color-primary, #D0046C);
|
|
144
|
-
border: 1px solid var(--emfe-w-color-primary, #D0046C);
|
|
145
|
-
color: var(--emfe-w-color-white, #FFFFFF);
|
|
146
|
-
cursor: pointer;
|
|
147
|
-
border-radius: 5px;
|
|
148
|
-
width: 50%;
|
|
149
|
-
height: 44px;
|
|
150
|
-
font-size: 15px;
|
|
151
|
-
text-transform: uppercase;
|
|
152
|
-
text-align: center;
|
|
153
|
-
transition-duration: 0.3s;
|
|
154
|
-
box-sizing: border-box;
|
|
155
|
-
padding: 10px;
|
|
156
|
-
margin-top: 10px;
|
|
157
|
-
&.DeleteBonusMobile {
|
|
158
|
-
width: 100%;
|
|
159
|
-
}
|
|
160
|
-
&:active {
|
|
161
|
-
background: var(--emfe-w-color-primary-600, #99034F);
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
</style>
|
|
1
|
+
<svelte:options tag={null} />
|
|
2
|
+
<script lang="ts">
|
|
3
|
+
import { getDevice } from 'rvhelper';
|
|
4
|
+
import { _, addNewMessages, setLocale } from './i18n';
|
|
5
|
+
import { PlayerBonusCardTranslations } from './translations';
|
|
6
|
+
|
|
7
|
+
import moment from 'moment';
|
|
8
|
+
|
|
9
|
+
export let bonuswalletid:string = '';
|
|
10
|
+
export let bonusdate:string = '';
|
|
11
|
+
export let bonusstatus:string = '';
|
|
12
|
+
export let bonusname:string = '';
|
|
13
|
+
export let bonustype:string = '';
|
|
14
|
+
export let bonusamount:string = '';
|
|
15
|
+
export let bonuswageringamount:string = '';
|
|
16
|
+
export let bonusremainingamount:string = '';
|
|
17
|
+
export let bonuscurrency:string = '';
|
|
18
|
+
export let lang:string = 'en';
|
|
19
|
+
|
|
20
|
+
let userAgent:string = window.navigator.userAgent;
|
|
21
|
+
let isMobile:boolean = (getDevice(userAgent) === 'PC') ? false : true;
|
|
22
|
+
|
|
23
|
+
let bonusTypeText:string = '';
|
|
24
|
+
|
|
25
|
+
Object.keys(PlayerBonusCardTranslations).forEach((item:any) => {
|
|
26
|
+
addNewMessages(item, PlayerBonusCardTranslations[item]);
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
const bonusTypeRewrite = () => {
|
|
30
|
+
bonusTypeText = bonustype;
|
|
31
|
+
|
|
32
|
+
if (bonusTypeText === 'freeRound') {
|
|
33
|
+
bonusTypeText = 'Free Spins';
|
|
34
|
+
} else if (bonusTypeText === 'freeBet') {
|
|
35
|
+
bonusTypeText = 'Free Bet';
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const deleteBonus = () => {
|
|
40
|
+
window.postMessage({ type: 'DeleteActiveBonus', bonuswalletid }, window.location.href);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const initialLoad = () => {
|
|
44
|
+
setLocale(lang);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
$: lang && initialLoad();
|
|
48
|
+
$: bonustype && bonusTypeRewrite();
|
|
49
|
+
</script>
|
|
50
|
+
|
|
51
|
+
<div class="BonusCard" part="BonusCard">
|
|
52
|
+
<div class="BonusCardInfo" part="BonusCardInfo">
|
|
53
|
+
<div class="BonusCardRow" part="BonusCardRow">
|
|
54
|
+
<p class="BonusCardRowTitle" part="BonusCardRowTitle">{$_('bonusCard.date')} <span>{moment(bonusdate).format('DD/MM/YYYY h:mm A')}</span></p>
|
|
55
|
+
<p class="BonusCardRowText BonusCardStatus TextCapitalize {bonusstatus === 'active' || bonusstatus === 'released' ? 'StatusActive' : ''} {bonusstatus === 'expired' ? 'StatusExpired' : ''} {bonusstatus === 'forfeited' ? 'StatusForfeited' : ''}"
|
|
56
|
+
part="BonusCardRowText BonusCardStatus TextCapitalize {bonusstatus === 'active' || bonusstatus === 'released' ? 'StatusActive' : ''} {bonusstatus === 'expired' ? 'StatusExpired' : ''} {bonusstatus === 'forfeited' ? 'StatusForfeited' : ''}">{bonusstatus}</p>
|
|
57
|
+
</div>
|
|
58
|
+
<div class="BonusCardRow" part="BonusCardRow">
|
|
59
|
+
<p class="BonusCardRowTitle" part="BonusCardRowTitle">{$_('bonusCard.bonusName')}</p>
|
|
60
|
+
<p class="BonusCardRowText" part="BonusCardRowText">{bonusname}</p>
|
|
61
|
+
</div>
|
|
62
|
+
<div class="BonusCardRow" part="BonusCardRow">
|
|
63
|
+
<p class="BonusCardRowTitle" part="BonusCardRowTitle">{$_('bonusCard.bonusType')}</p>
|
|
64
|
+
<p class="BonusCardRowText TextCapitalize" part="BonusCardRowText TextCapitalize">{bonusTypeText}</p>
|
|
65
|
+
</div>
|
|
66
|
+
{#if bonusamount}
|
|
67
|
+
<div class="BonusCardRow" part="BonusCardRow">
|
|
68
|
+
<p class="BonusCardRowTitle" part="BonusCardRowTitle">{$_('bonusCard.bonusAmount')}</p>
|
|
69
|
+
<p class="BonusCardRowText" part="BonusCardRowText">{bonusamount} {bonuscurrency}</p>
|
|
70
|
+
</div>
|
|
71
|
+
{/if}
|
|
72
|
+
{#if bonuswageringamount}
|
|
73
|
+
<div class="BonusCardRow" part="BonusCardRow">
|
|
74
|
+
<p class="BonusCardRowTitle" part="BonusCardRowTitle">{$_('bonusCard.wageringAmount')}</p>
|
|
75
|
+
<p class="BonusCardRowText" part="BonusCardRowText">{bonuswageringamount} {bonuscurrency}</p>
|
|
76
|
+
</div>
|
|
77
|
+
{/if}
|
|
78
|
+
{#if bonusremainingamount}
|
|
79
|
+
<div class="BonusCardRow" part="BonusCardRow">
|
|
80
|
+
<p class="BonusCardRowTitle" part="BonusCardRowTitle">{$_('bonusCard.remainingBonus')}</p>
|
|
81
|
+
<p class="BonusCardRowText" part="BonusCardRowText">{bonusremainingamount} {bonuscurrency}</p>
|
|
82
|
+
</div>
|
|
83
|
+
{/if}
|
|
84
|
+
</div>
|
|
85
|
+
{#if bonusstatus === 'active'}
|
|
86
|
+
<button class="DeleteBonus {isMobile ? 'DeleteBonusMobile' : ''}" part="DeleteBonus {isMobile ? 'DeleteBonusMobile' : ''}" on:click={deleteBonus}>{$_('bonusCard.forfeitBonus')}</button>
|
|
87
|
+
{/if}
|
|
88
|
+
</div>
|
|
89
|
+
|
|
90
|
+
<style lang="scss">
|
|
91
|
+
|
|
92
|
+
:host {
|
|
93
|
+
font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji';
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.BonusCard {
|
|
97
|
+
background-color: var(--emfe-w-color-white, #FFFFFF);
|
|
98
|
+
padding: 10px 20px 20px;
|
|
99
|
+
border-radius: 5px;
|
|
100
|
+
box-shadow: 0px 3px 12px var(--emfe-w-color-gray-100, #E6E6E6);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.BonusCardRow {
|
|
104
|
+
display: flex;
|
|
105
|
+
justify-content: space-between;
|
|
106
|
+
align-items: center;
|
|
107
|
+
padding: 2px 10px;
|
|
108
|
+
font-size: 14px;
|
|
109
|
+
.BonusCardRowTitle {
|
|
110
|
+
color: var(--emfe-w-color-black, #000000);
|
|
111
|
+
font-weight: 700;
|
|
112
|
+
span {
|
|
113
|
+
font-weight: 400;
|
|
114
|
+
color: var(--emfe-w-color-gray-300, #58586B);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
.BonusCardRowText {
|
|
118
|
+
color: var(--emfe-w-color-gray-300, #58586B);
|
|
119
|
+
&.BonusCardStatus {
|
|
120
|
+
font-weight: 700;
|
|
121
|
+
color: var(--emfe-w-color-black, #000000);
|
|
122
|
+
}
|
|
123
|
+
&.StatusActive {
|
|
124
|
+
color: #0AA543;
|
|
125
|
+
}
|
|
126
|
+
&.StatusExpired {
|
|
127
|
+
color: #FD2839;
|
|
128
|
+
}
|
|
129
|
+
&.StatusForfeited {
|
|
130
|
+
color: #fd8c2d;
|
|
131
|
+
}
|
|
132
|
+
&.TextCapitalize {
|
|
133
|
+
text-transform: capitalize;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
&:nth-child(even) {
|
|
137
|
+
background-color: var(--emfe-w-color-gray-50, #F9F8F8);
|
|
138
|
+
border-radius: 5px;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.DeleteBonus {
|
|
143
|
+
background: var(--emfe-w-color-primary, #D0046C);
|
|
144
|
+
border: 1px solid var(--emfe-w-color-primary, #D0046C);
|
|
145
|
+
color: var(--emfe-w-color-white, #FFFFFF);
|
|
146
|
+
cursor: pointer;
|
|
147
|
+
border-radius: 5px;
|
|
148
|
+
width: 50%;
|
|
149
|
+
height: 44px;
|
|
150
|
+
font-size: 15px;
|
|
151
|
+
text-transform: uppercase;
|
|
152
|
+
text-align: center;
|
|
153
|
+
transition-duration: 0.3s;
|
|
154
|
+
box-sizing: border-box;
|
|
155
|
+
padding: 10px;
|
|
156
|
+
margin-top: 10px;
|
|
157
|
+
&.DeleteBonusMobile {
|
|
158
|
+
width: 100%;
|
|
159
|
+
}
|
|
160
|
+
&:active {
|
|
161
|
+
background: var(--emfe-w-color-primary-600, #99034F);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
</style>
|