Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@tsparticles/updater-rotate

Package Overview
Dependencies
Maintainers
2
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tsparticles/updater-rotate - npm Package Compare versions

Comparing version 3.2.2 to 3.3.0

695.min.js

6

browser/RotateUpdater.js

@@ -8,3 +8,3 @@ import { degToRad, getRandom, getRangeValue, updateAnimation, } from "@tsparticles/engine";

}
async init(particle) {
init(particle) {
const rotateOptions = particle.options.rotate;

@@ -45,3 +45,2 @@ if (!rotateOptions) {

particle.rotation = particle.rotate.value;
await Promise.resolve();
}

@@ -63,3 +62,3 @@ isEnabled(particle) {

}
async update(particle, delta) {
update(particle, delta) {
if (!this.isEnabled(particle)) {

@@ -73,4 +72,3 @@ return;

particle.rotation = particle.rotate.value;
await Promise.resolve();
}
}
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });

@@ -29,3 +6,3 @@ exports.loadRotateUpdater = void 0;

await engine.addParticleUpdater("rotate", async (container) => {
const { RotateUpdater } = await Promise.resolve().then(() => __importStar(require("./RotateUpdater.js")));
const { RotateUpdater } = await import("./RotateUpdater.js");
return new RotateUpdater(container);

@@ -32,0 +9,0 @@ }, refresh);

@@ -11,3 +11,3 @@ "use strict";

}
async init(particle) {
init(particle) {
const rotateOptions = particle.options.rotate;

@@ -48,3 +48,2 @@ if (!rotateOptions) {

particle.rotation = particle.rotate.value;
await Promise.resolve();
}

@@ -66,3 +65,3 @@ isEnabled(particle) {

}
async update(particle, delta) {
update(particle, delta) {
if (!this.isEnabled(particle)) {

@@ -76,5 +75,4 @@ return;

particle.rotation = particle.rotate.value;
await Promise.resolve();
}
}
exports.RotateUpdater = RotateUpdater;

@@ -7,3 +7,3 @@ /*!

* How to use? : Check the GitHub README
* v3.2.2
* v3.3.0
*/

@@ -47,3 +47,3 @@ "use strict";

eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ RotateUpdater: () => (/* binding */ RotateUpdater)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _Options_Classes_Rotate_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Options/Classes/Rotate.js */ \"./dist/browser/Options/Classes/Rotate.js\");\n\n\nconst double = 2,\n doublePI = Math.PI * double,\n identity = 1,\n doublePIDeg = 360;\nclass RotateUpdater {\n constructor(container) {\n this.container = container;\n }\n async init(particle) {\n const rotateOptions = particle.options.rotate;\n if (!rotateOptions) {\n return;\n }\n particle.rotate = {\n enable: rotateOptions.animation.enable,\n value: (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.degToRad)((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeValue)(rotateOptions.value)),\n min: 0,\n max: doublePI\n };\n particle.pathRotation = rotateOptions.path;\n let rotateDirection = rotateOptions.direction;\n if (rotateDirection === \"random\") {\n const index = Math.floor((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRandom)() * double),\n minIndex = 0;\n rotateDirection = index > minIndex ? \"counter-clockwise\" : \"clockwise\";\n }\n switch (rotateDirection) {\n case \"counter-clockwise\":\n case \"counterClockwise\":\n particle.rotate.status = \"decreasing\";\n break;\n case \"clockwise\":\n particle.rotate.status = \"increasing\";\n break;\n }\n const rotateAnimation = rotateOptions.animation;\n if (rotateAnimation.enable) {\n particle.rotate.decay = identity - (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeValue)(rotateAnimation.decay);\n particle.rotate.velocity = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeValue)(rotateAnimation.speed) / doublePIDeg * this.container.retina.reduceFactor;\n if (!rotateAnimation.sync) {\n particle.rotate.velocity *= (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRandom)();\n }\n }\n particle.rotation = particle.rotate.value;\n await Promise.resolve();\n }\n isEnabled(particle) {\n const rotate = particle.options.rotate;\n if (!rotate) {\n return false;\n }\n return !particle.destroyed && !particle.spawning && rotate.animation.enable && !rotate.path;\n }\n loadOptions(options, ...sources) {\n if (!options.rotate) {\n options.rotate = new _Options_Classes_Rotate_js__WEBPACK_IMPORTED_MODULE_1__.Rotate();\n }\n for (const source of sources) {\n options.rotate.load(source?.rotate);\n }\n }\n async update(particle, delta) {\n if (!this.isEnabled(particle)) {\n return;\n }\n if (!particle.rotate) {\n return;\n }\n (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.updateAnimation)(particle, particle.rotate, false, \"none\", delta);\n particle.rotation = particle.rotate.value;\n await Promise.resolve();\n }\n}\n\n//# sourceURL=webpack://@tsparticles/updater-rotate/./dist/browser/RotateUpdater.js?");
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ RotateUpdater: () => (/* binding */ RotateUpdater)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _Options_Classes_Rotate_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Options/Classes/Rotate.js */ \"./dist/browser/Options/Classes/Rotate.js\");\n\n\nconst double = 2,\n doublePI = Math.PI * double,\n identity = 1,\n doublePIDeg = 360;\nclass RotateUpdater {\n constructor(container) {\n this.container = container;\n }\n init(particle) {\n const rotateOptions = particle.options.rotate;\n if (!rotateOptions) {\n return;\n }\n particle.rotate = {\n enable: rotateOptions.animation.enable,\n value: (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.degToRad)((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeValue)(rotateOptions.value)),\n min: 0,\n max: doublePI\n };\n particle.pathRotation = rotateOptions.path;\n let rotateDirection = rotateOptions.direction;\n if (rotateDirection === \"random\") {\n const index = Math.floor((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRandom)() * double),\n minIndex = 0;\n rotateDirection = index > minIndex ? \"counter-clockwise\" : \"clockwise\";\n }\n switch (rotateDirection) {\n case \"counter-clockwise\":\n case \"counterClockwise\":\n particle.rotate.status = \"decreasing\";\n break;\n case \"clockwise\":\n particle.rotate.status = \"increasing\";\n break;\n }\n const rotateAnimation = rotateOptions.animation;\n if (rotateAnimation.enable) {\n particle.rotate.decay = identity - (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeValue)(rotateAnimation.decay);\n particle.rotate.velocity = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeValue)(rotateAnimation.speed) / doublePIDeg * this.container.retina.reduceFactor;\n if (!rotateAnimation.sync) {\n particle.rotate.velocity *= (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRandom)();\n }\n }\n particle.rotation = particle.rotate.value;\n }\n isEnabled(particle) {\n const rotate = particle.options.rotate;\n if (!rotate) {\n return false;\n }\n return !particle.destroyed && !particle.spawning && rotate.animation.enable && !rotate.path;\n }\n loadOptions(options, ...sources) {\n if (!options.rotate) {\n options.rotate = new _Options_Classes_Rotate_js__WEBPACK_IMPORTED_MODULE_1__.Rotate();\n }\n for (const source of sources) {\n options.rotate.load(source?.rotate);\n }\n }\n update(particle, delta) {\n if (!this.isEnabled(particle)) {\n return;\n }\n if (!particle.rotate) {\n return;\n }\n (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.updateAnimation)(particle, particle.rotate, false, \"none\", delta);\n particle.rotation = particle.rotate.value;\n }\n}\n\n//# sourceURL=webpack://@tsparticles/updater-rotate/./dist/browser/RotateUpdater.js?");

@@ -50,0 +50,0 @@ /***/ })

