meetmore / lottery.js Goto Github PK
View Code? Open in Web Editor NEW🎲 A simple javascript lottery app
Home Page: https://meetmore.github.io/lottery.js/
License: Apache License 2.0
🎲 A simple javascript lottery app
Home Page: https://meetmore.github.io/lottery.js/
License: Apache License 2.0
比如这一次选择抽男生,下一次选择抽XX公司员工,根据data中的属性来选择
中奖人数最大只能增加到10,而且只能通过+
-
按钮来操作,这样的话如果设置人数比较大的时候操作很繁琐,应该可以输入那种
Want the ability of event dispatches at different states, so that implementer can, bind to those events and do the necessary.
For example once a person wins lottery, implementer wants to trigger an APi to update in DB, how to to do that?
I am ready to contribute. Let me know if I can.
Can you control the probability? how to set?
I tried your great software!
but lottery.js cannot do auto stop if setting.once is true.
I guess this bug happen "console.log('Lottery: dup, next.') execute once.
my config in index.html:
$.lottery({
el: '.lotterybox',
api: 'sample-data.json',
once: true,
subtitle: 'company',
timeout: 3
});
thanks.
我发现“startLottery”方法里判断抽奖机会是否用完是用的每次刷新页面已经抽的次数,这里应该用历史记录里已经抽过的次数,防止误操作关闭页面以后,抽奖次数就超过了限制。
`var startLottery = function () {
if(localStorage.getItem('lotteryHistory')) settings.winnerHistory = JSON.parse(localStorage.getItem('lotteryHistory'));
initSelector()
//检查当每用户只能获奖一次时,是否有足够剩余用户参加抽奖
if (settings.once && settings.data.length - arrayCount(settings.winnerHistory) < settings.number) {
alert('No user left to participate in lottery.');
return false;
}
...
}`
Chinese:当光圈移动的时候播放背景音,选中人的时候播放中奖音效
English(google translation) : Play the background sound when the aperture moves, and play the winning sound when the person is selected.
@untsop
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.