@everymatrix/lottery-program-wof 1.3.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/README.md +30 -0
- package/dist/lottery-program-wof.js +7278 -0
- package/dist/lottery-program-wof.js.map +1 -0
- package/index.html +42 -0
- package/index.js +1 -0
- package/package.json +41 -0
- package/public/favicon.png +0 -0
- package/public/reset.css +48 -0
- package/rollup.config.js +61 -0
- package/src/LotteryProgramWof.svelte +129 -0
- package/src/api/api.ts +2011 -0
- package/src/api/configuration.ts +65 -0
- package/src/api/custom.d.ts +2 -0
- package/src/api/index.ts +15 -0
- package/src/business.dom.ts +130 -0
- package/src/business.fake.ts +17 -0
- package/src/business.ts +276 -0
- package/src/calc.image.ts +13 -0
- package/src/calc.point.ts +315 -0
- package/src/calc.temp.ts +29 -0
- package/src/calc.ts +34 -0
- package/src/class.spinable.ts +65 -0
- package/src/class.spinable.util.ts +10 -0
- package/src/class.spinner.ts +145 -0
- package/src/class.spinner.util.ts +92 -0
- package/src/css.state.ts +13 -0
- package/src/fakeDraw.ts +9 -0
- package/src/fakeResult.ts +49 -0
- package/src/images/area.svg +11 -0
- package/src/images/areaSec.svg +11 -0
- package/src/images/areaV1.svg +18 -0
- package/src/images/areaV2.svg +17 -0
- package/src/images/background.svg +27 -0
- package/src/images/background3.svg +13 -0
- package/src/images/backgroundShadow.svg +22 -0
- package/src/images/centerArrow.svg +50 -0
- package/src/images/centerArrow1.svg +18 -0
- package/src/images/centerArrow2.svg +5 -0
- package/src/images/centerArrow3.svg +46 -0
- package/src/images/centerArrowBg.svg +12 -0
- package/src/images/centerBackground2.svg +24 -0
- package/src/images/centerCircle.svg +24 -0
- package/src/images/centerPack.svg +16 -0
- package/src/images/centerText3.svg +3 -0
- package/src/images/gift.svg +964 -0
- package/src/images/light.svg +19 -0
- package/src/images/partition1.svg +10 -0
- package/src/images/pointerArrow.svg +24 -0
- package/src/images/pointerArrow3.svg +25 -0
- package/src/images/spin.svg +13 -0
- package/src/index.ts +4 -0
- package/src/message.ts +28 -0
- package/src/private.item.svelte +279 -0
- package/src/private.item.svg.svelte +791 -0
- package/src/private.message.svelte +167 -0
- package/src/private.outcomes.svelte +163 -0
- package/src/private.tabs.svelte +92 -0
- package/src/themes.partitions.ts +174 -0
- package/src/themes.ts +206 -0
- package/src/types.business.ts +4 -0
- package/src/types.ts +74 -0
- package/src/util.ts +83 -0
- package/stories/LotteryProgramWof.stories.js +13 -0
- package/svelte.config.js +7 -0
- package/tsconfig.json +6 -0
|
@@ -0,0 +1,791 @@
|
|
|
1
|
+
<svelte:options tag={'lottery-program-wof-private-item-svg'} />
|
|
2
|
+
|
|
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
|
+
|
|
33
|
+
// types
|
|
34
|
+
import { ArrowMode, PointerMode, Lang } from './types';
|
|
35
|
+
import { findDegWithPointerMode, getSpinCondition, getSpinContainerSelector, Option } from './business';
|
|
36
|
+
import { setMessage as setMessageBase } from './business';
|
|
37
|
+
import { getColorSchema, getSvgImageProps, getSvgTextProps } from './business.dom';
|
|
38
|
+
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
|
+
import { onMountMessageLifeCycle, _postMessage } from './message';
|
|
49
|
+
import type { LotteryProgramForPlayer } from './types.business';
|
|
50
|
+
import { themes } from './themes';
|
|
51
|
+
import { renderSvgImageProps } from './calc.image';
|
|
52
|
+
import { classWithPart, delay, setProps } from './util';
|
|
53
|
+
import { Spinner } from './class.spinner';
|
|
54
|
+
|
|
55
|
+
// properties
|
|
56
|
+
export let lang: Lang = Lang.en
|
|
57
|
+
export let endpoint: string = ''
|
|
58
|
+
export let session: string = ''
|
|
59
|
+
|
|
60
|
+
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
|
+
|
|
67
|
+
export let id: string = undefined
|
|
68
|
+
export let sizeraw: string = '0'
|
|
69
|
+
$: size = Number(sizeraw) || 0;
|
|
70
|
+
|
|
71
|
+
export let optionsraw: string = '[]'
|
|
72
|
+
let options: Option[] = []
|
|
73
|
+
$: options = JSON.parse(optionsraw);
|
|
74
|
+
|
|
75
|
+
// binds
|
|
76
|
+
let svg: SVGElement;
|
|
77
|
+
|
|
78
|
+
// states
|
|
79
|
+
let spinable = true;
|
|
80
|
+
let isShowPrizeArea = false;
|
|
81
|
+
let pointermode: PointerMode = PointerMode.Partition;
|
|
82
|
+
let spinner = new Spinner
|
|
83
|
+
let shownFirstCheck = false
|
|
84
|
+
let speed: number = 0
|
|
85
|
+
|
|
86
|
+
$: lotteryProgramForPlayer = lotteryprogramforplayer && (JSON.parse(lotteryprogramforplayer)) as LotteryProgramForPlayer
|
|
87
|
+
|
|
88
|
+
let messageShown: boolean = false;
|
|
89
|
+
|
|
90
|
+
$: themeIndex = Number(themeindex)
|
|
91
|
+
$: pointermode = (() => {
|
|
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
|
|
99
|
+
}
|
|
100
|
+
})()
|
|
101
|
+
$: theme = themes[themeIndex]
|
|
102
|
+
|
|
103
|
+
const setMessage = (entry: string | object) => {
|
|
104
|
+
setMessageBase(id, entry)
|
|
105
|
+
messageShown = true
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
$: lotteryProgramForPlayer && checkSpinable()
|
|
109
|
+
|
|
110
|
+
const checkSpinable = () => {
|
|
111
|
+
if(shownFirstCheck) return;
|
|
112
|
+
shownFirstCheck = true
|
|
113
|
+
|
|
114
|
+
if(spinable){
|
|
115
|
+
if(getSpinCondition(lotteryProgramForPlayer)){
|
|
116
|
+
setMessage({
|
|
117
|
+
mode: 'spin-failed'
|
|
118
|
+
})
|
|
119
|
+
}else if(getSpinCondition(lotteryProgramForPlayer) && !lotteryProgramForPlayer.next){
|
|
120
|
+
setMessage(`You don't have any spins available. Please check T&C`)
|
|
121
|
+
}
|
|
122
|
+
}else{
|
|
123
|
+
// hasQueuedMessage = true
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
const getDeg = (index?: number) => findDegWithPointerMode(index || options.length - 1, options.length, pointermode)
|
|
128
|
+
|
|
129
|
+
const drawer = async (guid, frequency: number = 0) => {
|
|
130
|
+
|
|
131
|
+
let index
|
|
132
|
+
|
|
133
|
+
const stage = {
|
|
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
|
|
189
|
+
|
|
190
|
+
// events
|
|
191
|
+
const eventSpin = async () => {
|
|
192
|
+
if(!spinable) return;
|
|
193
|
+
|
|
194
|
+
if(!lotteryProgramForPlayer.current.remainingTimes){
|
|
195
|
+
if(lotteryProgramForPlayer.next){
|
|
196
|
+
setMessage({
|
|
197
|
+
mode: 'show-next',
|
|
198
|
+
modeValue: lotteryProgramForPlayer.next
|
|
199
|
+
})
|
|
200
|
+
}else{
|
|
201
|
+
setMessage(`You don't have any spins available. Please check T&C`)
|
|
202
|
+
}
|
|
203
|
+
return;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
spinable = false
|
|
207
|
+
isShowPrizeArea = false
|
|
208
|
+
|
|
209
|
+
container = svg.querySelector(getSpinContainerSelector(pointermode))
|
|
210
|
+
|
|
211
|
+
spinner.launch()
|
|
212
|
+
const guid = `userid-${id}-${new Date().getTime()}`
|
|
213
|
+
drawer(guid)
|
|
214
|
+
|
|
215
|
+
}
|
|
216
|
+
onMountMessageLifeCycle({
|
|
217
|
+
'wof-private-message-close': (data) => {
|
|
218
|
+
if(data.id !== id) return;
|
|
219
|
+
|
|
220
|
+
spinable = true
|
|
221
|
+
messageShown = false
|
|
222
|
+
},
|
|
223
|
+
})
|
|
224
|
+
|
|
225
|
+
$: propsSpinner = {
|
|
226
|
+
transform: `rotate(${convertArcToDeg(0)})`, //arcStart
|
|
227
|
+
"transform-origin": `${centerPoint.x} ${centerPoint.y}`,
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
$: rCircleCenter = radius / 5;
|
|
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
|
+
})()
|
|
254
|
+
</script>
|
|
255
|
+
|
|
256
|
+
|
|
257
|
+
{#if size}
|
|
258
|
+
<svg
|
|
259
|
+
bind:this={svg}
|
|
260
|
+
width={size}
|
|
261
|
+
height={size}
|
|
262
|
+
style={[
|
|
263
|
+
`${messageShown ? 'opacity: .3': ''}`,
|
|
264
|
+
].join(';')}
|
|
265
|
+
|
|
266
|
+
>
|
|
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
|
+
|
|
335
|
+
<g {...classWithPart("BackgroundCircleGroup")} filter="url(#BgHalo)">
|
|
336
|
+
|
|
337
|
+
<defs>
|
|
338
|
+
<linearGradient {...{
|
|
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
|
+
|
|
382
|
+
</g>
|
|
383
|
+
|
|
384
|
+
<g {...classWithPart("Partitions")} {...propsSpinner}>
|
|
385
|
+
<g {...classWithPart("PartitionsBackground")}>
|
|
386
|
+
<defs>
|
|
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>
|
|
413
|
+
<path
|
|
414
|
+
{...{
|
|
415
|
+
...classWithPart("PartitionBackground"),
|
|
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
|
+
}}
|
|
422
|
+
/>
|
|
423
|
+
|
|
424
|
+
{/each}
|
|
425
|
+
</g>
|
|
426
|
+
|
|
427
|
+
<g id="Images">
|
|
428
|
+
<defs>
|
|
429
|
+
<filter id="f1" x="0" y="0">
|
|
430
|
+
<feGaussianBlur in="SourceGraphic" stdDeviation={2 * speed} />
|
|
431
|
+
</filter>
|
|
432
|
+
</defs>
|
|
433
|
+
{#each options as option,index}
|
|
434
|
+
|
|
435
|
+
{#if option.name}
|
|
436
|
+
<text filter="url(#f1)" dominant-baseline="central" {...{
|
|
437
|
+
...classWithPart("PartitionText"),
|
|
438
|
+
...getSvgTextProps(ratio, index, radius, center, options.length, pointermode, arrowmode),
|
|
439
|
+
}}>
|
|
440
|
+
{option.name}
|
|
441
|
+
</text>
|
|
442
|
+
{:else if option.image}
|
|
443
|
+
<image {...{
|
|
444
|
+
...classWithPart("PartitionImage"),
|
|
445
|
+
...getSvgImageProps(ratio, index, radius, center, options.length, pointermode, arrowmode)
|
|
446
|
+
}} />
|
|
447
|
+
{/if}
|
|
448
|
+
{/each}
|
|
449
|
+
</g>
|
|
450
|
+
|
|
451
|
+
<!-- Background Shadow -->
|
|
452
|
+
<image {...{
|
|
453
|
+
...classWithPart("PartitionShadow"),
|
|
454
|
+
...renderSvgImageProps(center, backgroundShadowSvg, {
|
|
455
|
+
width: (rRingInner - 3.2 * ratio) * 2,
|
|
456
|
+
height: (rRingInner - 3.2 * ratio) * 2,
|
|
457
|
+
})
|
|
458
|
+
}} />
|
|
459
|
+
</g>
|
|
460
|
+
|
|
461
|
+
{#if pointermode === PointerMode.Partition && options[0]}
|
|
462
|
+
<g {...classWithPart("Pointer")} {...propsSpinner}>
|
|
463
|
+
<image
|
|
464
|
+
{...{
|
|
465
|
+
...classWithPart("HighLightAreaBackground"),
|
|
466
|
+
href: areaSecSvg,
|
|
467
|
+
...getImageProps(options.length, radius, center),
|
|
468
|
+
}}
|
|
469
|
+
/>
|
|
470
|
+
<image
|
|
471
|
+
{...{
|
|
472
|
+
...classWithPart("HighLightArea"),
|
|
473
|
+
href: areaSvg,
|
|
474
|
+
...getImageProps(options.length, radius, center),
|
|
475
|
+
}}
|
|
476
|
+
/>
|
|
477
|
+
|
|
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
|
+
<path
|
|
487
|
+
{...{
|
|
488
|
+
...classWithPart("PointerPartitionFrame"),
|
|
489
|
+
...getPartitionProps(0, options.length, radius, center),
|
|
490
|
+
fill: `transparent`,
|
|
491
|
+
stroke: `url(#GPointerPartitionFrame)`,
|
|
492
|
+
'stroke-width': isShowPrizeArea ? '3px' : '0px',
|
|
493
|
+
'stroke-dasharray': `${radius} ${getArcLength(radius, 360 / options.length)}`,
|
|
494
|
+
}}
|
|
495
|
+
/>
|
|
496
|
+
</g>
|
|
497
|
+
{/if}
|
|
498
|
+
|
|
499
|
+
|
|
500
|
+
<g {...classWithPart("Center", spinable ? '' : 'disabled')}
|
|
501
|
+
on:click={() => eventSpin()}
|
|
502
|
+
>
|
|
503
|
+
|
|
504
|
+
<defs>
|
|
505
|
+
<!-- <filter
|
|
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}
|
|
595
|
+
</g>
|
|
596
|
+
|
|
597
|
+
{#if theme.background.isShowingBulb}
|
|
598
|
+
<g id="RingCirclesGroup">
|
|
599
|
+
{#each options as option,index}
|
|
600
|
+
<image
|
|
601
|
+
href={lightSvg}
|
|
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
|
+
/>
|
|
616
|
+
{/each}
|
|
617
|
+
</g>
|
|
618
|
+
{/if}
|
|
619
|
+
|
|
620
|
+
|
|
621
|
+
{#if pointermode === PointerMode.Arrow}
|
|
622
|
+
<g {...classWithPart("Pointer")} {...propsSpinner}>
|
|
623
|
+
|
|
624
|
+
{#if themeIndex === 1}
|
|
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}
|
|
658
|
+
</g>
|
|
659
|
+
{/if}
|
|
660
|
+
|
|
661
|
+
</svg>
|
|
662
|
+
{/if}
|
|
663
|
+
|
|
664
|
+
<style lang="scss">
|
|
665
|
+
|
|
666
|
+
:host {
|
|
667
|
+
font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji';
|
|
668
|
+
}
|
|
669
|
+
|
|
670
|
+
*,
|
|
671
|
+
*::before,
|
|
672
|
+
*::after {
|
|
673
|
+
margin: 0;
|
|
674
|
+
padding: 0;
|
|
675
|
+
list-style: none;
|
|
676
|
+
text-decoration: none;
|
|
677
|
+
outline: none;
|
|
678
|
+
box-sizing: border-box;
|
|
679
|
+
}
|
|
680
|
+
|
|
681
|
+
$outlineColor: rgb(150, 54, 88);
|
|
682
|
+
$outlineWidth: 2px;
|
|
683
|
+
|
|
684
|
+
.LotteryProgramWof {
|
|
685
|
+
background: var(--emfe-w-color-contrast, #07072A);
|
|
686
|
+
display: flex;
|
|
687
|
+
align-items: center;
|
|
688
|
+
flex-direction: column;
|
|
689
|
+
padding: 20px 0;
|
|
690
|
+
}
|
|
691
|
+
|
|
692
|
+
main {
|
|
693
|
+
max-width: 600px;
|
|
694
|
+
width: 100%;
|
|
695
|
+
display: flex;
|
|
696
|
+
justify-content: space-around;
|
|
697
|
+
min-height: 200px;
|
|
698
|
+
}
|
|
699
|
+
|
|
700
|
+
svg {
|
|
701
|
+
transition: opacity 0.3s;
|
|
702
|
+
}
|
|
703
|
+
|
|
704
|
+
.HighLightArea {
|
|
705
|
+
mix-blend-mode: color-dodge;
|
|
706
|
+
}
|
|
707
|
+
|
|
708
|
+
.HighLightAreaBackground {
|
|
709
|
+
mix-blend-mode: screen;
|
|
710
|
+
opacity: 0.41;
|
|
711
|
+
}
|
|
712
|
+
|
|
713
|
+
.HighLightAreaV1 {
|
|
714
|
+
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%);
|
|
715
|
+
filter: blur(9px);
|
|
716
|
+
}
|
|
717
|
+
.HighLightAreaV2 {
|
|
718
|
+
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%);
|
|
719
|
+
filter: blur(9px);
|
|
720
|
+
}
|
|
721
|
+
|
|
722
|
+
.FortuneContainer {
|
|
723
|
+
width: 100%;
|
|
724
|
+
display: flex;
|
|
725
|
+
align-items: center;
|
|
726
|
+
flex-direction: column;
|
|
727
|
+
}
|
|
728
|
+
|
|
729
|
+
.BackgroundCircle {
|
|
730
|
+
fill: #FFFFFF;
|
|
731
|
+
animation: color-animation 1s infinite linear alternate;
|
|
732
|
+
}
|
|
733
|
+
|
|
734
|
+
.RingCirclesGroup {
|
|
735
|
+
.RingCircle {
|
|
736
|
+
fill: #FFFFFF;
|
|
737
|
+
stroke: #FFFFFF;
|
|
738
|
+
}
|
|
739
|
+
}
|
|
740
|
+
|
|
741
|
+
.Center {
|
|
742
|
+
cursor: pointer;
|
|
743
|
+
|
|
744
|
+
transition: filter;
|
|
745
|
+
transition-duration: 1s;
|
|
746
|
+
|
|
747
|
+
&.disabled {
|
|
748
|
+
filter: grayscale(80%);
|
|
749
|
+
}
|
|
750
|
+
|
|
751
|
+
.CenterCircle {
|
|
752
|
+
fill: #3CE4BB;
|
|
753
|
+
stroke: $outlineColor;
|
|
754
|
+
stroke-width: $outlineWidth;
|
|
755
|
+
cursor: pointer;
|
|
756
|
+
|
|
757
|
+
transition: fill;
|
|
758
|
+
transition-duration: 1s;
|
|
759
|
+
|
|
760
|
+
}
|
|
761
|
+
|
|
762
|
+
.CenterText {
|
|
763
|
+
fill: #FFFFFF;
|
|
764
|
+
}
|
|
765
|
+
}
|
|
766
|
+
|
|
767
|
+
.PointerPartition {
|
|
768
|
+
opacity: 0.3;
|
|
769
|
+
fill: lightgoldenrodyellow;
|
|
770
|
+
stroke: red;
|
|
771
|
+
stroke-width: 6px;
|
|
772
|
+
stroke-dasharray: 12;
|
|
773
|
+
}
|
|
774
|
+
|
|
775
|
+
.Current {
|
|
776
|
+
color: #FFFFFF;
|
|
777
|
+
}
|
|
778
|
+
|
|
779
|
+
.PartitionText {
|
|
780
|
+
fill: #FFFFFF;
|
|
781
|
+
font-style: normal;
|
|
782
|
+
font-weight: 700;
|
|
783
|
+
text-anchor: end;
|
|
784
|
+
text-shadow: 0px 3px #000;
|
|
785
|
+
}
|
|
786
|
+
|
|
787
|
+
.PartitionShadow {
|
|
788
|
+
background-blend-mode: multiply;
|
|
789
|
+
mix-blend-mode: multiply;
|
|
790
|
+
}
|
|
791
|
+
</style>
|