@everymatrix/player-bonus-card 0.0.155
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 -0
- package/dist/player-bonus-card.js +10806 -0
- package/dist/player-bonus-card.js.map +1 -0
- package/index.html +21 -0
- package/index.js +1 -0
- package/package.json +40 -0
- package/public/favicon.png +0 -0
- package/public/reset.css +48 -0
- package/rollup.config.js +59 -0
- package/src/PlayerBonusCard.svelte +152 -0
- package/src/index.ts +4 -0
- package/stories/PlayerBonusCard.stories.js +13 -0
- package/tsconfig.json +6 -0
package/index.html
ADDED
|
@@ -0,0 +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>
|
package/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import './dist/player-bonus-card.js';
|
package/package.json
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@everymatrix/player-bonus-card",
|
|
3
|
+
"version": "0.0.155",
|
|
4
|
+
"main": "dist/player-bonus-card",
|
|
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": "7cbd0cbdfee24abfd1e534e10aeb57fdc7c48b11"
|
|
40
|
+
}
|
|
Binary file
|
package/public/reset.css
ADDED
|
@@ -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
|
+
}
|
package/rollup.config.js
ADDED
|
@@ -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/player-bonus-card.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,152 @@
|
|
|
1
|
+
<svelte:options tag={null} />
|
|
2
|
+
<script lang="typescript">
|
|
3
|
+
import moment from 'moment';
|
|
4
|
+
import { getDevice } from 'rvhelper';
|
|
5
|
+
|
|
6
|
+
export let bonuswalletid:String = '';
|
|
7
|
+
export let bonusdate:String = '';
|
|
8
|
+
export let bonusstatus:String = '';
|
|
9
|
+
export let bonusname:String = '';
|
|
10
|
+
export let bonustype:String = '';
|
|
11
|
+
export let bonusamount:Number;
|
|
12
|
+
export let bonuswageringamount:Number;
|
|
13
|
+
export let bonusremainingamount:Number;
|
|
14
|
+
export let bonuscurrency:String = '';
|
|
15
|
+
|
|
16
|
+
let userAgent:String = window.navigator.userAgent;
|
|
17
|
+
let isMobile = (getDevice(userAgent) === 'PC') ? false : true;
|
|
18
|
+
|
|
19
|
+
let bonusTypeText:String = '';
|
|
20
|
+
|
|
21
|
+
const bonusTypeRewrite = () => {
|
|
22
|
+
bonusTypeText = bonustype;
|
|
23
|
+
if (bonusTypeText === 'freeRound') {
|
|
24
|
+
bonusTypeText = 'Free Spins';
|
|
25
|
+
} else if (bonusTypeText === 'freeBet') {
|
|
26
|
+
bonusTypeText = 'Free Bet';
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const deleteBonus = () => {
|
|
31
|
+
window.postMessage({ type: 'DeleteActiveBonus', bonuswalletid }, window.location.href);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
$: bonustype && bonusTypeRewrite();
|
|
35
|
+
</script>
|
|
36
|
+
|
|
37
|
+
<div class="BonusCard">
|
|
38
|
+
<div class="BonusCardInfo">
|
|
39
|
+
<div class="BonusCardRow">
|
|
40
|
+
<p class="BonusCardRowTitle">Granted date: <span>{moment(bonusdate).format('DD/MM/YYYY h:mm A')}</span></p>
|
|
41
|
+
<p class="BonusCardRowText BonusCardStatus TextCapitalize {bonusstatus === 'active' || bonusstatus === 'released' ? 'StatusActive' : ''} {bonusstatus === 'expired' ? 'StatusExpired' : ''} {bonusstatus === 'forfeited' ? 'StatusForfeited' : ''}">{bonusstatus}</p>
|
|
42
|
+
</div>
|
|
43
|
+
<div class="BonusCardRow">
|
|
44
|
+
<p class="BonusCardRowTitle">Bonus Name</p>
|
|
45
|
+
<p class="BonusCardRowText">{bonusname}</p>
|
|
46
|
+
</div>
|
|
47
|
+
<div class="BonusCardRow">
|
|
48
|
+
<p class="BonusCardRowTitle">Bonus Type</p>
|
|
49
|
+
<p class="BonusCardRowText TextCapitalize">{bonusTypeText}</p>
|
|
50
|
+
</div>
|
|
51
|
+
{#if bonusamount >= 0}
|
|
52
|
+
<div class="BonusCardRow">
|
|
53
|
+
<p class="BonusCardRowTitle">Bonus Amount</p>
|
|
54
|
+
<p class="BonusCardRowText">{bonusamount} {bonuscurrency}</p>
|
|
55
|
+
</div>
|
|
56
|
+
{/if}
|
|
57
|
+
{#if bonuswageringamount >= 0}
|
|
58
|
+
<div class="BonusCardRow">
|
|
59
|
+
<p class="BonusCardRowTitle">Wagering Amount</p>
|
|
60
|
+
<p class="BonusCardRowText">{bonuswageringamount} {bonuscurrency}</p>
|
|
61
|
+
</div>
|
|
62
|
+
{/if}
|
|
63
|
+
{#if bonusremainingamount >= 0}
|
|
64
|
+
<div class="BonusCardRow">
|
|
65
|
+
<p class="BonusCardRowTitle">Remaining Bonus Amount</p>
|
|
66
|
+
<p class="BonusCardRowText">{bonusremainingamount} {bonuscurrency}</p>
|
|
67
|
+
</div>
|
|
68
|
+
{/if}
|
|
69
|
+
</div>
|
|
70
|
+
{#if bonusstatus === 'active'}
|
|
71
|
+
<button class="DeleteBonus {isMobile ? 'DeleteBonusMobile' : ''}" on:click={deleteBonus}>Forfeit Bonus</button>
|
|
72
|
+
{/if}
|
|
73
|
+
</div>
|
|
74
|
+
|
|
75
|
+
<style lang="scss">
|
|
76
|
+
//This function does a multiplication
|
|
77
|
+
// in order to work with px the
|
|
78
|
+
// same way as working with em
|
|
79
|
+
@function ttp($value) {
|
|
80
|
+
$multiplicator: 16px;
|
|
81
|
+
@return $value * $multiplicator;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.BonusCard {
|
|
85
|
+
background-color: #fff;
|
|
86
|
+
padding: 10px 20px 20px;
|
|
87
|
+
border-radius: 5px;
|
|
88
|
+
box-shadow: 0 3px 12px #00000012;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.BonusCardRow {
|
|
92
|
+
display: flex;
|
|
93
|
+
justify-content: space-between;
|
|
94
|
+
align-items: center;
|
|
95
|
+
padding: 10px;
|
|
96
|
+
font-size: 14px;
|
|
97
|
+
.BonusCardRowTitle {
|
|
98
|
+
color: #000;
|
|
99
|
+
font-weight: 700;
|
|
100
|
+
span {
|
|
101
|
+
font-weight: 400;
|
|
102
|
+
color: #58586B;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
.BonusCardRowText {
|
|
106
|
+
color: #58586B;
|
|
107
|
+
&.BonusCardStatus {
|
|
108
|
+
font-weight: 700;
|
|
109
|
+
color: #000;
|
|
110
|
+
}
|
|
111
|
+
&.StatusActive {
|
|
112
|
+
color: #0AA543;
|
|
113
|
+
}
|
|
114
|
+
&.StatusExpired {
|
|
115
|
+
color: #FD2839;
|
|
116
|
+
}
|
|
117
|
+
&.StatusForfeited {
|
|
118
|
+
color: #fd8c2d;
|
|
119
|
+
}
|
|
120
|
+
&.TextCapitalize {
|
|
121
|
+
text-transform: capitalize;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
&:nth-child(even) {
|
|
125
|
+
background-color: #F9F8F8;
|
|
126
|
+
border-radius: 5px;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.DeleteBonus {
|
|
131
|
+
background: #D0046C;
|
|
132
|
+
border: 1px solid #D0046C;
|
|
133
|
+
color: #fff;
|
|
134
|
+
cursor: pointer;
|
|
135
|
+
border-radius: 5px;
|
|
136
|
+
width: 50%;
|
|
137
|
+
height: 44px;
|
|
138
|
+
font-size: 15px;
|
|
139
|
+
text-transform: uppercase;
|
|
140
|
+
text-align: center;
|
|
141
|
+
transition-duration: 0.3s;
|
|
142
|
+
box-sizing: border-box;
|
|
143
|
+
padding: 10px;
|
|
144
|
+
margin-top: 10px;
|
|
145
|
+
&.DeleteBonusMobile {
|
|
146
|
+
width: 100%;
|
|
147
|
+
}
|
|
148
|
+
&:active {
|
|
149
|
+
background: darken(#D0046C, 10);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
</style>
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { html } from 'lit-element';
|
|
2
|
+
|
|
3
|
+
import PlayerBonusCard from '../src/PlayerBonusCard';
|
|
4
|
+
|
|
5
|
+
// This default export determines where your story goes in the story list
|
|
6
|
+
export default {
|
|
7
|
+
title: 'PlayerBonusCard',
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
// 👇 We create a “template” of how args map to rendering
|
|
11
|
+
const PlayerBonusCard = ({ aProperty }) => html`<player-bonus-card></player-bonus-card>`;
|
|
12
|
+
|
|
13
|
+
export const FirstStory = PlayerBonusCard.bind({});
|