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

@tsparticles/updater-twinkle

Package Overview
Dependencies
Maintainers
0
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tsparticles/updater-twinkle - npm Package Compare versions

Comparing version 3.6.0-beta.1 to 3.6.0

3

browser/Options/Classes/Twinkle.js

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

import { isNull } from "@tsparticles/engine";
import { TwinkleValues } from "./TwinkleValues.js";

@@ -8,3 +9,3 @@ export class Twinkle {

load(data) {
if (!data) {
if (isNull(data)) {
return;

@@ -11,0 +12,0 @@ }

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

import { OptionsColor, setRangeValue, } from "@tsparticles/engine";
import { OptionsColor, isNull, setRangeValue, } from "@tsparticles/engine";
export class TwinkleValues {

@@ -9,3 +9,3 @@ constructor() {

load(data) {
if (!data) {
if (isNull(data)) {
return;

@@ -12,0 +12,0 @@ }

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Twinkle = void 0;
const engine_1 = require("@tsparticles/engine");
const TwinkleValues_js_1 = require("./TwinkleValues.js");

@@ -11,3 +12,3 @@ class Twinkle {

load(data) {
if (!data) {
if ((0, engine_1.isNull)(data)) {
return;

@@ -14,0 +15,0 @@ }

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

load(data) {
if (!data) {
if ((0, engine_1.isNull)(data)) {
return;

@@ -15,0 +15,0 @@ }

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

import { isNull } from "@tsparticles/engine";
import { TwinkleValues } from "./TwinkleValues.js";

@@ -8,3 +9,3 @@ export class Twinkle {

load(data) {
if (!data) {
if (isNull(data)) {
return;

@@ -11,0 +12,0 @@ }

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

import { OptionsColor, setRangeValue, } from "@tsparticles/engine";
import { OptionsColor, isNull, setRangeValue, } from "@tsparticles/engine";
export class TwinkleValues {

@@ -9,3 +9,3 @@ constructor() {

load(data) {
if (!data) {
if (isNull(data)) {
return;

@@ -12,0 +12,0 @@ }

{
"name": "@tsparticles/updater-twinkle",
"version": "3.6.0-beta.1",
"version": "3.6.0",
"description": "tsParticles particles twinkle updater",

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

"dependencies": {
"@tsparticles/engine": "^3.6.0-beta.1"
"@tsparticles/engine": "^3.6.0"
},

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

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

* How to use? : Check the GitHub README
* v3.6.0-beta.1
* v3.6.0
*/

@@ -38,3 +38,3 @@ /*

eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Twinkle: () => (/* binding */ Twinkle)\n/* harmony export */ });\n/* harmony import */ var _TwinkleValues_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./TwinkleValues.js */ \"./dist/browser/Options/Classes/TwinkleValues.js\");\n\nclass Twinkle {\n constructor() {\n this.lines = new _TwinkleValues_js__WEBPACK_IMPORTED_MODULE_0__.TwinkleValues();\n this.particles = new _TwinkleValues_js__WEBPACK_IMPORTED_MODULE_0__.TwinkleValues();\n }\n load(data) {\n if (!data) {\n return;\n }\n this.lines.load(data.lines);\n this.particles.load(data.particles);\n }\n}\n\n//# sourceURL=webpack://@tsparticles/updater-twinkle/./dist/browser/Options/Classes/Twinkle.js?");
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Twinkle: () => (/* binding */ Twinkle)\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 _TwinkleValues_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./TwinkleValues.js */ \"./dist/browser/Options/Classes/TwinkleValues.js\");\n\n\nclass Twinkle {\n constructor() {\n this.lines = new _TwinkleValues_js__WEBPACK_IMPORTED_MODULE_1__.TwinkleValues();\n this.particles = new _TwinkleValues_js__WEBPACK_IMPORTED_MODULE_1__.TwinkleValues();\n }\n load(data) {\n if ((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isNull)(data)) {\n return;\n }\n this.lines.load(data.lines);\n this.particles.load(data.particles);\n }\n}\n\n//# sourceURL=webpack://@tsparticles/updater-twinkle/./dist/browser/Options/Classes/Twinkle.js?");

@@ -49,3 +49,3 @@ /***/ }),

eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ TwinkleValues: () => (/* binding */ TwinkleValues)\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 TwinkleValues {\n constructor() {\n this.enable = false;\n this.frequency = 0.05;\n this.opacity = 1;\n }\n load(data) {\n if (!data) {\n return;\n }\n if (data.color !== undefined) {\n this.color = _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.OptionsColor.create(this.color, data.color);\n }\n if (data.enable !== undefined) {\n this.enable = data.enable;\n }\n if (data.frequency !== undefined) {\n this.frequency = data.frequency;\n }\n if (data.opacity !== undefined) {\n this.opacity = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.setRangeValue)(data.opacity);\n }\n }\n}\n\n//# sourceURL=webpack://@tsparticles/updater-twinkle/./dist/browser/Options/Classes/TwinkleValues.js?");
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ TwinkleValues: () => (/* binding */ TwinkleValues)\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 TwinkleValues {\n constructor() {\n this.enable = false;\n this.frequency = 0.05;\n this.opacity = 1;\n }\n load(data) {\n if ((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isNull)(data)) {\n return;\n }\n if (data.color !== undefined) {\n this.color = _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.OptionsColor.create(this.color, data.color);\n }\n if (data.enable !== undefined) {\n this.enable = data.enable;\n }\n if (data.frequency !== undefined) {\n this.frequency = data.frequency;\n }\n if (data.opacity !== undefined) {\n this.opacity = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.setRangeValue)(data.opacity);\n }\n }\n}\n\n//# sourceURL=webpack://@tsparticles/updater-twinkle/./dist/browser/Options/Classes/TwinkleValues.js?");

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

/*! For license information please see tsparticles.updater.twinkle.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 o="object"==typeof exports?t(require("@tsparticles/engine")):t(e.window);for(var r in o)("object"==typeof exports?exports:e)[r]=o[r]}}(this,(e=>(()=>{var t={303:t=>{t.exports=e}},o={};function r(e){var i=o[e];if(void 0!==i)return i.exports;var n=o[e]={exports:{}};return t[e](n,n.exports,r),n.exports}r.d=(e,t)=>{for(var o in t)r.o(t,o)&&!r.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};r.r(i),r.d(i,{loadTwinkleUpdater:()=>c});var n=r(303);class s{constructor(){this.enable=!1,this.frequency=.05,this.opacity=1}load(e){e&&(void 0!==e.color&&(this.color=n.OptionsColor.create(this.color,e.color)),void 0!==e.enable&&(this.enable=e.enable),void 0!==e.frequency&&(this.frequency=e.frequency),void 0!==e.opacity&&(this.opacity=(0,n.setRangeValue)(e.opacity)))}}class a{constructor(){this.lines=new s,this.particles=new s}load(e){e&&(this.lines.load(e.lines),this.particles.load(e.particles))}}class l{getColorStyles(e,t,o,r){const i=e.options.twinkle;if(!i)return{};const s=i.particles,a=s.enable&&(0,n.getRandom)()<s.frequency,l=e.options.zIndex,c=(1-e.zIndexFactor)**l.opacityRate,p=a?(0,n.getRangeValue)(s.opacity)*c:r,d=(0,n.rangeColorToHsl)(s.color),f=d?(0,n.getStyleFromHsl)(d,p):void 0,u={},y=a&&f;return u.fill=y?f:void 0,u.stroke=y?f:void 0,u}async init(){await Promise.resolve()}isEnabled(e){const t=e.options.twinkle;return!!t&&t.particles.enable}loadOptions(e,...t){e.twinkle||(e.twinkle=new a);for(const o of t)e.twinkle.load(o?.twinkle)}async update(){await Promise.resolve()}}async function c(e,t=!0){await e.addParticleUpdater("twinkle",(()=>Promise.resolve(new l)),t)}return 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 o="object"==typeof exports?t(require("@tsparticles/engine")):t(e.window);for(var r in o)("object"==typeof exports?exports:e)[r]=o[r]}}(this,(e=>(()=>{var t={303:t=>{t.exports=e}},o={};function r(e){var i=o[e];if(void 0!==i)return i.exports;var n=o[e]={exports:{}};return t[e](n,n.exports,r),n.exports}r.d=(e,t)=>{for(var o in t)r.o(t,o)&&!r.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};r.r(i),r.d(i,{loadTwinkleUpdater:()=>c});var n=r(303);class s{constructor(){this.enable=!1,this.frequency=.05,this.opacity=1}load(e){(0,n.isNull)(e)||(void 0!==e.color&&(this.color=n.OptionsColor.create(this.color,e.color)),void 0!==e.enable&&(this.enable=e.enable),void 0!==e.frequency&&(this.frequency=e.frequency),void 0!==e.opacity&&(this.opacity=(0,n.setRangeValue)(e.opacity)))}}class l{constructor(){this.lines=new s,this.particles=new s}load(e){(0,n.isNull)(e)||(this.lines.load(e.lines),this.particles.load(e.particles))}}class a{getColorStyles(e,t,o,r){const i=e.options.twinkle;if(!i)return{};const s=i.particles,l=s.enable&&(0,n.getRandom)()<s.frequency,a=e.options.zIndex,c=(1-e.zIndexFactor)**a.opacityRate,p=l?(0,n.getRangeValue)(s.opacity)*c:r,d=(0,n.rangeColorToHsl)(s.color),u=d?(0,n.getStyleFromHsl)(d,p):void 0,f={},y=l&&u;return f.fill=y?u:void 0,f.stroke=y?u:void 0,f}async init(){await Promise.resolve()}isEnabled(e){const t=e.options.twinkle;return!!t&&t.particles.enable}loadOptions(e,...t){e.twinkle||(e.twinkle=new l);for(const o of t)e.twinkle.load(o?.twinkle)}async update(){await Promise.resolve()}}async function c(e,t=!0){await e.addParticleUpdater("twinkle",(()=>Promise.resolve(new a)),t)}return i})()));

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

/*! tsParticles Twinkle Updater v3.6.0-beta.1 by Matteo Bruni */
/*! tsParticles Twinkle Updater v3.6.0 by Matteo Bruni */

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

import type { IOptionLoader, RecursivePartial } from "@tsparticles/engine";
import { type IOptionLoader, type RecursivePartial } from "@tsparticles/engine";
import type { ITwinkle } from "../Interfaces/ITwinkle.js";

@@ -3,0 +3,0 @@ import { TwinkleValues } from "./TwinkleValues.js";

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

else if (typeof define === "function" && define.amd) {
define(["require", "exports", "./TwinkleValues.js"], factory);
define(["require", "exports", "@tsparticles/engine", "./TwinkleValues.js"], factory);
}

@@ -14,2 +14,3 @@ })(function (require, exports) {

exports.Twinkle = void 0;
const engine_1 = require("@tsparticles/engine");
const TwinkleValues_js_1 = require("./TwinkleValues.js");

@@ -22,3 +23,3 @@ class Twinkle {

load(data) {
if (!data) {
if ((0, engine_1.isNull)(data)) {
return;

@@ -25,0 +26,0 @@ }

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

load(data) {
if (!data) {
if ((0, engine_1.isNull)(data)) {
return;

@@ -24,0 +24,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