Socket
Socket
Sign inDemoInstall

react-confetti

Package Overview
Dependencies
Maintainers
1
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-confetti - npm Package Compare versions

Comparing version 2.0.0 to 2.0.1

4

lib/react-confetti.js

@@ -1,2 +0,2 @@

/*! react-confetti - 2.0.0 | (c) 2015, 2017 Aaron Lampros <alampros@gmail.com> | MIT | https://github.com/alampros/react-confetti#readme */
/*! react-confetti - 2.0.1 | (c) 2015, 2017 Aaron Lampros <alampros@gmail.com> | MIT | https://github.com/alampros/react-confetti#readme */
(function webpackUniversalModuleDefinition(root, factory) {

@@ -1436,3 +1436,3 @@ if(typeof exports === 'object' && typeof module === 'object')

if (p.y > canvas.height || p.y < -100 || p.x > canvas.width + 100 || p.x < -100) {
if (limit <= _this.number) {
if (recycle && limit <= _this.number) {
// a brand new particle replacing the dead one

@@ -1439,0 +1439,0 @@ _this.particles[i] = _this.getParticle();

@@ -1,2 +0,2 @@

/*! react-confetti - 2.0.0 | (c) 2015, 2017 Aaron Lampros <alampros@gmail.com> | MIT | https://github.com/alampros/react-confetti#readme */
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react")):"function"==typeof define&&define.amd?define(["react"],e):"object"==typeof exports?exports.ReactConfetti=e(require("react")):t.ReactConfetti=e(t.React)}(this,function(t){return function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var n={};return e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="/lib",e(e.s=0)}([function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function i(t,e){var n={};for(var r in t)e.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function u(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var c=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},s=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),l=n(1),f=r(l),h=n(6),p=r(h),d=n(7),y=r(d),g=function(t){function e(){return o(this,e),a(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return u(e,t),s(e,[{key:"componentDidMount",value:function(){this.confetti=(0,y.default)(this.canvas).numberOfPieces(this.props.numberOfPieces).confettiSource(this.props.confettiSource).friction(this.props.friction).wind(this.props.wind).gravity(this.props.gravity).colors(this.props.colors).opacity(this.props.opacity).recycle(this.props.recycle).run(this.props.run)()}},{key:"componentWillReceiveProps",value:function(t){this.confetti.numberOfPieces(t.numberOfPieces).confettiSource(t.confettiSource).friction(t.friction).wind(t.wind).gravity(t.gravity).colors(t.colors).opacity(t.opacity).recycle(t.recycle).run(t.run)}},{key:"render",value:function(){var t=this,e=this.props,n=e.width,r=e.height,o=e.style,a=(e.numberOfPieces,e.friction,e.wind,e.gravity,e.colors,e.opacity,e.recycle,e.confettiSource,e.run,i(e,["width","height","style","numberOfPieces","friction","wind","gravity","colors","opacity","recycle","confettiSource","run"])),u=Object.assign({},{zIndex:2,position:"absolute",top:0,left:0,pointerEvents:"none",WebkitPointerEvents:"none",MozPointerEvents:"none"},o);return p.default.createElement("canvas",c({width:n,height:r,ref:function(e){t.canvas=e},style:u},a))}}]),e}(p.default.PureComponent);g.propTypes={style:f.default.object,width:f.default.number.isRequired,height:f.default.number.isRequired,numberOfPieces:f.default.number,confettiSource:f.default.shape({x:f.default.number,y:f.default.number,w:f.default.number,h:f.default.number}),friction:f.default.number,wind:f.default.number,gravity:f.default.number,colors:f.default.arrayOf(f.default.string),opacity:f.default.number,recycle:f.default.bool,run:f.default.bool},g.defaultProps={numberOfPieces:200,confettiSource:{},friction:.99,wind:0,gravity:.1,colors:["#f44336","#e91e63","#9c27b0","#673ab7","#3f51b5","#2196f3","#03a9f4","#00bcd4","#009688","#4CAF50","#8BC34A","#CDDC39","#FFEB3B","#FFC107","#FF9800","#FF5722","#795548"],opacity:1,recycle:!0,run:!0},e.default=g},function(t,e,n){t.exports=n(2)()},function(t,e,n){"use strict";var r=n(3),i=n(4),o=n(5);t.exports=function(){function t(t,e,n,r,a,u){u!==o&&i(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types")}function e(){return t}t.isRequired=t;var n={array:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e};return n.checkPropTypes=r,n.PropTypes=n,n}},function(t,e,n){"use strict";function r(t){return function(){return t}}var i=function(){};i.thatReturns=r,i.thatReturnsFalse=r(!1),i.thatReturnsTrue=r(!0),i.thatReturnsNull=r(null),i.thatReturnsThis=function(){return this},i.thatReturnsArgument=function(t){return t},t.exports=i},function(t,e,n){"use strict";function r(t,e,n,r,o,a,u,c){if(i(e),!t){var s;if(void 0===e)s=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=[n,r,o,a,u,c],f=0;s=new Error(e.replace(/%s/g,function(){return l[f++]})),s.name="Invariant Violation"}throw s.framesToPop=1,s}}var i=function(t){};t.exports=r},function(t,e,n){"use strict";t.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,n){e.exports=t},function(t,e,n){"use strict";function r(t){function e(){function h(t,e){this.radius=o.randomRange(.1,1),this.x=t,this.y=e,this.vx=o.randomRange(-4,4),this.vy=o.randomRange(-10,-0),this.type=o.randomInt(0,1),this.w=o.randomRange(5,20),this.h=o.randomRange(5,20),this.r=o.randomRange(5,10),this.angle=o.degreesToRads(o.randomRange(0,360)),this.anglespin=o.randomRange(-.2,.2),this.color=c[Math.floor(Math.random()*c.length)],this.rotateY=o.randomRange(0,1)}function p(t,e,n){this.x=t.x,this.y=t.y,this.w=t.w,this.h=t.h,this.number=e,this.particles=[],this.particlesGenerated=0,this.text=n,this.recycle=l}var d=t.getContext("2d");return h.prototype.update=function(){if(this.x+=this.vx,this.y+=this.vy,this.vy+=u,this.vx+=a,this.vx*=i,this.vy*=i,this.radius-=.02,this.rotateY<1?this.rotateY+=.1:this.rotateY=-1,this.angle+=this.anglespin,d.save(),d.translate(this.x,this.y),d.rotate(this.angle),d.scale(1,this.rotateY),d.rotate(this.angle),d.beginPath(),d.fillStyle=this.color,d.strokeStyle=this.color,d.globalAlpha=s,d.lineCap="round",d.lineWidth=2,0===this.type)d.beginPath(),d.arc(0,0,this.r,0,2*Math.PI),d.fill();else if(2===this.type){d.beginPath();for(var t=0;t<22;t++){var e=.5*t,n=(.2+1.5*e)*Math.cos(e),r=(.2+1.5*e)*Math.sin(e);d.lineTo(n,r)}d.stroke()}else 1===this.type&&d.fillRect(-this.w/2,-this.h/2,this.w,this.h);d.closePath(),d.restore()},p.prototype.removeParticleAt=function(t){this.particles.splice(t,1)},p.prototype.getParticle=function(){return new h(o.randomRange(this.x,this.w+this.x),o.randomRange(this.y,this.h+this.y),this.text)},p.prototype.animate=function(){var e=this;if(!f)return!1;var n=this.particles.length,r=this.recycle?n:this.particlesGenerated;return r<this.number&&(this.particles.push(this.getParticle()),this.particlesGenerated+=1),this.particles.forEach(function(n,i){n.update(),(n.y>t.height||n.y<-100||n.x>t.width+100||n.x<-100)&&(r<=e.number?e.particles[i]=e.getParticle():e.removeParticleAt(i))}),n>0||r<this.number},e.particleGenerator=new p(r,n),e.update=function(){f&&(e.particleGenerator.number=n,d.fillStyle="white",d.clearRect(0,0,t.width,t.height)),e.particleGenerator.animate()?requestAnimationFrame(e.update):f=!1},e.update(),e}var n=200,r={x:0,y:0,w:t.width,h:0},i=.99,a=0,u=.1,c=["#f44336","#e91e63","#9c27b0","#673ab7","#3f51b5","#2196f3","#03a9f4","#00bcd4","#009688","#4CAF50","#8BC34A","#CDDC39","#FFEB3B","#FFC107","#FF9800","#FF5722","#795548"],s=1,l=!0,f=!0;return e.numberOfPieces=function(){return arguments.length?(n=arguments.length<=0?void 0:arguments[0],e.particleGenerator&&(e.particleGenerator.number=n),e):n},e.friction=function(){return arguments.length?(i=arguments.length<=0?void 0:arguments[0],e):i},e.wind=function(){return arguments.length?(a=arguments.length<=0?void 0:arguments[0],e):a},e.gravity=function(){return arguments.length?(u=arguments.length<=0?void 0:arguments[0],e):u},e.colors=function(){return arguments.length?(c=arguments.length<=0?void 0:arguments[0],e):c},e.opacity=function(){return arguments.length?(s=arguments.length<=0?void 0:arguments[0],e):s},e.recycle=function(){return arguments.length?(l=arguments.length<=0?void 0:arguments[0],e.particleGenerator&&(e.particleGenerator.recycle=l),e):l},e.confettiSource=function(){return arguments.length?(r=Object.assign(r,arguments.length<=0?void 0:arguments[0]),e):r},e.run=function(){if(!arguments.length)return f;var t=f;return f=arguments.length<=0?void 0:arguments[0],!t&&f&&e.update(),e},e}Object.defineProperty(e,"__esModule",{value:!0});var i=n(8),o=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(i);e.default=r},function(t,e,n){"use strict";function r(t,e,n){return(t-e)/(n-e)}function i(t,e,n){return(n-e)*t+e}function o(t,e,n,o,a){return i(r(t,e,n),o,a)}function a(t,e,n){return Math.min(Math.max(t,Math.min(e,n)),Math.max(e,n))}function u(t,e){var n=e.x-t.x,r=e.y-t.y;return Math.sqrt(n*n+r*r)}function c(t,e,n,r){var i=n-t,o=r-e;return Math.sqrt(i*i+o*o)}function s(t,e){return u(t,e)<=t.radius+e.radius}function l(t,e,n){return c(t,e,n.x,n.y)<n.radius}function f(t,e,n){return t>=Math.min(e,n)&&t<=Math.max(e,n)}function h(t,e,n){return f(t,n.x,n.x+n.width)&&f(e,n.y,n.y+n.height)}function p(t,e,n,r){return Math.max(t,e)>=Math.min(n,r)&&Math.min(t,e)<=Math.max(n,r)}function d(t,e){return p(t.x,t.x+t.width,e.x,e.x+e.width)&&p(t.y,t.y+t.height,e.y,e.y+e.height)}function y(t){return t/(180*Math.PI)}function g(t){return 180*t/Math.PI}function m(t,e){return t+Math.random()*(e-t)}function b(t,e){return Math.floor(t+Math.random()*(e-t+1))}Object.defineProperty(e,"__esModule",{value:!0}),e.norm=r,e.lerp=i,e.map=o,e.clamp=a,e.distance=u,e.distanceXY=c,e.circleCollision=s,e.circlePointCollision=l,e.inRange=f,e.pointInRect=h,e.rangeIntersect=p,e.rectIntersect=d,e.degreesToRads=y,e.radsToDegrees=g,e.randomRange=m,e.randomInt=b}])});
/*! react-confetti - 2.0.1 | (c) 2015, 2017 Aaron Lampros <alampros@gmail.com> | MIT | https://github.com/alampros/react-confetti#readme */
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react")):"function"==typeof define&&define.amd?define(["react"],e):"object"==typeof exports?exports.ReactConfetti=e(require("react")):t.ReactConfetti=e(t.React)}(this,function(t){return function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var n={};return e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="/lib",e(e.s=0)}([function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function i(t,e){var n={};for(var r in t)e.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function u(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var c=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},s=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),l=n(1),f=r(l),h=n(6),p=r(h),d=n(7),y=r(d),g=function(t){function e(){return o(this,e),a(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return u(e,t),s(e,[{key:"componentDidMount",value:function(){this.confetti=(0,y.default)(this.canvas).numberOfPieces(this.props.numberOfPieces).confettiSource(this.props.confettiSource).friction(this.props.friction).wind(this.props.wind).gravity(this.props.gravity).colors(this.props.colors).opacity(this.props.opacity).recycle(this.props.recycle).run(this.props.run)()}},{key:"componentWillReceiveProps",value:function(t){this.confetti.numberOfPieces(t.numberOfPieces).confettiSource(t.confettiSource).friction(t.friction).wind(t.wind).gravity(t.gravity).colors(t.colors).opacity(t.opacity).recycle(t.recycle).run(t.run)}},{key:"render",value:function(){var t=this,e=this.props,n=e.width,r=e.height,o=e.style,a=(e.numberOfPieces,e.friction,e.wind,e.gravity,e.colors,e.opacity,e.recycle,e.confettiSource,e.run,i(e,["width","height","style","numberOfPieces","friction","wind","gravity","colors","opacity","recycle","confettiSource","run"])),u=Object.assign({},{zIndex:2,position:"absolute",top:0,left:0,pointerEvents:"none",WebkitPointerEvents:"none",MozPointerEvents:"none"},o);return p.default.createElement("canvas",c({width:n,height:r,ref:function(e){t.canvas=e},style:u},a))}}]),e}(p.default.PureComponent);g.propTypes={style:f.default.object,width:f.default.number.isRequired,height:f.default.number.isRequired,numberOfPieces:f.default.number,confettiSource:f.default.shape({x:f.default.number,y:f.default.number,w:f.default.number,h:f.default.number}),friction:f.default.number,wind:f.default.number,gravity:f.default.number,colors:f.default.arrayOf(f.default.string),opacity:f.default.number,recycle:f.default.bool,run:f.default.bool},g.defaultProps={numberOfPieces:200,confettiSource:{},friction:.99,wind:0,gravity:.1,colors:["#f44336","#e91e63","#9c27b0","#673ab7","#3f51b5","#2196f3","#03a9f4","#00bcd4","#009688","#4CAF50","#8BC34A","#CDDC39","#FFEB3B","#FFC107","#FF9800","#FF5722","#795548"],opacity:1,recycle:!0,run:!0},e.default=g},function(t,e,n){t.exports=n(2)()},function(t,e,n){"use strict";var r=n(3),i=n(4),o=n(5);t.exports=function(){function t(t,e,n,r,a,u){u!==o&&i(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types")}function e(){return t}t.isRequired=t;var n={array:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e};return n.checkPropTypes=r,n.PropTypes=n,n}},function(t,e,n){"use strict";function r(t){return function(){return t}}var i=function(){};i.thatReturns=r,i.thatReturnsFalse=r(!1),i.thatReturnsTrue=r(!0),i.thatReturnsNull=r(null),i.thatReturnsThis=function(){return this},i.thatReturnsArgument=function(t){return t},t.exports=i},function(t,e,n){"use strict";function r(t,e,n,r,o,a,u,c){if(i(e),!t){var s;if(void 0===e)s=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=[n,r,o,a,u,c],f=0;s=new Error(e.replace(/%s/g,function(){return l[f++]})),s.name="Invariant Violation"}throw s.framesToPop=1,s}}var i=function(t){};t.exports=r},function(t,e,n){"use strict";t.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,n){e.exports=t},function(t,e,n){"use strict";function r(t){function e(){function h(t,e){this.radius=o.randomRange(.1,1),this.x=t,this.y=e,this.vx=o.randomRange(-4,4),this.vy=o.randomRange(-10,-0),this.type=o.randomInt(0,1),this.w=o.randomRange(5,20),this.h=o.randomRange(5,20),this.r=o.randomRange(5,10),this.angle=o.degreesToRads(o.randomRange(0,360)),this.anglespin=o.randomRange(-.2,.2),this.color=c[Math.floor(Math.random()*c.length)],this.rotateY=o.randomRange(0,1)}function p(t,e,n){this.x=t.x,this.y=t.y,this.w=t.w,this.h=t.h,this.number=e,this.particles=[],this.particlesGenerated=0,this.text=n,this.recycle=l}var d=t.getContext("2d");return h.prototype.update=function(){if(this.x+=this.vx,this.y+=this.vy,this.vy+=u,this.vx+=a,this.vx*=i,this.vy*=i,this.radius-=.02,this.rotateY<1?this.rotateY+=.1:this.rotateY=-1,this.angle+=this.anglespin,d.save(),d.translate(this.x,this.y),d.rotate(this.angle),d.scale(1,this.rotateY),d.rotate(this.angle),d.beginPath(),d.fillStyle=this.color,d.strokeStyle=this.color,d.globalAlpha=s,d.lineCap="round",d.lineWidth=2,0===this.type)d.beginPath(),d.arc(0,0,this.r,0,2*Math.PI),d.fill();else if(2===this.type){d.beginPath();for(var t=0;t<22;t++){var e=.5*t,n=(.2+1.5*e)*Math.cos(e),r=(.2+1.5*e)*Math.sin(e);d.lineTo(n,r)}d.stroke()}else 1===this.type&&d.fillRect(-this.w/2,-this.h/2,this.w,this.h);d.closePath(),d.restore()},p.prototype.removeParticleAt=function(t){this.particles.splice(t,1)},p.prototype.getParticle=function(){return new h(o.randomRange(this.x,this.w+this.x),o.randomRange(this.y,this.h+this.y),this.text)},p.prototype.animate=function(){var e=this;if(!f)return!1;var n=this.particles.length,r=this.recycle?n:this.particlesGenerated;return r<this.number&&(this.particles.push(this.getParticle()),this.particlesGenerated+=1),this.particles.forEach(function(n,i){n.update(),(n.y>t.height||n.y<-100||n.x>t.width+100||n.x<-100)&&(l&&r<=e.number?e.particles[i]=e.getParticle():e.removeParticleAt(i))}),n>0||r<this.number},e.particleGenerator=new p(r,n),e.update=function(){f&&(e.particleGenerator.number=n,d.fillStyle="white",d.clearRect(0,0,t.width,t.height)),e.particleGenerator.animate()?requestAnimationFrame(e.update):f=!1},e.update(),e}var n=200,r={x:0,y:0,w:t.width,h:0},i=.99,a=0,u=.1,c=["#f44336","#e91e63","#9c27b0","#673ab7","#3f51b5","#2196f3","#03a9f4","#00bcd4","#009688","#4CAF50","#8BC34A","#CDDC39","#FFEB3B","#FFC107","#FF9800","#FF5722","#795548"],s=1,l=!0,f=!0;return e.numberOfPieces=function(){return arguments.length?(n=arguments.length<=0?void 0:arguments[0],e.particleGenerator&&(e.particleGenerator.number=n),e):n},e.friction=function(){return arguments.length?(i=arguments.length<=0?void 0:arguments[0],e):i},e.wind=function(){return arguments.length?(a=arguments.length<=0?void 0:arguments[0],e):a},e.gravity=function(){return arguments.length?(u=arguments.length<=0?void 0:arguments[0],e):u},e.colors=function(){return arguments.length?(c=arguments.length<=0?void 0:arguments[0],e):c},e.opacity=function(){return arguments.length?(s=arguments.length<=0?void 0:arguments[0],e):s},e.recycle=function(){return arguments.length?(l=arguments.length<=0?void 0:arguments[0],e.particleGenerator&&(e.particleGenerator.recycle=l),e):l},e.confettiSource=function(){return arguments.length?(r=Object.assign(r,arguments.length<=0?void 0:arguments[0]),e):r},e.run=function(){if(!arguments.length)return f;var t=f;return f=arguments.length<=0?void 0:arguments[0],!t&&f&&e.update(),e},e}Object.defineProperty(e,"__esModule",{value:!0});var i=n(8),o=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(i);e.default=r},function(t,e,n){"use strict";function r(t,e,n){return(t-e)/(n-e)}function i(t,e,n){return(n-e)*t+e}function o(t,e,n,o,a){return i(r(t,e,n),o,a)}function a(t,e,n){return Math.min(Math.max(t,Math.min(e,n)),Math.max(e,n))}function u(t,e){var n=e.x-t.x,r=e.y-t.y;return Math.sqrt(n*n+r*r)}function c(t,e,n,r){var i=n-t,o=r-e;return Math.sqrt(i*i+o*o)}function s(t,e){return u(t,e)<=t.radius+e.radius}function l(t,e,n){return c(t,e,n.x,n.y)<n.radius}function f(t,e,n){return t>=Math.min(e,n)&&t<=Math.max(e,n)}function h(t,e,n){return f(t,n.x,n.x+n.width)&&f(e,n.y,n.y+n.height)}function p(t,e,n,r){return Math.max(t,e)>=Math.min(n,r)&&Math.min(t,e)<=Math.max(n,r)}function d(t,e){return p(t.x,t.x+t.width,e.x,e.x+e.width)&&p(t.y,t.y+t.height,e.y,e.y+e.height)}function y(t){return t/(180*Math.PI)}function g(t){return 180*t/Math.PI}function m(t,e){return t+Math.random()*(e-t)}function b(t,e){return Math.floor(t+Math.random()*(e-t+1))}Object.defineProperty(e,"__esModule",{value:!0}),e.norm=r,e.lerp=i,e.map=o,e.clamp=a,e.distance=u,e.distanceXY=c,e.circleCollision=s,e.circlePointCollision=l,e.inRange=f,e.pointInRect=h,e.rangeIntersect=p,e.rectIntersect=d,e.degreesToRads=y,e.radsToDegrees=g,e.randomRange=m,e.randomInt=b}])});
{
"name": "react-confetti",
"version": "2.0.0",
"version": "2.0.1",
"description": "React component to draw confetti for your party.",

@@ -29,3 +29,3 @@ "main": "lib/react-confetti.js",

"build": "webpack",
"clean": "rm -rf lib/* docs/bundle.js",
"clean": "rm -rf lib/* docs/docs.js",
"lint": "eslint src/ --ext .js --ext .jsx",

@@ -32,0 +32,0 @@ "prepublish": "npm run clean && npm run lint && npm run build"

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc