canvas-confetti
Advanced tools
Comparing version
@@ -1,2 +0,2 @@ | ||
// canvas-confetti v0.4.0 built on 2019-08-05T22:54:55.707Z | ||
// canvas-confetti v0.4.1 built on 2019-09-23T21:26:55.487Z | ||
!(function (window, module) { | ||
@@ -143,2 +143,11 @@ // source content | ||
function ellipse(context, x, y, radiusX, radiusY, rotation, startAngle, endAngle, antiClockwise) { | ||
context.save(); | ||
context.translate(x, y); | ||
context.rotate(rotation); | ||
context.scale(radiusX, radiusY); | ||
context.arc(0, 0, 1, startAngle, endAngle, antiClockwise); | ||
context.restore(); | ||
} | ||
function randomPhysics(opts) { | ||
@@ -191,3 +200,5 @@ var radAngle = opts.angle * (Math.PI / 180); | ||
if (fetti.shape === 'circle') { | ||
context.ellipse(fetti.x, fetti.y, Math.abs(x2 - x1) * 0.6, Math.abs(y2 - y1) * 0.6, Math.PI / 10 * fetti.wobble, 0, 2 * Math.PI); | ||
context.ellipse ? | ||
context.ellipse(fetti.x, fetti.y, Math.abs(x2 - x1) * 0.6, Math.abs(y2 - y1) * 0.6, Math.PI / 10 * fetti.wobble, 0, 2 * Math.PI) : | ||
ellipse(context, fetti.x, fetti.y, Math.abs(x2 - x1) * 0.6, Math.abs(y2 - y1) * 0.6, Math.PI / 10 * fetti.wobble, 0, 2 * Math.PI); | ||
} else { | ||
@@ -194,0 +205,0 @@ context.moveTo(Math.floor(fetti.x), Math.floor(fetti.y)); |
{ | ||
"name": "canvas-confetti", | ||
"version": "0.4.0", | ||
"version": "0.4.1", | ||
"description": "performant confetti animation in the browser", | ||
@@ -5,0 +5,0 @@ "main": "src/confetti.js", |
@@ -140,2 +140,11 @@ (function () { | ||
function ellipse(context, x, y, radiusX, radiusY, rotation, startAngle, endAngle, antiClockwise) { | ||
context.save(); | ||
context.translate(x, y); | ||
context.rotate(rotation); | ||
context.scale(radiusX, radiusY); | ||
context.arc(0, 0, 1, startAngle, endAngle, antiClockwise); | ||
context.restore(); | ||
} | ||
function randomPhysics(opts) { | ||
@@ -188,3 +197,5 @@ var radAngle = opts.angle * (Math.PI / 180); | ||
if (fetti.shape === 'circle') { | ||
context.ellipse(fetti.x, fetti.y, Math.abs(x2 - x1) * 0.6, Math.abs(y2 - y1) * 0.6, Math.PI / 10 * fetti.wobble, 0, 2 * Math.PI); | ||
context.ellipse ? | ||
context.ellipse(fetti.x, fetti.y, Math.abs(x2 - x1) * 0.6, Math.abs(y2 - y1) * 0.6, Math.PI / 10 * fetti.wobble, 0, 2 * Math.PI) : | ||
ellipse(context, fetti.x, fetti.y, Math.abs(x2 - x1) * 0.6, Math.abs(y2 - y1) * 0.6, Math.PI / 10 * fetti.wobble, 0, 2 * Math.PI); | ||
} else { | ||
@@ -191,0 +202,0 @@ context.moveTo(Math.floor(fetti.x), Math.floor(fetti.y)); |
Sorry, the diff of this file is not supported yet
39296
3.75%933
3.32%