@everymatrix/lottery-program-wof 1.22.2 → 1.22.6
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/lottery-program-wof.js +1244 -2170
- package/dist/lottery-program-wof.js.map +1 -1
- package/index.html +2 -2
- package/package.json +2 -2
- package/src/LotteryProgramWof.svelte +7 -6
- package/src/business.ts +11 -6
- package/src/calc.point.ts +1 -112
- package/src/calc.ts +0 -6
- package/src/class.svgcalc.ts +35 -210
- package/src/images/theme.bg.blackring.svg +10 -0
- package/src/images/theme.bg.halo.svg +27 -0
- package/src/images/theme1Bg3.svg +15 -0
- package/src/images/theme2Bg3.svg +11 -0
- package/src/images/theme2Center.svg +36 -0
- package/src/images/theme3Bg1.svg +29 -0
- package/src/images/theme3Bg2.svg +19 -0
- package/src/images/theme3Center.svg +77 -0
- package/src/images/theme7Arrow.svg +67 -0
- package/src/images/theme7Bg1.svg +786 -0
- package/src/images/theme7Bg2.svg +40 -0
- package/src/images/theme7Bg3.svg +26 -0
- package/src/images/theme7Center.svg +72 -0
- package/src/images/theme7Light.svg +17 -0
- package/src/images/themeCenter1.svg +76 -0
- package/src/images/themeCenter2.svg +58 -0
- package/src/images/{areaSec.svg → themePointerArea.svg} +37 -4
- package/src/images/themeShadow.svg +27 -0
- package/src/private.item.svelte +13 -16
- package/src/private.item.svg.scss +179 -20
- package/src/private.item.svg.svelte +89 -135
- package/src/private.message.svelte +33 -12
- package/src/private.outcomes.svelte +1 -0
- package/src/themes.image.center.ts +61 -134
- package/src/themes.ts +8 -231
- package/src/translations.js +2 -2
- package/src/business.dom.test.ts +0 -34
- package/src/business.dom.ts +0 -21
- package/src/images/area.svg +0 -11
- package/src/images/areaV1.svg +0 -18
- package/src/images/areaV2.svg +0 -17
- package/src/images/background.svg +0 -27
- package/src/images/background3.svg +0 -13
- package/src/images/backgroundShadow.svg +0 -22
- package/src/images/centerArrow.svg +0 -50
- package/src/images/centerArrow1.svg +0 -18
- package/src/images/centerArrow2.svg +0 -5
- package/src/images/centerArrow3.svg +0 -46
- package/src/images/centerArrowBg.svg +0 -12
- package/src/images/centerBackground1.svg +0 -21
- package/src/images/centerBackground2.svg +0 -24
- package/src/images/centerCircle.svg +0 -24
- package/src/images/centerPack.svg +0 -16
- package/src/images/centerText3.svg +0 -3
- package/src/images/partition1.svg +0 -10
- package/src/images/spin.svg +0 -13
- package/src/themes.image.base.ts +0 -69
- package/src/themes.image.pointer.ts +0 -51
- package/src/themes.partitions.ts +0 -193
- /package/src/images/{pointerArrow.svg → theme2Arrow.svg} +0 -0
- /package/src/images/{pointerArrow3.svg → theme3Arrow.svg} +0 -0
- /package/src/images/{light.svg → themePartitionLight.svg} +0 -0
|
@@ -37,24 +37,6 @@ svg {
|
|
|
37
37
|
transition: opacity 0.3s;
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
.HighLightArea {
|
|
41
|
-
mix-blend-mode: color-dodge;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
.HighLightAreaBackground {
|
|
45
|
-
mix-blend-mode: screen;
|
|
46
|
-
opacity: 0.41;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
.HighLightAreaV1 {
|
|
50
|
-
background: radial-gradient(72.02% 62.64% at 50% 84.62%, rgba(255, 184, 47, 0.7) 0%, rgba(255, 184, 47, 0.384271) 30.52%, rgba(255, 184, 47, 0.165346) 52.4%, rgba(255, 184, 47, 0) 100%);
|
|
51
|
-
filter: blur(9px);
|
|
52
|
-
}
|
|
53
|
-
.HighLightAreaV2 {
|
|
54
|
-
background: radial-gradient(87.18% 75.82% at 50% 84.62%, rgba(255, 248, 186, 0.7) 0%, rgba(255, 248, 186, 0.384271) 29.48%, rgba(255, 248, 186, 0) 100%);
|
|
55
|
-
filter: blur(9px);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
40
|
.FortuneContainer {
|
|
59
41
|
width: 100%;
|
|
60
42
|
display: flex;
|
|
@@ -64,10 +46,10 @@ svg {
|
|
|
64
46
|
|
|
65
47
|
.Center {
|
|
66
48
|
cursor: pointer;
|
|
67
|
-
|
|
49
|
+
|
|
68
50
|
transition: filter;
|
|
69
51
|
transition-duration: 1s;
|
|
70
|
-
|
|
52
|
+
|
|
71
53
|
&.disabled {
|
|
72
54
|
filter: grayscale(80%);
|
|
73
55
|
}
|
|
@@ -127,3 +109,180 @@ svg {
|
|
|
127
109
|
.PartitionTextEntity.Anticlockwise {
|
|
128
110
|
text-align: end;
|
|
129
111
|
}
|
|
112
|
+
|
|
113
|
+
// Themed Bottom
|
|
114
|
+
|
|
115
|
+
.theme1, .theme4, .theme5 {
|
|
116
|
+
foreignObject.Bottom {
|
|
117
|
+
background-image: var(--img-theme1-bg3), var(--img-theme-BgBlackRing), var(--img-theme-BgHalo);
|
|
118
|
+
background-position: center, center, center;
|
|
119
|
+
background-size: calc(var(--radius) * 2px + var(--ratio) * 7px), calc(var(--radius) * 2px + var(--ratio) * 37px), calc(var(--radius) * 2px + var(--ratio) * 130px);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.theme2, .theme6 {
|
|
124
|
+
foreignObject.Bottom {
|
|
125
|
+
background-image: var(--img-theme2-bg3), var(--img-theme-BgHalo), var(--img-theme-BgBlackRing);
|
|
126
|
+
background-position: center, center, center;
|
|
127
|
+
background-size: calc(var(--radius) * 2px + var(--ratio) * 8px), calc(var(--radius) * 2px + var(--ratio) * 123px), calc(var(--radius) * 2px + var(--ratio) * 37px);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.theme3 {
|
|
132
|
+
foreignObject.Bottom {
|
|
133
|
+
background-image: var(--img-theme3-bg2), var(--img-theme3-bg1);
|
|
134
|
+
background-position: center, center;
|
|
135
|
+
background-size: calc(var(--radius) * 2px + var(--ratio) * 57px), calc(var(--radius) * 2px + var(--ratio) * 125px);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.theme7 {
|
|
140
|
+
foreignObject.Bottom {
|
|
141
|
+
background-image: var(--img-theme7-bg3), var(--img-theme7-bg2), var(--img-theme7-bg1);
|
|
142
|
+
background-position: center, center calc(var(--size) * 1px - var(--ratio) * 95px), calc(var(--ratio) * 42px) calc(var(--ratio) * -5px);
|
|
143
|
+
background-size: calc(var(--radius) * 2px + 35px), calc(var(--radius) * 2px * 0.6), calc(var(--radius) * 2.7px);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
// Themed Middle
|
|
148
|
+
.theme1, .theme4 {
|
|
149
|
+
foreignObject.Middle {
|
|
150
|
+
background-image: var(--img-theme-center1);
|
|
151
|
+
background-position: center;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.theme2 {
|
|
156
|
+
foreignObject.Middle {
|
|
157
|
+
background-image: var(--img-theme2-center), var(--img-theme2-arrow);
|
|
158
|
+
background-position: center, center 60px;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.theme3 {
|
|
163
|
+
foreignObject.Middle {
|
|
164
|
+
background-image: var(--img-theme3-center), var(--img-theme3-arrow);
|
|
165
|
+
background-position: center, center 39px;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
.theme5, .theme6 {
|
|
170
|
+
foreignObject.Middle {
|
|
171
|
+
background-image: var(--img-theme-center2);
|
|
172
|
+
background-position: center;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.theme7 {
|
|
177
|
+
foreignObject.Middle {
|
|
178
|
+
background-image: var(--img-theme7-center), var(--img-theme7-arrow);
|
|
179
|
+
background-position: center, center 36px;
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
// Themed Top
|
|
184
|
+
.theme7 {
|
|
185
|
+
foreignObject.Top {
|
|
186
|
+
background-image: var(--img-theme7-light);
|
|
187
|
+
background-position: 294px 135px;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
.theme1, .theme2, .theme3, .theme4, .theme5, .theme6 {
|
|
192
|
+
foreignObject.Top {
|
|
193
|
+
background-image: var(--img-theme-shadow);
|
|
194
|
+
background-position: center;
|
|
195
|
+
mix-blend-mode: multiply;
|
|
196
|
+
background-size: calc(var(--radius) * 2px);
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
// Themed Partition
|
|
201
|
+
|
|
202
|
+
.theme2 {
|
|
203
|
+
foreignObject.Partition1 {
|
|
204
|
+
background-image: var(--img-theme-partition-light);
|
|
205
|
+
background-position: center calc((var(--size) / 2 - var(--radius)) * 1px - calc(var(--ratio) * 22px));
|
|
206
|
+
transform: rotate(calc(var(--index) * 360deg / var(--length)));
|
|
207
|
+
}
|
|
208
|
+
foreignObject.Partition2 {
|
|
209
|
+
background-image: var(--img-theme-partition-light), var(--img-theme-partition-light);
|
|
210
|
+
background-position: center calc((var(--size) / 2 - var(--radius)) * 1px - calc(var(--ratio) * 22px));
|
|
211
|
+
transform: rotate(calc((var(--index) + 0.5) * 360deg / var(--length)));
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
foreignObject.PointerArea {
|
|
216
|
+
background-image: var(--img-theme-pointer-area);
|
|
217
|
+
background-position: center -3px;
|
|
218
|
+
mix-blend-mode: screen;
|
|
219
|
+
background-size: 51%;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
foreignObject.Partition1, foreignObject.Partition2 {
|
|
223
|
+
transform-origin: center;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
foreignObject.Customable {
|
|
227
|
+
overflow: visible;
|
|
228
|
+
background-repeat: no-repeat;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
.PartitionBackground {
|
|
232
|
+
background-size: calc(var(--radius) * 2 / var(--size) * 100%) calc(var(--radius) * 2 / var(--size) * 100%);
|
|
233
|
+
background-position: center;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
.theme1, .theme2 {
|
|
237
|
+
.PartitionBackground:nth-child(4n+1) { background-image: radial-gradient(#009C9C 0%, #002634 100%) }
|
|
238
|
+
.PartitionBackground:nth-child(4n+2) { background-image: radial-gradient(#AA00BF 0%, #3B0031 100%) }
|
|
239
|
+
.PartitionBackground:nth-child(4n+3) { background-image: radial-gradient(#0068CD 0%, #150D42 100%) }
|
|
240
|
+
.PartitionBackground:nth-child(4n+4) { background-image: radial-gradient(#DA005B 0%, #400021 100%) }
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
.theme3 {
|
|
244
|
+
.PartitionBackground:nth-child(4n+1) { background-image: radial-gradient(#066 0%, #007F76 13%, #00B59B 42%, #00DDB5 67.01%, #00F6C6 88.01%, #0FC 100.01%) }
|
|
245
|
+
.PartitionBackground:nth-child(4n+2) { background-image: radial-gradient(#580065 22.67%, #D453FF 91.3%) }
|
|
246
|
+
.PartitionBackground:nth-child(4n+3) { background-image: radial-gradient(#FFE767 -0.01%, #F28F00 100%) }
|
|
247
|
+
.PartitionBackground:nth-child(4n+4) { background-image: radial-gradient(#900A42 22.59%, #960A44 23.94%, #B60B53 31.36%, #D00C5E 39.45%, #E40D67 48.22%, #F30D6E 57.66%, #FB0D71 69.8%, #FE0E73 90.03%) }
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
.theme4, .theme5, .theme6 {
|
|
251
|
+
.PartitionBackground:nth-child(4n+1) { background: radial-gradient(#3B0031 0%, #7E008E 100.01%) }
|
|
252
|
+
.PartitionBackground:nth-child(4n+2) { background: radial-gradient(#5A005F 22.67%, #EA53FF 91.3%) }
|
|
253
|
+
.PartitionBackground:nth-child(4n+3) { background: radial-gradient(#B300C3 -0.01%, #4D003B 100%) }
|
|
254
|
+
.PartitionBackground:nth-child(4n+4) { background: radial-gradient(#59007B 22.59%, #B753FF 90.03%) }
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
.theme7 {
|
|
258
|
+
.PartitionBackground:nth-child(2n+1) { background: linear-gradient(90.23deg, #F6AD3F 16.59%, #AF8531 99.8%) }
|
|
259
|
+
.PartitionBackground:nth-child(2n+2) { background: linear-gradient(90deg, #323234 -0.01%, #272425 54.99%, #231F1F 99.99%) }
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
.PartitionBackground {
|
|
263
|
+
transform-origin: center;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
|
|
267
|
+
// Themed Partition Background Stroke
|
|
268
|
+
.PartitionBackgroundStroke {
|
|
269
|
+
fill: transparent;
|
|
270
|
+
stroke-width: 0.5px;
|
|
271
|
+
stroke-dasharray: var(--radius) calc(2 * pi / var(--length) * var(--radius));
|
|
272
|
+
}
|
|
273
|
+
.theme1, .theme2 {
|
|
274
|
+
.PartitionBackgroundStroke {
|
|
275
|
+
stroke: #FCD755;
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
.PointerPartitionFrame {
|
|
280
|
+
stroke: #FFDD64;
|
|
281
|
+
fill: transparent;
|
|
282
|
+
stroke-dasharray: var(--radius) calc(2 * pi / var(--length) * var(--radius));
|
|
283
|
+
stroke-width: 0px;
|
|
284
|
+
|
|
285
|
+
&.active {
|
|
286
|
+
stroke-width: 3px;
|
|
287
|
+
}
|
|
288
|
+
}
|
|
@@ -8,13 +8,14 @@
|
|
|
8
8
|
import { api } from './business';
|
|
9
9
|
import { onMountMessageLifeCycle, _postMessage } from './message';
|
|
10
10
|
import type { LotteryProgramForPlayer } from './types.business';
|
|
11
|
-
import {
|
|
11
|
+
import { themes } from './themes';
|
|
12
12
|
import { setProps } from './util';
|
|
13
13
|
import { Spinner } from './class.spinner';
|
|
14
14
|
import { SvgCalc } from './class.svgcalc';
|
|
15
15
|
import { Process } from './class.process';
|
|
16
16
|
import { _ } from './i18n';
|
|
17
17
|
import { setClientStyling } from './widget';
|
|
18
|
+
import { defines } from './themes.image.center';
|
|
18
19
|
|
|
19
20
|
// properties common
|
|
20
21
|
export let lang: Lang = Lang.en
|
|
@@ -22,18 +23,22 @@
|
|
|
22
23
|
export let session: string = ''
|
|
23
24
|
export let clientstyling:string = ''
|
|
24
25
|
export let contentdirection: keyof typeof ContentDirection = 'anticlockwise'
|
|
25
|
-
|
|
26
|
+
export let partitiondivisor: string = ''
|
|
27
|
+
|
|
26
28
|
let rootContainer: HTMLElement
|
|
27
29
|
$: clientstyling && rootContainer && setClientStyling(rootContainer, clientstyling);
|
|
28
30
|
|
|
29
31
|
// properties
|
|
30
32
|
export let id: string = undefined
|
|
31
|
-
export let size
|
|
33
|
+
export let size: string = ''
|
|
34
|
+
export let radius: string = ''
|
|
32
35
|
|
|
33
36
|
let bonus: LotteryProgramForPlayer
|
|
34
37
|
const updateOptions = async () => {
|
|
35
38
|
if(!options.length){
|
|
36
39
|
options = await getOptions(bonus, lang)
|
|
40
|
+
|
|
41
|
+
_postMessage({ type: 'wof-private-options-ready', id })
|
|
37
42
|
}
|
|
38
43
|
}
|
|
39
44
|
$: bonus && lang && updateOptions()
|
|
@@ -61,12 +66,13 @@
|
|
|
61
66
|
let shownFirstCheck = false
|
|
62
67
|
|
|
63
68
|
let speed: number = 0
|
|
64
|
-
|
|
69
|
+
|
|
65
70
|
$: themeIndex = bonus?.program?.metadata?.template || 0
|
|
66
|
-
$: theme = themes[themeIndex]
|
|
71
|
+
$: theme = themes[themeIndex] || themes[0]
|
|
67
72
|
$: calc = new SvgCalc({
|
|
68
|
-
size,
|
|
69
|
-
|
|
73
|
+
size,
|
|
74
|
+
radius,
|
|
75
|
+
options,
|
|
70
76
|
themeIndex,
|
|
71
77
|
contentdirection,
|
|
72
78
|
})
|
|
@@ -85,11 +91,11 @@
|
|
|
85
91
|
|
|
86
92
|
const setImageProps = () => {
|
|
87
93
|
if(!rootContainer) return;
|
|
88
|
-
|
|
94
|
+
|
|
89
95
|
for ( let index = 0; index <= options.length; index++ ) {
|
|
90
96
|
const image = rootContainer.querySelector(`.PartitionImage.PartitionImage${index} image`)
|
|
91
97
|
if(image) {
|
|
92
|
-
setProps(image, calc.getSvgImageProps(index))
|
|
98
|
+
setProps(image, calc.getSvgImageProps(index, partitiondivisor))
|
|
93
99
|
}
|
|
94
100
|
}
|
|
95
101
|
}
|
|
@@ -114,14 +120,16 @@
|
|
|
114
120
|
modeValue: bonus.next
|
|
115
121
|
})
|
|
116
122
|
}else{
|
|
117
|
-
process.setMessage(
|
|
123
|
+
process.setMessage({
|
|
124
|
+
mode: 'NoNext',
|
|
125
|
+
})
|
|
118
126
|
}
|
|
119
127
|
}
|
|
120
128
|
}
|
|
121
129
|
|
|
122
130
|
$: process = new Process({
|
|
123
|
-
id,
|
|
124
|
-
afterSetMessage: () => messageShown = true,
|
|
131
|
+
id,
|
|
132
|
+
afterSetMessage: () => messageShown = true,
|
|
125
133
|
halter: (index, cb) => spinner.halt(calc.getDeg(index), cb),
|
|
126
134
|
afterSuccess: () => isShowPrizeArea = true,
|
|
127
135
|
fetcher: async (guid) => await api.draw(endpoint, session, id, guid, options)
|
|
@@ -151,7 +159,7 @@
|
|
|
151
159
|
},
|
|
152
160
|
'wof-private-message-close': (data) => {
|
|
153
161
|
if(data.id !== id) return;
|
|
154
|
-
|
|
162
|
+
|
|
155
163
|
isSpinning = false
|
|
156
164
|
setTimeout(() => updateSpinable(), 1)
|
|
157
165
|
messageShown = false
|
|
@@ -166,9 +174,14 @@
|
|
|
166
174
|
}
|
|
167
175
|
|
|
168
176
|
$: optionFilter = theme.pointerMode === PointerMode.Arrow && speed > 0.3 ? `blur(${speed}px)` : null
|
|
177
|
+
$: sizeProps = { height: size, width: size}
|
|
169
178
|
</script>
|
|
170
179
|
|
|
171
|
-
<div
|
|
180
|
+
<div
|
|
181
|
+
class={`WheelContainer theme${Number(themeIndex) + 1}`}
|
|
182
|
+
bind:this={rootContainer}
|
|
183
|
+
style={`${defines()} --length: ${options.length}; --radius: ${radius}; --ratio: ${Number(size) / 480}; --size: ${size}`}
|
|
184
|
+
>
|
|
172
185
|
{#if size && options.length}
|
|
173
186
|
<svg
|
|
174
187
|
bind:this={svg}
|
|
@@ -176,176 +189,117 @@
|
|
|
176
189
|
height={size}
|
|
177
190
|
style:opacity={messageShown ? '.3': ''}
|
|
178
191
|
>
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
{#each calc.backgroundCirclePropsArray() as props}
|
|
182
|
-
<circle {...props} />
|
|
183
|
-
{/each}
|
|
184
|
-
</g>
|
|
185
|
-
|
|
192
|
+
<foreignObject {...sizeProps} class="Bottom Customable" />
|
|
193
|
+
|
|
186
194
|
<g class="PartitionsContainer" {...calc.getSpinnerProps()}>
|
|
187
195
|
<g class="PartitionsBackgrounds">
|
|
188
196
|
{#each options as option, index}
|
|
189
|
-
<
|
|
190
|
-
|
|
191
|
-
|
|
197
|
+
<foreignObject
|
|
198
|
+
clip-path={`url(#clip${index})`}
|
|
199
|
+
class="PartitionBackground Customable"
|
|
200
|
+
style={`--index: ${index}`}
|
|
201
|
+
width={size}
|
|
202
|
+
height={size}
|
|
192
203
|
/>
|
|
193
204
|
{/each}
|
|
194
205
|
</g>
|
|
206
|
+
<g class="PartitionsBackgroundStrokes">
|
|
207
|
+
{#each options as option, index}
|
|
208
|
+
<path
|
|
209
|
+
class="PartitionBackgroundStroke"
|
|
210
|
+
{...calc.getPartitionDraw(index)}
|
|
211
|
+
width={size}
|
|
212
|
+
height={size}
|
|
213
|
+
/>
|
|
214
|
+
{/each}
|
|
215
|
+
</g>
|
|
195
216
|
|
|
196
|
-
<g class="Partitions">
|
|
217
|
+
<g class="Partitions" style:filter={optionFilter}>
|
|
197
218
|
{#each options as option,index}
|
|
198
219
|
|
|
199
220
|
{#if option.image}
|
|
200
221
|
<g
|
|
201
222
|
class={`PartitionImage PartitionImage${index}`}
|
|
202
223
|
use:renderImage={index}
|
|
203
|
-
style:filter={optionFilter}
|
|
204
224
|
/>
|
|
205
225
|
{/if}
|
|
206
226
|
|
|
207
227
|
{#if option.name}
|
|
208
|
-
<foreignObject
|
|
228
|
+
<foreignObject
|
|
209
229
|
class="PartitionText"
|
|
210
|
-
{...(
|
|
211
|
-
const props = calc.getSvgTextProps(index)
|
|
212
|
-
const size = option.image ? 80 : 100
|
|
213
|
-
|
|
214
|
-
const objectSize = {
|
|
215
|
-
width: size,
|
|
216
|
-
height: size,
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
return {
|
|
220
|
-
...props,
|
|
221
|
-
...objectSize,
|
|
222
|
-
x: calc.contentdirection === 'clockwise' ? props.x : props.x - objectSize.width,
|
|
223
|
-
y: props.y - objectSize.height / 2,
|
|
224
|
-
}
|
|
225
|
-
})()}
|
|
226
|
-
style:filter={optionFilter}
|
|
230
|
+
{...calc.getSvgTextPropsAdjustedByImage(index)}
|
|
227
231
|
>
|
|
228
232
|
<div class="PartitionTextEntityContainer">
|
|
229
233
|
<p class={`PartitionTextEntity${calc.contentdirection === 'clockwise' ? '' : ' Anticlockwise'}`}>{option.name}</p>
|
|
230
234
|
</div>
|
|
231
235
|
</foreignObject>
|
|
232
236
|
{/if}
|
|
237
|
+
|
|
233
238
|
{/each}
|
|
234
239
|
</g>
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
{/each}
|
|
245
|
-
</radialGradient>
|
|
246
|
-
</defs>
|
|
247
|
-
<circle
|
|
248
|
-
{...calc.getShadowSize()}
|
|
249
|
-
fill="url(#shadow-fill)"
|
|
250
|
-
style="mix-blend-mode:multiply"
|
|
240
|
+
|
|
241
|
+
</g>
|
|
242
|
+
|
|
243
|
+
<g class="PartitionsCustomable1">
|
|
244
|
+
{#each options as option,index}
|
|
245
|
+
<foreignObject
|
|
246
|
+
class="Partition1 Customable"
|
|
247
|
+
style={`--index: ${index}`}
|
|
248
|
+
{...sizeProps}
|
|
251
249
|
/>
|
|
252
|
-
|
|
250
|
+
{/each}
|
|
251
|
+
</g>
|
|
252
|
+
<g class="PartitionsCustomable2">
|
|
253
|
+
{#each options as option,index}
|
|
254
|
+
<foreignObject
|
|
255
|
+
class="Partition2 Customable"
|
|
256
|
+
style={`--index: ${index}`}
|
|
257
|
+
{...sizeProps}
|
|
258
|
+
/>
|
|
259
|
+
{/each}
|
|
253
260
|
</g>
|
|
254
261
|
|
|
255
262
|
{#if theme.pointerMode === PointerMode.Partition}
|
|
256
263
|
<g class="PointerContainer" {...calc.getSpinnerProps()}>
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
...calc.getBackgroundImageProps(0),
|
|
261
|
-
}}
|
|
262
|
-
/>
|
|
263
|
-
<image
|
|
264
|
-
{...{
|
|
265
|
-
class: "HighLightArea",
|
|
266
|
-
...calc.getBackgroundImageProps(1),
|
|
267
|
-
}}
|
|
268
|
-
/>
|
|
269
|
-
|
|
264
|
+
|
|
265
|
+
<foreignObject class="PointerArea Customable" {...sizeProps} />
|
|
266
|
+
|
|
270
267
|
<path
|
|
271
268
|
class="PointerPartitionFrame"
|
|
272
|
-
{
|
|
273
|
-
{...
|
|
269
|
+
class:active={isShowPrizeArea}
|
|
270
|
+
{...calc.getPartitionDraw(0)}
|
|
274
271
|
/>
|
|
275
272
|
</g>
|
|
276
273
|
{/if}
|
|
277
274
|
|
|
275
|
+
<foreignObject class="Middle Customable" {...sizeProps} />
|
|
276
|
+
<foreignObject class="Top Customable" {...sizeProps} />
|
|
277
|
+
|
|
278
278
|
<g
|
|
279
279
|
class="Center"
|
|
280
280
|
class:disabled={isSpinning}
|
|
281
281
|
on:click={() => eventSpin()}
|
|
282
282
|
>
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
<g class="RingCirclesGroup">
|
|
290
|
-
{#each options as option,index}
|
|
291
|
-
<image class="RingImage" {...calc.getRingImageProps(index)} />
|
|
292
|
-
<image class="RingImage" {...calc.getRingImageProps(index + 1/2)} />
|
|
293
|
-
{/each}
|
|
283
|
+
<foreignObject
|
|
284
|
+
x={Number(size)/2 - 100/2}
|
|
285
|
+
y={Number(size)/2 - 100/2}
|
|
286
|
+
width={100}
|
|
287
|
+
height={100}
|
|
288
|
+
/>
|
|
294
289
|
</g>
|
|
295
|
-
{/if}
|
|
296
290
|
|
|
297
|
-
|
|
298
|
-
<g
|
|
299
|
-
{#each
|
|
300
|
-
|
|
291
|
+
<!-- defs -->
|
|
292
|
+
<g>
|
|
293
|
+
{#each options as option, index}
|
|
294
|
+
<clipPath {...{id: `clip${index}`}}>
|
|
295
|
+
<path {...calc.getPartitionDraw(index)} />
|
|
296
|
+
</clipPath>
|
|
301
297
|
{/each}
|
|
302
298
|
</g>
|
|
303
|
-
{/if}
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
<!-- defs -->
|
|
307
|
-
|
|
308
|
-
{#each calc.getDefs() as def}
|
|
309
|
-
<defs>
|
|
310
|
-
<linearGradient {...def.props}>
|
|
311
|
-
{#each def.steps as step}
|
|
312
|
-
<stop offset={step.offset} stop-color={step.color} />
|
|
313
|
-
{/each}
|
|
314
|
-
</linearGradient>
|
|
315
|
-
</defs>
|
|
316
|
-
{/each}
|
|
317
|
-
<defs>
|
|
318
|
-
<linearGradient id="GPointerPartitionFrame" x1="50.7564" y1="-9.24463" x2="50.7564" y2="115.67" gradientUnits="userSpaceOnUse">
|
|
319
|
-
<stop offset="0" stop-color="#E7A60D"/>
|
|
320
|
-
<stop offset="0.378125" stop-color="#FFDD64"/>
|
|
321
|
-
<stop offset="1" stop-color="#FFF100"/>
|
|
322
|
-
</linearGradient>
|
|
323
|
-
</defs>
|
|
324
|
-
|
|
325
|
-
<defs>
|
|
326
|
-
<filter
|
|
327
|
-
{...{
|
|
328
|
-
width: size,
|
|
329
|
-
height: size,
|
|
330
|
-
x: 0,
|
|
331
|
-
y: 0,
|
|
332
|
-
}}
|
|
333
|
-
id="BgHalo" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"
|
|
334
|
-
>
|
|
335
|
-
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
|
|
336
|
-
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
|
|
337
|
-
<feOffset/>
|
|
338
|
-
<feGaussianBlur stdDeviation="25"/>
|
|
339
|
-
<feComposite in2="hardAlpha" operator="out"/>
|
|
340
|
-
<feColorMatrix type="matrix" values="0 0 0 0 1 0 0 0 0 0.972917 0 0 0 0 0.729167 0 0 0 0.5 0"/>
|
|
341
|
-
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_4318_310"/>
|
|
342
|
-
<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_4318_310" result="shape"/>
|
|
343
|
-
</filter>
|
|
344
|
-
</defs>
|
|
345
299
|
</svg>
|
|
346
300
|
{/if}
|
|
347
301
|
</div>
|
|
348
302
|
|
|
349
303
|
<style lang="scss">
|
|
350
304
|
@import './private.item.svg.scss';
|
|
351
|
-
</style>
|
|
305
|
+
</style>
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
import { setClientStyling } from './widget';
|
|
9
9
|
|
|
10
10
|
export let r = 0
|
|
11
|
+
export let size = 0
|
|
11
12
|
export let id: string = undefined
|
|
12
13
|
export let clientstyling:string = ''
|
|
13
14
|
export let giftimagesrc: string = ''
|
|
@@ -20,8 +21,13 @@
|
|
|
20
21
|
let isShown: boolean = false
|
|
21
22
|
let mode: string = ''
|
|
22
23
|
let modeValue: any
|
|
24
|
+
let isOptionsReady: boolean = false
|
|
23
25
|
|
|
24
26
|
onMountMessageLifeCycle({
|
|
27
|
+
'wof-private-options-ready': (data) => {
|
|
28
|
+
if(data.id !== id) return;
|
|
29
|
+
isOptionsReady = true
|
|
30
|
+
},
|
|
25
31
|
'wof-private-message-open': (data) => {
|
|
26
32
|
if(data.id !== id) return;
|
|
27
33
|
|
|
@@ -52,32 +58,43 @@
|
|
|
52
58
|
].join(' ')
|
|
53
59
|
}
|
|
54
60
|
|
|
55
|
-
const
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
61
|
+
const setObserver = () => {
|
|
62
|
+
const resizeObserver = new ResizeObserver(entries => {
|
|
63
|
+
entries.map(entry => {
|
|
64
|
+
if(entry.target === rootContainer) {
|
|
65
|
+
topOffset = entry.target.clientHeight / 2
|
|
66
|
+
}
|
|
67
|
+
})
|
|
68
|
+
})
|
|
69
|
+
resizeObserver.observe(rootContainer)
|
|
60
70
|
}
|
|
61
71
|
|
|
62
|
-
$:
|
|
72
|
+
$: rootContainer && setObserver()
|
|
63
73
|
|
|
64
|
-
$: width = r*2
|
|
65
|
-
$: left =
|
|
66
|
-
$: top =
|
|
74
|
+
$: width = r * 2
|
|
75
|
+
$: left = size / 2 - width / 2
|
|
76
|
+
$: top = size / 2 - topOffset
|
|
67
77
|
|
|
68
78
|
$: startTime = modeValue?.startTime && getTimeString(modeValue?.startTime)
|
|
69
79
|
|
|
70
80
|
$: prizeSrc = modeValue?.prizeSrc || giftimagesrc || giftSvg
|
|
71
81
|
|
|
82
|
+
const handlerTC = () => _postMessage({ type: "OnTCClicked", WofProgramID: id })
|
|
83
|
+
|
|
84
|
+
let holderTC: HTMLElement
|
|
85
|
+
const bindEventTC = () => {
|
|
86
|
+
holderTC.querySelector('a').addEventListener('click', handlerTC)
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
$: holderTC && bindEventTC()
|
|
72
90
|
</script>
|
|
73
91
|
|
|
74
92
|
|
|
75
|
-
{#if isShown}
|
|
93
|
+
{#if isShown && isOptionsReady}
|
|
76
94
|
<div
|
|
77
95
|
bind:this={rootContainer}
|
|
78
96
|
class="MessagePanel"
|
|
79
97
|
style={[
|
|
80
|
-
// `margin-top: ${r + topOffset}px`,
|
|
81
98
|
`top: ${top}px`,
|
|
82
99
|
`left: ${left}px`,
|
|
83
100
|
`width: ${width}px`,
|
|
@@ -93,6 +110,10 @@
|
|
|
93
110
|
<p>{@html $_('wof.ShowNext', {values: { startTime }})}</p>
|
|
94
111
|
{/if}
|
|
95
112
|
|
|
113
|
+
{#if mode === 'NoNext'}
|
|
114
|
+
<p bind:this={holderTC}>{@html $_(`wof.NoNext`)}</p>
|
|
115
|
+
{/if}
|
|
116
|
+
|
|
96
117
|
{#if mode === 'gift'}
|
|
97
118
|
<p>
|
|
98
119
|
<img src={prizeSrc} alt="" class="GiftImage">
|
|
@@ -114,7 +135,7 @@
|
|
|
114
135
|
<p>{@html $_('wof.Loss')}</p>
|
|
115
136
|
{/if}
|
|
116
137
|
|
|
117
|
-
{#if
|
|
138
|
+
{#if !['init-failed', 'show-next', 'NoNext'].includes(mode)}
|
|
118
139
|
<div>
|
|
119
140
|
<button
|
|
120
141
|
class="MessagePanelButton"
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
export let endpoint: string = ''
|
|
16
16
|
export let session: string = ''
|
|
17
17
|
export let clientstyling:string = ''
|
|
18
|
+
export let id: string = ''
|
|
18
19
|
|
|
19
20
|
let rootContainer: HTMLElement
|
|
20
21
|
$: clientstyling && rootContainer && setClientStyling(rootContainer, clientstyling);
|