@@ -8,3 +8,3 @@ import { degToRad, getRandom, getRangeValue, updateAnimation, } from "@tsparticles/engine";

}
async init(particle) {
init(particle) {
const rotateOptions = particle.options.rotate;

@@ -45,3 +45,2 @@ if (!rotateOptions) {

particle.rotation = particle.rotate.value;
await Promise.resolve();
}

@@ -63,3 +62,3 @@ isEnabled(particle) {

}
async update(particle, delta) {
update(particle, delta) {
if (!this.isEnabled(particle)) {

@@ -73,4 +72,3 @@ return;

particle.rotation = particle.rotate.value;
await Promise.resolve();
}
}
{
"name": "@tsparticles/updater-rotate",
"version": "3.2.2",
"version": "3.3.0",
"description": "tsParticles particles rotate updater",

@@ -90,3 +90,3 @@ "homepage": "https://particles.js.org",

"dependencies": {
"@tsparticles/engine": "^3.2.2"
"@tsparticles/engine": "^3.3.0"
},

@@ -93,0 +93,0 @@ "publishConfig": {

@@ -7,3 +7,3 @@ /*!

* How to use? : Check the GitHub README
* v3.2.2
* v3.3.0
*/

@@ -214,3 +214,3 @@ /*

/******/ var i = scripts.length - 1;
/******/ while (i > -1 && !scriptUrl) scriptUrl = scripts[i--].src;
/******/ while (i > -1 && (!scriptUrl || !/^http(s?):/.test(scriptUrl))) scriptUrl = scripts[i--].src;
/******/ }

@@ -217,0 +217,0 @@ /******/ }

/*! For license information please see tsparticles.updater.rotate.min.js.LICENSE.txt */
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("@tsparticles/engine"));else if("function"==typeof define&&define.amd)define(["@tsparticles/engine"],t);else{var r="object"==typeof exports?t(require("@tsparticles/engine")):t(e.window);for(var o in r)("object"==typeof exports?exports:e)[o]=r[o]}}(this,(e=>(()=>{var t,r,o={533:t=>{t.exports=e}},n={};function a(e){var t=n[e];if(void 0!==t)return t.exports;var r=n[e]={exports:{}};return o[e](r,r.exports,a),r.exports}a.m=o,a.d=(e,t)=>{for(var r in t)a.o(t,r)&&!a.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},a.f={},a.e=e=>Promise.all(Object.keys(a.f).reduce(((t,r)=>(a.f[r](e,t),t)),[])),a.u=e=>e+".min.js",a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),t={},r="@tsparticles/updater-rotate:",a.l=(e,o,n,i)=>{if(t[e])t[e].push(o);else{var s,c;if(void 0!==n)for(var p=document.getElementsByTagName("script"),u=0;u<p.length;u++){var l=p[u];if(l.getAttribute("src")==e||l.getAttribute("data-webpack")==r+n){s=l;break}}s||(c=!0,(s=document.createElement("script")).charset="utf-8",s.timeout=120,a.nc&&s.setAttribute("nonce",a.nc),s.setAttribute("data-webpack",r+n),s.src=e),t[e]=[o];var d=(r,o)=>{s.onerror=s.onload=null,clearTimeout(f);var n=t[e];if(delete t[e],s.parentNode&&s.parentNode.removeChild(s),n&&n.forEach((e=>e(o))),r)return r(o)},f=setTimeout(d.bind(null,void 0,{type:"timeout",target:s}),12e4);s.onerror=d.bind(null,s.onerror),s.onload=d.bind(null,s.onload),c&&document.head.appendChild(s)}},a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;a.g.importScripts&&(e=a.g.location+"");var t=a.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var r=t.getElementsByTagName("script");if(r.length)for(var o=r.length-1;o>-1&&!e;)e=r[o--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),a.p=e})(),(()=>{var e={800:0};a.f.j=(t,r)=>{var o=a.o(e,t)?e[t]:void 0;if(0!==o)if(o)r.push(o[2]);else{var n=new Promise(((r,n)=>o=e[t]=[r,n]));r.push(o[2]=n);var i=a.p+a.u(t),s=new Error;a.l(i,(r=>{if(a.o(e,t)&&(0!==(o=e[t])&&(e[t]=void 0),o)){var n=r&&("load"===r.type?"missing":r.type),i=r&&r.target&&r.target.src;s.message="Loading chunk "+t+" failed.\n("+n+": "+i+")",s.name="ChunkLoadError",s.type=n,s.request=i,o[1](s)}}),"chunk-"+t,t)}};var t=(t,r)=>{var o,n,i=r[0],s=r[1],c=r[2],p=0;if(i.some((t=>0!==e[t]))){for(o in s)a.o(s,o)&&(a.m[o]=s[o]);if(c)c(a)}for(t&&t(r);p<i.length;p++)n=i[p],a.o(e,n)&&e[n]&&e[n][0](),e[n]=0},r=this.webpackChunk_tsparticles_updater_rotate=this.webpackChunk_tsparticles_updater_rotate||[];r.forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r))})();var i={};return(()=>{async function e(e,t=!0){await e.addParticleUpdater("rotate",(async e=>{const{RotateUpdater:t}=await a.e(467).then(a.bind(a,467));return new t(e)}),t)}a.r(i),a.d(i,{loadRotateUpdater:()=>e})})(),i})()));
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("@tsparticles/engine"));else if("function"==typeof define&&define.amd)define(["@tsparticles/engine"],t);else{var r="object"==typeof exports?t(require("@tsparticles/engine")):t(e.window);for(var o in r)("object"==typeof exports?exports:e)[o]=r[o]}}(this,(e=>(()=>{var t,r,o={303:t=>{t.exports=e}},n={};function a(e){var t=n[e];if(void 0!==t)return t.exports;var r=n[e]={exports:{}};return o[e](r,r.exports,a),r.exports}a.m=o,a.d=(e,t)=>{for(var r in t)a.o(t,r)&&!a.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},a.f={},a.e=e=>Promise.all(Object.keys(a.f).reduce(((t,r)=>(a.f[r](e,t),t)),[])),a.u=e=>e+".min.js",a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),t={},r="@tsparticles/updater-rotate:",a.l=(e,o,n,i)=>{if(t[e])t[e].push(o);else{var s,p;if(void 0!==n)for(var c=document.getElementsByTagName("script"),u=0;u<c.length;u++){var l=c[u];if(l.getAttribute("src")==e||l.getAttribute("data-webpack")==r+n){s=l;break}}s||(p=!0,(s=document.createElement("script")).charset="utf-8",s.timeout=120,a.nc&&s.setAttribute("nonce",a.nc),s.setAttribute("data-webpack",r+n),s.src=e),t[e]=[o];var d=(r,o)=>{s.onerror=s.onload=null,clearTimeout(f);var n=t[e];if(delete t[e],s.parentNode&&s.parentNode.removeChild(s),n&&n.forEach((e=>e(o))),r)return r(o)},f=setTimeout(d.bind(null,void 0,{type:"timeout",target:s}),12e4);s.onerror=d.bind(null,s.onerror),s.onload=d.bind(null,s.onload),p&&document.head.appendChild(s)}},a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;a.g.importScripts&&(e=a.g.location+"");var t=a.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var r=t.getElementsByTagName("script");if(r.length)for(var o=r.length-1;o>-1&&(!e||!/^http(s?):/.test(e));)e=r[o--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),a.p=e})(),(()=>{var e={145:0};a.f.j=(t,r)=>{var o=a.o(e,t)?e[t]:void 0;if(0!==o)if(o)r.push(o[2]);else{var n=new Promise(((r,n)=>o=e[t]=[r,n]));r.push(o[2]=n);var i=a.p+a.u(t),s=new Error;a.l(i,(r=>{if(a.o(e,t)&&(0!==(o=e[t])&&(e[t]=void 0),o)){var n=r&&("load"===r.type?"missing":r.type),i=r&&r.target&&r.target.src;s.message="Loading chunk "+t+" failed.\n("+n+": "+i+")",s.name="ChunkLoadError",s.type=n,s.request=i,o[1](s)}}),"chunk-"+t,t)}};var t=(t,r)=>{var o,n,i=r[0],s=r[1],p=r[2],c=0;if(i.some((t=>0!==e[t]))){for(o in s)a.o(s,o)&&(a.m[o]=s[o]);if(p)p(a)}for(t&&t(r);c<i.length;c++)n=i[c],a.o(e,n)&&e[n]&&e[n][0](),e[n]=0},r=this.webpackChunk_tsparticles_updater_rotate=this.webpackChunk_tsparticles_updater_rotate||[];r.forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r))})();var i={};return(()=>{async function e(e,t=!0){await e.addParticleUpdater("rotate",(async e=>{const{RotateUpdater:t}=await a.e(695).then(a.bind(a,695));return new t(e)}),t)}a.r(i),a.d(i,{loadRotateUpdater:()=>e})})(),i})()));

