@everymatrix/lottery-program-wof 1.44.0 → 1.45.3

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.
Files changed (75) hide show
  1. package/es2015/lottery-program-wof.cjs +1 -0
  2. package/es2015/lottery-program-wof.js +16 -0
  3. package/package.json +14 -37
  4. package/CHANGELOG.md +0 -12
  5. package/README.md +0 -30
  6. package/babel.config.js +0 -6
  7. package/dist/lottery-program-wof.js +0 -11886
  8. package/dist/lottery-program-wof.js.map +0 -1
  9. package/index.html +0 -42
  10. package/index.js +0 -1
  11. package/public/favicon.png +0 -0
  12. package/public/reset.css +0 -48
  13. package/rollup.config.js +0 -61
  14. package/src/LotteryProgramWof.svelte +0 -214
  15. package/src/api/api.ts +0 -2016
  16. package/src/api/configuration.ts +0 -65
  17. package/src/api/custom.d.ts +0 -2
  18. package/src/api/index.ts +0 -15
  19. package/src/business.partition.ts +0 -98
  20. package/src/business.ts +0 -186
  21. package/src/calc.point.ts +0 -67
  22. package/src/calc.temp.ts +0 -29
  23. package/src/calc.ts +0 -28
  24. package/src/class.process.ts +0 -130
  25. package/src/class.spinable.ts +0 -60
  26. package/src/class.spinable.util.ts +0 -10
  27. package/src/class.spinner.ts +0 -176
  28. package/src/class.spinner.util.ts +0 -92
  29. package/src/class.svgcalc.ts +0 -249
  30. package/src/i18n.ts +0 -38
  31. package/src/images/Thankyou_1.svg +0 -100
  32. package/src/images/Thankyou_2.svg +0 -112
  33. package/src/images/Thankyou_3.svg +0 -87
  34. package/src/images/Thankyou_4.svg +0 -114
  35. package/src/images/gift.svg +0 -964
  36. package/src/images/theme.bg.blackring.svg +0 -10
  37. package/src/images/theme.bg.halo.svg +0 -27
  38. package/src/images/theme1Bg3.svg +0 -15
  39. package/src/images/theme2Arrow.svg +0 -24
  40. package/src/images/theme2Bg3.svg +0 -11
  41. package/src/images/theme2Center.svg +0 -36
  42. package/src/images/theme3Arrow.svg +0 -25
  43. package/src/images/theme3Bg1.svg +0 -29
  44. package/src/images/theme3Bg2.svg +0 -19
  45. package/src/images/theme3Center.svg +0 -77
  46. package/src/images/theme7Arrow.svg +0 -67
  47. package/src/images/theme7Bg1.svg +0 -786
  48. package/src/images/theme7Bg2.svg +0 -40
  49. package/src/images/theme7Bg3.svg +0 -26
  50. package/src/images/theme7Center.svg +0 -72
  51. package/src/images/theme7Light.svg +0 -17
  52. package/src/images/themeCenter1.svg +0 -76
  53. package/src/images/themeCenter2.svg +0 -58
  54. package/src/images/themePartitionLight.svg +0 -19
  55. package/src/images/themePointerArea.svg +0 -44
  56. package/src/images/themeShadow.svg +0 -27
  57. package/src/index.ts +0 -4
  58. package/src/message.ts +0 -28
  59. package/src/private.item.svelte +0 -172
  60. package/src/private.item.svg.scss +0 -302
  61. package/src/private.item.svg.svelte +0 -356
  62. package/src/private.loader.svelte +0 -61
  63. package/src/private.message.svelte +0 -236
  64. package/src/private.outcomes.svelte +0 -203
  65. package/src/private.tabs.svelte +0 -106
  66. package/src/themes.image.center.ts +0 -68
  67. package/src/themes.ts +0 -52
  68. package/src/translations.js +0 -218
  69. package/src/types.business.ts +0 -20
  70. package/src/types.ts +0 -79
  71. package/src/util.ts +0 -90
  72. package/src/widget.ts +0 -27
  73. package/stories/LotteryProgramWof.stories.js +0 -13
  74. package/svelte.config.js +0 -7
  75. package/tsconfig.json +0 -11
