mirror of
https://github.com/seigler/dash.party
synced 2025-07-26 00:46:09 +00:00
⚡ Use specific confetti colors
This commit is contained in:
parent
4fd2ed688b
commit
8151b6a3a9
1 changed files with 13 additions and 3 deletions
16
confetti.js
16
confetti.js
|
@ -4,6 +4,15 @@
|
|||
'use strict';
|
||||
|
||||
var DEFAULT_NUM_CONFETTI = 500,
|
||||
CONFETTI_COLORS = [
|
||||
"white",
|
||||
"purple",
|
||||
"#D12D23",
|
||||
"#C1141A",
|
||||
"#DD7512",
|
||||
"#EAA813",
|
||||
"#1BA58E"
|
||||
],
|
||||
animate = window.requestAnimationFrame ||
|
||||
window.webkitRequestAnimationFrame ||
|
||||
window.mozRequestAnimationFrame ||
|
||||
|
@ -87,9 +96,10 @@
|
|||
};
|
||||
|
||||
function color() {
|
||||
return 'rgba(' + randomFrom(0, 256) + ', ' +
|
||||
randomFrom(0, 256) + ', ' +
|
||||
randomFrom(0, 256) + ', ' + Math.random() + ')';
|
||||
// return 'rgba(' + randomFrom(0, 256) + ', ' +
|
||||
// randomFrom(0, 256) + ', ' +
|
||||
// randomFrom(0, 256) + ', ' + Math.random() + ')';
|
||||
return CONFETTI_COLORS[randomFrom(0,CONFETTI_COLORS.length)];
|
||||
}
|
||||
|
||||
function randomFrom(a, b, factor) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue