@everymatrix/lottery-program-wof 1.22.11 → 1.23.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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@everymatrix/lottery-program-wof",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.23.0",
|
|
4
4
|
"main": "dist/lottery-program-wof.js",
|
|
5
5
|
"svelte": "src/index.ts",
|
|
6
6
|
"scripts": {
|
|
@@ -39,5 +39,5 @@
|
|
|
39
39
|
"publishConfig": {
|
|
40
40
|
"access": "public"
|
|
41
41
|
},
|
|
42
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "e1f96f1273bd4af5ca8e311c90006f51ca00a642"
|
|
43
43
|
}
|
package/src/private.item.svelte
CHANGED
|
@@ -42,6 +42,7 @@
|
|
|
42
42
|
let bonusNew: LotteryProgramForPlayer
|
|
43
43
|
let currentInfoKeys: CurrentInfo[]
|
|
44
44
|
let isOptionsReady: boolean = false
|
|
45
|
+
let checkableValid: boolean = true
|
|
45
46
|
|
|
46
47
|
const refetcher = async () => {
|
|
47
48
|
const LotteryProgramsForPlayer = await api.lotteries(endpoint, session)
|
|
@@ -67,8 +68,16 @@
|
|
|
67
68
|
|
|
68
69
|
'wof-private-message-spin-before': async (data) => {
|
|
69
70
|
if(data.id !== id) return;
|
|
71
|
+
checkableValid = false
|
|
70
72
|
bonusNew = await refetcher()
|
|
71
73
|
},
|
|
74
|
+
|
|
75
|
+
'wof-private-message-close': (data) => {
|
|
76
|
+
if(data.id !== id) return;
|
|
77
|
+
setTimeout(() => {
|
|
78
|
+
checkableValid = true
|
|
79
|
+
}, 1000);
|
|
80
|
+
},
|
|
72
81
|
})
|
|
73
82
|
|
|
74
83
|
// reactives
|
|
@@ -79,7 +88,11 @@
|
|
|
79
88
|
$: currentInfoKeys = currentinfo ? currentinfo.split(',') : [CurrentInfo.RemainingTimes]
|
|
80
89
|
</script>
|
|
81
90
|
|
|
82
|
-
<div
|
|
91
|
+
<div
|
|
92
|
+
class="LotteryItem"
|
|
93
|
+
class:Invalid={bonus?.current.remainingTimes == 0 && !bonus?.next && checkableValid}
|
|
94
|
+
bind:this={rootContainer}
|
|
95
|
+
>
|
|
83
96
|
<lottery-program-wof-private-item-svg {...{
|
|
84
97
|
...commonProps,
|
|
85
98
|
id,
|
|
@@ -145,6 +158,10 @@
|
|
|
145
158
|
max-width: 600px;
|
|
146
159
|
justify-content: space-around;
|
|
147
160
|
min-height: 200px;
|
|
161
|
+
|
|
162
|
+
&.Invalid {
|
|
163
|
+
display: none;
|
|
164
|
+
}
|
|
148
165
|
}
|
|
149
166
|
|
|
150
167
|
.Current {
|
|
@@ -206,7 +206,7 @@ svg {
|
|
|
206
206
|
transform: rotate(calc(var(--index) * 360deg / var(--length)));
|
|
207
207
|
}
|
|
208
208
|
foreignObject.Partition2 {
|
|
209
|
-
background-image: var(--img-theme-partition-light)
|
|
209
|
+
background-image: var(--img-theme-partition-light);
|
|
210
210
|
background-position: center calc((var(--size) / 2 - var(--radius)) * 1px - calc(var(--ratio) * 22px));
|
|
211
211
|
transform: rotate(calc((var(--index) + 0.5) * 360deg / var(--length)));
|
|
212
212
|
}
|
|
@@ -222,6 +222,12 @@ foreignObject.PointerArea {
|
|
|
222
222
|
foreignObject.Partition1, foreignObject.Partition2 {
|
|
223
223
|
transform-origin: center;
|
|
224
224
|
}
|
|
225
|
+
.PartitionsCustomable1, .PartitionsCustomable2 {
|
|
226
|
+
visibility: hidden;
|
|
227
|
+
&.active {
|
|
228
|
+
visibility: visible;
|
|
229
|
+
}
|
|
230
|
+
}
|
|
225
231
|
|
|
226
232
|
foreignObject.Customable {
|
|
227
233
|
overflow: visible;
|
|
@@ -33,12 +33,25 @@
|
|
|
33
33
|
export let size: string = ''
|
|
34
34
|
export let radius: string = ''
|
|
35
35
|
|
|
36
|
+
let isPartitionsCustomableReady: boolean = false
|
|
37
|
+
// temp way to make sure transform-origin effects on safari
|
|
38
|
+
const handleSafariIssue = (trigger) => {
|
|
39
|
+
trigger(-1)
|
|
40
|
+
setTimeout(() => {
|
|
41
|
+
trigger(1)
|
|
42
|
+
isPartitionsCustomableReady = true
|
|
43
|
+
}, 100)
|
|
44
|
+
}
|
|
45
|
+
|
|
36
46
|
let bonus: LotteryProgramForPlayer
|
|
37
47
|
const updateOptions = async () => {
|
|
38
48
|
if(!options.length){
|
|
39
49
|
options = await getOptions(bonus, lang)
|
|
40
50
|
|
|
41
51
|
_postMessage({ type: 'wof-private-options-ready', id })
|
|
52
|
+
|
|
53
|
+
const trigger = (amount: number) => size = String(Number(size) + amount)
|
|
54
|
+
handleSafariIssue(trigger)
|
|
42
55
|
}
|
|
43
56
|
}
|
|
44
57
|
$: bonus && lang && updateOptions()
|
|
@@ -182,7 +195,7 @@
|
|
|
182
195
|
bind:this={rootContainer}
|
|
183
196
|
style={`${defines()} --length: ${options.length}; --radius: ${radius}; --ratio: ${Number(size) / 480}; --size: ${size}`}
|
|
184
197
|
>
|
|
185
|
-
{#if size && options.length}
|
|
198
|
+
{#if Number(size) && options.length}
|
|
186
199
|
<svg
|
|
187
200
|
bind:this={svg}
|
|
188
201
|
width={size}
|
|
@@ -241,7 +254,7 @@
|
|
|
241
254
|
|
|
242
255
|
</g>
|
|
243
256
|
|
|
244
|
-
<g class="PartitionsCustomable1">
|
|
257
|
+
<g class="PartitionsCustomable1" class:active={isPartitionsCustomableReady}>
|
|
245
258
|
{#each options as option,index}
|
|
246
259
|
<foreignObject
|
|
247
260
|
class="Partition1 Customable"
|
|
@@ -250,7 +263,7 @@
|
|
|
250
263
|
/>
|
|
251
264
|
{/each}
|
|
252
265
|
</g>
|
|
253
|
-
<g class="PartitionsCustomable2">
|
|
266
|
+
<g class="PartitionsCustomable2" class:active={isPartitionsCustomableReady}>
|
|
254
267
|
{#each options as option,index}
|
|
255
268
|
<foreignObject
|
|
256
269
|
class="Partition2 Customable"
|