@tsparticles/updater-opacity
Advanced tools
Comparing version 3.2.2 to 3.3.0
@@ -6,3 +6,3 @@ import { getRandom, getRangeValue, initParticleNumericAnimationValue, percentDenominator, updateAnimation, } from "@tsparticles/engine"; | ||
} | ||
async init(particle) { | ||
init(particle) { | ||
const opacityOptions = particle.options.opacity, pxRatio = 1; | ||
@@ -18,3 +18,2 @@ particle.opacity = initParticleNumericAnimationValue(opacityOptions, pxRatio); | ||
} | ||
await Promise.resolve(); | ||
} | ||
@@ -37,3 +36,3 @@ isEnabled(particle) { | ||
} | ||
async update(particle, delta) { | ||
update(particle, delta) { | ||
if (!this.isEnabled(particle) || !particle.opacity) { | ||
@@ -43,4 +42,3 @@ return; | ||
updateAnimation(particle, particle.opacity, true, particle.options.opacity.animation.destroy, delta); | ||
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.loadOpacityUpdater = void 0; | ||
await engine.addParticleUpdater("opacity", async (container) => { | ||
const { OpacityUpdater } = await Promise.resolve().then(() => __importStar(require("./OpacityUpdater.js"))); | ||
const { OpacityUpdater } = await import("./OpacityUpdater.js"); | ||
return new OpacityUpdater(container); | ||
@@ -32,0 +9,0 @@ }, refresh); |
@@ -9,3 +9,3 @@ "use strict"; | ||
} | ||
async init(particle) { | ||
init(particle) { | ||
const opacityOptions = particle.options.opacity, pxRatio = 1; | ||
@@ -21,3 +21,2 @@ particle.opacity = (0, engine_1.initParticleNumericAnimationValue)(opacityOptions, pxRatio); | ||
} | ||
await Promise.resolve(); | ||
} | ||
@@ -40,3 +39,3 @@ isEnabled(particle) { | ||
} | ||
async update(particle, delta) { | ||
update(particle, delta) { | ||
if (!this.isEnabled(particle) || !particle.opacity) { | ||
@@ -46,5 +45,4 @@ return; | ||
(0, engine_1.updateAnimation)(particle, particle.opacity, true, particle.options.opacity.animation.destroy, delta); | ||
await Promise.resolve(); | ||
} | ||
} | ||
exports.OpacityUpdater = OpacityUpdater; |
@@ -7,3 +7,3 @@ /*! | ||
* How to use? : Check the GitHub README | ||
* v3.2.2 | ||
* v3.3.0 | ||
*/ | ||
@@ -27,3 +27,3 @@ "use strict"; | ||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ OpacityUpdater: () => (/* binding */ OpacityUpdater)\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\nclass OpacityUpdater {\n constructor(container) {\n this.container = container;\n }\n async init(particle) {\n const opacityOptions = particle.options.opacity,\n pxRatio = 1;\n particle.opacity = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.initParticleNumericAnimationValue)(opacityOptions, pxRatio);\n const opacityAnimation = opacityOptions.animation;\n if (opacityAnimation.enable) {\n particle.opacity.velocity = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeValue)(opacityAnimation.speed) / _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.percentDenominator * this.container.retina.reduceFactor;\n if (!opacityAnimation.sync) {\n particle.opacity.velocity *= (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRandom)();\n }\n }\n await Promise.resolve();\n }\n isEnabled(particle) {\n const none = 0;\n return !particle.destroyed && !particle.spawning && !!particle.opacity && particle.opacity.enable && ((particle.opacity.maxLoops ?? none) <= none || (particle.opacity.maxLoops ?? none) > none && (particle.opacity.loops ?? none) < (particle.opacity.maxLoops ?? none));\n }\n reset(particle) {\n if (particle.opacity) {\n particle.opacity.time = 0;\n particle.opacity.loops = 0;\n }\n }\n async update(particle, delta) {\n if (!this.isEnabled(particle) || !particle.opacity) {\n return;\n }\n (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.updateAnimation)(particle, particle.opacity, true, particle.options.opacity.animation.destroy, delta);\n await Promise.resolve();\n }\n}\n\n//# sourceURL=webpack://@tsparticles/updater-opacity/./dist/browser/OpacityUpdater.js?"); | ||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ OpacityUpdater: () => (/* binding */ OpacityUpdater)\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\nclass OpacityUpdater {\n constructor(container) {\n this.container = container;\n }\n init(particle) {\n const opacityOptions = particle.options.opacity,\n pxRatio = 1;\n particle.opacity = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.initParticleNumericAnimationValue)(opacityOptions, pxRatio);\n const opacityAnimation = opacityOptions.animation;\n if (opacityAnimation.enable) {\n particle.opacity.velocity = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeValue)(opacityAnimation.speed) / _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.percentDenominator * this.container.retina.reduceFactor;\n if (!opacityAnimation.sync) {\n particle.opacity.velocity *= (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRandom)();\n }\n }\n }\n isEnabled(particle) {\n const none = 0;\n return !particle.destroyed && !particle.spawning && !!particle.opacity && particle.opacity.enable && ((particle.opacity.maxLoops ?? none) <= none || (particle.opacity.maxLoops ?? none) > none && (particle.opacity.loops ?? none) < (particle.opacity.maxLoops ?? none));\n }\n reset(particle) {\n if (particle.opacity) {\n particle.opacity.time = 0;\n particle.opacity.loops = 0;\n }\n }\n update(particle, delta) {\n if (!this.isEnabled(particle) || !particle.opacity) {\n return;\n }\n (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.updateAnimation)(particle, particle.opacity, true, particle.options.opacity.animation.destroy, delta);\n }\n}\n\n//# sourceURL=webpack://@tsparticles/updater-opacity/./dist/browser/OpacityUpdater.js?"); | ||
@@ -30,0 +30,0 @@ /***/ }) |
@@ -6,3 +6,3 @@ import { getRandom, getRangeValue, initParticleNumericAnimationValue, percentDenominator, updateAnimation, } from "@tsparticles/engine"; | ||
} | ||
async init(particle) { | ||
init(particle) { | ||
const opacityOptions = particle.options.opacity, pxRatio = 1; | ||
@@ -18,3 +18,2 @@ particle.opacity = initParticleNumericAnimationValue(opacityOptions, pxRatio); | ||
} | ||
await Promise.resolve(); | ||
} | ||
@@ -37,3 +36,3 @@ isEnabled(particle) { | ||
} | ||
async update(particle, delta) { | ||
update(particle, delta) { | ||
if (!this.isEnabled(particle) || !particle.opacity) { | ||
@@ -43,4 +42,3 @@ return; | ||
updateAnimation(particle, particle.opacity, true, particle.options.opacity.animation.destroy, delta); | ||
await Promise.resolve(); | ||
} | ||
} |
{ | ||
"name": "@tsparticles/updater-opacity", | ||
"version": "3.2.2", | ||
"version": "3.3.0", | ||
"description": "tsParticles particles opacity 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.opacity.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 i(e){var t=n[e];if(void 0!==t)return t.exports;var r=n[e]={exports:{}};return o[e](r,r.exports,i),r.exports}i.m=o,i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t)=>{for(var r in t)i.o(t,r)&&!i.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},i.f={},i.e=e=>Promise.all(Object.keys(i.f).reduce(((t,r)=>(i.f[r](e,t),t)),[])),i.u=e=>e+".min.js",i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),t={},r="@tsparticles/updater-opacity:",i.l=(e,o,n,a)=>{if(t[e])t[e].push(o);else{var c,p;if(void 0!==n)for(var s=document.getElementsByTagName("script"),u=0;u<s.length;u++){var l=s[u];if(l.getAttribute("src")==e||l.getAttribute("data-webpack")==r+n){c=l;break}}c||(p=!0,(c=document.createElement("script")).charset="utf-8",c.timeout=120,i.nc&&c.setAttribute("nonce",i.nc),c.setAttribute("data-webpack",r+n),c.src=e),t[e]=[o];var d=(r,o)=>{c.onerror=c.onload=null,clearTimeout(f);var n=t[e];if(delete t[e],c.parentNode&&c.parentNode.removeChild(c),n&&n.forEach((e=>e(o))),r)return r(o)},f=setTimeout(d.bind(null,void 0,{type:"timeout",target:c}),12e4);c.onerror=d.bind(null,c.onerror),c.onload=d.bind(null,c.onload),p&&document.head.appendChild(c)}},i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;i.g.importScripts&&(e=i.g.location+"");var t=i.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(/\/[^\/]+$/,"/"),i.p=e})(),(()=>{var e={245:0};i.f.j=(t,r)=>{var o=i.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 a=i.p+i.u(t),c=new Error;i.l(a,(r=>{if(i.o(e,t)&&(0!==(o=e[t])&&(e[t]=void 0),o)){var n=r&&("load"===r.type?"missing":r.type),a=r&&r.target&&r.target.src;c.message="Loading chunk "+t+" failed.\n("+n+": "+a+")",c.name="ChunkLoadError",c.type=n,c.request=a,o[1](c)}}),"chunk-"+t,t)}};var t=(t,r)=>{var o,n,a=r[0],c=r[1],p=r[2],s=0;if(a.some((t=>0!==e[t]))){for(o in c)i.o(c,o)&&(i.m[o]=c[o]);if(p)p(i)}for(t&&t(r);s<a.length;s++)n=a[s],i.o(e,n)&&e[n]&&e[n][0](),e[n]=0},r=this.webpackChunk_tsparticles_updater_opacity=this.webpackChunk_tsparticles_updater_opacity||[];r.forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r))})();var a={};return(()=>{async function e(e,t=!0){await e.addParticleUpdater("opacity",(async e=>{const{OpacityUpdater:t}=await i.e(535).then(i.bind(i,535));return new t(e)}),t)}i.r(a),i.d(a,{loadOpacityUpdater:()=>e})})(),a})())); | ||
!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 i(e){var t=n[e];if(void 0!==t)return t.exports;var r=n[e]={exports:{}};return o[e](r,r.exports,i),r.exports}i.m=o,i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t)=>{for(var r in t)i.o(t,r)&&!i.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},i.f={},i.e=e=>Promise.all(Object.keys(i.f).reduce(((t,r)=>(i.f[r](e,t),t)),[])),i.u=e=>e+".min.js",i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),t={},r="@tsparticles/updater-opacity:",i.l=(e,o,n,a)=>{if(t[e])t[e].push(o);else{var p,s;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){p=l;break}}p||(s=!0,(p=document.createElement("script")).charset="utf-8",p.timeout=120,i.nc&&p.setAttribute("nonce",i.nc),p.setAttribute("data-webpack",r+n),p.src=e),t[e]=[o];var d=(r,o)=>{p.onerror=p.onload=null,clearTimeout(f);var n=t[e];if(delete t[e],p.parentNode&&p.parentNode.removeChild(p),n&&n.forEach((e=>e(o))),r)return r(o)},f=setTimeout(d.bind(null,void 0,{type:"timeout",target:p}),12e4);p.onerror=d.bind(null,p.onerror),p.onload=d.bind(null,p.onload),s&&document.head.appendChild(p)}},i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;i.g.importScripts&&(e=i.g.location+"");var t=i.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(/\/[^\/]+$/,"/"),i.p=e})(),(()=>{var e={647:0};i.f.j=(t,r)=>{var o=i.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 a=i.p+i.u(t),p=new Error;i.l(a,(r=>{if(i.o(e,t)&&(0!==(o=e[t])&&(e[t]=void 0),o)){var n=r&&("load"===r.type?"missing":r.type),a=r&&r.target&&r.target.src;p.message="Loading chunk "+t+" failed.\n("+n+": "+a+")",p.name="ChunkLoadError",p.type=n,p.request=a,o[1](p)}}),"chunk-"+t,t)}};var t=(t,r)=>{var o,n,a=r[0],p=r[1],s=r[2],c=0;if(a.some((t=>0!==e[t]))){for(o in p)i.o(p,o)&&(i.m[o]=p[o]);if(s)s(i)}for(t&&t(r);c<a.length;c++)n=a[c],i.o(e,n)&&e[n]&&e[n][0](),e[n]=0},r=this.webpackChunk_tsparticles_updater_opacity=this.webpackChunk_tsparticles_updater_opacity||[];r.forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r))})();var a={};return(()=>{async function e(e,t=!0){await e.addParticleUpdater("opacity",(async e=>{const{OpacityUpdater:t}=await i.e(831).then(i.bind(i,831));return new t(e)}),t)}i.r(a),i.d(a,{loadOpacityUpdater:()=>e})})(),a})())); |
@@ -1,1 +0,1 @@ | ||
/*! tsParticles Opacity Updater v3.2.2 by Matteo Bruni */ | ||
/*! tsParticles Opacity Updater v3.3.0 by Matteo Bruni */ |
@@ -5,6 +5,6 @@ import { type Container, type IDelta, type IParticleUpdater, type Particle } from "@tsparticles/engine"; | ||
constructor(container: Container); | ||
init(particle: Particle): Promise<void>; | ||
init(particle: Particle): void; | ||
isEnabled(particle: Particle): boolean; | ||
reset(particle: Particle): void; | ||
update(particle: Particle, delta: IDelta): Promise<void>; | ||
update(particle: Particle, delta: IDelta): void; | ||
} |
@@ -18,3 +18,3 @@ (function (factory) { | ||
} | ||
async init(particle) { | ||
init(particle) { | ||
const opacityOptions = particle.options.opacity, pxRatio = 1; | ||
@@ -30,3 +30,2 @@ particle.opacity = (0, engine_1.initParticleNumericAnimationValue)(opacityOptions, pxRatio); | ||
} | ||
await Promise.resolve(); | ||
} | ||
@@ -49,3 +48,3 @@ isEnabled(particle) { | ||
} | ||
async update(particle, delta) { | ||
update(particle, delta) { | ||
if (!this.isEnabled(particle) || !particle.opacity) { | ||
@@ -55,3 +54,2 @@ return; | ||
(0, engine_1.updateAnimation)(particle, particle.opacity, true, particle.options.opacity.animation.destroy, delta); | ||
await Promise.resolve(); | ||
} | ||
@@ -58,0 +56,0 @@ } |
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
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license.
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
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license.
Found 1 instance in 1 package
313738
609
Updated@tsparticles/engine@^3.3.0