package/src/message.ts DELETED
@@ -1,28 +0,0 @@
1
- import { onMount } from "svelte"
2
-
3
- export const _postMessage = (message) => window.postMessage(message, window.location.href);
4
-
5
- const composeMessageHandler = (listeners) => {
6
- const handler = e => {
7
- Object.keys(listeners).map(key => {
8
- if (e.data && e.data.type == key) {
9
- const {type, ...restData} = e.data
10
- listeners[key](restData)
11
- }
12
- })
13
- }
14
-
15
- return handler
16
- }
17
-
18
- export const onMountMessageLifeCycle = (messageRegisters) => {
19
-
20
- const messageHandler = composeMessageHandler(messageRegisters)
21
-
22
- onMount(() => {
23
- window.addEventListener('message', messageHandler);
24
- return () => {
25
- window.removeEventListener('message', messageHandler);
26
- }
27
- })
28
- }
@@ -1,172 +0,0 @@
1
- <svelte:options tag={'lottery-program-wof-private-item'} />
2
-
3
- <script lang="ts">
4
- import './private.message.svelte'
5
- import './private.tabs.svelte'
6
- import './private.outcomes.svelte'
7
- import './private.item.svg.svelte'
8
-
9
- // types
10
- import { ContentDirection, Lang } from './types';
11
- import { getCurrentInfo, isBonusInvalid } from './business';
12
- import { api } from './business';
13
- import { onMountMessageLifeCycle, _postMessage } from './message';
14
- import { CurrentInfo, LotteryProgramForPlayer } from './types.business';
15
- import { _ } from './i18n';
16
- import { setClientStyling } from './widget';
17
-
18
- // properties common
19
- export let lang: Lang = Lang.en
20
- export let endpoint: string = ''
21
- export let session: string = ''
22
- export let clientstyling:string = ''
23
- export let currentinfo: string = CurrentInfo.RemainingTimes
24
- export let giftimagesrc: string = ''
25
- export let contentdirection: keyof typeof ContentDirection = 'anticlockwise'
26
- export let size: string = '480'
27
-
28
- // properties
29
- export let id: string = ''
30
-
31
- let rootContainer: HTMLElement
32
- $: clientstyling && rootContainer && setClientStyling(rootContainer, clientstyling);
33
-
34
- $: commonProps = {
35
- endpoint,
36
- lang,
37
- session,
38
- clientstyling,
39
- }
40
-
41
- let bonus: LotteryProgramForPlayer
42
- let bonusNew: LotteryProgramForPlayer
43
- let currentInfoKeys: CurrentInfo[]
44
- let isOptionsReady: boolean = false
45
- let checkableValid: boolean = true
46
-
47
- const refetcher = async () => {
48
- const LotteryProgramsForPlayer = await api.lotteries(endpoint, session)
49
- return LotteryProgramsForPlayer.filter(l => l.program.id === id)[0]
50
- }
51
-
52
- onMountMessageLifeCycle({
53
- 'wof-private-options-ready': (data) => {
54
- if(data.id !== id) return;
55
- isOptionsReady = true
56
- },
57
- 'wof-private-bonuses': (data) => {
58
- const bonusFound = data.bonuses.find(l => l.program.id === id)
59
- if(bonusFound){
60
- bonus = bonusFound
61
- }
62
- },
63
- 'wof-private-message-spin-after': (data) => {
64
- if(data.id !== id) return;
65
- if(!bonusNew) return;
66
- bonus = bonusNew
67
- _postMessage({type: 'wof-private-bonus', bonus: bonusNew, id })
68
- },
69
-
70
- 'wof-private-message-spin-before': async (data) => {
71
- if(data.id !== id) return;
72
- checkableValid = false
73
- bonusNew = await refetcher()
74
- },
75
-
76
- 'wof-private-message-close': (data) => {
77
- if(data.id !== id) return;
78
- _postMessage({type: 'wof-private-checking', bonus, id })
79
- setTimeout(() => {
80
- checkableValid = true
81
- }, 1000);
82
- },
83
- })
84
-
85
- // reactives
86
- $: _size = Number(size) || 480
87
- $: radius = 0.62 * _size / 2;
88
-
89
- // @ts-ignore
90
- $: currentInfoKeys = currentinfo ? currentinfo.split(',') : [CurrentInfo.RemainingTimes]
91
- </script>
92
-
93
- <div
94
- class="LotteryItem"
95
- class:Invalid={isBonusInvalid(bonus) && checkableValid}
96
- bind:this={rootContainer}
97
- >
98
- <lottery-program-wof-private-item-svg {...{
99
- ...commonProps,
100
- id,
101
- size: _size,
102
- radius,
103
- contentdirection,
104
- }} />
105
-
106
- <lottery-program-wof-private-message-panel {...{
107
- ...commonProps,
108
- id,
109
- size: _size,
110
- r: radius,
111
- giftimagesrc,
112
- }} />
113
-
114
- {#if bonus?.current && isOptionsReady}
115
- <div class="Current">
116
- {#each currentInfoKeys as CurrentInfoKey}
117
- <p class={CurrentInfoKey}>
118
- {$_(`wof.${CurrentInfoKey}`)}: {getCurrentInfo(bonus, CurrentInfoKey)}
119
- </p>
120
- {/each}
121
- </div>
122
- {/if}
123
-
124
- </div>
125
-
126
- <style lang="scss">
127
- @mixin FortuneContainer {
128
- width: 100%;
129
- display: flex;
130
- align-items: center;
131
- flex-direction: column;
132
- }
133
-
134
- lottery-program-wof-private-message-panel {
135
- position: absolute;
136
- top: 0;
137
- }
138
-
139
-
140
-
141
- *,
142
- *::before,
143
- *::after {
144
- margin: 0;
145
- padding: 0;
146
- list-style: none;
147
- text-decoration: none;
148
- outline: none;
149
- box-sizing: border-box;
150
- }
151
-
152
- $outlineColor: rgb(150, 54, 88);
153
- $outlineWidth: 2px;
154
-
155
- .LotteryItem {
156
- @include FortuneContainer;
157
- margin: 20px 0;
158
-
159
- position: relative;
160
- max-width: 600px;
161
- justify-content: space-around;
162
- min-height: 200px;
163
-
164
- &.Invalid {
165
- display: none;
166
- }
167
- }
168
-
169
- .Current {
170
- color: #FFFFFF;
171
- }
172
- </style>
@@ -1,302 +0,0 @@
1
-
2
- :host {
3
- font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji';
4
- }
5
-
6
- *,
7
- *::before,
8
- *::after {
9
- margin: 0;
10
- padding: 0;
11
- list-style: none;
12
- text-decoration: none;
13
- outline: none;
14
- box-sizing: border-box;
15
- }
16
-
17
- $outlineColor: rgb(150, 54, 88);
18
- $outlineWidth: 2px;
19
-
20
- .LotteryProgramWof {
21
- background: var(--emfe-w-color-contrast, #07072A);
22
- display: flex;
23
- align-items: center;
24
- flex-direction: column;
25
- padding: 20px 0;
26
- }
27
-
28
- main {
29
- max-width: 600px;
30
- width: 100%;
31
- display: flex;
32
- justify-content: space-around;
33
- min-height: 200px;
34
- }
35
-
36
- svg {
37
- transition: opacity 0.3s;
38
- }
39
-
40
- .FortuneContainer {
41
- width: 100%;
42
- display: flex;
43
- align-items: center;
44
- flex-direction: column;
45
- }
46
-
47
- .Center {
48
- cursor: pointer;
49
-
50
- transition: filter;
51
- transition-duration: 1s;
52
-
53
- &.disabled {
54
- filter: grayscale(80%);
55
- }
56
-
57
- .CenterCircle {
58
- fill: #3CE4BB;
59
- stroke: $outlineColor;
60
- stroke-width: $outlineWidth;
61
- cursor: pointer;
62
-
63
- transition: fill;
64
- transition-duration: 1s;
65
-
66
- }
67
-
68
- .CenterText {
69
- fill: #FFFFFF;
70
- }
71
- }
72
-
73
- .PointerPartition {
74
- opacity: 0.3;
75
- fill: lightgoldenrodyellow;
76
- stroke: red;
77
- stroke-width: 6px;
78
- stroke-dasharray: 12;
79
- }
80
-
81
- .Current {
82
- color: #FFFFFF;
83
- }
84
-
85
- .PartitionText {
86
- color: #FFFFFF;
87
- font-style: normal;
88
- font-weight: 700;
89
- text-anchor: end;
90
- text-shadow: 0px 3px #000;
91
- dominant-baseline: central;
92
- }
93
-
94
- .PartitionsShadow {
95
- background-blend-mode: multiply;
96
- mix-blend-mode: multiply;
97
- }
98
-
99
- .PartitionTextEntityContainer {
100
- height: 100%;
101
- display: flex;
102
- align-items: center;
103
- }
104
-
105
- .PartitionTextEntity {
106
- width: 100%;
107
- }
108
-
109
- .PartitionTextEntity.Anticlockwise {
110
- text-align: end;
111
- }
112
-
113
- // Themed Bottom
114
-
115
- .theme1, .theme4, .theme5 {
116
- foreignObject.Bottom div {
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 div {
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 div {
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 div {
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 div {
150
- background-image: var(--img-theme-center1);
151
- background-position: center;
152
- }
153
- }
154
-
155
- .theme2 {
156
- foreignObject.Middle div {
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 div {
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 div {
171
- background-image: var(--img-theme-center2);
172
- background-position: center;
173
- }
174
- }
175
-
176
- .theme7 {
177
- foreignObject.Middle div {
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 div {
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
- mix-blend-mode: multiply;
194
- }
195
-
196
- foreignObject.Top div {
197
- background-image: var(--img-theme-shadow);
198
- background-position: center;
199
- background-size: calc(var(--radius) * 2px);
200
- }
201
- }
202
-
203
- // Themed Partition
204
-
205
- .theme2 {
206
- foreignObject.Partition1 div {
207
- background-image: var(--img-theme-partition-light);
208
- background-position: center calc((var(--size) / 2 - var(--radius)) * 1px - calc(var(--ratio) * 22px));
209
- transform: rotate(calc(var(--index) * 360deg / var(--length)));
210
- }
211
- foreignObject.Partition2 div {
212
- background-image: var(--img-theme-partition-light);
213
- background-position: center calc((var(--size) / 2 - var(--radius)) * 1px - calc(var(--ratio) * 22px));
214
- transform: rotate(calc((var(--index) + 0.5) * 360deg / var(--length)));
215
- }
216
- }
217
-
218
- foreignObject.PointerArea {
219
- mix-blend-mode: screen;
220
- }
221
- foreignObject.PointerArea div {
222
- background-image: var(--img-theme-pointer-area);
223
- background-position: center -3px;
224
- background-size: 51%;
225
- }
226
-
227
- foreignObject.Partition1 div, foreignObject.Partition2 div {
228
- transform-origin: center;
229
- }
230
- .PartitionsCustomable1 div, .PartitionsCustomable2 div {
231
- visibility: hidden;
232
- &.active {
233
- visibility: visible;
234
- }
235
- }
236
-
237
- foreignObject.Customable {
238
- overflow: visible;
239
- }
240
-
241
- foreignObject.Customable div {
242
- background-repeat: no-repeat;
243
- }
244
-
245
- .PartitionBackground div {
246
- background-size: calc(var(--radius) * 2 / var(--size) * 100%) calc(var(--radius) * 2 / var(--size) * 100%);
247
- background-position: center;
248
- }
249
-
250
- .theme1, .theme2 {
251
- .PartitionBackground:nth-child(4n+1) { div { background-image: radial-gradient(#009C9C 0%, #002634 100%) }}
252
- .PartitionBackground:nth-child(4n+2) { div { background-image: radial-gradient(#AA00BF 0%, #3B0031 100%) }}
253
- .PartitionBackground:nth-child(4n+3) { div { background-image: radial-gradient(#0068CD 0%, #150D42 100%) }}
254
- .PartitionBackground:nth-child(4n+4) { div { background-image: radial-gradient(#DA005B 0%, #400021 100%) }}
255
- }
256
-
257
- .theme3 {
258
- .PartitionBackground:nth-child(4n+1) { div { background-image: radial-gradient(#066 0%, #007F76 13%, #00B59B 42%, #00DDB5 67.01%, #00F6C6 88.01%, #0FC 100.01%) }}
259
- .PartitionBackground:nth-child(4n+2) { div { background-image: radial-gradient(#580065 22.67%, #D453FF 91.3%) }}
260
- .PartitionBackground:nth-child(4n+3) { div { background-image: radial-gradient(#FFE767 -0.01%, #F28F00 100%) }}
261
- .PartitionBackground:nth-child(4n+4) { div { 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%) }}
262
- }
263
-
264
- .theme4, .theme5, .theme6 {
265
- .PartitionBackground:nth-child(4n+1) div { background: radial-gradient(#3B0031 0%, #7E008E 100.01%) }
266
- .PartitionBackground:nth-child(4n+2) div { background: radial-gradient(#5A005F 22.67%, #EA53FF 91.3%) }
267
- .PartitionBackground:nth-child(4n+3) div { background: radial-gradient(#B300C3 -0.01%, #4D003B 100%) }
268
- .PartitionBackground:nth-child(4n+4) div { background: radial-gradient(#59007B 22.59%, #B753FF 90.03%) }
269
- }
270
-
271
- .theme7 {
272
- .PartitionBackground:nth-child(2n+1) div { background: linear-gradient(90.23deg, #F6AD3F 16.59%, #AF8531 99.8%) }
273
- .PartitionBackground:nth-child(2n+2) div { background: linear-gradient(90deg, #323234 -0.01%, #272425 54.99%, #231F1F 99.99%) }
274
- }
275
-
276
- .PartitionBackground div {
277
- transform-origin: center;
278
- }
279
-
280
-
281
- // Themed Partition Background Stroke
282
- .PartitionBackgroundStroke {
283
- fill: transparent;
284
- stroke-width: 0.5px;
285
- stroke-dasharray: var(--radius) calc(2 * pi / var(--length) * var(--radius));
286
- }
287
- .theme1, .theme2 {
288
- .PartitionBackgroundStroke {
289
- stroke: #FCD755;
290
- }
291
- }
292
-
293
- .PointerPartitionFrame {
294
- stroke: #FFDD64;
295
- fill: transparent;
296
- stroke-dasharray: var(--radius) calc(2 * pi / var(--length) * var(--radius));
297
- stroke-width: 0px;
298
-
299
- &.active {
300
- stroke-width: 3px;
301
- }
302
- }