@everymatrix/casino-engagement-suite-luckywheel 0.0.1
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/dist/casino-engagement-suite-luckywheel/casino-engagement-suite-luckywheel.esm.js +1 -0
- package/dist/casino-engagement-suite-luckywheel/index.esm.js +1 -0
- package/dist/casino-engagement-suite-luckywheel/p-31e6965f.js +1 -0
- package/dist/casino-engagement-suite-luckywheel/p-c99c6eaf.entry.js +1 -0
- package/dist/casino-engagement-suite-luckywheel/p-e1255160.js +1 -0
- package/dist/casino-engagement-suite-luckywheel/p-f5a837f6.js +2 -0
- package/dist/cjs/app-globals-3a1e7e63.js +5 -0
- package/dist/cjs/casino-engagement-suite-luckywheel-d1e393bd.js +739 -0
- package/dist/cjs/casino-engagement-suite-luckywheel.cjs.entry.js +10 -0
- package/dist/cjs/casino-engagement-suite-luckywheel.cjs.js +25 -0
- package/dist/cjs/index-b3b5597c.js +1428 -0
- package/dist/cjs/index.cjs.js +10 -0
- package/dist/cjs/loader.cjs.js +15 -0
- package/dist/collection/collection-manifest.json +12 -0
- package/dist/collection/components/casino-engagement-suite-luckywheel/casino-engagement-suite-luckywheel.css +213 -0
- package/dist/collection/components/casino-engagement-suite-luckywheel/casino-engagement-suite-luckywheel.js +367 -0
- package/dist/collection/components/casino-engagement-suite-luckywheel/index.js +1 -0
- package/dist/collection/index.js +1 -0
- package/dist/collection/models/luckywheel.js +12 -0
- package/dist/collection/utils/class.spinable.js +38 -0
- package/dist/collection/utils/class.spinner.js +120 -0
- package/dist/collection/utils/class.svgcalc.js +175 -0
- package/dist/collection/utils/types.js +42 -0
- package/dist/collection/utils/utils.js +204 -0
- package/dist/esm/app-globals-0f993ce5.js +3 -0
- package/dist/esm/casino-engagement-suite-luckywheel-0aad8871.js +737 -0
- package/dist/esm/casino-engagement-suite-luckywheel.entry.js +2 -0
- package/dist/esm/casino-engagement-suite-luckywheel.js +20 -0
- package/dist/esm/index-27ac0c91.js +1401 -0
- package/dist/esm/index.js +2 -0
- package/dist/esm/loader.js +11 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/stencil.config.dev.js +16 -0
- package/dist/stencil.config.js +17 -0
- package/dist/storybook/main.js +21 -0
- package/dist/storybook/preview.js +9 -0
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/casino-engagement-suite-luckywheel/.stencil/packages/stencil/casino-engagement-suite-luckywheel/stencil.config.d.ts +2 -0
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/casino-engagement-suite-luckywheel/.stencil/packages/stencil/casino-engagement-suite-luckywheel/stencil.config.dev.d.ts +2 -0
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/casino-engagement-suite-luckywheel/.stencil/packages/stencil/casino-engagement-suite-luckywheel/storybook/main.d.ts +3 -0
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/casino-engagement-suite-luckywheel/.stencil/packages/stencil/casino-engagement-suite-luckywheel/storybook/preview.d.ts +70 -0
- package/dist/types/components/casino-engagement-suite-luckywheel/casino-engagement-suite-luckywheel.d.ts +59 -0
- package/dist/types/components/casino-engagement-suite-luckywheel/index.d.ts +1 -0
- package/dist/types/components.d.ts +95 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/models/luckywheel.d.ts +57 -0
- package/dist/types/stencil-public-runtime.d.ts +1680 -0
- package/dist/types/utils/class.spinable.d.ts +14 -0
- package/dist/types/utils/class.spinner.d.ts +26 -0
- package/dist/types/utils/class.svgcalc.d.ts +109 -0
- package/dist/types/utils/types.d.ts +55 -0
- package/dist/types/utils/utils.d.ts +78 -0
- package/loader/cdn.js +1 -0
- package/loader/index.cjs.js +1 -0
- package/loader/index.d.ts +24 -0
- package/loader/index.es2017.js +1 -0
- package/loader/index.js +2 -0
- package/loader/package.json +11 -0
- package/package.json +26 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const casinoEngagementSuiteLuckywheel = require('./casino-engagement-suite-luckywheel-d1e393bd.js');
|
|
6
|
+
require('./index-b3b5597c.js');
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
exports.CasinoEngagementSuiteLuckywheel = casinoEngagementSuiteLuckywheel.CasinoEngagementSuiteLuckywheel;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-b3b5597c.js');
|
|
6
|
+
const appGlobals = require('./app-globals-3a1e7e63.js');
|
|
7
|
+
|
|
8
|
+
const defineCustomElements = async (win, options) => {
|
|
9
|
+
if (typeof window === 'undefined') return undefined;
|
|
10
|
+
await appGlobals.globalScripts();
|
|
11
|
+
return index.bootstrapLazy([["casino-engagement-suite-luckywheel.cjs",[[1,"casino-engagement-suite-luckywheel",{"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"language":[1],"device":[1],"luckywheel":[16],"size":[1],"contentdirection":[1],"limitStylingAppends":[32],"isPartitionsCustomableReady":[32],"isSpinning":[32],"options":[32],"radius":[32],"speed":[32],"settings":[32],"svg":[32],"spinContainer":[32],"spinable":[32],"spinner":[32]},[[8,"message","handleEvent"]]]]]], options);
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
exports.setNonce = index.setNonce;
|
|
15
|
+
exports.defineCustomElements = defineCustomElements;
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
*,
|
|
6
|
+
*::before,
|
|
7
|
+
*::after {
|
|
8
|
+
margin: 0;
|
|
9
|
+
padding: 0;
|
|
10
|
+
list-style: none;
|
|
11
|
+
text-decoration: none;
|
|
12
|
+
outline: none;
|
|
13
|
+
box-sizing: border-box;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.LotteryProgramWof {
|
|
17
|
+
background: var(--emw--color-contrast, #07072A);
|
|
18
|
+
display: flex;
|
|
19
|
+
align-items: center;
|
|
20
|
+
flex-direction: column;
|
|
21
|
+
padding: 20px 0;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
main {
|
|
25
|
+
max-width: 600px;
|
|
26
|
+
width: 100%;
|
|
27
|
+
display: flex;
|
|
28
|
+
justify-content: space-around;
|
|
29
|
+
min-height: 200px;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
svg {
|
|
33
|
+
transition: opacity 0.3s;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.WheelContainer {
|
|
37
|
+
text-align: center;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.FortuneContainer {
|
|
41
|
+
width: 100%;
|
|
42
|
+
display: flex;
|
|
43
|
+
align-items: center;
|
|
44
|
+
flex-direction: column;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.Center {
|
|
48
|
+
cursor: pointer;
|
|
49
|
+
transition: filter;
|
|
50
|
+
transition-duration: 1s;
|
|
51
|
+
}
|
|
52
|
+
.Center.disabled {
|
|
53
|
+
filter: grayscale(80%);
|
|
54
|
+
}
|
|
55
|
+
.Center .CenterCircle {
|
|
56
|
+
fill: #3CE4BB;
|
|
57
|
+
stroke: rgb(150, 54, 88);
|
|
58
|
+
stroke-width: 2px;
|
|
59
|
+
cursor: pointer;
|
|
60
|
+
transition: fill;
|
|
61
|
+
transition-duration: 1s;
|
|
62
|
+
}
|
|
63
|
+
.Center .CenterText {
|
|
64
|
+
fill: #FFFFFF;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.PointerPartition {
|
|
68
|
+
opacity: 0.3;
|
|
69
|
+
fill: lightgoldenrodyellow;
|
|
70
|
+
stroke: red;
|
|
71
|
+
stroke-width: 6px;
|
|
72
|
+
stroke-dasharray: 12;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.Current {
|
|
76
|
+
color: #FFFFFF;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.PartitionText {
|
|
80
|
+
color: #FFFFFF;
|
|
81
|
+
font-style: normal;
|
|
82
|
+
font-weight: 700;
|
|
83
|
+
text-anchor: end;
|
|
84
|
+
text-shadow: 0px 3px #000;
|
|
85
|
+
dominant-baseline: central;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.PartitionsShadow {
|
|
89
|
+
background-blend-mode: multiply;
|
|
90
|
+
mix-blend-mode: multiply;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.PartitionTextEntityContainer {
|
|
94
|
+
height: 100%;
|
|
95
|
+
display: flex;
|
|
96
|
+
align-items: center;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.PartitionTextEntity {
|
|
100
|
+
width: 100%;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.PartitionTextEntity.Anticlockwise {
|
|
104
|
+
text-align: end;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
foreignObject.Bottom div {
|
|
108
|
+
background-image: url("https://static.everymatrix.com/gic/img/engagement-suite/bar/luckywheel/luckywheel-bg.svg");
|
|
109
|
+
background-size: calc(var(--radius) * 2px + var(--ratio) * 20px);
|
|
110
|
+
background-position: center;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
foreignObject.Middle div {
|
|
114
|
+
background-image: url("https://static.everymatrix.com/gic/img/engagement-suite/bar/luckywheel/luckywheel-spin.svg"), url("https://static.everymatrix.com/gic/img/engagement-suite/bar/luckywheel/luckywheel-pointer.svg");
|
|
115
|
+
background-position: center, center 5px;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
foreignObject.Top {
|
|
119
|
+
mix-blend-mode: multiply;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
foreignObject.Top div {
|
|
123
|
+
background-image: var(--img-theme-shadow);
|
|
124
|
+
background-position: center;
|
|
125
|
+
background-size: calc(var(--radius) * 2px);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
foreignObject.Partition1 div {
|
|
129
|
+
background-image: var(--img-theme-partition-light);
|
|
130
|
+
background-position: center calc((var(--size) / 2 - var(--radius)) * 1px - var(--ratio) * 22px);
|
|
131
|
+
transform: rotate(calc(var(--index) * 360deg / var(--length)));
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
foreignObject.Partition2 div {
|
|
135
|
+
background-image: var(--img-theme-partition-light);
|
|
136
|
+
background-position: center calc((var(--size) / 2 - var(--radius)) * 1px - var(--ratio) * 22px);
|
|
137
|
+
transform: rotate(calc((var(--index) + 0.5) * 360deg / var(--length)));
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
foreignObject.PointerArea {
|
|
141
|
+
mix-blend-mode: screen;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
foreignObject.PointerArea div {
|
|
145
|
+
background-image: var(--img-theme-pointer-area);
|
|
146
|
+
background-position: center -3px;
|
|
147
|
+
background-size: 51%;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
foreignObject.Partition1 div, foreignObject.Partition2 div {
|
|
151
|
+
transform-origin: center;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.PartitionsCustomable1 div, .PartitionsCustomable2 div {
|
|
155
|
+
visibility: hidden;
|
|
156
|
+
}
|
|
157
|
+
.PartitionsCustomable1 div.active, .PartitionsCustomable2 div.active {
|
|
158
|
+
visibility: visible;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
foreignObject.Customable {
|
|
162
|
+
overflow: visible;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
foreignObject.Customable div {
|
|
166
|
+
background-repeat: no-repeat;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
.PartitionBackground div {
|
|
170
|
+
background-size: calc(var(--radius) * 2 / var(--size) * 100%) calc(var(--radius) * 2 / var(--size) * 100%);
|
|
171
|
+
background-position: center;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
.PartitionBackground:nth-child(2n) div {
|
|
175
|
+
background: var(--emw--color-primary, #3F2E75);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
.PartitionBackground:nth-child(2n+1) div {
|
|
179
|
+
background: var(--emw--color-secondary, #9482CE);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
.PartitionBackground div {
|
|
183
|
+
transform-origin: center;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
.PartitionBackgroundStroke {
|
|
187
|
+
fill: transparent;
|
|
188
|
+
stroke: var(--emw--color-background-secondary, #251D3E);
|
|
189
|
+
stroke-width: 3px;
|
|
190
|
+
stroke-dasharray: none;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
.PointerPartitionFrame {
|
|
194
|
+
stroke: #FFDD64;
|
|
195
|
+
fill: transparent;
|
|
196
|
+
stroke-dasharray: var(--radius) calc(6.2831853072 / var(--length) * var(--radius));
|
|
197
|
+
stroke-width: 0px;
|
|
198
|
+
}
|
|
199
|
+
.PointerPartitionFrame.active {
|
|
200
|
+
stroke-width: 3px;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
.WheelContainer.Mobile foreignObject.Middle div {
|
|
204
|
+
background-size: 95px, 38px;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
.PartitionText .PartitionTextEntityContainer .PartitionTextEntity {
|
|
208
|
+
text-align: center;
|
|
209
|
+
text-transform: uppercase;
|
|
210
|
+
text-shadow: none;
|
|
211
|
+
font-size: var(--emw--font-size-small, 14px);
|
|
212
|
+
font-weight: 900;
|
|
213
|
+
}
|
|
@@ -0,0 +1,367 @@
|
|
|
1
|
+
import { __rest } from "tslib";
|
|
2
|
+
import { h } from "@stencil/core";
|
|
3
|
+
import { SvgCalc } from "../../utils/class.svgcalc";
|
|
4
|
+
import { Lang } from "../../utils/types";
|
|
5
|
+
import { getOptions, isSafari, setProps } from "../../utils/utils";
|
|
6
|
+
import { Spinner } from "../../utils/class.spinner";
|
|
7
|
+
export class CasinoEngagementSuiteLuckywheel {
|
|
8
|
+
constructor() {
|
|
9
|
+
/**
|
|
10
|
+
* Client custom styling via string
|
|
11
|
+
*/
|
|
12
|
+
this.clientStyling = '';
|
|
13
|
+
/**
|
|
14
|
+
* Client custom styling via url
|
|
15
|
+
*/
|
|
16
|
+
this.clientStylingUrl = '';
|
|
17
|
+
/**
|
|
18
|
+
* Language of the widget
|
|
19
|
+
*/
|
|
20
|
+
this.language = 'en';
|
|
21
|
+
/**
|
|
22
|
+
* User's device type
|
|
23
|
+
*/
|
|
24
|
+
this.device = 'Mobile';
|
|
25
|
+
/**
|
|
26
|
+
* Wheel size
|
|
27
|
+
*/
|
|
28
|
+
this.size = '440';
|
|
29
|
+
/**
|
|
30
|
+
* Content Direction
|
|
31
|
+
*/
|
|
32
|
+
this.contentdirection = 'anticlockwise';
|
|
33
|
+
this.limitStylingAppends = false;
|
|
34
|
+
this.isPartitionsCustomableReady = false;
|
|
35
|
+
this.isSpinning = false;
|
|
36
|
+
this.radius = 0.85 * Number(this.size) / 2;
|
|
37
|
+
this.speed = 0;
|
|
38
|
+
this.setClientStyling = () => {
|
|
39
|
+
let sheet = document.createElement('style');
|
|
40
|
+
sheet.innerHTML = this.clientStyling;
|
|
41
|
+
this.host.prepend(sheet);
|
|
42
|
+
};
|
|
43
|
+
this.setClientStylingURL = () => {
|
|
44
|
+
let url = new URL(this.clientStylingUrl);
|
|
45
|
+
let cssFile = document.createElement('style');
|
|
46
|
+
fetch(url.href)
|
|
47
|
+
.then((res) => res.text())
|
|
48
|
+
.then((data) => {
|
|
49
|
+
cssFile.innerHTML = data;
|
|
50
|
+
setTimeout(() => { this.host.prepend(cssFile); }, 1);
|
|
51
|
+
})
|
|
52
|
+
.catch((err) => {
|
|
53
|
+
console.log('Error ', err);
|
|
54
|
+
});
|
|
55
|
+
};
|
|
56
|
+
this.renderImage = (node, index) => {
|
|
57
|
+
const image = this.options[index].image;
|
|
58
|
+
setProps(image, this.settings.getSvgImageProps(index));
|
|
59
|
+
node.innerHTML = null;
|
|
60
|
+
node.appendChild(image);
|
|
61
|
+
};
|
|
62
|
+
this.updateSpinable = () => {
|
|
63
|
+
if (!!this.luckywheel.current) {
|
|
64
|
+
if (Number(this.luckywheel.current.remainingTimes) > 0) {
|
|
65
|
+
this.spinable = true;
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
window.postMessage({ type: 'ShowNoSpinLeftModal' });
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
this.spinable = false;
|
|
73
|
+
};
|
|
74
|
+
this.eventSpin = () => {
|
|
75
|
+
this.updateSpinable();
|
|
76
|
+
if (!this.spinable || this.isSpinning) {
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
this.isSpinning = true;
|
|
80
|
+
this.spinContainer = this.svg.querySelector('g.PartitionsContainer');
|
|
81
|
+
this.spinner.launch();
|
|
82
|
+
window.postMessage({
|
|
83
|
+
type: 'SpinLuckyWheel',
|
|
84
|
+
lotteryProgramID: this.luckywheel.program.id,
|
|
85
|
+
});
|
|
86
|
+
// todo: this code below simulates the server response,
|
|
87
|
+
// delete after implementation with GLС
|
|
88
|
+
setTimeout(() => {
|
|
89
|
+
window.postMessage({
|
|
90
|
+
type: 'SpinLuckyWheelRes',
|
|
91
|
+
data: {
|
|
92
|
+
item: { result: { wheelOfFortunePartitionIndex: 1 } },
|
|
93
|
+
success: false
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
}, 2500);
|
|
97
|
+
};
|
|
98
|
+
this.handleSpinClick = () => {
|
|
99
|
+
if (isSafari()) {
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
this.eventSpin();
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
handleEvent(e) {
|
|
106
|
+
const _a = e === null || e === void 0 ? void 0 : e.data, { type } = _a, rest = __rest(_a, ["type"]);
|
|
107
|
+
switch (type) {
|
|
108
|
+
case 'SpinLuckyWheelRes':
|
|
109
|
+
this.spinner.halt(this.settings.getDeg(rest.data.item.result.wheelOfFortunePartitionIndex), () => {
|
|
110
|
+
this.isSpinning = false;
|
|
111
|
+
this.updateSpinable();
|
|
112
|
+
const prizeText = this.luckywheel.program.wheelOfFortune.partitions[rest.data.item.result.wheelOfFortunePartitionIndex].prizeText;
|
|
113
|
+
window.postMessage({
|
|
114
|
+
type: 'ShowLuckywheelRewardModal',
|
|
115
|
+
data: {
|
|
116
|
+
PrizeMessage: prizeText['en'] || prizeText['*'],
|
|
117
|
+
HasError: rest.data.success,
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
});
|
|
121
|
+
break;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
componentDidRender() {
|
|
125
|
+
if (!this.limitStylingAppends && this.host) {
|
|
126
|
+
if (this.clientStyling)
|
|
127
|
+
this.setClientStyling();
|
|
128
|
+
if (this.clientStylingUrl)
|
|
129
|
+
this.setClientStylingURL();
|
|
130
|
+
this.limitStylingAppends = true;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
async componentWillLoad() {
|
|
134
|
+
this.options = await getOptions(this.luckywheel, Lang.en);
|
|
135
|
+
this.settings = new SvgCalc({
|
|
136
|
+
size: this.size,
|
|
137
|
+
radius: this.radius,
|
|
138
|
+
options: this.options,
|
|
139
|
+
themeIndex: 1,
|
|
140
|
+
contentdirection: this.contentdirection
|
|
141
|
+
});
|
|
142
|
+
this.spinner = new Spinner({
|
|
143
|
+
tick: (deg, speed) => {
|
|
144
|
+
setProps(this.spinContainer, {
|
|
145
|
+
style: [
|
|
146
|
+
`transform: rotate(${deg}deg)`,
|
|
147
|
+
`height: ${this.size}px`,
|
|
148
|
+
`width: ${this.size}px`,
|
|
149
|
+
].join(';'),
|
|
150
|
+
});
|
|
151
|
+
this.speed = speed * 0.5;
|
|
152
|
+
}
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
defineGeneralVariables() {
|
|
156
|
+
return {
|
|
157
|
+
'--length': `${this.options.length}`,
|
|
158
|
+
'--radius': `${this.radius}`,
|
|
159
|
+
'--ratio': `${Number(this.size) / 480}`,
|
|
160
|
+
'--size': `${this.size}`,
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
render() {
|
|
164
|
+
const sizeProps = { height: this.size, width: this.size };
|
|
165
|
+
const foreignObjectAgentProps = { 'height': `${this.size}px`, 'width': `${this.size}px` };
|
|
166
|
+
return (h("div", { key: '8d964d9a81690d2a22240cb1355abb3c7cf6f665', class: `WheelContainer ${this.device}`, style: this.defineGeneralVariables() }, h("svg", { key: '92f44f4659874e1fedaffa32813c57d1c9c04440', width: this.size, height: this.size, ref: (el) => { this.svg = el; } }, h("foreignObject", Object.assign({ key: 'f042214f1516c688035f650a92ff1437c5d06a36' }, sizeProps, { class: "Bottom Customable" }), h("div", { key: '6c80c40dfdb80159d75af8f70a75604257039c53', style: foreignObjectAgentProps })), h("g", Object.assign({ key: '46c01589f440c19727c8364d5e1bdb3a90082cac', class: "PartitionsContainer" }, this.settings.getSpinnerProps()), h("g", { key: 'fd0e9a65b7ba25db742ff12bb26e389b8d72e4c7', class: "PartitionsBackgrounds" }, this.options.map((_el, index) => {
|
|
167
|
+
return (h("foreignObject", { "clip-path": `url(#clip${index})`, class: "PartitionBackground Customable", style: { '--index': index.toString() }, width: this.size, height: this.size }, h("div", { style: foreignObjectAgentProps })));
|
|
168
|
+
})), h("g", { key: '8c116aa611b92b87b98f23aa344025953a27e90d', class: "PartitionsBackgroundStrokes" }, this.options.map((_el, index) => {
|
|
169
|
+
return (h("path", Object.assign({ class: "PartitionBackgroundStroke" }, this.settings.getPartitionDraw(index), { width: this.size, height: this.size })));
|
|
170
|
+
})), h("g", { key: '8907e6529e660e6452328aaa684995719b528ec6', class: "Partitions", style: { filter: this.speed > 0.3 ? `blur(${this.speed}px)` : '' } }, this.options.map((el, index) => {
|
|
171
|
+
return ([
|
|
172
|
+
el.image && (h("g", { class: `PartitionImage PartitionImage${index}`, ref: (el) => this.renderImage(el, index) })),
|
|
173
|
+
el.name && (h("foreignObject", Object.assign({ class: "PartitionText" }, this.settings.getSvgTextPropsAdjustedByImage(index)), h("div", { class: "PartitionTextEntityContainer" }, h("p", { class: `PartitionTextEntity${this.settings.contentdirection === 'clockwise' ? '' : ' Anticlockwise'}`, innerHTML: el.name }))))
|
|
174
|
+
]);
|
|
175
|
+
}))), h("g", { key: '62cf4e41e77374dd8f8c1af0833a4143e5d45403', class: { 'active': this.isPartitionsCustomableReady, 'PartitionsCustomable1': true } }, this.options.map((_el, index) => {
|
|
176
|
+
return (h("foreignObject", Object.assign({ class: "Partition1 Customable", style: { '--index': index.toString() } }, sizeProps), h("div", { style: foreignObjectAgentProps })));
|
|
177
|
+
})), h("g", { key: '6b0538da5d4f52e4b543205fb64dedda084f81b2', class: { 'active': this.isPartitionsCustomableReady, 'PartitionsCustomable2': true } }, this.options.map((_el, index) => {
|
|
178
|
+
return (h("foreignObject", Object.assign({ class: "Partition2 Customable", style: { '--index': index.toString() } }, sizeProps), h("div", { style: foreignObjectAgentProps })));
|
|
179
|
+
})), h("foreignObject", Object.assign({ key: '907db579094a7a192999510ade3150fdadbb94b6', class: "Middle Customable" }, sizeProps), h("div", { key: 'fa66cb96da2f285015fb8afeea5db05313ed832c', style: foreignObjectAgentProps })), h("foreignObject", Object.assign({ key: '688c0d33ad480ea331847286335a88fd74dbbb26', class: "Top Customable" }, sizeProps), h("div", { key: '292f6ea3549322a605fc8c3c61a93addcba00890', style: foreignObjectAgentProps })), h("g", { key: '22368be98007a7fa820cee96c666c363f85cd32a', class: { 'spinning': this.isSpinning, 'Center': true }, onClick: this.handleSpinClick }, h("foreignObject", { key: 'efffd7edb9ed21d5bd93896a4bead8931d91ff1f', x: Number(this.size) / 2 - 100 / 2, y: Number(this.size) / 2 - 100 / 2, width: 100, height: 100 })), h("g", { key: '7d8b741cc21d6d07f5736336f147cef2bfdf90ca' }, this.options.map((_el, index) => {
|
|
180
|
+
return (h("clipPath", { id: `clip${index}` }, h("path", Object.assign({}, this.settings.getPartitionDraw(index)))));
|
|
181
|
+
})))));
|
|
182
|
+
}
|
|
183
|
+
static get is() { return "casino-engagement-suite-luckywheel"; }
|
|
184
|
+
static get encapsulation() { return "shadow"; }
|
|
185
|
+
static get originalStyleUrls() {
|
|
186
|
+
return {
|
|
187
|
+
"$": ["casino-engagement-suite-luckywheel.scss"]
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
static get styleUrls() {
|
|
191
|
+
return {
|
|
192
|
+
"$": ["casino-engagement-suite-luckywheel.css"]
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
static get properties() {
|
|
196
|
+
return {
|
|
197
|
+
"clientStyling": {
|
|
198
|
+
"type": "string",
|
|
199
|
+
"mutable": false,
|
|
200
|
+
"complexType": {
|
|
201
|
+
"original": "string",
|
|
202
|
+
"resolved": "string",
|
|
203
|
+
"references": {}
|
|
204
|
+
},
|
|
205
|
+
"required": false,
|
|
206
|
+
"optional": false,
|
|
207
|
+
"docs": {
|
|
208
|
+
"tags": [],
|
|
209
|
+
"text": "Client custom styling via string"
|
|
210
|
+
},
|
|
211
|
+
"getter": false,
|
|
212
|
+
"setter": false,
|
|
213
|
+
"attribute": "client-styling",
|
|
214
|
+
"reflect": true,
|
|
215
|
+
"defaultValue": "''"
|
|
216
|
+
},
|
|
217
|
+
"clientStylingUrl": {
|
|
218
|
+
"type": "string",
|
|
219
|
+
"mutable": false,
|
|
220
|
+
"complexType": {
|
|
221
|
+
"original": "string",
|
|
222
|
+
"resolved": "string",
|
|
223
|
+
"references": {}
|
|
224
|
+
},
|
|
225
|
+
"required": false,
|
|
226
|
+
"optional": false,
|
|
227
|
+
"docs": {
|
|
228
|
+
"tags": [],
|
|
229
|
+
"text": "Client custom styling via url"
|
|
230
|
+
},
|
|
231
|
+
"getter": false,
|
|
232
|
+
"setter": false,
|
|
233
|
+
"attribute": "client-styling-url",
|
|
234
|
+
"reflect": true,
|
|
235
|
+
"defaultValue": "''"
|
|
236
|
+
},
|
|
237
|
+
"language": {
|
|
238
|
+
"type": "string",
|
|
239
|
+
"mutable": false,
|
|
240
|
+
"complexType": {
|
|
241
|
+
"original": "string",
|
|
242
|
+
"resolved": "string",
|
|
243
|
+
"references": {}
|
|
244
|
+
},
|
|
245
|
+
"required": false,
|
|
246
|
+
"optional": false,
|
|
247
|
+
"docs": {
|
|
248
|
+
"tags": [],
|
|
249
|
+
"text": "Language of the widget"
|
|
250
|
+
},
|
|
251
|
+
"getter": false,
|
|
252
|
+
"setter": false,
|
|
253
|
+
"attribute": "language",
|
|
254
|
+
"reflect": false,
|
|
255
|
+
"defaultValue": "'en'"
|
|
256
|
+
},
|
|
257
|
+
"device": {
|
|
258
|
+
"type": "string",
|
|
259
|
+
"mutable": false,
|
|
260
|
+
"complexType": {
|
|
261
|
+
"original": "\"Mobile\" | \"Tablet\" | \"Desktop\"",
|
|
262
|
+
"resolved": "\"Desktop\" | \"Mobile\" | \"Tablet\"",
|
|
263
|
+
"references": {}
|
|
264
|
+
},
|
|
265
|
+
"required": false,
|
|
266
|
+
"optional": false,
|
|
267
|
+
"docs": {
|
|
268
|
+
"tags": [],
|
|
269
|
+
"text": "User's device type"
|
|
270
|
+
},
|
|
271
|
+
"getter": false,
|
|
272
|
+
"setter": false,
|
|
273
|
+
"attribute": "device",
|
|
274
|
+
"reflect": false,
|
|
275
|
+
"defaultValue": "'Mobile' as 'Mobile' | 'Tablet' | 'Desktop'"
|
|
276
|
+
},
|
|
277
|
+
"luckywheel": {
|
|
278
|
+
"type": "unknown",
|
|
279
|
+
"mutable": false,
|
|
280
|
+
"complexType": {
|
|
281
|
+
"original": "LuckyWheel",
|
|
282
|
+
"resolved": "LuckyWheel",
|
|
283
|
+
"references": {
|
|
284
|
+
"LuckyWheel": {
|
|
285
|
+
"location": "import",
|
|
286
|
+
"path": "../../models/luckywheel",
|
|
287
|
+
"id": "../../../../packages/stencil/casino-engagement-suite-luckywheel/src/models/luckywheel.ts::LuckyWheel"
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
},
|
|
291
|
+
"required": false,
|
|
292
|
+
"optional": false,
|
|
293
|
+
"docs": {
|
|
294
|
+
"tags": [],
|
|
295
|
+
"text": "Active Luckywheel"
|
|
296
|
+
},
|
|
297
|
+
"getter": false,
|
|
298
|
+
"setter": false
|
|
299
|
+
},
|
|
300
|
+
"size": {
|
|
301
|
+
"type": "string",
|
|
302
|
+
"mutable": false,
|
|
303
|
+
"complexType": {
|
|
304
|
+
"original": "string",
|
|
305
|
+
"resolved": "string",
|
|
306
|
+
"references": {}
|
|
307
|
+
},
|
|
308
|
+
"required": false,
|
|
309
|
+
"optional": false,
|
|
310
|
+
"docs": {
|
|
311
|
+
"tags": [],
|
|
312
|
+
"text": "Wheel size"
|
|
313
|
+
},
|
|
314
|
+
"getter": false,
|
|
315
|
+
"setter": false,
|
|
316
|
+
"attribute": "size",
|
|
317
|
+
"reflect": false,
|
|
318
|
+
"defaultValue": "'440'"
|
|
319
|
+
},
|
|
320
|
+
"contentdirection": {
|
|
321
|
+
"type": "string",
|
|
322
|
+
"mutable": false,
|
|
323
|
+
"complexType": {
|
|
324
|
+
"original": "keyof typeof ContentDirection",
|
|
325
|
+
"resolved": "\"anticlockwise\" | \"clockwise\" | \"outward\"",
|
|
326
|
+
"references": {}
|
|
327
|
+
},
|
|
328
|
+
"required": false,
|
|
329
|
+
"optional": false,
|
|
330
|
+
"docs": {
|
|
331
|
+
"tags": [],
|
|
332
|
+
"text": "Content Direction"
|
|
333
|
+
},
|
|
334
|
+
"getter": false,
|
|
335
|
+
"setter": false,
|
|
336
|
+
"attribute": "contentdirection",
|
|
337
|
+
"reflect": false,
|
|
338
|
+
"defaultValue": "'anticlockwise'"
|
|
339
|
+
}
|
|
340
|
+
};
|
|
341
|
+
}
|
|
342
|
+
static get states() {
|
|
343
|
+
return {
|
|
344
|
+
"limitStylingAppends": {},
|
|
345
|
+
"isPartitionsCustomableReady": {},
|
|
346
|
+
"isSpinning": {},
|
|
347
|
+
"options": {},
|
|
348
|
+
"radius": {},
|
|
349
|
+
"speed": {},
|
|
350
|
+
"settings": {},
|
|
351
|
+
"svg": {},
|
|
352
|
+
"spinContainer": {},
|
|
353
|
+
"spinable": {},
|
|
354
|
+
"spinner": {}
|
|
355
|
+
};
|
|
356
|
+
}
|
|
357
|
+
static get elementRef() { return "host"; }
|
|
358
|
+
static get listeners() {
|
|
359
|
+
return [{
|
|
360
|
+
"name": "message",
|
|
361
|
+
"method": "handleEvent",
|
|
362
|
+
"target": "window",
|
|
363
|
+
"capture": false,
|
|
364
|
+
"passive": false
|
|
365
|
+
}];
|
|
366
|
+
}
|
|
367
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { CasinoEngagementSuiteLuckywheel } from './casino-engagement-suite-luckywheel';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './components/casino-engagement-suite-luckywheel';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export var CurrentInfo;
|
|
2
|
+
(function (CurrentInfo) {
|
|
3
|
+
CurrentInfo["ActiveTickets"] = "ActiveTickets";
|
|
4
|
+
CurrentInfo["ImplicitTickets"] = "ImplicitTickets";
|
|
5
|
+
CurrentInfo["RemainingTimes"] = "RemainingTimes";
|
|
6
|
+
})(CurrentInfo || (CurrentInfo = {}));
|
|
7
|
+
export var ContentDirection;
|
|
8
|
+
(function (ContentDirection) {
|
|
9
|
+
ContentDirection[ContentDirection["clockwise"] = 1] = "clockwise";
|
|
10
|
+
ContentDirection[ContentDirection["anticlockwise"] = -1] = "anticlockwise";
|
|
11
|
+
ContentDirection[ContentDirection["outward"] = 0] = "outward";
|
|
12
|
+
})(ContentDirection || (ContentDirection = {}));
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { convertDegToArc, easeOut } from "./utils";
|
|
2
|
+
export class Spinnable {
|
|
3
|
+
constructor() {
|
|
4
|
+
this.arcStart = 0;
|
|
5
|
+
this.spinTime = 0;
|
|
6
|
+
this.spinTimeTotal = Math.random() * 3 + 8 * 1000;
|
|
7
|
+
this.spinAngleStart = 0;
|
|
8
|
+
this.spinable = true;
|
|
9
|
+
}
|
|
10
|
+
spin(deg, fn) {
|
|
11
|
+
this.spinAngleStart = deg;
|
|
12
|
+
if (!this.spinable)
|
|
13
|
+
return;
|
|
14
|
+
this.spinable = false;
|
|
15
|
+
this.spinTimeTotal = 1000;
|
|
16
|
+
this.spinTime = 0;
|
|
17
|
+
this.spinTick(fn);
|
|
18
|
+
}
|
|
19
|
+
spinTick(fn) {
|
|
20
|
+
this.spinTime += 30;
|
|
21
|
+
if (this.spinTime >= this.spinTimeTotal) {
|
|
22
|
+
this.stop(fn);
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
var spinAngle = this.spinAngleStart -
|
|
26
|
+
easeOut(this.spinTime, 0, this.spinAngleStart, this.spinTimeTotal);
|
|
27
|
+
this.arcStart += convertDegToArc(spinAngle);
|
|
28
|
+
this.tick();
|
|
29
|
+
this.spinTimeout = setTimeout(this.spinTick.bind(this, fn), 10);
|
|
30
|
+
}
|
|
31
|
+
stop(fn) {
|
|
32
|
+
clearTimeout(this.spinTimeout);
|
|
33
|
+
this.afterStop();
|
|
34
|
+
this.spinable = true;
|
|
35
|
+
if (fn)
|
|
36
|
+
fn();
|
|
37
|
+
}
|
|
38
|
+
}
|