@everymatrix/casino-challenges-overlay-modal 0.16.1 → 0.16.2
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-challenges-overlay-modal/casino-challenges-overlay-modal-a6da84b6.js +1 -0
- package/dist/casino-challenges-overlay-modal/casino-challenges-overlay-modal.entry.js +1 -1
- package/dist/casino-challenges-overlay-modal/casino-challenges-overlay-modal.esm.js +1 -1
- package/dist/casino-challenges-overlay-modal/index-603664b0.js +2 -0
- package/dist/casino-challenges-overlay-modal/index.esm.js +1 -1
- package/dist/cjs/casino-challenges-overlay-modal-5004ed4a.js +369 -0
- package/dist/cjs/casino-challenges-overlay-modal.cjs.entry.js +2 -2
- package/dist/cjs/casino-challenges-overlay-modal.cjs.js +2 -2
- package/dist/cjs/{index-c1a8ddc1.js → index-3aa45572.js} +26 -3
- package/dist/cjs/index.cjs.js +2 -2
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/components/casino-challenges-overlay-modal/casino-challenges-overlay-modal.css +191 -36
- package/dist/collection/components/casino-challenges-overlay-modal/casino-challenges-overlay-modal.js +158 -1
- package/dist/collection/utils/locale.utils.js +10 -2
- package/dist/collection/utils/types.js +1 -0
- package/dist/collection/utils/utils.js +7 -3
- package/dist/esm/casino-challenges-overlay-modal-a6da84b6.js +367 -0
- package/dist/esm/casino-challenges-overlay-modal.entry.js +2 -2
- package/dist/esm/casino-challenges-overlay-modal.js +3 -3
- package/dist/esm/{index-f13cfc58.js → index-603664b0.js} +26 -3
- package/dist/esm/index.js +2 -2
- package/dist/esm/loader.js +3 -3
- package/dist/types/components/casino-challenges-overlay-modal/casino-challenges-overlay-modal.d.ts +20 -0
- package/dist/types/components.d.ts +6 -0
- package/dist/types/utils/types.d.ts +4 -0
- package/dist/types/utils/utils.d.ts +1 -1
- package/package.json +1 -1
- package/dist/casino-challenges-overlay-modal/casino-challenges-overlay-modal-f5be3740.js +0 -1
- package/dist/casino-challenges-overlay-modal/index-f13cfc58.js +0 -2
- package/dist/cjs/casino-challenges-overlay-modal-3fbdf2d7.js +0 -244
- package/dist/esm/casino-challenges-overlay-modal-f5be3740.js +0 -242
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-3aa45572.js');
|
|
6
6
|
const appGlobals = require('./app-globals-3a1e7e63.js');
|
|
7
7
|
|
|
8
8
|
const defineCustomElements = async (win, options) => {
|
|
9
9
|
if (typeof window === 'undefined') return undefined;
|
|
10
10
|
await appGlobals.globalScripts();
|
|
11
|
-
return index.bootstrapLazy([["casino-challenges-overlay-modal.cjs",[[1,"casino-challenges-overlay-modal",{"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"language":[513],"isOpen":[516,"is-open"],"reward":[513],"addition":[516],"handleClick":[16],"errored":[516],"orderNumber":[514,"order-number"]},null,{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"]}]]]], options);
|
|
11
|
+
return index.bootstrapLazy([["casino-challenges-overlay-modal.cjs",[[1,"casino-challenges-overlay-modal",{"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"language":[513],"isOpen":[516,"is-open"],"reward":[513],"addition":[516],"handleClick":[16],"errored":[516],"orderNumber":[514,"order-number"],"isFreeSpinsGranted":[516,"is-free-spins-granted"],"bonusProgramGames":[16],"currentIndex":[32]},null,{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"],"bonusProgramGames":["handleBonusProgramGameChange"]}]]]], options);
|
|
12
12
|
};
|
|
13
13
|
|
|
14
14
|
exports.setNonce = index.setNonce;
|
|
@@ -41,11 +41,11 @@ button:focus {
|
|
|
41
41
|
flex-direction: column;
|
|
42
42
|
align-items: center;
|
|
43
43
|
position: relative;
|
|
44
|
-
background: linear-gradient(90deg, var(--emw--color-background, #
|
|
45
|
-
padding:
|
|
44
|
+
background: linear-gradient(90deg, var(--emw--color-background, #003e5c) 0.05%, var(--emw--color-background-secondary, #113b21) 87.69%);
|
|
45
|
+
padding: 60px;
|
|
46
46
|
border-radius: 26px;
|
|
47
|
-
border: 2px solid var(--emw--color-primary-variant, #
|
|
48
|
-
width:
|
|
47
|
+
border: 2px solid var(--emw--color-primary-variant, #1e654f);
|
|
48
|
+
width: 540px;
|
|
49
49
|
max-width: 90%;
|
|
50
50
|
text-align: center;
|
|
51
51
|
max-height: 90dvh;
|
|
@@ -55,22 +55,24 @@ button:focus {
|
|
|
55
55
|
|
|
56
56
|
.InnerContainer {
|
|
57
57
|
border-radius: 20px;
|
|
58
|
-
background: #
|
|
59
|
-
padding:
|
|
58
|
+
background: #f9f8f8;
|
|
59
|
+
padding: 40px 50px;
|
|
60
60
|
width: 100%;
|
|
61
|
+
display: flex;
|
|
62
|
+
flex-direction: column;
|
|
63
|
+
align-items: center;
|
|
61
64
|
}
|
|
62
65
|
|
|
63
66
|
.ImageWrapper {
|
|
64
|
-
margin-bottom:
|
|
67
|
+
margin-bottom: 10px;
|
|
65
68
|
}
|
|
66
69
|
|
|
67
70
|
.ModalHeader {
|
|
68
71
|
color: var(--emw--color-typography, #212529);
|
|
69
72
|
text-align: center;
|
|
70
73
|
font-family: var(--emw--button-typography, "PF BeauSans Pro", sans-serif);
|
|
71
|
-
font-size: 16px;
|
|
72
|
-
font-
|
|
73
|
-
font-weight: 700;
|
|
74
|
+
font-size: var(--emw--font-size-medium, 16px);
|
|
75
|
+
font-weight: var(--emw--font-weight-bold, 700);
|
|
74
76
|
line-height: normal;
|
|
75
77
|
text-transform: uppercase;
|
|
76
78
|
letter-spacing: 1px;
|
|
@@ -79,54 +81,51 @@ button:focus {
|
|
|
79
81
|
.ModalSubtitle {
|
|
80
82
|
color: var(--emw--color-gray-300, #212529);
|
|
81
83
|
text-align: center;
|
|
82
|
-
font-size: var(--emw--font-size-
|
|
83
|
-
font-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
84
|
+
font-size: var(--emw--font-size-medium, 16px);
|
|
85
|
+
font-weight: var(--emw--font-weigh-normal, 400);
|
|
86
|
+
margin-top: 10px;
|
|
87
|
+
line-height: 24px;
|
|
88
|
+
width: 316px;
|
|
87
89
|
}
|
|
88
90
|
|
|
89
91
|
.ModalErrorMessage {
|
|
90
92
|
color: var(--emw--color-typography, #212529);
|
|
91
93
|
font-size: var(--emw--font-size-medium, 16px);
|
|
92
94
|
line-height: 24px;
|
|
93
|
-
margin: 10px 0
|
|
95
|
+
margin: 10px 0;
|
|
94
96
|
}
|
|
95
97
|
|
|
96
98
|
.ModalReward {
|
|
97
|
-
background: linear-gradient(90deg, var(--emw--color-primary, #
|
|
99
|
+
background: linear-gradient(90deg, var(--emw--color-primary, #24aa4d) 0%, var(--emw--color-background-secondary, #113f21) 100%);
|
|
98
100
|
background-clip: text;
|
|
99
101
|
-webkit-background-clip: text;
|
|
100
102
|
-webkit-text-fill-color: transparent;
|
|
101
103
|
font-family: var(--emw--button-typography, "PF BeauSans Pro", sans-serif);
|
|
102
|
-
font-size:
|
|
103
|
-
font-
|
|
104
|
-
font-weight: 700;
|
|
105
|
-
margin-bottom: 10px;
|
|
104
|
+
font-size: var(--emw--font-size-medium, 16px);
|
|
105
|
+
font-weight: var(--emw--font-weight-bold, 700);
|
|
106
106
|
}
|
|
107
107
|
|
|
108
108
|
.ModalAddition {
|
|
109
109
|
color: var(--emw--color-gray-100, #727672);
|
|
110
110
|
text-align: center;
|
|
111
111
|
font-family: var(--emw--button-typography, "Roboto", sans-serif);
|
|
112
|
-
font-size: var(--emw--font-size-
|
|
112
|
+
font-size: var(--emw--font-size-medium, 16px);
|
|
113
113
|
font-style: normal;
|
|
114
114
|
font-weight: 400;
|
|
115
|
-
height: 39px;
|
|
116
115
|
align-content: center;
|
|
116
|
+
margin-top: 10px;
|
|
117
|
+
line-height: 24px;
|
|
117
118
|
}
|
|
118
119
|
|
|
119
120
|
.ModalAddition span {
|
|
120
|
-
background: linear-gradient(90deg, var(--emw--color-primary, #
|
|
121
|
+
background: linear-gradient(90deg, var(--emw--color-primary, #24aa4d) 0%, var(--emw--color-background-secondary, #113f21) 100%);
|
|
121
122
|
background-clip: text;
|
|
122
123
|
-webkit-background-clip: text;
|
|
123
124
|
-webkit-text-fill-color: transparent;
|
|
124
|
-
font-size: 12px;
|
|
125
125
|
font-style: normal;
|
|
126
126
|
font-weight: 700;
|
|
127
127
|
line-height: 15px;
|
|
128
128
|
text-decoration: none;
|
|
129
|
-
margin-left: 8px;
|
|
130
129
|
position: relative;
|
|
131
130
|
}
|
|
132
131
|
.ModalAddition span::after {
|
|
@@ -136,22 +135,178 @@ button:focus {
|
|
|
136
135
|
bottom: 0;
|
|
137
136
|
height: 1px;
|
|
138
137
|
width: 100%;
|
|
139
|
-
background: linear-gradient(90deg, var(--emw--color-primary, #
|
|
138
|
+
background: linear-gradient(90deg, var(--emw--color-primary, #24aa4d) 0%, var(--emw--color-background-secondary, #113f21) 100%);
|
|
140
139
|
}
|
|
141
140
|
|
|
142
141
|
.ModalAction {
|
|
143
142
|
border-radius: var(--emw--button-border-radius, 99px);
|
|
144
|
-
border: 2px solid var(--emw--button-border-color, #
|
|
145
|
-
background: linear-gradient(90deg, var(--emw--color-primary, #
|
|
143
|
+
border: 2px solid var(--emw--button-border-color, #083b17);
|
|
144
|
+
background: linear-gradient(90deg, var(--emw--color-primary, #24aa4d) 0%, var(--emw--color-background-secondary, #113f21) 100%);
|
|
146
145
|
padding: 9px 20px;
|
|
147
|
-
margin-top:
|
|
146
|
+
margin-top: 24px;
|
|
148
147
|
text-transform: uppercase;
|
|
149
|
-
color: var(--emw--button-text-color, #
|
|
148
|
+
color: var(--emw--button-text-color, #fff);
|
|
150
149
|
text-align: center;
|
|
151
150
|
font-family: var(--emw--button-typography, "PF BeauSans Pro", sans-serif);
|
|
152
|
-
font-size:
|
|
153
|
-
font-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
151
|
+
font-size: var(--emw--font-size-small, 14px);
|
|
152
|
+
font-weight: var(--emw--font-weight-bold, 700);
|
|
153
|
+
min-width: 100px;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.ModalSliderWrapper {
|
|
157
|
+
margin-top: 24px;
|
|
158
|
+
position: relative;
|
|
159
|
+
overflow: hidden;
|
|
160
|
+
width: 316px;
|
|
161
|
+
justify-self: center;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
.ModalSlider {
|
|
165
|
+
display: flex;
|
|
166
|
+
transition: transform 0.3s ease;
|
|
167
|
+
cursor: pointer;
|
|
168
|
+
touch-action: pan-y;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.ModalSlider:active {
|
|
172
|
+
cursor: grabbing;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
.ModalSlide {
|
|
176
|
+
min-width: 100%;
|
|
177
|
+
flex-shrink: 0;
|
|
178
|
+
position: relative;
|
|
179
|
+
display: flex;
|
|
180
|
+
justify-content: center;
|
|
181
|
+
}
|
|
182
|
+
.ModalSlide .ModalSlideSpins {
|
|
183
|
+
position: absolute;
|
|
184
|
+
top: 50%;
|
|
185
|
+
left: 50%;
|
|
186
|
+
transform: translate(-50%, -50%);
|
|
187
|
+
border-radius: 99px;
|
|
188
|
+
width: 188px;
|
|
189
|
+
height: 48px;
|
|
190
|
+
text-transform: uppercase;
|
|
191
|
+
font-size: var(--emw--font-size-small, 14px);
|
|
192
|
+
font-weight: var(--emw--font-weight-bold, 700);
|
|
193
|
+
color: var(--emw--color-white, white);
|
|
194
|
+
align-content: center;
|
|
195
|
+
background: var(--emw--use-spins-button-bg, linear-gradient(180deg, #ea9018 0%, #e0a84e 100%));
|
|
196
|
+
}
|
|
197
|
+
.ModalSlide .ModalSlideSpins svg {
|
|
198
|
+
margin-left: 8px;
|
|
199
|
+
}
|
|
200
|
+
.ModalSlide .ModalSlideImageWrapper {
|
|
201
|
+
position: relative;
|
|
202
|
+
width: 244px;
|
|
203
|
+
height: 144px;
|
|
204
|
+
border-radius: 12px;
|
|
205
|
+
overflow: hidden;
|
|
206
|
+
}
|
|
207
|
+
.ModalSlide .ModalSlideImageWrapper img {
|
|
208
|
+
width: 100%;
|
|
209
|
+
height: 100%;
|
|
210
|
+
object-fit: cover;
|
|
211
|
+
pointer-events: none;
|
|
212
|
+
user-select: none;
|
|
213
|
+
-webkit-user-drag: none;
|
|
214
|
+
}
|
|
215
|
+
.ModalSlide .ModalSlideImageWrapper::after {
|
|
216
|
+
content: "";
|
|
217
|
+
position: absolute;
|
|
218
|
+
inset: 0;
|
|
219
|
+
background: var(--emw--color-black-shadow, rgba(0, 0, 0, 0.5019607843));
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
.prev,
|
|
223
|
+
.next {
|
|
224
|
+
position: absolute;
|
|
225
|
+
top: 42%;
|
|
226
|
+
transform: translateY(-50%);
|
|
227
|
+
stroke: white;
|
|
228
|
+
width: 22px;
|
|
229
|
+
height: 22px;
|
|
230
|
+
border-radius: 50%;
|
|
231
|
+
border: 2px solid var(--emw--button-border-color, #083b17);
|
|
232
|
+
background: var(--emw--slider-arrow-primary-bg, linear-gradient(90deg, #24aa4d 0%, #113f21 100%));
|
|
233
|
+
display: flex;
|
|
234
|
+
align-items: center;
|
|
235
|
+
justify-content: center;
|
|
236
|
+
}
|
|
237
|
+
.prev.disabled,
|
|
238
|
+
.next.disabled {
|
|
239
|
+
stroke: var(--emw--color-gray-100, #727672);
|
|
240
|
+
background: var(--emw--ingame-color-black40, rgba(0, 0, 0, 0.4));
|
|
241
|
+
border-color: var(--emw--color-gray-100, #727672);
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
.prev {
|
|
245
|
+
left: 2px;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
.next {
|
|
249
|
+
right: 2px;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
.ModalSliderDots {
|
|
253
|
+
display: flex;
|
|
254
|
+
justify-content: center;
|
|
255
|
+
margin-top: 10px;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
.ModalSliderDot {
|
|
259
|
+
width: 8px;
|
|
260
|
+
height: 8px;
|
|
261
|
+
border-radius: 50%;
|
|
262
|
+
background: var(--emw--color-gray-50, #e2e2e2);
|
|
263
|
+
margin: 8px;
|
|
264
|
+
cursor: pointer;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
.ModalSliderDot.active {
|
|
268
|
+
background: var(--emw--border-success-color, #00b74f);
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
.Mobile .ModalContent {
|
|
272
|
+
padding: 26px;
|
|
273
|
+
}
|
|
274
|
+
.Mobile .InnerContainer {
|
|
275
|
+
padding: 25px;
|
|
276
|
+
}
|
|
277
|
+
.Mobile .ImageWrapper {
|
|
278
|
+
margin-bottom: 6px;
|
|
279
|
+
}
|
|
280
|
+
.Mobile .ModalHeader {
|
|
281
|
+
margin-bottom: 16px;
|
|
282
|
+
}
|
|
283
|
+
.Mobile .ModalAddition {
|
|
284
|
+
margin-top: 8px;
|
|
285
|
+
}
|
|
286
|
+
.Mobile .ModalAction,
|
|
287
|
+
.Mobile .ModalSliderWrapper {
|
|
288
|
+
margin-top: 20px;
|
|
289
|
+
}
|
|
290
|
+
.Mobile .ModalSliderWrapper {
|
|
291
|
+
width: 230px;
|
|
292
|
+
justify-self: center;
|
|
293
|
+
}
|
|
294
|
+
.Mobile .ModalSliderWrapper .prev,
|
|
295
|
+
.Mobile .ModalSliderWrapper .next {
|
|
296
|
+
display: none;
|
|
297
|
+
}
|
|
298
|
+
.Mobile .ModalSliderWrapper .ModalSlideImageWrapper {
|
|
299
|
+
width: 220px;
|
|
300
|
+
height: 125px;
|
|
301
|
+
}
|
|
302
|
+
.Mobile .ModalSliderWrapper .ModalSlideSpins {
|
|
303
|
+
width: 154px;
|
|
304
|
+
height: 34px;
|
|
305
|
+
font-size: var(--emw--font-size-x-small, 12px);
|
|
306
|
+
}
|
|
307
|
+
.Mobile .ModalSliderWrapper .ModalSliderDot {
|
|
308
|
+
margin: 8px 4px;
|
|
309
|
+
}
|
|
310
|
+
.Mobile .ModalSubtitle {
|
|
311
|
+
width: 220px;
|
|
157
312
|
}
|
|
@@ -2,8 +2,76 @@ import { h } from "@stencil/core";
|
|
|
2
2
|
import { setClientStyling, setClientStylingURL, setStreamStyling } from "../../../../../../../../libs/common/src/styling/index";
|
|
3
3
|
import giftBox from "../../assets/giftbox.svg";
|
|
4
4
|
import { resolveTranslationUrl, translate } from "../../utils/locale.utils";
|
|
5
|
+
import { isMobile } from "../../utils/utils";
|
|
5
6
|
export class CasinoChallengesOverlayModal {
|
|
6
7
|
constructor() {
|
|
8
|
+
this.startX = 0;
|
|
9
|
+
this.currentTranslate = 0;
|
|
10
|
+
this.prevTranslate = 0;
|
|
11
|
+
this.isDragging = false;
|
|
12
|
+
this.moved = false;
|
|
13
|
+
this.threshold = 50;
|
|
14
|
+
this.onPointerDown = (e) => {
|
|
15
|
+
var _a;
|
|
16
|
+
this.isDragging = true;
|
|
17
|
+
this.moved = false;
|
|
18
|
+
this.startX = e.clientX;
|
|
19
|
+
(_a = this.sliderContainer) === null || _a === void 0 ? void 0 : _a.setPointerCapture(e.pointerId);
|
|
20
|
+
};
|
|
21
|
+
this.onPointerMove = (e) => {
|
|
22
|
+
if (!this.isDragging)
|
|
23
|
+
return;
|
|
24
|
+
const diff = e.clientX - this.startX;
|
|
25
|
+
if (Math.abs(diff) > 5) {
|
|
26
|
+
this.moved = true;
|
|
27
|
+
}
|
|
28
|
+
this.currentTranslate = this.prevTranslate + diff;
|
|
29
|
+
this.setSliderPosition(this.currentTranslate);
|
|
30
|
+
};
|
|
31
|
+
this.onPointerUp = (e) => {
|
|
32
|
+
var _a;
|
|
33
|
+
if (!this.isDragging)
|
|
34
|
+
return;
|
|
35
|
+
this.isDragging = false;
|
|
36
|
+
(_a = this.sliderContainer) === null || _a === void 0 ? void 0 : _a.releasePointerCapture(e.pointerId);
|
|
37
|
+
const movedBy = this.currentTranslate - this.prevTranslate;
|
|
38
|
+
if (movedBy < -this.threshold)
|
|
39
|
+
this.next();
|
|
40
|
+
else if (movedBy > this.threshold)
|
|
41
|
+
this.prev();
|
|
42
|
+
else
|
|
43
|
+
this.setPositionByIndex();
|
|
44
|
+
};
|
|
45
|
+
this.next = () => {
|
|
46
|
+
if (!this.bonusProgramGames.length)
|
|
47
|
+
return;
|
|
48
|
+
if (this.currentIndex === this.bonusProgramGames.length - 1) {
|
|
49
|
+
this.setPositionByIndex();
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
this.currentIndex = (this.currentIndex + 1) % this.bonusProgramGames.length;
|
|
53
|
+
this.setPositionByIndex();
|
|
54
|
+
};
|
|
55
|
+
this.prev = () => {
|
|
56
|
+
if (!this.bonusProgramGames.length)
|
|
57
|
+
return;
|
|
58
|
+
if (this.currentIndex === 0) {
|
|
59
|
+
this.setPositionByIndex();
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
this.currentIndex = (this.currentIndex - 1 + this.bonusProgramGames.length) % this.bonusProgramGames.length;
|
|
63
|
+
this.setPositionByIndex();
|
|
64
|
+
};
|
|
65
|
+
this.onSlideClick = (gameSlug) => {
|
|
66
|
+
if (this.moved)
|
|
67
|
+
return;
|
|
68
|
+
if (gameSlug) {
|
|
69
|
+
window.postMessage({
|
|
70
|
+
type: 'ChallengeInGameRedirect',
|
|
71
|
+
data: { Slug: gameSlug }
|
|
72
|
+
}, window.location.href);
|
|
73
|
+
}
|
|
74
|
+
};
|
|
7
75
|
this.mbSource = undefined;
|
|
8
76
|
this.clientStyling = undefined;
|
|
9
77
|
this.clientStylingUrl = undefined;
|
|
@@ -15,6 +83,9 @@ export class CasinoChallengesOverlayModal {
|
|
|
15
83
|
this.handleClick = () => { };
|
|
16
84
|
this.errored = false;
|
|
17
85
|
this.orderNumber = 0;
|
|
86
|
+
this.isFreeSpinsGranted = false;
|
|
87
|
+
this.bonusProgramGames = [];
|
|
88
|
+
this.currentIndex = 0;
|
|
18
89
|
}
|
|
19
90
|
handleClientStylingChange(newValue, oldValue) {
|
|
20
91
|
if (newValue != oldValue) {
|
|
@@ -31,6 +102,12 @@ export class CasinoChallengesOverlayModal {
|
|
|
31
102
|
setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription);
|
|
32
103
|
}
|
|
33
104
|
}
|
|
105
|
+
handleBonusProgramGameChange(newValue) {
|
|
106
|
+
if (this.currentIndex >= newValue.length) {
|
|
107
|
+
this.currentIndex = 0;
|
|
108
|
+
this.setPositionByIndex();
|
|
109
|
+
}
|
|
110
|
+
}
|
|
34
111
|
componentWillLoad() {
|
|
35
112
|
if (this.translationUrl) {
|
|
36
113
|
resolveTranslationUrl(this.translationUrl);
|
|
@@ -45,12 +122,44 @@ export class CasinoChallengesOverlayModal {
|
|
|
45
122
|
if (this.clientStylingUrl)
|
|
46
123
|
setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
|
|
47
124
|
}
|
|
125
|
+
this.setPositionByIndex();
|
|
48
126
|
}
|
|
49
127
|
disconnectedCallback() {
|
|
50
128
|
this.stylingSubscription && this.stylingSubscription.unsubscribe();
|
|
51
129
|
}
|
|
130
|
+
setSliderPosition(value) {
|
|
131
|
+
if (this.bonusProgramGames.length < 2)
|
|
132
|
+
return;
|
|
133
|
+
if (this.sliderContainer) {
|
|
134
|
+
this.sliderContainer.style.transform = `translateX(${value}px)`;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
setPositionByIndex() {
|
|
138
|
+
var _a;
|
|
139
|
+
const width = ((_a = this.sliderContainer) === null || _a === void 0 ? void 0 : _a.clientWidth) || 0;
|
|
140
|
+
this.currentTranslate = -this.currentIndex * width;
|
|
141
|
+
this.prevTranslate = this.currentTranslate;
|
|
142
|
+
this.setSliderPosition(this.currentTranslate);
|
|
143
|
+
}
|
|
52
144
|
render() {
|
|
53
|
-
|
|
145
|
+
var _a;
|
|
146
|
+
return (h("div", { key: 'a069be23593a04f768fcca1b86094d3af8e58ca3', ref: (el) => (this.stylingContainer = el), class: {
|
|
147
|
+
ModalOverlay: true,
|
|
148
|
+
Mobile: isMobile() || window.innerWidth <= 768,
|
|
149
|
+
Open: this.isOpen
|
|
150
|
+
} }, h("div", { key: 'f41925c7697a9cd1c3da2f61c4e3a0673bd5728b', class: "ModalWinAnimation" }), h("div", { key: '9fac97b95cc682790d5e925fc40782ae71b9f54c', class: "ModalContent GradientBorder" }, h("div", { key: '14683c5830b0317dd11d064a6a88a69f4805d250', class: "InnerContainer" }, !this.errored && (h("div", { key: '2b7091ea3619423d41d98440d7800d95ec92a1bc', class: "ImageWrapper" }, h("img", { key: 'd23cfe79a0e7a2e138c0bb1e9894cc7534e5c173', src: giftBox, alt: "gift-box-icon" }))), h("h1", { key: 'f95fbb76d703c28c45c568a0163df747dd269556', class: "ModalHeader" }, translate(this.errored ? 'errorTitle' : 'congrats', this.language)), this.errored ? (h("div", { class: "ModalErrorMessage" }, translate('errorSubTitle', this.language))) : (h("div", { class: "ModalSubtitle" }, `${translate('level', this.language)} ${this.orderNumber} ${translate('completed', this.language)}`, h("div", null, translate('youWon', this.language)), h("div", { class: "ModalReward" }, this.reward), this.isFreeSpinsGranted && (h("div", { class: "ModalAddition" }, translate('playNowOrLater', this.language))), h("div", { class: "ModalAddition" }, translate('rewardInLobby', this.language)))), this.addition && (h("div", { key: '201e5f0d4b3e04797c0478429dcd3c22dd30a4d3', class: "ModalAddition" }, h("div", { key: 'ef793ed69b572f4a9654f55cae0a71dd66af0ad6' }, translate('physicalReward', this.language)), h("span", { key: '131e4d36dc54d3682469a61c7196f0e379efe42f' }, translate('linkText', this.language)))), h("button", { key: 'bca6bc399277288d0ca2d9bd453eef6f6c9793e2', class: "ModalAction", onClick: this.handleClick }, this.errored ? translate('errorBtnText', this.language) : translate('continue', this.language)), this.isFreeSpinsGranted && ((_a = this.bonusProgramGames) === null || _a === void 0 ? void 0 : _a.length) > 0 && (h("div", { key: '13b921d1ff411987b9045950b1676e22b52481ab', class: "ModalSliderWrapper" }, h("div", { key: 'b48c9553aec2d709cede91d67b678aa545ed03a2', class: "ModalSlider", ref: (el) => (this.sliderContainer = el), onPointerDown: this.onPointerDown, onPointerMove: this.onPointerMove, onPointerUp: this.onPointerUp, onPointerLeave: this.onPointerUp }, this.bonusProgramGames.map((item) => (h("div", { class: "ModalSlide", key: item.GameSlug, onClick: () => this.onSlideClick(item.GameSlug) }, h("div", { class: "ModalSlideImageWrapper" }, h("img", { src: item.Thumbnail, alt: "" })), h("div", { class: "ModalSlideSpins" }, translate('useSpinsNow', this.language), h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "6", height: "10", viewBox: "0 0 6 10", fill: "none" }, h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M0.195262 0.195262C0.455612 -0.0650874 0.877722 -0.0650874 1.13807 0.195262L5.13807 4.19526C5.39842 4.45561 5.39842 4.87772 5.13807 5.13807L1.13807 9.13807C0.877722 9.39842 0.455612 9.39842 0.195262 9.13807C-0.0650874 8.87772 -0.0650874 8.45561 0.195262 8.19526L3.72386 4.66667L0.195262 1.13807C-0.0650874 0.877722 -0.0650874 0.455612 0.195262 0.195262Z", fill: "white" }))))))), this.bonusProgramGames.length > 1 && (h("div", { key: '5878e9df2ba211fbe330d959c89278d611b0d501' }, h("button", { key: '25008b1e3500bdde9b1cf9285640ca342e8490a7', class: {
|
|
151
|
+
prev: true,
|
|
152
|
+
disabled: this.currentIndex === 0
|
|
153
|
+
}, onClick: this.prev }, h("svg", { key: '2433588c5615f8b788022f8859a98f9d16504e84', xmlns: "http://www.w3.org/2000/svg", width: "6", height: "10", viewBox: "0 0 6 10", fill: "none" }, h("path", { key: '14d34bf5a6538e458b7c18bb481f6a5b7c2f55bf', d: "M5 1L1 5L5 9", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }))), h("button", { key: '63be7d730151f3741802f415ec3c9e66508b78e7', class: {
|
|
154
|
+
next: true,
|
|
155
|
+
disabled: this.currentIndex === this.bonusProgramGames.length - 1
|
|
156
|
+
}, onClick: this.next }, h("svg", { key: '52f1005fe412de34c71060974688874e5bf45a47', xmlns: "http://www.w3.org/2000/svg", width: "6", height: "10", viewBox: "0 0 6 10", fill: "none" }, h("path", { key: '1af4edf8dc717f54d5735d34ec27de8313918e0d', d: "M1 1L5 5L1 9", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }))), h("div", { key: '13201c67ba3cb6a1215fb41f5a6fe3ae60864bdd', class: "ModalSliderDots" }, this.bonusProgramGames.map((_, i) => (h("span", { class: {
|
|
157
|
+
ModalSliderDot: true,
|
|
158
|
+
active: i === this.currentIndex
|
|
159
|
+
}, onClick: () => {
|
|
160
|
+
this.currentIndex = i;
|
|
161
|
+
this.setPositionByIndex();
|
|
162
|
+
} }))))))))))));
|
|
54
163
|
}
|
|
55
164
|
static get is() { return "casino-challenges-overlay-modal"; }
|
|
56
165
|
static get encapsulation() { return "shadow"; }
|
|
@@ -263,9 +372,54 @@ export class CasinoChallengesOverlayModal {
|
|
|
263
372
|
"attribute": "order-number",
|
|
264
373
|
"reflect": true,
|
|
265
374
|
"defaultValue": "0"
|
|
375
|
+
},
|
|
376
|
+
"isFreeSpinsGranted": {
|
|
377
|
+
"type": "boolean",
|
|
378
|
+
"mutable": false,
|
|
379
|
+
"complexType": {
|
|
380
|
+
"original": "boolean",
|
|
381
|
+
"resolved": "boolean",
|
|
382
|
+
"references": {}
|
|
383
|
+
},
|
|
384
|
+
"required": false,
|
|
385
|
+
"optional": false,
|
|
386
|
+
"docs": {
|
|
387
|
+
"tags": [],
|
|
388
|
+
"text": ""
|
|
389
|
+
},
|
|
390
|
+
"attribute": "is-free-spins-granted",
|
|
391
|
+
"reflect": true,
|
|
392
|
+
"defaultValue": "false"
|
|
393
|
+
},
|
|
394
|
+
"bonusProgramGames": {
|
|
395
|
+
"type": "unknown",
|
|
396
|
+
"mutable": false,
|
|
397
|
+
"complexType": {
|
|
398
|
+
"original": "IBonusProgramGame[]",
|
|
399
|
+
"resolved": "IBonusProgramGame[]",
|
|
400
|
+
"references": {
|
|
401
|
+
"IBonusProgramGame": {
|
|
402
|
+
"location": "import",
|
|
403
|
+
"path": "../../utils/types",
|
|
404
|
+
"id": "../../../../packages/stencil/casino-challenges-overlay-modal/src/utils/types.ts::IBonusProgramGame"
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
},
|
|
408
|
+
"required": false,
|
|
409
|
+
"optional": false,
|
|
410
|
+
"docs": {
|
|
411
|
+
"tags": [],
|
|
412
|
+
"text": ""
|
|
413
|
+
},
|
|
414
|
+
"defaultValue": "[]"
|
|
266
415
|
}
|
|
267
416
|
};
|
|
268
417
|
}
|
|
418
|
+
static get states() {
|
|
419
|
+
return {
|
|
420
|
+
"currentIndex": {}
|
|
421
|
+
};
|
|
422
|
+
}
|
|
269
423
|
static get watchers() {
|
|
270
424
|
return [{
|
|
271
425
|
"propName": "clientStyling",
|
|
@@ -276,6 +430,9 @@ export class CasinoChallengesOverlayModal {
|
|
|
276
430
|
}, {
|
|
277
431
|
"propName": "mbSource",
|
|
278
432
|
"methodName": "handleMbSourceChange"
|
|
433
|
+
}, {
|
|
434
|
+
"propName": "bonusProgramGames",
|
|
435
|
+
"methodName": "handleBonusProgramGameChange"
|
|
279
436
|
}];
|
|
280
437
|
}
|
|
281
438
|
}
|
|
@@ -10,7 +10,11 @@ const TRANSLATIONS = {
|
|
|
10
10
|
completed: 'has been completed!',
|
|
11
11
|
youWon: 'You have won',
|
|
12
12
|
physicalReward: 'for physical rewards please contact ',
|
|
13
|
-
linkText: 'Customer Support'
|
|
13
|
+
linkText: 'Customer Support',
|
|
14
|
+
playNowOrLater: 'Play your free spins now or come back later.',
|
|
15
|
+
rewardInLobby: 'You can find your reward in the relevant section of the Lobby Widget.',
|
|
16
|
+
assistance: 'If you need any assistance, please contact',
|
|
17
|
+
useSpinsNow: 'Use spins now'
|
|
14
18
|
},
|
|
15
19
|
da: {
|
|
16
20
|
congrats: 'Tillykke!',
|
|
@@ -22,7 +26,11 @@ const TRANSLATIONS = {
|
|
|
22
26
|
completed: 'er blevet gennemført!',
|
|
23
27
|
youWon: 'Du har vundet',
|
|
24
28
|
physicalReward: 'Ved fysiske præmier, venligst kontakt ',
|
|
25
|
-
linkText: 'Kundeservice'
|
|
29
|
+
linkText: 'Kundeservice',
|
|
30
|
+
playNowOrLater: 'Brug dine freespins nu eller gem dem til senere.',
|
|
31
|
+
rewardInLobby: 'Du kan finde din belønning under ”Mine tilbud”',
|
|
32
|
+
assistance: 'Har du brug for hjælp? Kontakt venligst',
|
|
33
|
+
useSpinsNow: 'Brug dine spins nu'
|
|
26
34
|
}
|
|
27
35
|
};
|
|
28
36
|
export const translate = (key, customLang) => {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
-
export
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
export const isMobile = () => {
|
|
2
|
+
let userAgent = window.navigator.userAgent;
|
|
3
|
+
return !!(userAgent.toLowerCase().match(/android/i) ||
|
|
4
|
+
userAgent.toLowerCase().match(/blackberry|bb/i) ||
|
|
5
|
+
userAgent.toLowerCase().match(/iphone|ipad|ipod/i) ||
|
|
6
|
+
userAgent.toLowerCase().match(/windows phone|windows mobile|iemobile|wpdesktop/i));
|
|
7
|
+
};
|