{"_id":"@eightfeet/wc-lottery","_rev":"8-cdf99e7770162793a73c94e2c6a10994","name":"@eightfeet/wc-lottery","dist-tags":{"latest":"0.0.9"},"versions":{"0.0.1":{"name":"@eightfeet/wc-lottery","version":"0.0.1","private":false,"description":"wc-lottery is a lottery component written with web-component","type":"module","main":"dist/index.cjs","module":"dist/index.mjs","unpkg":"dist/index.iife.js","jsdelivr":"dist/index.iife.js","types":"dist/index.d.ts","devDependencies":{"@rollup/plugin-typescript":"^11.1.1","rimraf":"^5.0.1","rollup":"^3.23.0","rollup-plugin-dts":"^6.0.0","rollup-plugin-esbuild":"^5.0.0","rollup-plugin-postcss":"^4.0.2","tslib":"^2.5.3","typescript":"^5.0.2","vite":"^4.3.9"},"scripts":{"dev":"vite","build:docs":"tsc && vite build --outDir docs --base ./","build":"rimraf dist && rollup -c && rimraf dist/types","preview":"vite preview"},"repository":{"type":"git","url":"git+https://github.com/eightfeet/wc-lottery.git"},"keywords":["lottery","wheel-lottery"],"author":{"name":"eightfeet"},"license":"MIT","bugs":{"url":"https://github.com/eightfeet/wc-lottery/issues"},"homepage":"https://github.com/eightfeet/wc-lottery#readme","gitHead":"c45e15c360b7d9790a79ce628bd7c8fc5f3c377f","_id":"@eightfeet/wc-lottery@0.0.1","_nodeVersion":"18.17.1","_npmVersion":"9.6.7","dist":{"integrity":"sha512-vsgZSxDz4gvOtgT9f8NqK38LdJv+ml59893N1decZq7Pw97wZwBk6vm+IYQ1EazEpPKL28zPJLpKu/3yBAmRjA==","shasum":"043f29d12944994115a36c18f4d769f557971384","tarball":"https://registry.npmjs.org/@eightfeet/wc-lottery/-/wc-lottery-0.0.1.tgz","fileCount":8,"unpackedSize":23592,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAoCy3d8t+OmllG8WRjs558E1BzBtYDhsLYY2Lf3Un6KAiBH0pfeWRIO8GvcamBuNvjABuPsa+CRw3vp0+JmR95ESw=="}]},"_npmUser":{"name":"eightfeet","email":"747095684@qq.com"},"directories":{},"maintainers":[{"name":"eightfeet","email":"747095684@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wc-lottery_0.0.1_1703039472898_0.913384873001927"},"_hasShrinkwrap":false},"0.0.2":{"name":"@eightfeet/wc-lottery","version":"0.0.2","private":false,"description":"wc-lottery is a lottery component written with web-component","type":"module","main":"dist/index.cjs","module":"dist/index.mjs","unpkg":"dist/index.iife.js","jsdelivr":"dist/index.iife.js","types":"dist/index.d.ts","devDependencies":{"@rollup/plugin-typescript":"^11.1.1","rimraf":"^5.0.1","rollup":"^3.23.0","rollup-plugin-dts":"^6.0.0","rollup-plugin-esbuild":"^5.0.0","rollup-plugin-postcss":"^4.0.2","tslib":"^2.5.3","typescript":"^5.0.2","vite":"^4.3.9"},"scripts":{"dev":"vite","build:docs":"tsc && vite build --outDir docs --base ./","build":"rimraf dist && rollup -c && rimraf dist/types","preview":"vite preview"},"repository":{"type":"git","url":"git+https://github.com/eightfeet/wc-lottery.git"},"keywords":["lottery","wheel-lottery"],"author":{"name":"eightfeet"},"license":"MIT","bugs":{"url":"https://github.com/eightfeet/wc-lottery/issues"},"homepage":"https://github.com/eightfeet/wc-lottery#readme","gitHead":"9e6e8c5e6ad39f8bd0d91615e63dcff63dad87fb","_id":"@eightfeet/wc-lottery@0.0.2","_nodeVersion":"18.17.1","_npmVersion":"9.6.7","dist":{"integrity":"sha512-+G7NEBOCEQqrTu76zbmWzYgg6VXcjbgv9bl2IBeuNk41v3B7JEQ7M0JRkIH6j/ttZTpfl3uVyB3vQCy5i75d7A==","shasum":"3b6522800aadf49a8dea8f1ef00ce7a2c869dc16","tarball":"https://registry.npmjs.org/@eightfeet/wc-lottery/-/wc-lottery-0.0.2.tgz","fileCount":7,"unpackedSize":29189,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGq9PYQ2VbHFW6UUVNUkLRurQYmEZO1XnZYg0OYo564zAiEAg7/LCJKMXhO/U+X8YZKoXn8fezzzDuKqixDYSZP0pZE="}]},"_npmUser":{"name":"eightfeet","email":"747095684@qq.com"},"directories":{},"maintainers":[{"name":"eightfeet","email":"747095684@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wc-lottery_0.0.2_1703665416426_0.9632966959102207"},"_hasShrinkwrap":false},"0.0.3":{"name":"@eightfeet/wc-lottery","version":"0.0.3","private":false,"description":"wc-lottery is a lottery component written with web-component","type":"module","main":"dist/index.cjs","module":"dist/index.mjs","unpkg":"dist/index.iife.js","jsdelivr":"dist/index.iife.js","types":"dist/index.d.ts","devDependencies":{"@rollup/plugin-typescript":"^11.1.1","rimraf":"^5.0.1","rollup":"^3.23.0","rollup-plugin-dts":"^6.0.0","rollup-plugin-esbuild":"^5.0.0","rollup-plugin-postcss":"^4.0.2","tslib":"^2.5.3","typescript":"^5.0.2","vite":"^4.3.9"},"scripts":{"dev":"vite","build:docs":"tsc && vite build --outDir docs --base ./","build":"rimraf dist && rollup -c && rimraf dist/types","preview":"vite preview"},"repository":{"type":"git","url":"git+https://github.com/eightfeet/wc-lottery.git"},"keywords":["lottery","wheel-lottery"],"author":{"name":"eightfeet"},"license":"MIT","bugs":{"url":"https://github.com/eightfeet/wc-lottery/issues"},"homepage":"https://github.com/eightfeet/wc-lottery#readme","gitHead":"e8787163b049fa6b90a9bd22e9dcd7b17727d1f5","_id":"@eightfeet/wc-lottery@0.0.3","_nodeVersion":"18.17.1","_npmVersion":"9.6.7","dist":{"integrity":"sha512-9crBKWom/IW60S+MKxYSSy7q1P69Mqwms9vvEn4DBSlJ/BgCG+uhVHLc27Wk92sTD4im9tAd7CxXWL664OXsjw==","shasum":"54bf369555fa8eaec261706f5b1ca0c1c57148c4","tarball":"https://registry.npmjs.org/@eightfeet/wc-lottery/-/wc-lottery-0.0.3.tgz","fileCount":7,"unpackedSize":29392,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHPf+LENSJtmOKopyl9T8IgdoRzkm+UrF5SfFfqUZFS1AiBIBPKBn231j+Rgn+7IQLBdUdz185Ibo8WWBp9ZAfDhKQ=="}]},"_npmUser":{"name":"eightfeet","email":"747095684@qq.com"},"directories":{},"maintainers":[{"name":"eightfeet","email":"747095684@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wc-lottery_0.0.3_1703731894525_0.16555083921726288"},"_hasShrinkwrap":false},"0.0.4":{"name":"@eightfeet/wc-lottery","version":"0.0.4","private":false,"description":"wc-lottery is a lottery component written with web-component","type":"module","main":"dist/index.cjs","module":"dist/index.mjs","unpkg":"dist/index.iife.js","jsdelivr":"dist/index.iife.js","types":"dist/index.d.ts","devDependencies":{"@rollup/plugin-typescript":"^11.1.1","rimraf":"^5.0.1","rollup":"^3.23.0","rollup-plugin-dts":"^6.0.0","rollup-plugin-esbuild":"^5.0.0","rollup-plugin-postcss":"^4.0.2","tslib":"^2.5.3","typescript":"^5.0.2","vite":"^4.3.9"},"scripts":{"dev":"vite","build:docs":"tsc && vite build --outDir docs --base ./","build":"rimraf dist && rollup -c && rimraf dist/types","preview":"vite preview"},"repository":{"type":"git","url":"git+https://github.com/eightfeet/wc-lottery.git"},"keywords":["lottery","wheel-lottery"],"author":{"name":"eightfeet"},"license":"MIT","bugs":{"url":"https://github.com/eightfeet/wc-lottery/issues"},"homepage":"https://github.com/eightfeet/wc-lottery#readme","gitHead":"dd89dcce98ec7a877a04bfa911ce2d2804d1d0e7","_id":"@eightfeet/wc-lottery@0.0.4","_nodeVersion":"18.17.1","_npmVersion":"9.6.7","dist":{"integrity":"sha512-ul71u9ieu4+tv5kjsluet7Sv/WJNmxnlmK/WEK3Dl84VCZVbAWLoOtJ6d7YaV518tNWiZhW5fmb4jn45f1yCuA==","shasum":"afeffd5a4a09ff9992c03190616ab9989622d8ed","tarball":"https://registry.npmjs.org/@eightfeet/wc-lottery/-/wc-lottery-0.0.4.tgz","fileCount":7,"unpackedSize":29801,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCp312JJ9C8Oi1LwYyuVLPdzzv03hVHzQ6Tmv8mwpDuxQIgbQv3hh0pOB9lG2pjJNKUJElCqm2rYIpXvM6DF2E+eFs="}]},"_npmUser":{"name":"eightfeet","email":"747095684@qq.com"},"directories":{},"maintainers":[{"name":"eightfeet","email":"747095684@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wc-lottery_0.0.4_1703735746064_0.9540480754749874"},"_hasShrinkwrap":false},"0.0.5":{"name":"@eightfeet/wc-lottery","version":"0.0.5","private":false,"description":"wc-lottery is a lottery component written with web-component","type":"module","main":"dist/index.cjs","module":"dist/index.mjs","unpkg":"dist/index.iife.js","jsdelivr":"dist/index.iife.js","types":"dist/index.d.ts","devDependencies":{"@rollup/plugin-typescript":"^11.1.1","rimraf":"^5.0.1","rollup":"^3.23.0","rollup-plugin-dts":"^6.0.0","rollup-plugin-esbuild":"^5.0.0","rollup-plugin-postcss":"^4.0.2","tslib":"^2.5.3","typescript":"^5.0.2","vite":"^4.3.9"},"scripts":{"dev":"vite","build:docs":"tsc && vite build --outDir docs --base ./","build":"rimraf dist && rollup -c && rimraf dist/types","preview":"vite preview"},"repository":{"type":"git","url":"git+https://github.com/eightfeet/wc-lottery.git"},"keywords":["lottery","wheel-lottery"],"author":{"name":"eightfeet"},"license":"MIT","bugs":{"url":"https://github.com/eightfeet/wc-lottery/issues"},"homepage":"https://github.com/eightfeet/wc-lottery#readme","gitHead":"ad998753d815a4f14534876be56eed55ae249191","_id":"@eightfeet/wc-lottery@0.0.5","_nodeVersion":"18.17.1","_npmVersion":"9.6.7","dist":{"integrity":"sha512-k9fM9vytJkFm3Y3qTmhXckJoU6VXCWamGAYCeiB3bZF9cHDUzllthY4kbfv4cY2Y490jcGW+dDq9khue5WPvjA==","shasum":"d39f63f9b78c3e31f2b9b7df4ff988ff9ed1b601","tarball":"https://registry.npmjs.org/@eightfeet/wc-lottery/-/wc-lottery-0.0.5.tgz","fileCount":7,"unpackedSize":31514,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHmqa0I19sBvYZgjYy9SVJvHZYMvOOod9CYGDSaf5XcNAiEAxgUVHFZmYVoFjHcyEFg2HT4A8LpGoWZF6DGZ4YOpUZo="}]},"_npmUser":{"name":"eightfeet","email":"747095684@qq.com"},"directories":{},"maintainers":[{"name":"eightfeet","email":"747095684@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wc-lottery_0.0.5_1703742909407_0.24552094188861884"},"_hasShrinkwrap":false},"0.0.6":{"name":"@eightfeet/wc-lottery","version":"0.0.6","private":false,"description":"wc-lottery is a lottery component written with web-component","type":"module","main":"dist/index.cjs","module":"dist/index.mjs","unpkg":"dist/index.iife.js","jsdelivr":"dist/index.iife.js","types":"dist/index.d.ts","devDependencies":{"@rollup/plugin-typescript":"^11.1.1","rimraf":"^5.0.1","rollup":"^3.23.0","rollup-plugin-dts":"^6.0.0","rollup-plugin-esbuild":"^5.0.0","rollup-plugin-postcss":"^4.0.2","tslib":"^2.5.3","typescript":"^5.0.2","vite":"^4.3.9"},"scripts":{"dev":"vite","build:docs":"tsc && vite build --outDir docs --base ./","build":"rimraf dist && rollup -c && rimraf dist/types","preview":"vite preview"},"repository":{"type":"git","url":"git+https://github.com/eightfeet/wc-lottery.git"},"keywords":["lottery","wheel-lottery"],"author":{"name":"eightfeet"},"license":"MIT","bugs":{"url":"https://github.com/eightfeet/wc-lottery/issues"},"homepage":"https://github.com/eightfeet/wc-lottery#readme","gitHead":"1863ce87cd33170fbf61db8520d18e78f1568a0a","_id":"@eightfeet/wc-lottery@0.0.6","_nodeVersion":"18.17.1","_npmVersion":"9.6.7","dist":{"integrity":"sha512-p1zt+/ImYYKobd7oFtPH+AMozlGsWE7n97MY2X3J8y5ekS9RMjZJ5ztwAm0GCONqD/qgGFNMQj38rMWOlFVAng==","shasum":"07f1083d4193b7931db091c7778723a87c2a9ebf","tarball":"https://registry.npmjs.org/@eightfeet/wc-lottery/-/wc-lottery-0.0.6.tgz","fileCount":7,"unpackedSize":33256,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIH6wheaWat53FZKoUNaHkXyMoG/bR9t0ltjQzgrDRjoeAiARC+d1lbztHmPU9Z0D468xEVQGFooRGHueCkVDgRstyg=="}]},"_npmUser":{"name":"eightfeet","email":"747095684@qq.com"},"directories":{},"maintainers":[{"name":"eightfeet","email":"747095684@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wc-lottery_0.0.6_1703747623826_0.6642535690509639"},"_hasShrinkwrap":false},"0.0.7":{"name":"@eightfeet/wc-lottery","version":"0.0.7","private":false,"description":"wc-lottery is a lottery component written with web-component","type":"module","main":"dist/index.cjs","module":"dist/index.mjs","unpkg":"dist/index.iife.js","jsdelivr":"dist/index.iife.js","types":"dist/index.d.ts","devDependencies":{"@rollup/plugin-typescript":"^11.1.1","rimraf":"^5.0.1","rollup":"^3.23.0","rollup-plugin-dts":"^6.0.0","rollup-plugin-esbuild":"^5.0.0","rollup-plugin-postcss":"^4.0.2","tslib":"^2.5.3","typescript":"^5.0.2","vite":"^4.3.9"},"scripts":{"dev":"vite","build:docs":"tsc && vite build --outDir docs --base ./","build":"rimraf dist && rollup -c && rimraf dist/types","preview":"vite preview"},"repository":{"type":"git","url":"git+https://github.com/eightfeet/wc-wheel-lottery.git"},"keywords":["lottery","wheel-lottery"],"author":{"name":"eightfeet"},"license":"MIT","bugs":{"url":"https://github.com/eightfeet/wc-wheel-lottery/issues"},"homepage":"https://github.com/eightfeet/wc-wheel-lottery#readme","gitHead":"05a05c452c477cacf84bc8c467282dab2a818bca","_id":"@eightfeet/wc-lottery@0.0.7","_nodeVersion":"18.17.1","_npmVersion":"9.6.7","dist":{"integrity":"sha512-RQS7PCwSrZYcP+6KvLnR2wBA3BaLpDuoC/Sm57i3HHTirS+yOPbIeTSO7YQ1J6Q7JTFpOfUx7HT8foNQq5uhrQ==","shasum":"b8ea1cda1be4c21df41f8e5227704d711fc20efb","tarball":"https://registry.npmjs.org/@eightfeet/wc-lottery/-/wc-lottery-0.0.7.tgz","fileCount":7,"unpackedSize":33274,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIB75bX21UhBY/jKbVrOhy3TIBGvpkBHmcILRz9G18QB3AiEAlmVeQKdSPV1LjMFjpUBjgRiAWUr/SYG0trdXfAuhri0="}]},"_npmUser":{"name":"eightfeet","email":"747095684@qq.com"},"directories":{},"maintainers":[{"name":"eightfeet","email":"747095684@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wc-lottery_0.0.7_1703748020200_0.6004090024610444"},"_hasShrinkwrap":false},"0.0.8":{"name":"@eightfeet/wc-lottery","version":"0.0.8","private":false,"description":"wc-lottery is a lottery component written with web-component","type":"module","main":"dist/index.cjs","module":"dist/index.mjs","unpkg":"dist/index.iife.js","jsdelivr":"dist/index.iife.js","types":"dist/index.d.ts","devDependencies":{"@rollup/plugin-typescript":"^11.1.1","rimraf":"^5.0.1","rollup":"^3.23.0","rollup-plugin-dts":"^6.0.0","rollup-plugin-esbuild":"^5.0.0","rollup-plugin-postcss":"^4.0.2","tslib":"^2.5.3","typescript":"^5.0.2","vite":"^4.3.9"},"scripts":{"dev":"vite","build:docs":"tsc && vite build --outDir docs --base ./","build":"rimraf dist && rollup -c && rimraf dist/types","preview":"vite preview"},"repository":{"type":"git","url":"git+https://github.com/eightfeet/wc-wheel-lottery.git"},"keywords":["lottery","wheel-lottery"],"author":{"name":"eightfeet"},"license":"MIT","bugs":{"url":"https://github.com/eightfeet/wc-wheel-lottery/issues"},"homepage":"https://github.com/eightfeet/wc-wheel-lottery#readme","gitHead":"bbf3f226565eecc75d663ecbcc5d840d952a48f9","_id":"@eightfeet/wc-lottery@0.0.8","_nodeVersion":"18.17.1","_npmVersion":"9.6.7","dist":{"integrity":"sha512-Nyb8yRhxGcPLNV83vjlY5y1mNWav6MJq7mWV1sdXaH3d9yYHZoc+L0ljOjbydaDxvUaMWQxXIBxd8XgIn39dtQ==","shasum":"6eb74f9665048ac56d409637ae4a87f5391725a6","tarball":"https://registry.npmjs.org/@eightfeet/wc-lottery/-/wc-lottery-0.0.8.tgz","fileCount":7,"unpackedSize":33223,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC8zw+8ForkVZyLK0KJopIZwlvvVqUP5VYLUFyXF5/6aAIgaM+1IIhfnj2omWLLCxGWN51b4zhu9BuKwxvx22WKZNQ="}]},"_npmUser":{"name":"eightfeet","email":"747095684@qq.com"},"directories":{},"maintainers":[{"name":"eightfeet","email":"747095684@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wc-lottery_0.0.8_1703750479588_0.11560414947007347"},"_hasShrinkwrap":false},"0.0.9":{"name":"@eightfeet/wc-lottery","version":"0.0.9","private":false,"description":"wc-lottery is a lottery component written with web-component","type":"module","main":"dist/index.cjs","module":"dist/index.mjs","unpkg":"dist/index.iife.js","jsdelivr":"dist/index.iife.js","types":"dist/index.d.ts","devDependencies":{"@rollup/plugin-typescript":"^11.1.1","rimraf":"^5.0.1","rollup":"^3.23.0","rollup-plugin-dts":"^6.0.0","rollup-plugin-esbuild":"^5.0.0","rollup-plugin-postcss":"^4.0.2","tslib":"^2.5.3","typescript":"^5.0.2","vite":"^4.3.9"},"scripts":{"dev":"vite","build:docs":"tsc && vite build --outDir docs --base ./","build":"rimraf dist && rollup -c && rimraf dist/types","preview":"vite preview"},"repository":{"type":"git","url":"git+https://github.com/eightfeet/wc-wheel-lottery.git"},"keywords":["lottery","wheel-lottery"],"author":{"name":"eightfeet"},"license":"MIT","bugs":{"url":"https://github.com/eightfeet/wc-wheel-lottery/issues"},"homepage":"https://github.com/eightfeet/wc-wheel-lottery#readme","gitHead":"4ae9e24d5de736af75d20ff59e0da2b269409afa","_id":"@eightfeet/wc-lottery@0.0.9","_nodeVersion":"18.17.1","_npmVersion":"9.6.7","dist":{"integrity":"sha512-kcTSzmyFeFyd6vn9+yfJCDMLT1GJCQsTvyc1EkkZ/EULho2UG4r5bNKidwl3Hzfe/HWowuwFy01PfbdrXMgwGw==","shasum":"39f71376a68c96f884c9429be4c443a367451121","tarball":"https://registry.npmjs.org/@eightfeet/wc-lottery/-/wc-lottery-0.0.9.tgz","fileCount":7,"unpackedSize":34426,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCiybWsVu3s4sM1xMLC5RSTf6bdtyx1sRd/DrQyTjfclAIgeuDwoja7wRLoEyhZzzzK4u0QracesKNmBnA10+DUqjs="}]},"_npmUser":{"name":"eightfeet","email":"747095684@qq.com"},"directories":{},"maintainers":[{"name":"eightfeet","email":"747095684@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wc-lottery_0.0.9_1703817404060_0.9986554664579166"},"_hasShrinkwrap":false}},"time":{"created":"2023-12-20T02:31:12.778Z","0.0.1":"2023-12-20T02:31:13.161Z","modified":"2023-12-29T02:36:44.459Z","0.0.2":"2023-12-27T08:23:36.654Z","0.0.3":"2023-12-28T02:51:34.724Z","0.0.4":"2023-12-28T03:55:46.244Z","0.0.5":"2023-12-28T05:55:09.564Z","0.0.6":"2023-12-28T07:13:44.015Z","0.0.7":"2023-12-28T07:20:20.366Z","0.0.8":"2023-12-28T08:01:19.760Z","0.0.9":"2023-12-29T02:36:44.303Z"},"maintainers":[{"name":"eightfeet","email":"747095684@qq.com"}],"description":"wc-lottery is a lottery component written with web-component","homepage":"https://github.com/eightfeet/wc-wheel-lottery#readme","keywords":["lottery","wheel-lottery"],"repository":{"type":"git","url":"git+https://github.com/eightfeet/wc-wheel-lottery.git"},"author":{"name":"eightfeet"},"bugs":{"url":"https://github.com/eightfeet/wc-wheel-lottery/issues"},"license":"MIT","readme":"# wc-lottery\n\nThe `wc-lottery` is a high-performance lottery webcomponent.\n\n## 🎡 Demo\n\n- [https://www.eightfeet.cn/wc-wheel-lottery/](https://www.eightfeet.cn/wc-wheel-lottery/)\n\n## 📦 Installation\n\n```shell\n    npm i @eightfeet/wc-lottery\n```\n\n## Attribute\n\n- **class** string\n\n  > wc-lottery 的样式名\n\n  > 请确保 wc-lottery 的样式属性 display 为 block, 组件以此来计算内部宽高，此属性默认为 block，但不排除被父级影响或覆盖；\n\n  ```html\n  <style>\n    .yourclass {\n      display: block;\n    }\n  </style>\n  <wc-lottery class=\"your class\"> ... </wc-lottery>\n  ```\n\n- **prize** string | number;\n  > wc-lottery 的奖品 id，当外部修改此属性时，组件内部开始启用抽奖动画，值为 undefined 时不开启抽奖动画\n  ```html\n  <wc-lottery prize=\"your prize\"> ... </wc-lottery>\n  ```\n- **activeclass** string;\n  > wc-lottery 的奖品项目被激活的样式；此属性仅在 type=\"grid\"九宫格抽奖时才起作用，最终奖品将以此样式高亮显示;\n  ```html\n  <style>\n    .youractiveclass {\n      display: block;\n    }\n  </style>\n  <wc-lottery activeclass=\"youractiveclass\"> ... </wc-lottery>\n  ```\n- **type** \"wheel\" | \"grid\";\n\n  > 类型：wheel 转盘抽奖，grid 九宫格抽奖 默认为 wheel\n\n  ```html\n  <wc-lottery type=\"grid\"> ... </wc-lottery>\n  ```\n\n- **round** number | string;\n  > 旋转圈数, 默认 6 圈\n  ```html\n  <wc-lottery round=\"6\"> ... </wc-lottery>\n  ```\n\n## Event\n\n- **onplay**\n\n  > 抽奖动画开始时调用\n\n  ```javascript\n  // 方法1\n  LotteryElement.addEventListener(\"play\", ({detail}) => {console.log('奖品': detail)});\n  // 方法2\n  LotteryElement.onplay = ({detail}) => {console.log('奖品': detail)};\n  ```\n\n- **onended**\n  > 抽奖动画结束时调用\n  ```javascript\n  // 方法1\n  LotteryElement.addEventListener(\"ended\", ({detail}) => {console.log('奖品': detail)});\n  // 方法2\n  LotteryElement.onended = ({detail}) => {console.log('奖品': detail)};\n  ```\n\n## Usage\n\n```js\nimport \"@eightfeet/wc-lottery\";\n```\n\n```html\n<style>\n  .lottery {\n    width: 50vw;\n    height: 50vw;\n  }\n\n  ul {\n    list-style: none;\n  }\n\n  li {\n    background-color: #ccc;\n    padding-top: 5px;\n    display: flex;\n    justify-content: center;\n  }\n\n  .button {\n    width: 50px;\n    height: 50px;\n    background-color: #aaa;\n    display: flex;\n    justify-content: center;\n    align-items: center;\n    line-height: 1;\n    user-select: none;\n  }\n</style>\n<wc-lottery prize=\"1\" class=\"lottery\">\n  <ul title=\"prizes\" style=\"background-color: #eee;\">\n    <li title=\"1\">1</li>\n    <li title=\"4\">4</li>\n    <li title=\"3\">3</li>\n    <li title=\"8\">8</li>\n    <li title=\"6\">6</li>\n    <li title=\"2\">2</li>\n    <li title=\"9\">9</li>\n    <li title=\"10\">10</li>\n    <li title=\"5\">5</li>\n    <li title=\"7\">7</li>\n  </ul>\n  <div title=\"trigger\" class=\"button\">按钮</div>\n</wc-lottery>\n\n<script>\n  document.querySelector(\".button\").onclick = () => {\n    document\n      .querySelector(\".lottery\")\n      .setAttribute(\"prize\", `${Math.floor(Math.random() * 10)}`);\n  };\n\n  document.querySelector(\".lottery\").onplay = (prize) => {\n    console.log(\"开始动画\", `中奖${prize.detail}`);\n  };\n\n  document.querySelector(\".lottery\").onended = (prize) => {\n    console.log(\"抽奖结束\", `中奖${prize.detail}`);\n  };\n</script>\n```\n\n### 在 React + Typescript 中使用\n\n```typescript\nimport { LotteryProps } from \"@eightfeet/wc-lottery\";\nimport { useState, DOMAttributes } from \"react\";\n\ntype LotteryElement<T> = Partial<\n  T &\n    DOMAttributes<T> & {\n      children: any;\n      ref: React.MutableRefObject<LotteryEvents | undefined>;\n    }\n>;\n\ndeclare global {\n  namespace JSX {\n    interface IntrinsicElements {\n      [\"wc-lottery\"]: LotteryElement<LotteryProps>;\n    }\n  }\n}\n```\n\n```javascript\nimport React, { useCallback, useEffect, useMemo, useRef, useState } from \"react\";\nimport '@eightfeet/wc-lottery';\nimport { LotteryEvents } from \"@eightfeet/wc-lottery\";\n\n\nconst Lottery: React.FC<Props> = () => {\n  const data = useMemo(() => [\"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\"], [])\n  const [prize, setPrize] = useState<string>();\n  const lotteryRef = useRef<LotteryEvents>();\n\n  // 抽奖\n  const handleLottery = useCallback(\n    async () => {\n      const prize = await Promise.resolve('1');\n      setPrize(prize);\n    },\n    [],\n  );\n\n  // 抽奖结束\n  const handleLotteryEnded = useCallback(\n    ({ detail }: { detail: string }) => {\n      console.log('抽中', detail);\n      setPrize(undefined)\n    },\n    [],\n  );\n\n  // 事件挂载\n  useEffect(() => {\n    if (lotteryRef.current) {\n      lotteryRef.current.onended = handleLotteryEnded\n    }\n  }, [handleLotteryEnded])\n\n\n  return <wc-lottery prize={prize} class={s.lt} ref={lotteryRef} activeclass={s.act} type=\"wheel\" round={5}>\n    <div title=\"prizes\">\n      {\n        data.map(item => <div style={{ background: \"red\", borderRadius: 100 }} key={item} title={item}>{item}</div>)\n      }\n    </div>\n    <button title=\"trigger\" onClick={handleLottery}>\n      抽奖\n    </button>\n  </wc-lottery>\n};\n\n```\n\n### 在 Vue + Typescript 中使用\n\n脚手架配置请参考 [Vue 与 Web Components](https://cn.vuejs.org/guide/extras/web-components.html#vue-and-web-components)\n\n**使用方式**\n\n```html\n<script setup lang=\"ts\">\n  import { ref } from \"vue\";\n  import \"@eightfeet/wc-lottery\";\n  const prizes = ref<string[]>([\"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\"]);\n  const prize = ref<string>();\n</script>\n\n<template>\n  <wc-lottery\n    class=\"lottery\"\n    :prize=\"prize\"\n    @ended=\"prize = undefined\"\n    type=\"grid\"\n    activeclass=\"activate\"\n  >\n    <div title=\"prizes\" style=\"background-color: #eee;\">\n      <div class=\"prizebox\" v-for=\"item in prizes\" :title=\"item\">{{item}}</div>\n    </div>\n    <div\n      title=\"trigger\"\n      class=\"button\"\n      @click=\"prize = `${Math.floor(Math.random() * 7) + 1}`\"\n    >\n      抽奖\n    </div>\n  </wc-lottery>\n</template>\n\n<style scoped>\n  .lottery {\n    width: 200px;\n    width: 200px;\n  }\n  .activate {\n    background-color: rgb(108, 143, 255);\n  }\n  .prizebox,\n  .button {\n    display: flex;\n    align-items: center;\n    justify-content: center;\n  }\n  .button {\n    background-color: orange;\n    width: 67px;\n    height: 67px;\n  }\n</style>\n```\n","readmeFilename":"README.md"}