@everymatrix/lottery-program-wof 1.11.0 → 1.12.0
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 +8036 -4427
- package/dist/lottery-program-wof.js.map +1 -1
- package/package.json +2 -2
- package/src/LotteryProgramWof.svelte +13 -6
- package/src/business.dom.ts +0 -118
- package/src/business.ts +28 -18
- package/src/calc.point.ts +2 -139
- package/src/class.process.ts +64 -0
- package/src/class.spinner.ts +38 -6
- package/src/class.spinner.util.ts +1 -1
- package/src/class.svgcalc.ts +372 -0
- package/src/i18n.js +38 -0
- package/src/images/Thankyou_1.svg +100 -0
- package/src/images/Thankyou_2.svg +112 -0
- package/src/images/Thankyou_3.svg +87 -0
- package/src/images/Thankyou_4.svg +114 -0
- package/src/images/centerBackground1.svg +21 -0
- package/src/private.item.svelte +7 -20
- package/src/private.item.svg.svelte +133 -512
- package/src/private.loader.svelte +61 -0
- package/src/private.message.svelte +14 -15
- package/src/private.outcomes.svelte +8 -6
- package/src/private.tabs.svelte +2 -2
- package/src/themes.image.base.ts +69 -0
- package/src/themes.image.center.ts +141 -0
- package/src/themes.image.pointer.ts +51 -0
- package/src/themes.partitions.ts +19 -0
- package/src/themes.ts +7 -0
- package/src/translations.js +52 -0
- package/src/calc.image.ts +0 -13
|
@@ -1,56 +1,19 @@
|
|
|
1
1
|
<svelte:options tag={'lottery-program-wof-private-item-svg'} />
|
|
2
2
|
|
|
3
3
|
<script lang="ts">
|
|
4
|
-
// @ts-ignore
|
|
5
|
-
import lightSvg from './images/light.svg'
|
|
6
|
-
// @ts-ignore
|
|
7
|
-
import areaSvg from './images/area.svg'
|
|
8
|
-
// @ts-ignore
|
|
9
|
-
import areaSecSvg from './images/areaSec.svg'
|
|
10
|
-
// @ts-ignore
|
|
11
|
-
import centerArrowSvg from './images/centerArrow.svg'
|
|
12
|
-
// @ts-ignore
|
|
13
|
-
import centerArrow3Svg from './images/centerArrow3.svg'
|
|
14
|
-
// @ts-ignore
|
|
15
|
-
import spinSvg from './images/spin.svg'
|
|
16
|
-
// @ts-ignore
|
|
17
|
-
import backgroundShadowSvg from './images/backgroundShadow.svg'
|
|
18
|
-
// @ts-ignore
|
|
19
|
-
import centerPackSvg from './images/centerPack.svg'
|
|
20
|
-
// @ts-ignore
|
|
21
|
-
import centerText3Svg from './images/centerText3.svg'
|
|
22
|
-
// @ts-ignore
|
|
23
|
-
import centerBackground2Svg from './images/centerBackground2.svg'
|
|
24
|
-
// @ts-ignore
|
|
25
|
-
import pointerArrowSvg from './images/pointerArrow.svg'
|
|
26
|
-
// @ts-ignore
|
|
27
|
-
import pointerArrow3Svg from './images/pointerArrow3.svg'
|
|
28
|
-
// @ts-ignore
|
|
29
|
-
import centerCircleSvg from './images/centerCircle.svg'
|
|
30
|
-
// @ts-ignore
|
|
31
|
-
import centerArrowBgSvg from './images/centerArrowBg.svg'
|
|
32
4
|
|
|
33
5
|
// types
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import { setMessage as setMessageBase } from './business';
|
|
37
|
-
import { getColorSchema, getSvgImageProps, getSvgTextProps } from './business.dom';
|
|
6
|
+
import { PointerMode, Lang } from './types';
|
|
7
|
+
import { getOptions, getSpinCondition, getSpinContainerSelector, Option } from './business';
|
|
38
8
|
import { api } from './business';
|
|
39
|
-
import { convertArcToDeg, getArcLength } from './calc';
|
|
40
|
-
import {
|
|
41
|
-
getTrianglePoints,
|
|
42
|
-
getPartitionProps,
|
|
43
|
-
getRingImageProps,
|
|
44
|
-
getImageProps,
|
|
45
|
-
getTwoPointsOfLineGradient,
|
|
46
|
-
getSymmetricalPointFromScalar,
|
|
47
|
-
} from './calc.point';
|
|
48
9
|
import { onMountMessageLifeCycle, _postMessage } from './message';
|
|
49
10
|
import type { LotteryProgramForPlayer } from './types.business';
|
|
50
11
|
import { themes } from './themes';
|
|
51
|
-
import {
|
|
52
|
-
import { classWithPart, delay, setProps } from './util';
|
|
12
|
+
import { classWithPart, setProps } from './util';
|
|
53
13
|
import { Spinner } from './class.spinner';
|
|
14
|
+
import { SvgCalc } from './class.svgcalc';
|
|
15
|
+
import { Process } from './class.process';
|
|
16
|
+
import { _ } from './i18n';
|
|
54
17
|
|
|
55
18
|
// properties
|
|
56
19
|
export let lang: Lang = Lang.en
|
|
@@ -58,11 +21,6 @@
|
|
|
58
21
|
export let session: string = ''
|
|
59
22
|
|
|
60
23
|
export let lotteryprogramforplayer: string = undefined
|
|
61
|
-
export let themeindex: string = '0'
|
|
62
|
-
|
|
63
|
-
export let arrowmode: ArrowMode = ArrowMode.DownFromTop;
|
|
64
|
-
export let spinduration: string = '3'
|
|
65
|
-
export let spinrotation: string = '3'
|
|
66
24
|
|
|
67
25
|
export let id: string = undefined
|
|
68
26
|
export let sizeraw: string = '0'
|
|
@@ -74,36 +32,40 @@
|
|
|
74
32
|
|
|
75
33
|
// binds
|
|
76
34
|
let svg: SVGElement;
|
|
35
|
+
let container
|
|
36
|
+
|
|
37
|
+
let spinner = new Spinner({
|
|
38
|
+
tick: (deg, _speed) => {
|
|
39
|
+
setProps(container, {
|
|
40
|
+
transform: `rotate(${deg})`,
|
|
41
|
+
})
|
|
42
|
+
speed = _speed * 0.5
|
|
43
|
+
}
|
|
44
|
+
})
|
|
77
45
|
|
|
78
46
|
// states
|
|
79
47
|
let spinable = true;
|
|
80
48
|
let isShowPrizeArea = false;
|
|
81
|
-
let
|
|
82
|
-
let spinner = new Spinner
|
|
49
|
+
let messageShown: boolean = false;
|
|
83
50
|
let shownFirstCheck = false
|
|
51
|
+
|
|
84
52
|
let speed: number = 0
|
|
85
53
|
|
|
86
54
|
$: lotteryProgramForPlayer = lotteryprogramforplayer && (JSON.parse(lotteryprogramforplayer)) as LotteryProgramForPlayer
|
|
87
|
-
|
|
88
|
-
let messageShown: boolean = false;
|
|
55
|
+
$: lotteryProgramForPlayer && (async () => {
|
|
89
56
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
switch (themeIndex) {
|
|
93
|
-
case 0: return PointerMode.Partition
|
|
94
|
-
case 1: return PointerMode.Arrow
|
|
95
|
-
case 2: return PointerMode.Arrow
|
|
96
|
-
case 3: return PointerMode.Partition
|
|
97
|
-
case 4: return PointerMode.Arrow
|
|
98
|
-
case 5: return PointerMode.Arrow
|
|
57
|
+
if(!options.length){
|
|
58
|
+
options = await getOptions(lotteryProgramForPlayer.program.wheelOfFortune.partitions, lang)
|
|
99
59
|
}
|
|
100
60
|
})()
|
|
61
|
+
|
|
62
|
+
$: themeIndex = lotteryProgramForPlayer?.program?.metadata?.template || 0
|
|
101
63
|
$: theme = themes[themeIndex]
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
}
|
|
64
|
+
$: calc = new SvgCalc({
|
|
65
|
+
size,
|
|
66
|
+
length: options.length,
|
|
67
|
+
themeIndex,
|
|
68
|
+
})
|
|
107
69
|
|
|
108
70
|
$: lotteryProgramForPlayer && checkSpinable()
|
|
109
71
|
|
|
@@ -113,92 +75,37 @@
|
|
|
113
75
|
|
|
114
76
|
if(spinable){
|
|
115
77
|
if(getSpinCondition(lotteryProgramForPlayer)){
|
|
116
|
-
setMessage({
|
|
78
|
+
process.setMessage({
|
|
117
79
|
mode: 'spin-failed'
|
|
118
80
|
})
|
|
119
81
|
}else if(getSpinCondition(lotteryProgramForPlayer) && !lotteryProgramForPlayer.next){
|
|
120
|
-
setMessage(
|
|
82
|
+
process.setMessage($_('wof.NoNext'))
|
|
121
83
|
}
|
|
122
84
|
}else{
|
|
123
85
|
// hasQueuedMessage = true
|
|
124
86
|
}
|
|
125
87
|
}
|
|
126
88
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
success: (message) => {
|
|
135
|
-
_postMessage({ id, type: 'wof-private-message-spin-before' })
|
|
136
|
-
|
|
137
|
-
const cb = () => {
|
|
138
|
-
setTimeout(() => {
|
|
139
|
-
_postMessage({ id, type: 'wof-private-message-spin-after' })
|
|
140
|
-
isShowPrizeArea = true
|
|
141
|
-
setMessage(message)
|
|
142
|
-
}, 1000)
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
spinner.halt(getDeg(index), cb)
|
|
146
|
-
},
|
|
147
|
-
failed: () => {
|
|
148
|
-
_postMessage({ id, type: 'wof-private-message-spin-before' })
|
|
149
|
-
|
|
150
|
-
const cb = () => {
|
|
151
|
-
setTimeout(() => {
|
|
152
|
-
setMessage('There was a problem to grant the reward. Please contact support')
|
|
153
|
-
_postMessage({ id, type: 'wof-private-message-spin-after' })
|
|
154
|
-
}, 1000)
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
spinner.halt(getDeg(index), cb)
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
try {
|
|
162
|
-
const { data, message, index: _index } = await api.draw(endpoint, session, id, guid, options, pointermode)
|
|
163
|
-
index = _index
|
|
164
|
-
|
|
165
|
-
if(!data.success) throw new Error()
|
|
166
|
-
if(data.item.state === "drawn") throw new Error()
|
|
167
|
-
|
|
168
|
-
stage.success(message)
|
|
169
|
-
|
|
170
|
-
} catch (e) {
|
|
171
|
-
if(frequency < 4){
|
|
172
|
-
drawer(guid, frequency + 1)
|
|
173
|
-
}else{
|
|
174
|
-
stage.failed()
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
let container
|
|
182
|
-
const setDeg = (deg, _speed) => {
|
|
183
|
-
setProps(container, {
|
|
184
|
-
transform: `rotate(${deg})`,
|
|
185
|
-
})
|
|
186
|
-
speed = _speed * 0.5
|
|
187
|
-
}
|
|
188
|
-
spinner.tick = setDeg
|
|
89
|
+
$: process = new Process({
|
|
90
|
+
id,
|
|
91
|
+
afterSetMessage: () => messageShown = true,
|
|
92
|
+
halter: (index, cb) => spinner.halt(calc.getDeg(index), cb),
|
|
93
|
+
afterSuccess: () => isShowPrizeArea = true,
|
|
94
|
+
fetcher: async (guid) => await api.draw(endpoint, session, id, guid, options)
|
|
95
|
+
})
|
|
189
96
|
|
|
190
97
|
// events
|
|
191
98
|
const eventSpin = async () => {
|
|
192
99
|
if(!spinable) return;
|
|
193
100
|
|
|
194
|
-
if(!lotteryProgramForPlayer.current
|
|
101
|
+
if(!lotteryProgramForPlayer.current?.remainingTimes){
|
|
195
102
|
if(lotteryProgramForPlayer.next){
|
|
196
|
-
setMessage({
|
|
103
|
+
process.setMessage({
|
|
197
104
|
mode: 'show-next',
|
|
198
105
|
modeValue: lotteryProgramForPlayer.next
|
|
199
106
|
})
|
|
200
107
|
}else{
|
|
201
|
-
setMessage(
|
|
108
|
+
process.setMessage($_('wof.NoNext'))
|
|
202
109
|
}
|
|
203
110
|
return;
|
|
204
111
|
}
|
|
@@ -206,12 +113,10 @@
|
|
|
206
113
|
spinable = false
|
|
207
114
|
isShowPrizeArea = false
|
|
208
115
|
|
|
209
|
-
container = svg.querySelector(getSpinContainerSelector(
|
|
116
|
+
container = svg.querySelector(getSpinContainerSelector(theme.pointerMode))
|
|
210
117
|
|
|
211
118
|
spinner.launch()
|
|
212
|
-
|
|
213
|
-
drawer(guid)
|
|
214
|
-
|
|
119
|
+
process.drawer(`userid-${id}-${new Date().getTime()}`)
|
|
215
120
|
}
|
|
216
121
|
onMountMessageLifeCycle({
|
|
217
122
|
'wof-private-message-close': (data) => {
|
|
@@ -222,442 +127,157 @@
|
|
|
222
127
|
},
|
|
223
128
|
})
|
|
224
129
|
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
130
|
+
const renderImage = (node: SVGElement, index) => {
|
|
131
|
+
const image = options[index].image as SVGImageElement
|
|
132
|
+
setProps(image, calc.getSvgImageProps(index))
|
|
133
|
+
node.innerHTML = null
|
|
134
|
+
node.appendChild(image)
|
|
228
135
|
}
|
|
229
136
|
|
|
230
|
-
$:
|
|
231
|
-
$: arrowPoints = getTrianglePoints(size/2, size/20, size/13, arrowmode, rCircleCenter)
|
|
232
|
-
|
|
233
|
-
$: center = size / 2
|
|
234
|
-
$: centerPoint = getSymmetricalPointFromScalar(center)
|
|
235
|
-
|
|
236
|
-
// ratio
|
|
237
|
-
$: ratio = size / 375
|
|
238
|
-
$: radius = theme.size.radius / 2 * ratio
|
|
239
|
-
$: rRingInner = theme.size.rRingInner / 2 * ratio
|
|
240
|
-
$: rRingOuter = theme.size.rRingOuter / 2 * ratio
|
|
241
|
-
|
|
242
|
-
$: size && (() => {
|
|
243
|
-
|
|
244
|
-
// console.log('sizeraw changed');
|
|
245
|
-
setTimeout(() => {
|
|
246
|
-
// console.log('spinner.deg', spinner.deg);
|
|
247
|
-
|
|
248
|
-
if(container){
|
|
249
|
-
// setDeg(spinner.deg)
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
}, 50)
|
|
253
|
-
})()
|
|
137
|
+
$: optionFilter = theme.pointerMode === PointerMode.Arrow && speed > 0.3 ? `blur(${speed}px)` : null
|
|
254
138
|
</script>
|
|
255
139
|
|
|
256
140
|
|
|
257
|
-
{#if size}
|
|
141
|
+
{#if size && options.length}
|
|
258
142
|
<svg
|
|
259
143
|
bind:this={svg}
|
|
260
144
|
width={size}
|
|
261
145
|
height={size}
|
|
262
|
-
style={
|
|
263
|
-
`${messageShown ? 'opacity: .3': ''}`,
|
|
264
|
-
].join(';')}
|
|
265
|
-
|
|
146
|
+
style:opacity={messageShown ? '.3': ''}
|
|
266
147
|
>
|
|
267
|
-
<!-- <defs>
|
|
268
|
-
<linearGradient id="paint0_linear_4318_345" x1="246.941" y1="47.0578" x2="35.8266" y2="258.172" gradientUnits="userSpaceOnUse">
|
|
269
|
-
<stop stop-color="#000604"/>
|
|
270
|
-
<stop offset="0.4" stop-color="#303030"/>
|
|
271
|
-
<stop offset="1" stop-color="#000604"/>
|
|
272
|
-
</linearGradient>
|
|
273
|
-
</defs> -->
|
|
274
|
-
<!-- <svg width="375" height="387" viewBox="0 0 375 387" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
275
|
-
|
|
276
|
-
<g filter="url(#filter0_d_4318_362)">
|
|
277
|
-
<path d="M89.0632 89.8008C31.5247 143.881 28.7204 234.398 82.8008 291.936C136.881 349.475 227.398 352.279 284.936 298.199C342.475 244.118 345.291 153.614 291.199 96.0631C237.107 38.5124 146.614 35.7089 89.0632 89.8008Z" fill="url(#paint0_linear_4318_362)"/>
|
|
278
|
-
</g>
|
|
279
|
-
|
|
280
|
-
<defs>
|
|
281
|
-
<filter id="filter0_d_4318_362" x="-5.99414" y="0.99707" width="385.992" height="385.997" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
|
|
282
|
-
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
|
|
283
|
-
<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"/>
|
|
284
|
-
<feOffset/>
|
|
285
|
-
<feGaussianBlur stdDeviation="25"/>
|
|
286
|
-
<feComposite in2="hardAlpha" operator="out"/>
|
|
287
|
-
<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"/>
|
|
288
|
-
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_4318_362"/>
|
|
289
|
-
<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_4318_362" result="shape"/>
|
|
290
|
-
</filter>
|
|
291
|
-
|
|
292
|
-
<linearGradient id="paint0_linear_4318_362" x1="136.465" y1="52.147" x2="243.827" y2="336.838" gradientUnits="userSpaceOnUse">
|
|
293
|
-
<stop offset="0.00312487" stop-color="#454545"/>
|
|
294
|
-
<stop offset="0.310417"/>
|
|
295
|
-
<stop offset="0.628125" stop-color="#575757"/>
|
|
296
|
-
<stop offset="1"/>
|
|
297
|
-
</linearGradient>
|
|
298
|
-
</defs>
|
|
299
|
-
</svg> -->
|
|
300
|
-
<!-- <svg width="280" height="280" viewBox="0 0 280 280" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
301
|
-
<path d="M139.993 0.000244141C62.6744 0.000244141 0 62.6746 0 139.993C0 217.312 62.6744 280 139.993 280C217.312 280 280 217.312 280 139.993C280 62.6746 217.312 0.000244141 139.993 0.000244141ZM139.993 257.893C74.8826 257.893 22.093 205.118 22.093 139.993C22.093 74.8687 74.8826 22.0933 139.993 22.0933C205.103 22.0933 257.893 74.8828 257.893 139.993C257.893 205.104 205.117 257.893 139.993 257.893Z" fill="url(#paint0_linear_4318_363)"/>
|
|
302
|
-
<defs>
|
|
303
|
-
<linearGradient id="paint0_linear_4318_363" x1="76.6217" y1="288.879" x2="197.5" y2="5.00024" gradientUnits="userSpaceOnUse">
|
|
304
|
-
<stop offset="0.0604165" stop-color="#FFB915"/>
|
|
305
|
-
<stop offset="0.2375" stop-color="#B6820A"/>
|
|
306
|
-
<stop offset="0.477083" stop-color="#FFE685"/>
|
|
307
|
-
<stop offset="0.721875" stop-color="#FFB915"/>
|
|
308
|
-
<stop offset="1" stop-color="#FFD600"/>
|
|
309
|
-
</linearGradient>
|
|
310
|
-
</defs>
|
|
311
|
-
</svg> -->
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
<defs>
|
|
315
|
-
<filter
|
|
316
|
-
{...{
|
|
317
|
-
width: size,
|
|
318
|
-
height: size,
|
|
319
|
-
x: 0,
|
|
320
|
-
y: 0,
|
|
321
|
-
}}
|
|
322
|
-
id="BgHalo" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"
|
|
323
|
-
>
|
|
324
|
-
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
|
|
325
|
-
<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"/>
|
|
326
|
-
<feOffset/>
|
|
327
|
-
<feGaussianBlur stdDeviation="25"/>
|
|
328
|
-
<feComposite in2="hardAlpha" operator="out"/>
|
|
329
|
-
<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"/>
|
|
330
|
-
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_4318_310"/>
|
|
331
|
-
<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_4318_310" result="shape"/>
|
|
332
|
-
</filter>
|
|
333
|
-
</defs>
|
|
334
148
|
|
|
335
149
|
<g {...classWithPart("BackgroundCircleGroup")} filter="url(#BgHalo)">
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
id: "BgRingBaseLinearGradient" ,
|
|
340
|
-
gradientTransform: "rotate(0)",
|
|
341
|
-
gradientUnits: "userSpaceOnUse",
|
|
342
|
-
}}>
|
|
343
|
-
{#each theme.background.base.linearGradient.steps as step, index}
|
|
344
|
-
<stop offset={step.offset} stop-color={step.color} />
|
|
345
|
-
{/each}
|
|
346
|
-
</linearGradient>
|
|
347
|
-
</defs>
|
|
348
|
-
<circle {...{
|
|
349
|
-
fill: `url(#BgRingBaseLinearGradient)`,
|
|
350
|
-
cx: center,
|
|
351
|
-
cy: center,
|
|
352
|
-
r: theme.size.rBg1 / 2 * ratio,
|
|
353
|
-
style: `transform-origin: ${center}px ${center}px; transform: rotate(135deg)`
|
|
354
|
-
}} />
|
|
355
|
-
|
|
356
|
-
<defs>
|
|
357
|
-
<linearGradient {...{
|
|
358
|
-
id: "BgRingSmallLinearGradient",
|
|
359
|
-
gradientTransform: "rotate(0)",
|
|
360
|
-
radientUnits: "userSpaceOnUse",
|
|
361
|
-
}}>
|
|
362
|
-
{#each theme.background.small.linearGradient.steps as step, index}
|
|
363
|
-
<stop offset={step.offset} stop-color={step.color} />
|
|
364
|
-
{/each}
|
|
365
|
-
</linearGradient>
|
|
366
|
-
</defs>
|
|
367
|
-
<circle {...{
|
|
368
|
-
fill: `url(#BgRingSmallLinearGradient)`,
|
|
369
|
-
cx: center,
|
|
370
|
-
cy: center,
|
|
371
|
-
r: rRingOuter,
|
|
372
|
-
}} />
|
|
373
|
-
|
|
374
|
-
<circle {...{
|
|
375
|
-
fill: `url(#BgRingBaseLinearGradient)`,
|
|
376
|
-
cx: center,
|
|
377
|
-
cy: center,
|
|
378
|
-
r: rRingInner,
|
|
379
|
-
style: `transform-origin: ${center}px ${center}px; transform: rotate(45deg)`
|
|
380
|
-
}} />
|
|
381
|
-
|
|
150
|
+
{#each calc.backgroundCirclePropsArray() as props}
|
|
151
|
+
<circle {...props} />
|
|
152
|
+
{/each}
|
|
382
153
|
</g>
|
|
383
154
|
|
|
384
|
-
<g {...classWithPart("Partitions")} {...
|
|
155
|
+
<g {...classWithPart("Partitions")} {...calc.getSpinnerProps()}>
|
|
385
156
|
<g {...classWithPart("PartitionsBackground")}>
|
|
386
|
-
|
|
387
|
-
<linearGradient
|
|
388
|
-
id="LGPartitionStroke"
|
|
389
|
-
gradientUnits="userSpaceOnUse"
|
|
390
|
-
{... {
|
|
391
|
-
gradientTransform: "rotate(45)",
|
|
392
|
-
}}
|
|
393
|
-
>
|
|
394
|
-
<stop stop-color="#F28F00"/>
|
|
395
|
-
<stop offset="0.27" stop-color="#F5A318"/>
|
|
396
|
-
<stop offset="0.85" stop-color="#FCD755"/>
|
|
397
|
-
<stop offset="1" stop-color="#FFE767"/>
|
|
398
|
-
</linearGradient>
|
|
399
|
-
</defs>
|
|
400
|
-
{#each options as option,index}
|
|
401
|
-
|
|
402
|
-
<defs>
|
|
403
|
-
<linearGradient
|
|
404
|
-
id={`grad${index}`}
|
|
405
|
-
{...getTwoPointsOfLineGradient(center, index, options.length, -1 * Math.PI / 2)}
|
|
406
|
-
gradientUnits="userSpaceOnUse"
|
|
407
|
-
>
|
|
408
|
-
{#each getColorSchema(index, options.length, theme.partitions.colorSchema) as _colorSchema}
|
|
409
|
-
<stop offset={_colorSchema.offset} stop-color={_colorSchema.color} />
|
|
410
|
-
{/each}
|
|
411
|
-
</linearGradient>
|
|
412
|
-
</defs>
|
|
157
|
+
{#each options as option, index}
|
|
413
158
|
<path
|
|
414
|
-
{...
|
|
415
|
-
|
|
416
|
-
...getPartitionProps(index, options.length, radius, center),
|
|
417
|
-
fill: `url(#grad${index})`,
|
|
418
|
-
strokeWidth: '0.5px',
|
|
419
|
-
'stroke-dasharray': `${radius} ${getArcLength(radius, 360 / options.length)}`,
|
|
420
|
-
...((themeIndex === 0 || themeIndex) === 1 ? {stroke: `url(#LGPartitionStroke)`}: {})
|
|
421
|
-
}}
|
|
159
|
+
{...classWithPart("PartitionBackground")}
|
|
160
|
+
{...calc.getPartitionBackgroundProp(index)}
|
|
422
161
|
/>
|
|
423
|
-
|
|
424
162
|
{/each}
|
|
425
163
|
</g>
|
|
426
164
|
|
|
427
|
-
<g
|
|
428
|
-
<defs>
|
|
429
|
-
<filter id="f1" x="0" y="0">
|
|
430
|
-
<feGaussianBlur in="SourceGraphic" stdDeviation={pointermode === PointerMode.Arrow ? 2 * speed : 0} />
|
|
431
|
-
</filter>
|
|
432
|
-
</defs>
|
|
165
|
+
<g {...classWithPart("PartitionsEntity")}>
|
|
433
166
|
{#each options as option,index}
|
|
434
167
|
|
|
435
|
-
{#if option.
|
|
436
|
-
<
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
168
|
+
{#if option.image}
|
|
169
|
+
<g
|
|
170
|
+
use:renderImage={index}
|
|
171
|
+
style:filter={optionFilter}
|
|
172
|
+
/>
|
|
173
|
+
{:else if option.name}
|
|
174
|
+
<text
|
|
175
|
+
{...classWithPart("PartitionText")}
|
|
176
|
+
{...calc.getSvgTextProps(index)}
|
|
177
|
+
style:filter={optionFilter}
|
|
178
|
+
>
|
|
440
179
|
{option.name}
|
|
441
180
|
</text>
|
|
442
|
-
{:else if option.image}
|
|
443
|
-
<image {...{
|
|
444
|
-
...classWithPart("PartitionImage"),
|
|
445
|
-
...getSvgImageProps(ratio, index, radius, center, options.length, pointermode, arrowmode)
|
|
446
|
-
}} />
|
|
447
181
|
{/if}
|
|
448
182
|
{/each}
|
|
449
183
|
</g>
|
|
450
184
|
|
|
451
|
-
<!-- Background Shadow -->
|
|
452
185
|
<image {...{
|
|
453
|
-
...classWithPart("
|
|
454
|
-
...
|
|
455
|
-
width: (rRingInner - 3.2 * ratio) * 2,
|
|
456
|
-
height: (rRingInner - 3.2 * ratio) * 2,
|
|
457
|
-
})
|
|
186
|
+
...classWithPart("PartitionsShadow"),
|
|
187
|
+
...calc.getShadowImage()
|
|
458
188
|
}} />
|
|
459
189
|
</g>
|
|
460
190
|
|
|
461
|
-
{#if
|
|
462
|
-
<g {...classWithPart("Pointer")} {...
|
|
191
|
+
{#if theme.pointerMode === PointerMode.Partition}
|
|
192
|
+
<g {...classWithPart("Pointer")} {...calc.getSpinnerProps()}>
|
|
463
193
|
<image
|
|
464
194
|
{...{
|
|
465
195
|
...classWithPart("HighLightAreaBackground"),
|
|
466
|
-
|
|
467
|
-
...getImageProps(options.length, radius, center),
|
|
196
|
+
...calc.getBackgroundImageProps(0),
|
|
468
197
|
}}
|
|
469
198
|
/>
|
|
470
199
|
<image
|
|
471
200
|
{...{
|
|
472
201
|
...classWithPart("HighLightArea"),
|
|
473
|
-
|
|
474
|
-
...getImageProps(options.length, radius, center),
|
|
202
|
+
...calc.getBackgroundImageProps(1),
|
|
475
203
|
}}
|
|
476
204
|
/>
|
|
477
205
|
|
|
478
|
-
|
|
479
|
-
<defs>
|
|
480
|
-
<linearGradient id="GPointerPartitionFrame" x1="50.7564" y1="-9.24463" x2="50.7564" y2="115.67" gradientUnits="userSpaceOnUse">
|
|
481
|
-
<stop stop-color="#E7A60D"/>
|
|
482
|
-
<stop offset="0.378125" stop-color="#FFDD64"/>
|
|
483
|
-
<stop offset="1" stop-color="#FFF100"/>
|
|
484
|
-
</linearGradient>
|
|
485
|
-
</defs>
|
|
486
206
|
<path
|
|
487
|
-
{...
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
fill: `transparent`,
|
|
491
|
-
stroke: `url(#GPointerPartitionFrame)`,
|
|
492
|
-
'stroke-width': isShowPrizeArea ? '3px' : '0px',
|
|
493
|
-
'stroke-dasharray': `${radius} ${getArcLength(radius, 360 / options.length)}`,
|
|
494
|
-
}}
|
|
207
|
+
{...classWithPart("PointerPartitionFrame")}
|
|
208
|
+
{...calc.getPartitionFrame()}
|
|
209
|
+
{...{'stroke-width': isShowPrizeArea ? '3px' : '0px'}}
|
|
495
210
|
/>
|
|
496
211
|
</g>
|
|
497
212
|
{/if}
|
|
498
213
|
|
|
499
|
-
|
|
500
|
-
|
|
214
|
+
<g
|
|
215
|
+
{...classWithPart("Center")}
|
|
216
|
+
class:disabled={!spinable}
|
|
501
217
|
on:click={() => eventSpin()}
|
|
502
218
|
>
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
{...{
|
|
507
|
-
width: 122 * ratio,
|
|
508
|
-
height: 122 * ratio,
|
|
509
|
-
}}
|
|
510
|
-
id="FilterCenterCircle" x="-0.000488281" y="-0.000976562" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"
|
|
511
|
-
>
|
|
512
|
-
<feFlood flood-opacity="0" result="FilterCenterCircleBackgroundImageFix"/>
|
|
513
|
-
<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"/>
|
|
514
|
-
<feOffset/>
|
|
515
|
-
<feGaussianBlur stdDeviation="15"/>
|
|
516
|
-
<feComposite in2="hardAlpha" operator="out"/>
|
|
517
|
-
<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0"/>
|
|
518
|
-
<feBlend mode="normal" in2="FilterCenterCircleBackgroundImageFix" result="FilterCenterCircleeffect1_dropShadow_4318_347"/>
|
|
519
|
-
<feBlend mode="normal" in="SourceGraphic" in2="FilterCenterCircleeffect1_dropShadow_4318_347" result="shape"/>
|
|
520
|
-
</filter> -->
|
|
521
|
-
<linearGradient id="LGCenterCircle" x1="86.7076" y1="35.306" x2="24.1663" y2="97.8472" gradientUnits="userSpaceOnUse">
|
|
522
|
-
<stop offset="0.28" stop-color="#303030"/>
|
|
523
|
-
<stop offset="1" stop-color="#000604"/>
|
|
524
|
-
</linearGradient>
|
|
525
|
-
</defs>
|
|
526
|
-
<g
|
|
527
|
-
{...{
|
|
528
|
-
// filter: "url(#FilterCenterCircle)",
|
|
529
|
-
}}
|
|
530
|
-
>
|
|
531
|
-
<circle {...{
|
|
532
|
-
fill: `url(#LGCenterCircle)`,
|
|
533
|
-
cx: center,
|
|
534
|
-
cy: center,
|
|
535
|
-
r: 66 / 2 * ratio,
|
|
536
|
-
}} />
|
|
537
|
-
</g>
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
{#if themeIndex === 0 || themeIndex === 3}
|
|
541
|
-
<!-- Center Ring Arrow -->
|
|
542
|
-
<image {...renderSvgImageProps(center, centerArrowSvg, {
|
|
543
|
-
width: 96 * ratio,
|
|
544
|
-
height: 96 * ratio
|
|
545
|
-
})} />
|
|
546
|
-
|
|
547
|
-
{/if}
|
|
548
|
-
{#if themeIndex === 0 || themeIndex === 3 || themeIndex === 4 || themeIndex === 5}
|
|
549
|
-
<!-- Center Spin Text Background -->
|
|
550
|
-
<image {...renderSvgImageProps(center, spinSvg, {
|
|
551
|
-
width: 1.3 * 42 * ratio,
|
|
552
|
-
height: 1.3 * 25 * ratio
|
|
553
|
-
})} />
|
|
554
|
-
{/if}
|
|
555
|
-
{#if themeIndex === 4 || themeIndex === 5}
|
|
556
|
-
|
|
557
|
-
<image {...renderSvgImageProps(center, centerArrowBgSvg, {
|
|
558
|
-
width: 28 * ratio,
|
|
559
|
-
height: 24 * ratio
|
|
560
|
-
}, {
|
|
561
|
-
x: 0,
|
|
562
|
-
y: 45 * ratio
|
|
563
|
-
})} />
|
|
564
|
-
<image {...renderSvgImageProps(center, centerCircleSvg, {
|
|
565
|
-
width: 88 * ratio,
|
|
566
|
-
height: 104 * ratio
|
|
567
|
-
}, {
|
|
568
|
-
x: 0,
|
|
569
|
-
y: 6 * ratio
|
|
570
|
-
})} />
|
|
571
|
-
{/if}
|
|
572
|
-
{#if themeIndex === 1}
|
|
573
|
-
<!-- Center Background2 -->
|
|
574
|
-
<image {...renderSvgImageProps(center, centerBackground2Svg, {
|
|
575
|
-
width: 128 * ratio,
|
|
576
|
-
height: 128 * ratio
|
|
577
|
-
})} />
|
|
578
|
-
<!-- Center Spin Text Background -->
|
|
579
|
-
<image {...renderSvgImageProps(center, centerPackSvg, {
|
|
580
|
-
width: 76 * ratio,
|
|
581
|
-
height: 76 * ratio
|
|
582
|
-
})} />
|
|
583
|
-
{/if}
|
|
584
|
-
{#if themeIndex === 2}
|
|
585
|
-
<image {...renderSvgImageProps(center, centerArrow3Svg, {
|
|
586
|
-
width: 92 * ratio,
|
|
587
|
-
height: 92 * ratio
|
|
588
|
-
})} />
|
|
589
|
-
<image {...renderSvgImageProps(center, centerText3Svg, {
|
|
590
|
-
width: 42 * ratio,
|
|
591
|
-
height: 25 * ratio
|
|
592
|
-
})} />
|
|
593
|
-
|
|
594
|
-
{/if}
|
|
219
|
+
{#each calc.getThemedCenterImages() as themedImage}
|
|
220
|
+
<image {...calc.getThemedImageProp(themedImage)} />
|
|
221
|
+
{/each}
|
|
595
222
|
</g>
|
|
596
223
|
|
|
597
224
|
{#if theme.background.isShowingBulb}
|
|
598
225
|
<g id="RingCirclesGroup">
|
|
599
226
|
{#each options as option,index}
|
|
600
|
-
<image
|
|
601
|
-
|
|
602
|
-
{...getRingImageProps(
|
|
603
|
-
index,
|
|
604
|
-
options.length, rRingOuter, rRingInner, center, ratio
|
|
605
|
-
)
|
|
606
|
-
}
|
|
607
|
-
/>
|
|
608
|
-
<image
|
|
609
|
-
href={lightSvg}
|
|
610
|
-
{...getRingImageProps(
|
|
611
|
-
index + 1/2,
|
|
612
|
-
options.length, rRingOuter, rRingInner, center, ratio
|
|
613
|
-
)
|
|
614
|
-
}
|
|
615
|
-
/>
|
|
227
|
+
<image {...classWithPart("RingImage")} {...calc.getRingImageProps(index)} />
|
|
228
|
+
<image {...classWithPart("RingImage")} {...calc.getRingImageProps(index + 1/2)} />
|
|
616
229
|
{/each}
|
|
617
230
|
</g>
|
|
618
231
|
{/if}
|
|
619
232
|
|
|
620
|
-
|
|
621
|
-
{
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
<image
|
|
626
|
-
{...{
|
|
627
|
-
...classWithPart("PointerArrow"),
|
|
628
|
-
href: pointerArrowSvg,
|
|
629
|
-
x: center - 60 / 2 / 2 * ratio,
|
|
630
|
-
y: center - (rRingOuter + rRingInner) / 2 - 80 / 2 / 2 * ratio,
|
|
631
|
-
width: 60 / 2 * ratio,
|
|
632
|
-
height: 80 / 2 * ratio,
|
|
633
|
-
}}
|
|
634
|
-
/>
|
|
635
|
-
{:else if themeIndex === 2}
|
|
636
|
-
<image
|
|
637
|
-
{...renderSvgImageProps(center, pointerArrow3Svg, {
|
|
638
|
-
width: 2.8 * 32 / 2 * ratio,
|
|
639
|
-
height: 2.8 * 48 / 2 * ratio,
|
|
640
|
-
}, {
|
|
641
|
-
x: 0,
|
|
642
|
-
y: (rRingOuter + rRingInner) / 2,
|
|
643
|
-
})}
|
|
644
|
-
{...{
|
|
645
|
-
...classWithPart("PointerArrow"),
|
|
646
|
-
}}
|
|
647
|
-
/>
|
|
648
|
-
{:else if themeIndex === 4 || themeIndex === 5}
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
{:else}
|
|
652
|
-
<polygon {...{
|
|
653
|
-
...classWithPart("PointerArrow"),
|
|
654
|
-
points: arrowPoints,
|
|
655
|
-
fill: 'blue',
|
|
656
|
-
}} />
|
|
657
|
-
{/if}
|
|
233
|
+
{#if theme.pointerMode === PointerMode.Arrow}
|
|
234
|
+
<g {...classWithPart("Pointer")} {...calc.getSpinnerProps()}>
|
|
235
|
+
{#each calc.getThemedPointerImages() as themedImage}
|
|
236
|
+
<image {...calc.getThemedImageProp(themedImage)} />
|
|
237
|
+
{/each}
|
|
658
238
|
</g>
|
|
659
239
|
{/if}
|
|
660
240
|
|
|
241
|
+
|
|
242
|
+
<!-- defs -->
|
|
243
|
+
|
|
244
|
+
{#each calc.getDefs() as def}
|
|
245
|
+
<defs>
|
|
246
|
+
<linearGradient {...def.props}>
|
|
247
|
+
{#each def.steps as step}
|
|
248
|
+
<stop offset={step.offset} stop-color={step.color} />
|
|
249
|
+
{/each}
|
|
250
|
+
</linearGradient>
|
|
251
|
+
</defs>
|
|
252
|
+
{/each}
|
|
253
|
+
<defs>
|
|
254
|
+
<linearGradient id="GPointerPartitionFrame" x1="50.7564" y1="-9.24463" x2="50.7564" y2="115.67" gradientUnits="userSpaceOnUse">
|
|
255
|
+
<stop offset="0" stop-color="#E7A60D"/>
|
|
256
|
+
<stop offset="0.378125" stop-color="#FFDD64"/>
|
|
257
|
+
<stop offset="1" stop-color="#FFF100"/>
|
|
258
|
+
</linearGradient>
|
|
259
|
+
</defs>
|
|
260
|
+
|
|
261
|
+
<defs>
|
|
262
|
+
<filter
|
|
263
|
+
{...{
|
|
264
|
+
width: size,
|
|
265
|
+
height: size,
|
|
266
|
+
x: 0,
|
|
267
|
+
y: 0,
|
|
268
|
+
}}
|
|
269
|
+
id="BgHalo" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"
|
|
270
|
+
>
|
|
271
|
+
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
|
|
272
|
+
<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"/>
|
|
273
|
+
<feOffset/>
|
|
274
|
+
<feGaussianBlur stdDeviation="25"/>
|
|
275
|
+
<feComposite in2="hardAlpha" operator="out"/>
|
|
276
|
+
<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"/>
|
|
277
|
+
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_4318_310"/>
|
|
278
|
+
<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_4318_310" result="shape"/>
|
|
279
|
+
</filter>
|
|
280
|
+
</defs>
|
|
661
281
|
</svg>
|
|
662
282
|
{/if}
|
|
663
283
|
|
|
@@ -782,9 +402,10 @@
|
|
|
782
402
|
font-weight: 700;
|
|
783
403
|
text-anchor: end;
|
|
784
404
|
text-shadow: 0px 3px #000;
|
|
405
|
+
dominant-baseline: central;
|
|
785
406
|
}
|
|
786
407
|
|
|
787
|
-
.
|
|
408
|
+
.PartitionsShadow {
|
|
788
409
|
background-blend-mode: multiply;
|
|
789
410
|
mix-blend-mode: multiply;
|
|
790
411
|
}
|