tsparticles-shape-square
Advanced tools
Comparing version 2.0.0-alpha.3 to 2.0.0-alpha.4
@@ -1,1 +0,2 @@ | ||
export {}; | ||
import type { Main } from "tsparticles-engine"; | ||
export declare function loadSquareShape(tsParticles: Main): void; |
@@ -1,3 +0,6 @@ | ||
import { loadShape } from "./shape"; | ||
import { tsParticles } from "tsparticles-core"; | ||
loadShape(tsParticles); | ||
import { SquareDrawer } from "./SquareDrawer"; | ||
export function loadSquareShape(tsParticles) { | ||
const drawer = new SquareDrawer(); | ||
tsParticles.addShape("edge", drawer); | ||
tsParticles.addShape("square", drawer); | ||
} |
{ | ||
"name": "tsparticles-shape-square", | ||
"version": "2.0.0-alpha.3", | ||
"version": "2.0.0-alpha.4", | ||
"description": "tsParticles Square shape", | ||
@@ -41,11 +41,11 @@ "homepage": "https://particles.js.org/", | ||
}, | ||
"main": "shape.js", | ||
"main": "index.js", | ||
"jsdelivr": "tsparticles.shape.square.min.js", | ||
"unpkg": "tsparticles.shape.square.min.js", | ||
"browser": "shape.js", | ||
"module": "shape.js", | ||
"types": "shape.d.ts", | ||
"browser": "index.js", | ||
"module": "index.js", | ||
"types": "index.d.ts", | ||
"dependencies": { | ||
"tsparticles-core": "^2.0.0-alpha.0" | ||
"tsparticles-engine": "^2.0.0-alpha.4" | ||
} | ||
} |
@@ -1,2 +0,2 @@ | ||
import type { IParticle, IShapeDrawer } from "tsparticles-core"; | ||
import type { IParticle, IShapeDrawer } from "tsparticles-engine"; | ||
export declare class SquareDrawer implements IShapeDrawer { | ||
@@ -3,0 +3,0 @@ getSidesCount(): number; |
@@ -6,4 +6,5 @@ export class SquareDrawer { | ||
draw(context, particle, radius) { | ||
context.rect(-radius, -radius, radius * 2, radius * 2); | ||
const f = Math.sqrt(2); | ||
context.rect(-radius / f, -radius / f, (radius * 2) / f, (radius * 2) / f); | ||
} | ||
} |
@@ -7,14 +7,14 @@ /*! | ||
* How to use? : Check the GitHub README | ||
* v2.0.0-alpha.3 | ||
* v2.0.0-alpha.4 | ||
*/ | ||
(function webpackUniversalModuleDefinition(root, factory) { | ||
if(typeof exports === 'object' && typeof module === 'object') | ||
module.exports = factory(require("tsparticles-core")); | ||
module.exports = factory(); | ||
else if(typeof define === 'function' && define.amd) | ||
define(["tsparticles-core"], factory); | ||
define([], factory); | ||
else { | ||
var a = typeof exports === 'object' ? factory(require("tsparticles-core")) : factory(root["window"]); | ||
var a = factory(); | ||
for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i]; | ||
} | ||
})(this, function(__WEBPACK_EXTERNAL_MODULE__646__) { | ||
})(this, function() { | ||
return /******/ (() => { // webpackBootstrap | ||
@@ -24,3 +24,3 @@ /******/ "use strict"; | ||
/***/ 196: | ||
/***/ 80: | ||
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { | ||
@@ -31,2 +31,7 @@ | ||
// EXPORTS | ||
__webpack_require__.d(__webpack_exports__, { | ||
"loadSquareShape": () => /* binding */ loadSquareShape | ||
}); | ||
;// CONCATENATED MODULE: ./dist/SquareDrawer.js | ||
@@ -39,9 +44,10 @@ class SquareDrawer { | ||
draw(context, particle, radius) { | ||
context.rect(-radius, -radius, radius * 2, radius * 2); | ||
const f = Math.sqrt(2); | ||
context.rect(-radius / f, -radius / f, radius * 2 / f, radius * 2 / f); | ||
} | ||
} | ||
;// CONCATENATED MODULE: ./dist/shape.js | ||
;// CONCATENATED MODULE: ./dist/index.js | ||
function loadShape(tsParticles) { | ||
function loadSquareShape(tsParticles) { | ||
const drawer = new SquareDrawer(); | ||
@@ -51,16 +57,3 @@ tsParticles.addShape("edge", drawer); | ||
} | ||
// EXTERNAL MODULE: external {"commonjs":"tsparticles-core","commonjs2":"tsparticles-core","amd":"tsparticles-core","root":"window"} | ||
var external_commonjs_tsparticles_core_commonjs2_tsparticles_core_amd_tsparticles_core_root_window_ = __webpack_require__(646); | ||
;// CONCATENATED MODULE: ./dist/index.js | ||
loadShape(external_commonjs_tsparticles_core_commonjs2_tsparticles_core_amd_tsparticles_core_root_window_.tsParticles); | ||
/***/ }), | ||
/***/ 646: | ||
/***/ ((module) => { | ||
module.exports = __WEBPACK_EXTERNAL_MODULE__646__; | ||
/***/ }) | ||
@@ -94,2 +87,19 @@ | ||
/************************************************************************/ | ||
/******/ /* webpack/runtime/define property getters */ | ||
/******/ (() => { | ||
/******/ // define getter functions for harmony exports | ||
/******/ __webpack_require__.d = (exports, definition) => { | ||
/******/ for(var key in definition) { | ||
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { | ||
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); | ||
/******/ } | ||
/******/ } | ||
/******/ }; | ||
/******/ })(); | ||
/******/ | ||
/******/ /* webpack/runtime/hasOwnProperty shorthand */ | ||
/******/ (() => { | ||
/******/ __webpack_require__.o = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop) | ||
/******/ })(); | ||
/******/ | ||
/******/ /* webpack/runtime/make namespace object */ | ||
@@ -110,5 +120,5 @@ /******/ (() => { | ||
/******/ // Load entry module and return exports | ||
/******/ return __webpack_require__(196); | ||
/******/ return __webpack_require__(80); | ||
/******/ })() | ||
; | ||
}); |
@@ -1,2 +0,2 @@ | ||
/*! tsParticles Square Shape v2.0.0-alpha.3 by Matteo Bruni */ | ||
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("tsparticles-core"));else if("function"==typeof define&&define.amd)define(["tsparticles-core"],t);else{var r="object"==typeof exports?t(require("tsparticles-core")):t(e.window);for(var o in r)("object"==typeof exports?exports:e)[o]=r[o]}}(this,(function(e){return(()=>{"use strict";var t={196:(e,t,r)=>{r.r(t);class o{getSidesCount(){return 4}draw(e,t,r){e.rect(-r,-r,2*r,2*r)}}!function(e){const t=new o;e.addShape("edge",t),e.addShape("square",t)}(r(646).tsParticles)},646:t=>{t.exports=e}},r={};function o(e){if(r[e])return r[e].exports;var n=r[e]={exports:{}};return t[e](n,n.exports,o),n.exports}return o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o(196)})()})); | ||
/*! tsParticles Square Shape v2.0.0-alpha.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 o=t();for(var r in o)("object"==typeof exports?exports:e)[r]=o[r]}}(this,(function(){return(()=>{"use strict";var e={80:(e,t,o)=>{o.r(t),o.d(t,{loadSquareShape:()=>n});class r{getSidesCount(){return 4}draw(e,t,o){const r=Math.sqrt(2);e.rect(-o/r,-o/r,2*o/r,2*o/r)}}function n(e){const t=new r;e.addShape("edge",t),e.addShape("square",t)}}},t={};function o(r){if(t[r])return t[r].exports;var n=t[r]={exports:{}};return e[r](n,n.exports,o),n.exports}return o.d=(e,t)=>{for(var r in t)o.o(t,r)&&!o.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o(80)})()})); |
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
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
130
1
281670
9
+ Addedtsparticles-engine@2.12.0(transitive)
- Removedtsparticles-core@^2.0.0-alpha.0