@tsparticles/shape-cog 3.0.0-beta.3 → 3.0.0-beta.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/browser/CogDrawer.js +1 -1
- package/cjs/CogDrawer.js +1 -1
- package/esm/CogDrawer.js +1 -1
- package/package.json +3 -3
- package/report.html +4 -22
- package/tsparticles.shape.cog.js +2 -2
- package/tsparticles.shape.cog.min.js +1 -1
- package/tsparticles.shape.cog.min.js.LICENSE.txt +1 -1
- package/types/CogDrawer.d.ts +1 -1
- package/umd/CogDrawer.js +1 -1
package/tsparticles.shape.cog.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Demo / Generator : https://particles.js.org/
|
|
5
5
|
* GitHub : https://www.github.com/matteobruni/tsparticles
|
|
6
6
|
* How to use? : Check the GitHub README
|
|
7
|
-
* v3.0.0-beta.
|
|
7
|
+
* v3.0.0-beta.5
|
|
8
8
|
*/
|
|
9
9
|
(function webpackUniversalModuleDefinition(root, factory) {
|
|
10
10
|
if(typeof exports === 'object' && typeof module === 'object')
|
|
@@ -99,7 +99,7 @@ var engine_root_window_ = __webpack_require__(533);
|
|
|
99
99
|
;// CONCATENATED MODULE: ./dist/browser/CogDrawer.js
|
|
100
100
|
|
|
101
101
|
class CogDrawer {
|
|
102
|
-
|
|
102
|
+
afterDraw(data) {
|
|
103
103
|
const {
|
|
104
104
|
context,
|
|
105
105
|
particle,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see tsparticles.shape.cog.min.js.LICENSE.txt */
|
|
2
|
-
!function(e,o){if("object"==typeof exports&&"object"==typeof module)module.exports=o(require("@tsparticles/engine"));else if("function"==typeof define&&define.amd)define(["@tsparticles/engine"],o);else{var t="object"==typeof exports?o(require("@tsparticles/engine")):o(e.window);for(var r in t)("object"==typeof exports?exports:e)[r]=t[r]}}(this,(e=>(()=>{"use strict";var o={533:o=>{o.exports=e}},t={};function r(e){var a=t[e];if(void 0!==a)return a.exports;var n=t[e]={exports:{}};return o[e](n,n.exports,r),n.exports}r.d=(e,o)=>{for(var t in o)r.o(o,t)&&!r.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:o[t]})},r.o=(e,o)=>Object.prototype.hasOwnProperty.call(e,o),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var a={};return(()=>{r.r(a),r.d(a,{loadCogShape:()=>t});var e=r(533);class o{
|
|
2
|
+
!function(e,o){if("object"==typeof exports&&"object"==typeof module)module.exports=o(require("@tsparticles/engine"));else if("function"==typeof define&&define.amd)define(["@tsparticles/engine"],o);else{var t="object"==typeof exports?o(require("@tsparticles/engine")):o(e.window);for(var r in t)("object"==typeof exports?exports:e)[r]=t[r]}}(this,(e=>(()=>{"use strict";var o={533:o=>{o.exports=e}},t={};function r(e){var a=t[e];if(void 0!==a)return a.exports;var n=t[e]={exports:{}};return o[e](n,n.exports,r),n.exports}r.d=(e,o)=>{for(var t in o)r.o(o,t)&&!r.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:o[t]})},r.o=(e,o)=>Object.prototype.hasOwnProperty.call(e,o),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var a={};return(()=>{r.r(a),r.d(a,{loadCogShape:()=>t});var e=r(533);class o{afterDraw(e){const{context:o,particle:t,radius:r}=e;if(void 0===t.cogHoleRadius||void 0===t.cogInnerRadius||void 0===t.cogInnerTaper||void 0===t.cogNotches||void 0===t.cogOuterTaper)return;const a=2*Math.PI,n=r*t.cogHoleRadius/100;o.globalCompositeOperation="destination-out",o.beginPath(),o.moveTo(n,0),o.arc(0,0,n,0,a),o.closePath(),o.fill(),o.globalCompositeOperation="source-over"}draw(e){const{context:o,particle:t,radius:r}=e;if(void 0===t.cogHoleRadius||void 0===t.cogInnerRadius||void 0===t.cogInnerTaper||void 0===t.cogNotches||void 0===t.cogOuterTaper)return;const a=2*Math.PI,n=a/(2*t.cogNotches),i=n*t.cogInnerTaper*.005,s=n*t.cogOuterTaper*.005,c=r*t.cogInnerRadius/100;let p=n,d=!1;for(o.moveTo(r*Math.cos(s),r*Math.sin(s));p<=a;p+=n)d?(o.lineTo(c*Math.cos(p-i),c*Math.sin(p-i)),o.lineTo(r*Math.cos(p+s),r*Math.sin(p+s))):(o.lineTo(r*Math.cos(p-s),r*Math.sin(p-s)),o.lineTo(c*Math.cos(p+i),c*Math.sin(p+i))),d=!d}particleInit(o,t){const r=t.shapeData;t.cogHoleRadius=(0,e.getRangeValue)(r?.holeRadius??44),t.cogInnerRadius=(0,e.getRangeValue)(r?.innerRadius??72),t.cogInnerTaper=(0,e.getRangeValue)(r?.innerTaper??35),t.cogNotches=(0,e.getRangeValue)(r?.notches??7),t.cogOuterTaper=(0,e.getRangeValue)(r?.outerTaper??50)}}async function t(e,t=!0){await e.addShape("cog",new o,t)}})(),a})()));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
/*! tsParticles Cog Shape v3.0.0-beta.
|
|
1
|
+
/*! tsParticles Cog Shape v3.0.0-beta.5 by Matteo Bruni */
|
package/types/CogDrawer.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type Container, type IShapeDrawData, type IShapeDrawer } from "@tsparticles/engine";
|
|
2
2
|
import type { CogParticle } from "./CogParticle.js";
|
|
3
3
|
export declare class CogDrawer implements IShapeDrawer<CogParticle> {
|
|
4
|
-
|
|
4
|
+
afterDraw(data: IShapeDrawData<CogParticle>): void;
|
|
5
5
|
draw(data: IShapeDrawData<CogParticle>): void;
|
|
6
6
|
particleInit(container: Container, particle: CogParticle): void;
|
|
7
7
|
}
|
package/umd/CogDrawer.js
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
exports.CogDrawer = void 0;
|
|
13
13
|
const engine_1 = require("@tsparticles/engine");
|
|
14
14
|
class CogDrawer {
|
|
15
|
-
|
|
15
|
+
afterDraw(data) {
|
|
16
16
|
const { context, particle, radius } = data;
|
|
17
17
|
if (particle.cogHoleRadius === undefined ||
|
|
18
18
|
particle.cogInnerRadius === undefined ||
|