tsparticles-shape-polygon
Advanced tools
Comparing version 2.0.0-beta.1 to 2.0.0-beta.2
{ | ||
"name": "tsparticles-shape-polygon", | ||
"version": "2.0.0-beta.1", | ||
"version": "2.0.0-beta.2", | ||
"description": "tsParticles polygon shape", | ||
@@ -48,4 +48,4 @@ "homepage": "https://particles.js.org/", | ||
"dependencies": { | ||
"tsparticles-engine": "^2.0.0-beta.0" | ||
"tsparticles-engine": "^2.0.0-beta.1" | ||
} | ||
} |
@@ -7,3 +7,3 @@ /*! | ||
* How to use? : Check the GitHub README | ||
* v2.0.0-beta.1 | ||
* v2.0.0-beta.2 | ||
*/ | ||
@@ -10,0 +10,0 @@ (function webpackUniversalModuleDefinition(root, factory) { |
@@ -1,2 +0,2 @@ | ||
/*! tsParticles Polygon Shape v2.0.0-beta.1 by Matteo Bruni */ | ||
/*! tsParticles Polygon Shape v2.0.0-beta.2 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:()=>l,loadTriangleShape:()=>i});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),a=r.count.numerator*r.count.denominator,i=r.count.numerator/r.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<a;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,a=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:a},length:2.66*t/(a/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}}}function a(e){e.addShape("polygon",new o)}function i(e){e.addShape("triangle",new r)}function l(e){a(e),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