@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,19 @@
|
|
|
1
|
+
<svg width="21" height="21" viewBox="0 0 21 21" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M1.13725 6.59296C-1.06246 11.7081 1.3605 17.6636 6.54907 19.8949C11.7376 22.1261 17.727 19.7883 19.9267 14.6732C22.1264 9.55803 19.7035 3.60256 14.5149 1.37127C9.32636 -0.860015 3.33697 1.47782 1.13725 6.59296Z" fill="url(#paint0_radial_4318_413)"/>
|
|
3
|
+
<defs>
|
|
4
|
+
<radialGradient id="paint0_radial_4318_413" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(10.4878 10.6315) rotate(-156.73) scale(10.1906 10.0463)">
|
|
5
|
+
<stop offset="0.3" stop-color="white"/>
|
|
6
|
+
<stop offset="0.3099" stop-color="#FFFCDB"/>
|
|
7
|
+
<stop offset="0.3232" stop-color="#FFF9B2"/>
|
|
8
|
+
<stop offset="0.3381" stop-color="#FFF68C"/>
|
|
9
|
+
<stop offset="0.3543" stop-color="#FFF36C"/>
|
|
10
|
+
<stop offset="0.3722" stop-color="#FFF150"/>
|
|
11
|
+
<stop offset="0.3925" stop-color="#FFEF3A"/>
|
|
12
|
+
<stop offset="0.4161" stop-color="#FFEE29"/>
|
|
13
|
+
<stop offset="0.4453" stop-color="#FFED1E"/>
|
|
14
|
+
<stop offset="0.4863" stop-color="#FFEC17"/>
|
|
15
|
+
<stop offset="0.6" stop-color="#FFEC15"/>
|
|
16
|
+
<stop offset="1" stop-color="#FFEC15" stop-opacity="0"/>
|
|
17
|
+
</radialGradient>
|
|
18
|
+
</defs>
|
|
19
|
+
</svg>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
|
|
2
|
+
<svg width="112" height="128" viewBox="0 0 112 128" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
3
|
+
<path d="M111.284 12.6811C94.4942 4.55217 75.65 0 55.7416 0C35.8333 0 16.989 4.55217 0.199219 12.6811C1.98757 11.8238 3.80549 10.9962 5.6234 10.2128L55.7416 127.727L105.86 10.2128C107.678 10.9962 109.496 11.809 111.284 12.6811Z" fill="url(#paint0_linear_4318_319)"/>
|
|
4
|
+
<defs>
|
|
5
|
+
<linearGradient id="paint0_linear_4318_319" x1="55.7416" y1="0" x2="55.7416" y2="127.742" gradientUnits="userSpaceOnUse">
|
|
6
|
+
<stop stop-color="#002634"/>
|
|
7
|
+
<stop offset="1" stop-color="#009C9C"/>
|
|
8
|
+
</linearGradient>
|
|
9
|
+
</defs>
|
|
10
|
+
</svg>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<svg width="42" height="46" viewBox="0 0 42 46" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<g filter="url(#filter0_d_4318_419)">
|
|
3
|
+
<path d="M21 38.0002L8.00962 8.00025L33.9904 8.00025L21 38.0002Z" fill="url(#paint0_linear_4318_419)"/>
|
|
4
|
+
</g>
|
|
5
|
+
<defs>
|
|
6
|
+
<filter id="filter0_d_4318_419" x="0.00976562" y="0.000244141" width="41.9805" height="46" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
|
|
7
|
+
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
|
|
8
|
+
<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"/>
|
|
9
|
+
<feOffset/>
|
|
10
|
+
<feGaussianBlur stdDeviation="4"/>
|
|
11
|
+
<feComposite in2="hardAlpha" operator="out"/>
|
|
12
|
+
<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0"/>
|
|
13
|
+
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_4318_419"/>
|
|
14
|
+
<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_4318_419" result="shape"/>
|
|
15
|
+
</filter>
|
|
16
|
+
<linearGradient id="paint0_linear_4318_419" x1="27.7905" y1="-3.26818" x2="6.23495" y2="34.4541" gradientUnits="userSpaceOnUse">
|
|
17
|
+
<stop offset="0.0604165" stop-color="#FFB915"/>
|
|
18
|
+
<stop offset="0.2375" stop-color="#C48A02"/>
|
|
19
|
+
<stop offset="0.477083" stop-color="#FFE067"/>
|
|
20
|
+
<stop offset="0.721875" stop-color="#FFB915"/>
|
|
21
|
+
<stop offset="1" stop-color="#FFF100"/>
|
|
22
|
+
</linearGradient>
|
|
23
|
+
</defs>
|
|
24
|
+
</svg>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<svg width="48" height="63" viewBox="0 0 48 63" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<g filter="url(#filter0_d_4318_464)">
|
|
3
|
+
<path d="M24 55L8 29.0689L18.6577 29.0689L16.35 8L24 8L31.65 8L29.3423 29.0689L40 29.0689L24 55Z" fill="url(#paint0_linear_4318_464)"/>
|
|
4
|
+
</g>
|
|
5
|
+
<defs>
|
|
6
|
+
<filter id="filter0_d_4318_464" x="0" y="0" width="48" height="63" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
|
|
7
|
+
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
|
|
8
|
+
<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"/>
|
|
9
|
+
<feOffset/>
|
|
10
|
+
<feGaussianBlur stdDeviation="4"/>
|
|
11
|
+
<feComposite in2="hardAlpha" operator="out"/>
|
|
12
|
+
<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0"/>
|
|
13
|
+
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_4318_464"/>
|
|
14
|
+
<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_4318_464" result="shape"/>
|
|
15
|
+
</filter>
|
|
16
|
+
<linearGradient id="paint0_linear_4318_464" x1="23.9916" y1="8.77629" x2="23.9916" y2="47.4768" gradientUnits="userSpaceOnUse">
|
|
17
|
+
<stop stop-color="#FEDC31"/>
|
|
18
|
+
<stop offset="0.09" stop-color="#FDC347"/>
|
|
19
|
+
<stop offset="0.27" stop-color="#FC8682"/>
|
|
20
|
+
<stop offset="0.52" stop-color="#FA2CD7"/>
|
|
21
|
+
<stop offset="0.76" stop-color="#987CDB"/>
|
|
22
|
+
<stop offset="1" stop-color="#33D0E0"/>
|
|
23
|
+
</linearGradient>
|
|
24
|
+
</defs>
|
|
25
|
+
</svg>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<svg width="54" height="27" viewBox="0 0 54 27" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<g filter="url(#filter0_f_4318_348)">
|
|
3
|
+
<path d="M9.98663 20.179C9.33863 20.179 8.74463 20.107 8.20463 19.963C7.67663 19.819 7.22663 19.627 6.85463 19.387V16.975C7.21463 17.167 7.56263 17.335 7.89863 17.479C8.24663 17.623 8.59463 17.737 8.94263 17.821C9.29063 17.893 9.64463 17.929 10.0046 17.929C10.3046 17.929 10.5806 17.905 10.8326 17.857C11.0846 17.797 11.3006 17.707 11.4806 17.587C11.6726 17.467 11.8226 17.323 11.9306 17.155C12.0386 16.975 12.0926 16.765 12.0926 16.525C12.0926 16.189 12.0266 15.907 11.8946 15.679C11.7626 15.451 11.5826 15.241 11.3546 15.049C11.1266 14.857 10.8566 14.653 10.5446 14.437C10.1846 14.173 9.83663 13.879 9.50063 13.555C9.16463 13.231 8.88863 12.853 8.67263 12.421C8.45663 11.977 8.34863 11.461 8.34863 10.873C8.34863 10.297 8.45063 9.77502 8.65463 9.30702C8.85863 8.82702 9.15263 8.41302 9.53663 8.06502C9.93263 7.71702 10.4006 7.44702 10.9406 7.25502C11.4806 7.06302 12.0866 6.96702 12.7586 6.96702C13.4306 6.96702 14.0486 7.03902 14.6126 7.18302C15.1766 7.32702 15.7226 7.54302 16.2506 7.83102L15.2966 9.88302C14.8406 9.66702 14.4026 9.50502 13.9826 9.39702C13.5746 9.28902 13.1666 9.23502 12.7586 9.23502C12.5186 9.23502 12.2966 9.27102 12.0926 9.34302C11.9006 9.40302 11.7266 9.49902 11.5706 9.63102C11.4266 9.75102 11.3126 9.90102 11.2286 10.081C11.1446 10.261 11.1026 10.459 11.1026 10.675C11.1026 10.975 11.1626 11.233 11.2826 11.449C11.4146 11.665 11.5946 11.869 11.8226 12.061C12.0626 12.241 12.3506 12.445 12.6866 12.673C13.1666 12.985 13.5626 13.321 13.8746 13.681C14.1866 14.029 14.4206 14.413 14.5766 14.833C14.7326 15.241 14.8106 15.697 14.8106 16.201C14.8106 16.873 14.6846 17.461 14.4326 17.965C14.1806 18.457 13.8326 18.871 13.3886 19.207C12.9446 19.531 12.4286 19.777 11.8406 19.945C11.2646 20.101 10.6466 20.179 9.98663 20.179ZM16.5076 19.999L19.2256 7.14702H22.8076C23.8516 7.14702 24.6856 7.30302 25.3096 7.61502C25.9456 7.92702 26.4016 8.36502 26.6776 8.92902C26.9656 9.49302 27.1096 10.147 27.1096 10.891C27.1096 11.659 26.9656 12.325 26.6776 12.889C26.4016 13.453 26.0116 13.927 25.5076 14.311C25.0036 14.683 24.4096 14.965 23.7256 15.157C23.0416 15.337 22.3036 15.427 21.5116 15.427H20.1436L19.1896 19.999H16.5076ZM21.7276 13.195C22.2676 13.195 22.7356 13.111 23.1316 12.943C23.5396 12.763 23.8516 12.505 24.0676 12.169C24.2956 11.833 24.4096 11.431 24.4096 10.963C24.4096 10.423 24.2656 10.027 23.9776 9.77502C23.6896 9.51102 23.2636 9.37902 22.6996 9.37902H21.4396L20.6296 13.195H21.7276ZM26.5039 19.999L26.8279 18.451L28.4659 17.731L30.2299 9.41502L28.8979 8.69502L29.2219 7.14702H34.9099L34.5859 8.69502L32.9119 9.41502L31.1479 17.731L32.5159 18.451L32.1919 19.999H26.5039ZM34.3845 19.999L37.1025 7.14702H40.2345L43.2225 16.615H43.2945C43.3305 16.423 43.3665 16.189 43.4025 15.913C43.4505 15.637 43.4985 15.343 43.5465 15.031C43.6065 14.707 43.6665 14.389 43.7265 14.077C43.7865 13.765 43.8405 13.483 43.8885 13.231L45.1845 7.14702H47.5965L44.8785 19.999H41.8725L38.7405 10.279H38.6505C38.6385 10.351 38.6145 10.525 38.5785 10.801C38.5425 11.065 38.4945 11.383 38.4345 11.755C38.3865 12.127 38.3265 12.511 38.2545 12.907C38.1945 13.291 38.1345 13.639 38.0745 13.951L36.7965 19.999H34.3845Z" fill="#FFF8BA"/>
|
|
4
|
+
</g>
|
|
5
|
+
<path d="M9.98663 20.179C9.33863 20.179 8.74463 20.107 8.20463 19.963C7.67663 19.819 7.22663 19.627 6.85463 19.387V16.975C7.21463 17.167 7.56263 17.335 7.89863 17.479C8.24663 17.623 8.59463 17.737 8.94263 17.821C9.29063 17.893 9.64463 17.929 10.0046 17.929C10.3046 17.929 10.5806 17.905 10.8326 17.857C11.0846 17.797 11.3006 17.707 11.4806 17.587C11.6726 17.467 11.8226 17.323 11.9306 17.155C12.0386 16.975 12.0926 16.765 12.0926 16.525C12.0926 16.189 12.0266 15.907 11.8946 15.679C11.7626 15.451 11.5826 15.241 11.3546 15.049C11.1266 14.857 10.8566 14.653 10.5446 14.437C10.1846 14.173 9.83663 13.879 9.50063 13.555C9.16463 13.231 8.88863 12.853 8.67263 12.421C8.45663 11.977 8.34863 11.461 8.34863 10.873C8.34863 10.297 8.45063 9.77502 8.65463 9.30702C8.85863 8.82702 9.15263 8.41302 9.53663 8.06502C9.93263 7.71702 10.4006 7.44702 10.9406 7.25502C11.4806 7.06302 12.0866 6.96702 12.7586 6.96702C13.4306 6.96702 14.0486 7.03902 14.6126 7.18302C15.1766 7.32702 15.7226 7.54302 16.2506 7.83102L15.2966 9.88302C14.8406 9.66702 14.4026 9.50502 13.9826 9.39702C13.5746 9.28902 13.1666 9.23502 12.7586 9.23502C12.5186 9.23502 12.2966 9.27102 12.0926 9.34302C11.9006 9.40302 11.7266 9.49902 11.5706 9.63102C11.4266 9.75102 11.3126 9.90102 11.2286 10.081C11.1446 10.261 11.1026 10.459 11.1026 10.675C11.1026 10.975 11.1626 11.233 11.2826 11.449C11.4146 11.665 11.5946 11.869 11.8226 12.061C12.0626 12.241 12.3506 12.445 12.6866 12.673C13.1666 12.985 13.5626 13.321 13.8746 13.681C14.1866 14.029 14.4206 14.413 14.5766 14.833C14.7326 15.241 14.8106 15.697 14.8106 16.201C14.8106 16.873 14.6846 17.461 14.4326 17.965C14.1806 18.457 13.8326 18.871 13.3886 19.207C12.9446 19.531 12.4286 19.777 11.8406 19.945C11.2646 20.101 10.6466 20.179 9.98663 20.179ZM16.5076 19.999L19.2256 7.14702H22.8076C23.8516 7.14702 24.6856 7.30302 25.3096 7.61502C25.9456 7.92702 26.4016 8.36502 26.6776 8.92902C26.9656 9.49302 27.1096 10.147 27.1096 10.891C27.1096 11.659 26.9656 12.325 26.6776 12.889C26.4016 13.453 26.0116 13.927 25.5076 14.311C25.0036 14.683 24.4096 14.965 23.7256 15.157C23.0416 15.337 22.3036 15.427 21.5116 15.427H20.1436L19.1896 19.999H16.5076ZM21.7276 13.195C22.2676 13.195 22.7356 13.111 23.1316 12.943C23.5396 12.763 23.8516 12.505 24.0676 12.169C24.2956 11.833 24.4096 11.431 24.4096 10.963C24.4096 10.423 24.2656 10.027 23.9776 9.77502C23.6896 9.51102 23.2636 9.37902 22.6996 9.37902H21.4396L20.6296 13.195H21.7276ZM26.5039 19.999L26.8279 18.451L28.4659 17.731L30.2299 9.41502L28.8979 8.69502L29.2219 7.14702H34.9099L34.5859 8.69502L32.9119 9.41502L31.1479 17.731L32.5159 18.451L32.1919 19.999H26.5039ZM34.3845 19.999L37.1025 7.14702H40.2345L43.2225 16.615H43.2945C43.3305 16.423 43.3665 16.189 43.4025 15.913C43.4505 15.637 43.4985 15.343 43.5465 15.031C43.6065 14.707 43.6665 14.389 43.7265 14.077C43.7865 13.765 43.8405 13.483 43.8885 13.231L45.1845 7.14702H47.5965L44.8785 19.999H41.8725L38.7405 10.279H38.6505C38.6385 10.351 38.6145 10.525 38.5785 10.801C38.5425 11.065 38.4945 11.383 38.4345 11.755C38.3865 12.127 38.3265 12.511 38.2545 12.907C38.1945 13.291 38.1345 13.639 38.0745 13.951L36.7965 19.999H34.3845Z" fill="white"/>
|
|
6
|
+
<defs>
|
|
7
|
+
<filter id="filter0_f_4318_348" x="0.854492" y="0.966797" width="52.7422" height="25.2124" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
|
|
8
|
+
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
|
|
9
|
+
<feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"/>
|
|
10
|
+
<feGaussianBlur stdDeviation="3" result="effect1_foregroundBlur_4318_348"/>
|
|
11
|
+
</filter>
|
|
12
|
+
</defs>
|
|
13
|
+
</svg>
|
package/src/index.ts
ADDED
package/src/message.ts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,279 @@
|
|
|
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
|
+
import { onMount } from 'svelte';
|
|
10
|
+
|
|
11
|
+
// types
|
|
12
|
+
import { Lang } from './types';
|
|
13
|
+
import { getCurrentInfo, Option, setMessage } from './business';
|
|
14
|
+
import { getOptions, api } from './business';
|
|
15
|
+
import { onMountMessageLifeCycle, _postMessage } from './message';
|
|
16
|
+
import type { LotteryProgramForPlayer } from './types.business';
|
|
17
|
+
import { classWithPart } from './util';
|
|
18
|
+
|
|
19
|
+
// properties
|
|
20
|
+
export let lang: Lang = Lang.en
|
|
21
|
+
export let endpoint: string = ''
|
|
22
|
+
export let session: string = ''
|
|
23
|
+
|
|
24
|
+
export let theme: string = '0'
|
|
25
|
+
|
|
26
|
+
export let lotteryprogramforplayer: string = undefined
|
|
27
|
+
|
|
28
|
+
export let spinduration: string = '3'
|
|
29
|
+
export let spinrotation: string = '3'
|
|
30
|
+
|
|
31
|
+
// binds
|
|
32
|
+
let main: HTMLElement;
|
|
33
|
+
|
|
34
|
+
// states
|
|
35
|
+
let size: number = 0;
|
|
36
|
+
let mainWidth: number = 0;
|
|
37
|
+
|
|
38
|
+
let options: Option[] = [];
|
|
39
|
+
let lotteryProgramForPlayer: LotteryProgramForPlayer
|
|
40
|
+
let lotteryProgramForPlayerNew: LotteryProgramForPlayer
|
|
41
|
+
|
|
42
|
+
$: lotteryProgramForPlayer = lotteryprogramforplayer && (JSON.parse(lotteryprogramforplayer)) as LotteryProgramForPlayer
|
|
43
|
+
$: id = lotteryProgramForPlayer?.program?.id
|
|
44
|
+
|
|
45
|
+
// lifecycles
|
|
46
|
+
const init = async () => {
|
|
47
|
+
await fetcher()
|
|
48
|
+
|
|
49
|
+
// if(getSpinCondition(lotteryProgramForPlayer)){
|
|
50
|
+
// setMessage(id, {
|
|
51
|
+
// mode: 'spin-failed'
|
|
52
|
+
// })
|
|
53
|
+
// }
|
|
54
|
+
mainWidth = main?.clientWidth
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const refetcher = async () => {
|
|
58
|
+
const LotteryProgramsForPlayer = await api.lotteries(endpoint, session)
|
|
59
|
+
return LotteryProgramsForPlayer.filter(l => l.program.id === id)[0]
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
const fetcher = async () => {
|
|
63
|
+
try {
|
|
64
|
+
if(!lotteryProgramForPlayer) return;
|
|
65
|
+
|
|
66
|
+
if(!options.length){
|
|
67
|
+
options = await getOptions(lotteryProgramForPlayer.program.wheelOfFortune.partitions, lang)
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
render()
|
|
71
|
+
} catch (e) {
|
|
72
|
+
setMessage(id, e.message)
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
const render = () => {
|
|
77
|
+
if(!main) return;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
onMount(() => {
|
|
81
|
+
window.addEventListener('resize', render)
|
|
82
|
+
return () => window.removeEventListener('resize', render)
|
|
83
|
+
})
|
|
84
|
+
|
|
85
|
+
onMountMessageLifeCycle({
|
|
86
|
+
'wof-private-message-spin-after': (data) => {
|
|
87
|
+
if(data.id !== id) return;
|
|
88
|
+
lotteryProgramForPlayer = lotteryProgramForPlayerNew
|
|
89
|
+
},
|
|
90
|
+
|
|
91
|
+
'wof-private-message-spin-before': async (data) => {
|
|
92
|
+
if(data.id !== id) return;
|
|
93
|
+
lotteryProgramForPlayerNew = await refetcher()
|
|
94
|
+
},
|
|
95
|
+
})
|
|
96
|
+
|
|
97
|
+
// reactives
|
|
98
|
+
$: lotteryProgramForPlayer && init()
|
|
99
|
+
//
|
|
100
|
+
|
|
101
|
+
$: size = mainWidth
|
|
102
|
+
|
|
103
|
+
// ratio
|
|
104
|
+
$: ratio = size / 375
|
|
105
|
+
$: radius = 247 / 2 * ratio
|
|
106
|
+
|
|
107
|
+
</script>
|
|
108
|
+
|
|
109
|
+
{#if lotteryProgramForPlayer}
|
|
110
|
+
|
|
111
|
+
<div {...classWithPart("LotteryProgramWof")}>
|
|
112
|
+
|
|
113
|
+
<div {...classWithPart("FortuneContainer")}>
|
|
114
|
+
<main bind:this={main}>
|
|
115
|
+
|
|
116
|
+
{#if size}
|
|
117
|
+
<lottery-program-wof-private-item-svg {...{
|
|
118
|
+
id,
|
|
119
|
+
endpoint, session,
|
|
120
|
+
sizeraw: size,
|
|
121
|
+
themeindex: theme,
|
|
122
|
+
optionsraw: JSON.stringify(options),
|
|
123
|
+
lotteryprogramforplayer: JSON.stringify(lotteryProgramForPlayer),
|
|
124
|
+
}} />
|
|
125
|
+
{/if}
|
|
126
|
+
|
|
127
|
+
<lottery-program-wof-private-message-panel {...{
|
|
128
|
+
id,
|
|
129
|
+
x: main?.offsetLeft + mainWidth/2,
|
|
130
|
+
r: radius || mainWidth /2,
|
|
131
|
+
}} />
|
|
132
|
+
|
|
133
|
+
</main>
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
{#if lotteryProgramForPlayer.current}
|
|
137
|
+
<div {...classWithPart("Current")}>
|
|
138
|
+
<p>Active tickets: {getCurrentInfo(lotteryProgramForPlayer, 'active')}</p>
|
|
139
|
+
<p>Implicit tickets: {getCurrentInfo(lotteryProgramForPlayer, 'implicit')}</p>
|
|
140
|
+
<p>Remaining Times: {getCurrentInfo(lotteryProgramForPlayer, 'remainingTimes')}</p>
|
|
141
|
+
</div>
|
|
142
|
+
{/if}
|
|
143
|
+
|
|
144
|
+
</div>
|
|
145
|
+
</div>
|
|
146
|
+
{/if}
|
|
147
|
+
|
|
148
|
+
<style lang="scss">
|
|
149
|
+
|
|
150
|
+
:host {
|
|
151
|
+
font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji';
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
*,
|
|
155
|
+
*::before,
|
|
156
|
+
*::after {
|
|
157
|
+
margin: 0;
|
|
158
|
+
padding: 0;
|
|
159
|
+
list-style: none;
|
|
160
|
+
text-decoration: none;
|
|
161
|
+
outline: none;
|
|
162
|
+
box-sizing: border-box;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
$outlineColor: rgb(150, 54, 88);
|
|
166
|
+
$outlineWidth: 2px;
|
|
167
|
+
|
|
168
|
+
.LotteryProgramWof {
|
|
169
|
+
background: var(--emfe-w-color-contrast, #07072A);
|
|
170
|
+
display: flex;
|
|
171
|
+
align-items: center;
|
|
172
|
+
flex-direction: column;
|
|
173
|
+
padding: 20px 0;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
main {
|
|
177
|
+
max-width: 600px;
|
|
178
|
+
width: 100%;
|
|
179
|
+
display: flex;
|
|
180
|
+
justify-content: space-around;
|
|
181
|
+
min-height: 200px;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
svg {
|
|
185
|
+
transition: opacity 0.3s;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
.HighLightArea {
|
|
189
|
+
mix-blend-mode: color-dodge;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
.HighLightAreaBackground {
|
|
193
|
+
mix-blend-mode: screen;
|
|
194
|
+
opacity: 0.41;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
.HighLightAreaV1 {
|
|
198
|
+
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%);
|
|
199
|
+
filter: blur(9px);
|
|
200
|
+
}
|
|
201
|
+
.HighLightAreaV2 {
|
|
202
|
+
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%);
|
|
203
|
+
filter: blur(9px);
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
.FortuneContainer {
|
|
207
|
+
width: 100%;
|
|
208
|
+
display: flex;
|
|
209
|
+
align-items: center;
|
|
210
|
+
flex-direction: column;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
.BackgroundCircle {
|
|
214
|
+
fill: #FFFFFF;
|
|
215
|
+
animation: color-animation 1s infinite linear alternate;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
.RingCirclesGroup {
|
|
219
|
+
.RingCircle {
|
|
220
|
+
fill: #FFFFFF;
|
|
221
|
+
stroke: #FFFFFF;
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
.Center {
|
|
226
|
+
|
|
227
|
+
transition: filter;
|
|
228
|
+
transition-duration: 1s;
|
|
229
|
+
|
|
230
|
+
&.disabled {
|
|
231
|
+
filter: grayscale(80%);
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
.CenterCircle {
|
|
235
|
+
fill: #3CE4BB;
|
|
236
|
+
stroke: $outlineColor;
|
|
237
|
+
stroke-width: $outlineWidth;
|
|
238
|
+
cursor: pointer;
|
|
239
|
+
|
|
240
|
+
transition: fill;
|
|
241
|
+
transition-duration: 1s;
|
|
242
|
+
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
.CenterText {
|
|
246
|
+
cursor: pointer;
|
|
247
|
+
fill: #FFFFFF;
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
.PointerPartition {
|
|
252
|
+
opacity: 0.3;
|
|
253
|
+
fill: lightgoldenrodyellow;
|
|
254
|
+
stroke: red;
|
|
255
|
+
stroke-width: 6px;
|
|
256
|
+
stroke-dasharray: 12;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
.PointerArrow {
|
|
260
|
+
fill: #064CA0;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
.Current {
|
|
264
|
+
color: #FFFFFF;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
.PartitionText {
|
|
268
|
+
fill: #FFFFFF;
|
|
269
|
+
font-style: normal;
|
|
270
|
+
font-weight: 700;
|
|
271
|
+
text-anchor: end;
|
|
272
|
+
text-shadow: 0px 2px #000;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
.PartitionShadow {
|
|
276
|
+
background-blend-mode: multiply;
|
|
277
|
+
mix-blend-mode: multiply;
|
|
278
|
+
}
|
|
279
|
+
</style>
|