tsparticles-shape-polygon
Advanced tools
Comparing version 2.0.4 to 2.0.5
{ | ||
"name": "tsparticles-shape-polygon", | ||
"version": "2.0.4", | ||
"version": "2.0.5", | ||
"description": "tsParticles polygon shape", | ||
@@ -48,4 +48,4 @@ "homepage": "https://particles.js.org/", | ||
"dependencies": { | ||
"tsparticles-engine": "^2.0.4" | ||
"tsparticles-engine": "^2.0.5" | ||
} | ||
} |
@@ -7,3 +7,3 @@ /*! | ||
* How to use? : Check the GitHub README | ||
* v2.0.4 | ||
* v2.0.5 | ||
*/ | ||
@@ -10,0 +10,0 @@ (function webpackUniversalModuleDefinition(root, factory) { |
@@ -1,2 +0,2 @@ | ||
/*! tsParticles Polygon Shape v2.0.4 by Matteo Bruni */ | ||
/*! tsParticles Polygon Shape v2.0.5 by Matteo Bruni */ | ||
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var o in n)("object"==typeof exports?exports:e)[o]=n[o]}}(this,(function(){return(()=>{"use strict";var e={d:(t,n)=>{for(var o in n)e.o(n,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:n[o]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{loadGenericPolygonShape:()=>a,loadPolygonShape:()=>d,loadTriangleShape:()=>u});class n{getSidesCount(e){var t,n;const o=e.shapeData;return null!==(n=null!==(t=null==o?void 0:o.sides)&&void 0!==t?t:null==o?void 0:o.nb_sides)&&void 0!==n?n:5}draw(e,t,n){const o=this.getCenter(t,n),r=this.getSidesData(t,n),i=r.count.numerator*r.count.denominator,a=r.count.numerator/r.count.denominator,u=180*(a-2)/a,d=Math.PI-Math.PI*u/180;if(e){e.beginPath(),e.translate(o.x,o.y),e.moveTo(0,0);for(let t=0;t<i;t++)e.lineTo(r.length,0),e.translate(r.length,0),e.rotate(d)}}}class o extends n{getSidesData(e,t){var n,o;const r=e.shapeData,i=null!==(o=null!==(n=null==r?void 0:r.sides)&&void 0!==n?n:null==r?void 0:r.nb_sides)&&void 0!==o?o:5;return{count:{denominator:1,numerator:i},length:2.66*t/(i/3)}}getCenter(e,t){return{x:-t/(this.getSidesCount(e)/3.5),y:-t/.76}}}class r extends n{getSidesCount(){return 3}getSidesData(e,t){return{count:{denominator:2,numerator:3},length:2*t}}getCenter(e,t){return{x:-t,y:t/1.66}}}var i=function(e,t,n,o){return new(n||(n=Promise))((function(r,i){function a(e){try{d(o.next(e))}catch(e){i(e)}}function u(e){try{d(o.throw(e))}catch(e){i(e)}}function d(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,u)}d((o=o.apply(e,t||[])).next())}))};function a(e){return i(this,void 0,void 0,(function*(){yield e.addShape("polygon",new o)}))}function u(e){return i(this,void 0,void 0,(function*(){yield e.addShape("triangle",new r)}))}function d(e){return i(this,void 0,void 0,(function*(){yield a(e),yield u(e)}))}return t})()})); |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
294335
Updatedtsparticles-engine@^2.0.5