官方文档 & Demo演示
中文:https://100px.net/usage/js.html
English:If anyone can help translate the document, please contact me ldq404@qq.com
在 Js / JQuery 中使用
方式 1:通过 script 标签引入
<div id="my-lucky"></div>
<script src="https://cdn.jsdelivr.net/npm/lucky-canvas@1.6/dist/index.umd.min.js"></script>
<script>
const myLucky = new LuckyCanvas.LuckyWheel('#my-lucky', {
width: '200px',
height: '200px',
blocks: [{ padding: '10px', background: '#869cfa' }],
prizes: [
{ fonts: [{ text: '0' }], background: '#e9e8fe' },
{ fonts: [{ text: '1' }], background: '#b8c5f2' },
{ fonts: [{ text: '2' }], background: '#e9e8fe' },
{ fonts: [{ text: '3' }], background: '#b8c5f2' },
{ fonts: [{ text: '4' }], background: '#e9e8fe' },
{ fonts: [{ text: '5' }], background: '#b8c5f2' },
],
})
</script>
🙏🙏🙏 点个Star
如果您觉得这个项目还不错, 可以在 Github 上面帮我点个star
, 支持一下作者 ☜(゚ヮ゚☜)