Skip to content

Commit

Permalink
Rolling out 0.0.17
Browse files Browse the repository at this point in the history
  • Loading branch information
Agezao committed Jan 22, 2020
1 parent fdb7c5b commit b2daca9
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 42 deletions.
19 changes: 1 addition & 18 deletions dist/index.es.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ function ConfettiGenerator(params) {
// Confetti drawing on canvas
function particleDraw(p) {
if (!p) {
// Particle has been removed
return;
}

Expand Down Expand Up @@ -173,7 +172,6 @@ function ConfettiGenerator(params) {
//////////////
// Render confetti on canvas
var _render = function() {
//canvas dimensions
cv.width = appstate.width;
cv.height = appstate.height;
particles = [];
Expand All @@ -189,26 +187,14 @@ function ConfettiGenerator(params) {

update();

//animation loop
if(appstate.animate) requestAnimationFrame(draw);
}

function update() {

for (var i = 0; i < appstate.max; i++) {
var p = particles[i];
<<<<<<< HEAD
if(appstate.animate)
p.y += p.speed;

if (p.rotate)
p.rotation += p.speed / 35;

if ((p.speed >= 0 && p.y > appstate.height) || (p.speed < 0 && p.y < 0)) {
particles[i] = p;
particles[i].x = rand(appstate.width, true);
particles[i].y = p.speed >= 0 ? -10 : parseFloat(appstate.height);
=======

if (p) {
if(appstate.animate)
p.y += p.speed;
Expand All @@ -222,16 +208,13 @@ function ConfettiGenerator(params) {
particles[i].x = rand(appstate.width, true);
particles[i].y = p.speed >= 0 ? -10 : parseFloat(appstate.height);
} else {
// Mark as to-delete
particles[i] = undefined;
}
}
>>>>>>> e53bb8960d34ace150fed28359130a2f3646619c
}
}

if (particles.every(function(p) { return p === undefined; })) {
// Clear when there is no particles left
_clear();
}
}
Expand Down
19 changes: 1 addition & 18 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ function ConfettiGenerator(params) {
// Confetti drawing on canvas
function particleDraw(p) {
if (!p) {
// Particle has been removed
return;
}

Expand Down Expand Up @@ -175,7 +174,6 @@ function ConfettiGenerator(params) {
//////////////
// Render confetti on canvas
var _render = function() {
//canvas dimensions
cv.width = appstate.width;
cv.height = appstate.height;
particles = [];
Expand All @@ -191,26 +189,14 @@ function ConfettiGenerator(params) {

update();

//animation loop
if(appstate.animate) requestAnimationFrame(draw);
}

function update() {

for (var i = 0; i < appstate.max; i++) {
var p = particles[i];
<<<<<<< HEAD
if(appstate.animate)
p.y += p.speed;

if (p.rotate)
p.rotation += p.speed / 35;

if ((p.speed >= 0 && p.y > appstate.height) || (p.speed < 0 && p.y < 0)) {
particles[i] = p;
particles[i].x = rand(appstate.width, true);
particles[i].y = p.speed >= 0 ? -10 : parseFloat(appstate.height);
=======

if (p) {
if(appstate.animate)
p.y += p.speed;
Expand All @@ -224,16 +210,13 @@ function ConfettiGenerator(params) {
particles[i].x = rand(appstate.width, true);
particles[i].y = p.speed >= 0 ? -10 : parseFloat(appstate.height);
} else {
// Mark as to-delete
particles[i] = undefined;
}
}
>>>>>>> e53bb8960d34ace150fed28359130a2f3646619c
}
}

if (particles.every(function(p) { return p === undefined; })) {
// Clear when there is no particles left
_clear();
}
}
Expand Down
6 changes: 1 addition & 5 deletions dist/index.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "confetti-js",
"version": "0.0.16",
"version": "0.0.17",
"description": "Easily Generate random confetti for your above-the-fold content",
"main": "dist/index.js",
"module": "dist/index.es.js",
Expand Down

0 comments on commit b2daca9

Please sign in to comment.