@@ -1,1 +0,1 @@

/*! tsParticles Rotate Updater v3.2.2 by Matteo Bruni */
/*! tsParticles Rotate Updater v3.3.0 by Matteo Bruni */

@@ -17,7 +17,7 @@ import { type Container, type IDelta, type IParticleNumericValueAnimation, type IParticleUpdater, type IParticlesOptions, type Particle, type ParticlesOptions, type RecursivePartial } from "@tsparticles/engine";

constructor(container: Container);
init(particle: RotateParticle): Promise<void>;
init(particle: RotateParticle): void;
isEnabled(particle: RotateParticle): boolean;
loadOptions(options: RotateParticlesOptions, ...sources: (RecursivePartial<IRotateParticlesOptions> | undefined)[]): void;
update(particle: RotateParticle, delta: IDelta): Promise<void>;
update(particle: RotateParticle, delta: IDelta): void;
}
export {};

@@ -20,3 +20,3 @@ (function (factory) {

}
async init(particle) {
init(particle) {
const rotateOptions = particle.options.rotate;

@@ -57,3 +57,2 @@ if (!rotateOptions) {

particle.rotation = particle.rotate.value;
await Promise.resolve();
}

@@ -75,3 +74,3 @@ isEnabled(particle) {

}
async update(particle, delta) {
update(particle, delta) {
if (!this.isEnabled(particle)) {

@@ -85,3 +84,2 @@ return;

particle.rotation = particle.rotate.value;
await Promise.resolve();
}

@@ -88,0 +86,0 @@ }

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc