tsparticles-shape-polygon
Advanced tools
Comparing version 2.1.3 to 2.1.4
{ | ||
"name": "tsparticles-shape-polygon", | ||
"version": "2.1.3", | ||
"version": "2.1.4", | ||
"description": "tsParticles polygon shape", | ||
@@ -47,4 +47,4 @@ "homepage": "https://particles.js.org/", | ||
"dependencies": { | ||
"tsparticles-engine": "^2.1.3" | ||
"tsparticles-engine": "^2.1.4" | ||
} | ||
} |
@@ -7,3 +7,3 @@ /*! | ||
* How to use? : Check the GitHub README | ||
* v2.1.3 | ||
* v2.1.4 | ||
*/ | ||
@@ -10,0 +10,0 @@ (function webpackUniversalModuleDefinition(root, factory) { |
@@ -1,2 +0,2 @@ | ||
/*! tsParticles Polygon Shape v2.1.3 by Matteo Bruni */ | ||
/*! tsParticles Polygon Shape v2.1.4 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,(()=>(()=>{"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:()=>r,loadPolygonShape:()=>l,loadTriangleShape:()=>i});class n{draw(e,t,n){const o=this.getCenter(t,n),a=this.getSidesData(t,n),r=a.count.numerator*a.count.denominator,i=a.count.numerator/a.count.denominator,l=180*(i-2)/i,d=Math.PI-Math.PI*l/180;if(e){e.beginPath(),e.translate(o.x,o.y),e.moveTo(0,0);for(let t=0;t<r;t++)e.lineTo(a.length,0),e.translate(a.length,0),e.rotate(d)}}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}}class o extends n{getCenter(e,t){return{x:-t/(this.getSidesCount(e)/3.5),y:-t/.76}}getSidesData(e,t){var n,o;const a=e.shapeData,r=null!==(o=null!==(n=null==a?void 0:a.sides)&&void 0!==n?n:null==a?void 0:a.nb_sides)&&void 0!==o?o:5;return{count:{denominator:1,numerator:r},length:2.66*t/(r/3)}}}class a extends n{getCenter(e,t){return{x:-t,y:t/1.66}}getSidesCount(){return 3}getSidesData(e,t){return{count:{denominator:2,numerator:3},length:2*t}}}async function r(e){await e.addShape("polygon",new o)}async function i(e){await e.addShape("triangle",new a)}async function l(e){await r(e),await i(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
305699
Updatedtsparticles-engine@^2.1.4