@tsparticles/confetti
Advanced tools
Comparing version 3.0.3 to 3.1.0
@@ -1,6 +0,6 @@ | ||
import { isSsr, isString, tsParticles, } from "@tsparticles/engine"; | ||
import { isSsr, isString, millisecondsToSeconds, tsParticles, } from "@tsparticles/engine"; | ||
import { loadEmittersPlugin } from "@tsparticles/plugin-emitters"; | ||
import { ConfettiOptions } from "./ConfettiOptions.js"; | ||
import { loadBasic } from "@tsparticles/basic"; | ||
import { loadCardsShape } from "@tsparticles/shape-cards"; | ||
import { loadEmittersPlugin } from "@tsparticles/plugin-emitters"; | ||
import { loadEmojiShape } from "@tsparticles/shape-emoji"; | ||
@@ -18,2 +18,3 @@ import { loadHeartShape } from "@tsparticles/shape-heart"; | ||
import { loadWobbleUpdater } from "@tsparticles/updater-wobble"; | ||
const defaultGravity = 9.81, sizeFactor = 5, speedFactor = 3, decayOffset = 1, disableRotate = 0, disableTilt = 0; | ||
let initialized = false; | ||
@@ -28,3 +29,3 @@ let initializing = false; | ||
return new Promise((resolve) => { | ||
const interval = setInterval(() => { | ||
const timeout = 100, interval = setInterval(() => { | ||
if (!initialized) { | ||
@@ -35,3 +36,3 @@ return; | ||
resolve(); | ||
}, 100); | ||
}, timeout); | ||
}); | ||
@@ -62,3 +63,3 @@ } | ||
let container; | ||
const fpsLimit = 120, opacitySpeed = (actualOptions.ticks * 1000) / (3600 * fpsLimit); | ||
const fpsLimit = 120, fpsLimitFactor = 3.6, opacitySpeed = (actualOptions.ticks * millisecondsToSeconds) / (fpsLimitFactor * millisecondsToSeconds * fpsLimit); | ||
if (ids.has(params.id)) { | ||
@@ -69,3 +70,3 @@ container = ids.get(params.id); | ||
if (alias.addEmitter) { | ||
alias.addEmitter({ | ||
await alias.addEmitter({ | ||
startCount: actualOptions.count, | ||
@@ -107,3 +108,3 @@ position: actualOptions.position, | ||
size: { | ||
value: 5 * actualOptions.scalar, | ||
value: sizeFactor * actualOptions.scalar, | ||
}, | ||
@@ -120,6 +121,6 @@ move: { | ||
gravity: { | ||
acceleration: actualOptions.gravity * 9.81, | ||
acceleration: actualOptions.gravity * defaultGravity, | ||
}, | ||
speed: actualOptions.startVelocity * 3, | ||
decay: 1 - actualOptions.decay, | ||
speed: actualOptions.startVelocity * speedFactor, | ||
decay: decayOffset - actualOptions.decay, | ||
direction: -actualOptions.angle, | ||
@@ -161,3 +162,3 @@ }, | ||
size: { | ||
value: 5 * actualOptions.scalar, | ||
value: sizeFactor * actualOptions.scalar, | ||
}, | ||
@@ -182,6 +183,6 @@ links: { | ||
enable: true, | ||
acceleration: actualOptions.gravity * 9.81, | ||
acceleration: actualOptions.gravity * defaultGravity, | ||
}, | ||
speed: actualOptions.startVelocity * 3, | ||
decay: 1 - actualOptions.decay, | ||
speed: actualOptions.startVelocity * speedFactor, | ||
decay: decayOffset - actualOptions.decay, | ||
direction: -actualOptions.angle, | ||
@@ -197,3 +198,3 @@ random: true, | ||
value: actualOptions.flat | ||
? 0 | ||
? disableRotate | ||
: { | ||
@@ -213,3 +214,3 @@ min: 0, | ||
value: actualOptions.flat | ||
? 0 | ||
? disableTilt | ||
: { | ||
@@ -292,3 +293,3 @@ min: 0, | ||
await initPlugins(tsParticles); | ||
const id = canvas.getAttribute("id") || "confetti"; | ||
const id = canvas.getAttribute("id") ?? "confetti"; | ||
canvas.setAttribute("id", id); | ||
@@ -295,0 +296,0 @@ return async (idOrOptions, confettiOptions) => { |
@@ -1,2 +0,2 @@ | ||
import { deepExtend, isArray, } from "@tsparticles/engine"; | ||
import { deepExtend, isArray, percentDenominator, } from "@tsparticles/engine"; | ||
export class ConfettiOptions { | ||
@@ -26,9 +26,9 @@ constructor() { | ||
return { | ||
x: this.position.x / 100, | ||
y: this.position.y / 100, | ||
x: this.position.x / percentDenominator, | ||
y: this.position.y / percentDenominator, | ||
}; | ||
} | ||
set origin(value) { | ||
this.position.x = value.x * 100; | ||
this.position.y = value.y * 100; | ||
this.position.x = value.x * percentDenominator; | ||
this.position.y = value.y * percentDenominator; | ||
} | ||
@@ -76,4 +76,4 @@ get particleCount() { | ||
data.position = { | ||
x: origin.x !== undefined ? origin.x * 100 : undefined, | ||
y: origin.y !== undefined ? origin.y * 100 : undefined, | ||
x: origin.x !== undefined ? origin.x * percentDenominator : undefined, | ||
y: origin.y !== undefined ? origin.y * percentDenominator : undefined, | ||
}; | ||
@@ -80,0 +80,0 @@ } |
@@ -5,6 +5,6 @@ "use strict"; | ||
const engine_1 = require("@tsparticles/engine"); | ||
const plugin_emitters_1 = require("@tsparticles/plugin-emitters"); | ||
const ConfettiOptions_js_1 = require("./ConfettiOptions.js"); | ||
const basic_1 = require("@tsparticles/basic"); | ||
const shape_cards_1 = require("@tsparticles/shape-cards"); | ||
const plugin_emitters_1 = require("@tsparticles/plugin-emitters"); | ||
const shape_emoji_1 = require("@tsparticles/shape-emoji"); | ||
@@ -22,2 +22,3 @@ const shape_heart_1 = require("@tsparticles/shape-heart"); | ||
const updater_wobble_1 = require("@tsparticles/updater-wobble"); | ||
const defaultGravity = 9.81, sizeFactor = 5, speedFactor = 3, decayOffset = 1, disableRotate = 0, disableTilt = 0; | ||
let initialized = false; | ||
@@ -32,3 +33,3 @@ let initializing = false; | ||
return new Promise((resolve) => { | ||
const interval = setInterval(() => { | ||
const timeout = 100, interval = setInterval(() => { | ||
if (!initialized) { | ||
@@ -39,3 +40,3 @@ return; | ||
resolve(); | ||
}, 100); | ||
}, timeout); | ||
}); | ||
@@ -66,3 +67,3 @@ } | ||
let container; | ||
const fpsLimit = 120, opacitySpeed = (actualOptions.ticks * 1000) / (3600 * fpsLimit); | ||
const fpsLimit = 120, fpsLimitFactor = 3.6, opacitySpeed = (actualOptions.ticks * engine_1.millisecondsToSeconds) / (fpsLimitFactor * engine_1.millisecondsToSeconds * fpsLimit); | ||
if (ids.has(params.id)) { | ||
@@ -73,3 +74,3 @@ container = ids.get(params.id); | ||
if (alias.addEmitter) { | ||
alias.addEmitter({ | ||
await alias.addEmitter({ | ||
startCount: actualOptions.count, | ||
@@ -111,3 +112,3 @@ position: actualOptions.position, | ||
size: { | ||
value: 5 * actualOptions.scalar, | ||
value: sizeFactor * actualOptions.scalar, | ||
}, | ||
@@ -124,6 +125,6 @@ move: { | ||
gravity: { | ||
acceleration: actualOptions.gravity * 9.81, | ||
acceleration: actualOptions.gravity * defaultGravity, | ||
}, | ||
speed: actualOptions.startVelocity * 3, | ||
decay: 1 - actualOptions.decay, | ||
speed: actualOptions.startVelocity * speedFactor, | ||
decay: decayOffset - actualOptions.decay, | ||
direction: -actualOptions.angle, | ||
@@ -165,3 +166,3 @@ }, | ||
size: { | ||
value: 5 * actualOptions.scalar, | ||
value: sizeFactor * actualOptions.scalar, | ||
}, | ||
@@ -186,6 +187,6 @@ links: { | ||
enable: true, | ||
acceleration: actualOptions.gravity * 9.81, | ||
acceleration: actualOptions.gravity * defaultGravity, | ||
}, | ||
speed: actualOptions.startVelocity * 3, | ||
decay: 1 - actualOptions.decay, | ||
speed: actualOptions.startVelocity * speedFactor, | ||
decay: decayOffset - actualOptions.decay, | ||
direction: -actualOptions.angle, | ||
@@ -201,3 +202,3 @@ random: true, | ||
value: actualOptions.flat | ||
? 0 | ||
? disableRotate | ||
: { | ||
@@ -217,3 +218,3 @@ min: 0, | ||
value: actualOptions.flat | ||
? 0 | ||
? disableTilt | ||
: { | ||
@@ -297,3 +298,3 @@ min: 0, | ||
await initPlugins(engine_1.tsParticles); | ||
const id = canvas.getAttribute("id") || "confetti"; | ||
const id = canvas.getAttribute("id") ?? "confetti"; | ||
canvas.setAttribute("id", id); | ||
@@ -300,0 +301,0 @@ return async (idOrOptions, confettiOptions) => { |
@@ -29,9 +29,9 @@ "use strict"; | ||
return { | ||
x: this.position.x / 100, | ||
y: this.position.y / 100, | ||
x: this.position.x / engine_1.percentDenominator, | ||
y: this.position.y / engine_1.percentDenominator, | ||
}; | ||
} | ||
set origin(value) { | ||
this.position.x = value.x * 100; | ||
this.position.y = value.y * 100; | ||
this.position.x = value.x * engine_1.percentDenominator; | ||
this.position.y = value.y * engine_1.percentDenominator; | ||
} | ||
@@ -79,4 +79,4 @@ get particleCount() { | ||
data.position = { | ||
x: origin.x !== undefined ? origin.x * 100 : undefined, | ||
y: origin.y !== undefined ? origin.y * 100 : undefined, | ||
x: origin.x !== undefined ? origin.x * engine_1.percentDenominator : undefined, | ||
y: origin.y !== undefined ? origin.y * engine_1.percentDenominator : undefined, | ||
}; | ||
@@ -83,0 +83,0 @@ } |
@@ -1,6 +0,6 @@ | ||
import { isSsr, isString, tsParticles, } from "@tsparticles/engine"; | ||
import { isSsr, isString, millisecondsToSeconds, tsParticles, } from "@tsparticles/engine"; | ||
import { loadEmittersPlugin } from "@tsparticles/plugin-emitters"; | ||
import { ConfettiOptions } from "./ConfettiOptions.js"; | ||
import { loadBasic } from "@tsparticles/basic"; | ||
import { loadCardsShape } from "@tsparticles/shape-cards"; | ||
import { loadEmittersPlugin } from "@tsparticles/plugin-emitters"; | ||
import { loadEmojiShape } from "@tsparticles/shape-emoji"; | ||
@@ -18,2 +18,3 @@ import { loadHeartShape } from "@tsparticles/shape-heart"; | ||
import { loadWobbleUpdater } from "@tsparticles/updater-wobble"; | ||
const defaultGravity = 9.81, sizeFactor = 5, speedFactor = 3, decayOffset = 1, disableRotate = 0, disableTilt = 0; | ||
let initialized = false; | ||
@@ -28,3 +29,3 @@ let initializing = false; | ||
return new Promise((resolve) => { | ||
const interval = setInterval(() => { | ||
const timeout = 100, interval = setInterval(() => { | ||
if (!initialized) { | ||
@@ -35,3 +36,3 @@ return; | ||
resolve(); | ||
}, 100); | ||
}, timeout); | ||
}); | ||
@@ -62,3 +63,3 @@ } | ||
let container; | ||
const fpsLimit = 120, opacitySpeed = (actualOptions.ticks * 1000) / (3600 * fpsLimit); | ||
const fpsLimit = 120, fpsLimitFactor = 3.6, opacitySpeed = (actualOptions.ticks * millisecondsToSeconds) / (fpsLimitFactor * millisecondsToSeconds * fpsLimit); | ||
if (ids.has(params.id)) { | ||
@@ -69,3 +70,3 @@ container = ids.get(params.id); | ||
if (alias.addEmitter) { | ||
alias.addEmitter({ | ||
await alias.addEmitter({ | ||
startCount: actualOptions.count, | ||
@@ -107,3 +108,3 @@ position: actualOptions.position, | ||
size: { | ||
value: 5 * actualOptions.scalar, | ||
value: sizeFactor * actualOptions.scalar, | ||
}, | ||
@@ -120,6 +121,6 @@ move: { | ||
gravity: { | ||
acceleration: actualOptions.gravity * 9.81, | ||
acceleration: actualOptions.gravity * defaultGravity, | ||
}, | ||
speed: actualOptions.startVelocity * 3, | ||
decay: 1 - actualOptions.decay, | ||
speed: actualOptions.startVelocity * speedFactor, | ||
decay: decayOffset - actualOptions.decay, | ||
direction: -actualOptions.angle, | ||
@@ -161,3 +162,3 @@ }, | ||
size: { | ||
value: 5 * actualOptions.scalar, | ||
value: sizeFactor * actualOptions.scalar, | ||
}, | ||
@@ -182,6 +183,6 @@ links: { | ||
enable: true, | ||
acceleration: actualOptions.gravity * 9.81, | ||
acceleration: actualOptions.gravity * defaultGravity, | ||
}, | ||
speed: actualOptions.startVelocity * 3, | ||
decay: 1 - actualOptions.decay, | ||
speed: actualOptions.startVelocity * speedFactor, | ||
decay: decayOffset - actualOptions.decay, | ||
direction: -actualOptions.angle, | ||
@@ -197,3 +198,3 @@ random: true, | ||
value: actualOptions.flat | ||
? 0 | ||
? disableRotate | ||
: { | ||
@@ -213,3 +214,3 @@ min: 0, | ||
value: actualOptions.flat | ||
? 0 | ||
? disableTilt | ||
: { | ||
@@ -292,3 +293,3 @@ min: 0, | ||
await initPlugins(tsParticles); | ||
const id = canvas.getAttribute("id") || "confetti"; | ||
const id = canvas.getAttribute("id") ?? "confetti"; | ||
canvas.setAttribute("id", id); | ||
@@ -295,0 +296,0 @@ return async (idOrOptions, confettiOptions) => { |
@@ -1,2 +0,2 @@ | ||
import { deepExtend, isArray, } from "@tsparticles/engine"; | ||
import { deepExtend, isArray, percentDenominator, } from "@tsparticles/engine"; | ||
export class ConfettiOptions { | ||
@@ -26,9 +26,9 @@ constructor() { | ||
return { | ||
x: this.position.x / 100, | ||
y: this.position.y / 100, | ||
x: this.position.x / percentDenominator, | ||
y: this.position.y / percentDenominator, | ||
}; | ||
} | ||
set origin(value) { | ||
this.position.x = value.x * 100; | ||
this.position.y = value.y * 100; | ||
this.position.x = value.x * percentDenominator; | ||
this.position.y = value.y * percentDenominator; | ||
} | ||
@@ -76,4 +76,4 @@ get particleCount() { | ||
data.position = { | ||
x: origin.x !== undefined ? origin.x * 100 : undefined, | ||
y: origin.y !== undefined ? origin.y * 100 : undefined, | ||
x: origin.x !== undefined ? origin.x * percentDenominator : undefined, | ||
y: origin.y !== undefined ? origin.y * percentDenominator : undefined, | ||
}; | ||
@@ -80,0 +80,0 @@ } |
{ | ||
"name": "@tsparticles/confetti", | ||
"version": "3.0.3", | ||
"version": "3.1.0", | ||
"description": "Easily create highly customizable particle animations and use them as animated backgrounds for your website. Ready to use components available also for React, Vue.js (2.x and 3.x), Angular, Svelte, jQuery, Preact, Riot.js, Inferno.", | ||
@@ -102,18 +102,18 @@ "homepage": "https://particles.js.org", | ||
"dependencies": { | ||
"@tsparticles/basic": "^3.0.3", | ||
"@tsparticles/engine": "^3.0.3", | ||
"@tsparticles/plugin-emitters": "^3.0.3", | ||
"@tsparticles/plugin-motion": "^3.0.3", | ||
"@tsparticles/shape-cards": "^3.0.3", | ||
"@tsparticles/shape-emoji": "^3.0.3", | ||
"@tsparticles/shape-heart": "^3.0.3", | ||
"@tsparticles/shape-image": "^3.0.3", | ||
"@tsparticles/shape-polygon": "^3.0.3", | ||
"@tsparticles/shape-square": "^3.0.3", | ||
"@tsparticles/shape-star": "^3.0.3", | ||
"@tsparticles/updater-life": "^3.0.3", | ||
"@tsparticles/updater-roll": "^3.0.3", | ||
"@tsparticles/updater-rotate": "^3.0.3", | ||
"@tsparticles/updater-tilt": "^3.0.3", | ||
"@tsparticles/updater-wobble": "^3.0.3" | ||
"@tsparticles/basic": "^3.1.0", | ||
"@tsparticles/engine": "^3.1.0", | ||
"@tsparticles/plugin-emitters": "^3.1.0", | ||
"@tsparticles/plugin-motion": "^3.1.0", | ||
"@tsparticles/shape-cards": "^3.1.0", | ||
"@tsparticles/shape-emoji": "^3.1.0", | ||
"@tsparticles/shape-heart": "^3.1.0", | ||
"@tsparticles/shape-image": "^3.1.0", | ||
"@tsparticles/shape-polygon": "^3.1.0", | ||
"@tsparticles/shape-square": "^3.1.0", | ||
"@tsparticles/shape-star": "^3.1.0", | ||
"@tsparticles/updater-life": "^3.1.0", | ||
"@tsparticles/updater-roll": "^3.1.0", | ||
"@tsparticles/updater-rotate": "^3.1.0", | ||
"@tsparticles/updater-tilt": "^3.1.0", | ||
"@tsparticles/updater-wobble": "^3.1.0" | ||
}, | ||
@@ -120,0 +120,0 @@ "publishConfig": { |
@@ -1,1 +0,1 @@ | ||
/*! tsParticles Confetti v3.0.3 by Matteo Bruni */ | ||
/*! tsParticles Confetti v3.1.0 by Matteo Bruni */ |
@@ -7,14 +7,14 @@ /*! | ||
* How to use? : Check the GitHub README | ||
* v3.0.3 | ||
* v3.1.0 | ||
*/ | ||
(function webpackUniversalModuleDefinition(root, factory) { | ||
if(typeof exports === 'object' && typeof module === 'object') | ||
module.exports = factory(require("@tsparticles/engine"), require("@tsparticles/basic"), require("@tsparticles/shape-cards"), require("@tsparticles/plugin-emitters"), require("@tsparticles/shape-emoji"), require("@tsparticles/shape-heart"), require("@tsparticles/shape-image"), require("@tsparticles/updater-life"), require("@tsparticles/plugin-motion"), require("@tsparticles/shape-polygon"), require("@tsparticles/updater-roll"), require("@tsparticles/updater-rotate"), require("@tsparticles/shape-square"), require("@tsparticles/shape-star"), require("@tsparticles/updater-tilt"), require("@tsparticles/updater-wobble")); | ||
module.exports = factory(require("@tsparticles/engine"), require("@tsparticles/plugin-emitters"), require("@tsparticles/basic"), require("@tsparticles/shape-cards"), require("@tsparticles/shape-emoji"), require("@tsparticles/shape-heart"), require("@tsparticles/shape-image"), require("@tsparticles/updater-life"), require("@tsparticles/plugin-motion"), require("@tsparticles/shape-polygon"), require("@tsparticles/updater-roll"), require("@tsparticles/updater-rotate"), require("@tsparticles/shape-square"), require("@tsparticles/shape-star"), require("@tsparticles/updater-tilt"), require("@tsparticles/updater-wobble")); | ||
else if(typeof define === 'function' && define.amd) | ||
define(["@tsparticles/engine", "@tsparticles/basic", "@tsparticles/shape-cards", "@tsparticles/plugin-emitters", "@tsparticles/shape-emoji", "@tsparticles/shape-heart", "@tsparticles/shape-image", "@tsparticles/updater-life", "@tsparticles/plugin-motion", "@tsparticles/shape-polygon", "@tsparticles/updater-roll", "@tsparticles/updater-rotate", "@tsparticles/shape-square", "@tsparticles/shape-star", "@tsparticles/updater-tilt", "@tsparticles/updater-wobble"], factory); | ||
define(["@tsparticles/engine", "@tsparticles/plugin-emitters", "@tsparticles/basic", "@tsparticles/shape-cards", "@tsparticles/shape-emoji", "@tsparticles/shape-heart", "@tsparticles/shape-image", "@tsparticles/updater-life", "@tsparticles/plugin-motion", "@tsparticles/shape-polygon", "@tsparticles/updater-roll", "@tsparticles/updater-rotate", "@tsparticles/shape-square", "@tsparticles/shape-star", "@tsparticles/updater-tilt", "@tsparticles/updater-wobble"], factory); | ||
else { | ||
var a = typeof exports === 'object' ? factory(require("@tsparticles/engine"), require("@tsparticles/basic"), require("@tsparticles/shape-cards"), require("@tsparticles/plugin-emitters"), require("@tsparticles/shape-emoji"), require("@tsparticles/shape-heart"), require("@tsparticles/shape-image"), require("@tsparticles/updater-life"), require("@tsparticles/plugin-motion"), require("@tsparticles/shape-polygon"), require("@tsparticles/updater-roll"), require("@tsparticles/updater-rotate"), require("@tsparticles/shape-square"), require("@tsparticles/shape-star"), require("@tsparticles/updater-tilt"), require("@tsparticles/updater-wobble")) : factory(root["window"], root["window"], root["window"], root["window"], root["window"], root["window"], root["window"], root["window"], root["window"], root["window"], root["window"], root["window"], root["window"], root["window"], root["window"], root["window"]); | ||
var a = typeof exports === 'object' ? factory(require("@tsparticles/engine"), require("@tsparticles/plugin-emitters"), require("@tsparticles/basic"), require("@tsparticles/shape-cards"), require("@tsparticles/shape-emoji"), require("@tsparticles/shape-heart"), require("@tsparticles/shape-image"), require("@tsparticles/updater-life"), require("@tsparticles/plugin-motion"), require("@tsparticles/shape-polygon"), require("@tsparticles/updater-roll"), require("@tsparticles/updater-rotate"), require("@tsparticles/shape-square"), require("@tsparticles/shape-star"), require("@tsparticles/updater-tilt"), require("@tsparticles/updater-wobble")) : factory(root["window"], root["window"], root["window"], root["window"], root["window"], root["window"], root["window"], root["window"], root["window"], root["window"], root["window"], root["window"], root["window"], root["window"], root["window"], root["window"]); | ||
for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i]; | ||
} | ||
})(this, (__WEBPACK_EXTERNAL_MODULE__533__, __WEBPACK_EXTERNAL_MODULE__574__, __WEBPACK_EXTERNAL_MODULE__686__, __WEBPACK_EXTERNAL_MODULE__68__, __WEBPACK_EXTERNAL_MODULE__151__, __WEBPACK_EXTERNAL_MODULE__12__, __WEBPACK_EXTERNAL_MODULE__885__, __WEBPACK_EXTERNAL_MODULE__84__, __WEBPACK_EXTERNAL_MODULE__82__, __WEBPACK_EXTERNAL_MODULE__907__, __WEBPACK_EXTERNAL_MODULE__734__, __WEBPACK_EXTERNAL_MODULE__59__, __WEBPACK_EXTERNAL_MODULE__652__, __WEBPACK_EXTERNAL_MODULE__960__, __WEBPACK_EXTERNAL_MODULE__448__, __WEBPACK_EXTERNAL_MODULE__83__) => { | ||
})(this, (__WEBPACK_EXTERNAL_MODULE__533__, __WEBPACK_EXTERNAL_MODULE__68__, __WEBPACK_EXTERNAL_MODULE__574__, __WEBPACK_EXTERNAL_MODULE__686__, __WEBPACK_EXTERNAL_MODULE__151__, __WEBPACK_EXTERNAL_MODULE__12__, __WEBPACK_EXTERNAL_MODULE__885__, __WEBPACK_EXTERNAL_MODULE__84__, __WEBPACK_EXTERNAL_MODULE__82__, __WEBPACK_EXTERNAL_MODULE__907__, __WEBPACK_EXTERNAL_MODULE__734__, __WEBPACK_EXTERNAL_MODULE__59__, __WEBPACK_EXTERNAL_MODULE__652__, __WEBPACK_EXTERNAL_MODULE__960__, __WEBPACK_EXTERNAL_MODULE__448__, __WEBPACK_EXTERNAL_MODULE__83__) => { | ||
return /******/ (() => { // webpackBootstrap | ||
@@ -205,2 +205,4 @@ /******/ "use strict"; | ||
var engine_root_window_ = __webpack_require__(533); | ||
// EXTERNAL MODULE: external {"commonjs":"@tsparticles/plugin-emitters","commonjs2":"@tsparticles/plugin-emitters","amd":"@tsparticles/plugin-emitters","root":"window"} | ||
var plugin_emitters_root_window_ = __webpack_require__(68); | ||
;// CONCATENATED MODULE: ./dist/browser/ConfettiOptions.js | ||
@@ -232,9 +234,9 @@ | ||
return { | ||
x: this.position.x / 100, | ||
y: this.position.y / 100 | ||
x: this.position.x / engine_root_window_.percentDenominator, | ||
y: this.position.y / engine_root_window_.percentDenominator | ||
}; | ||
} | ||
set origin(value) { | ||
this.position.x = value.x * 100; | ||
this.position.y = value.y * 100; | ||
this.position.x = value.x * engine_root_window_.percentDenominator; | ||
this.position.y = value.y * engine_root_window_.percentDenominator; | ||
} | ||
@@ -282,4 +284,4 @@ get particleCount() { | ||
data.position = { | ||
x: origin.x !== undefined ? origin.x * 100 : undefined, | ||
y: origin.y !== undefined ? origin.y * 100 : undefined | ||
x: origin.x !== undefined ? origin.x * engine_root_window_.percentDenominator : undefined, | ||
y: origin.y !== undefined ? origin.y * engine_root_window_.percentDenominator : undefined | ||
}; | ||
@@ -334,4 +336,2 @@ } | ||
var shape_cards_root_window_ = __webpack_require__(686); | ||
// EXTERNAL MODULE: external {"commonjs":"@tsparticles/plugin-emitters","commonjs2":"@tsparticles/plugin-emitters","amd":"@tsparticles/plugin-emitters","root":"window"} | ||
var plugin_emitters_root_window_ = __webpack_require__(68); | ||
// EXTERNAL MODULE: external {"commonjs":"@tsparticles/shape-emoji","commonjs2":"@tsparticles/shape-emoji","amd":"@tsparticles/shape-emoji","root":"window"} | ||
@@ -379,2 +379,8 @@ var shape_emoji_root_window_ = __webpack_require__(151); | ||
const defaultGravity = 9.81, | ||
sizeFactor = 5, | ||
speedFactor = 3, | ||
decayOffset = 1, | ||
disableRotate = 0, | ||
disableTilt = 0; | ||
let initialized = false; | ||
@@ -389,9 +395,10 @@ let initializing = false; | ||
return new Promise(resolve => { | ||
const interval = setInterval(() => { | ||
if (!initialized) { | ||
return; | ||
} | ||
clearInterval(interval); | ||
resolve(); | ||
}, 100); | ||
const timeout = 100, | ||
interval = setInterval(() => { | ||
if (!initialized) { | ||
return; | ||
} | ||
clearInterval(interval); | ||
resolve(); | ||
}, timeout); | ||
}); | ||
@@ -423,3 +430,4 @@ } | ||
const fpsLimit = 120, | ||
opacitySpeed = actualOptions.ticks * 1000 / (3600 * fpsLimit); | ||
fpsLimitFactor = 3.6, | ||
opacitySpeed = actualOptions.ticks * engine_root_window_.millisecondsToSeconds / (fpsLimitFactor * engine_root_window_.millisecondsToSeconds * fpsLimit); | ||
if (ids.has(params.id)) { | ||
@@ -430,3 +438,3 @@ container = ids.get(params.id); | ||
if (alias.addEmitter) { | ||
alias.addEmitter({ | ||
await alias.addEmitter({ | ||
startCount: actualOptions.count, | ||
@@ -471,3 +479,3 @@ position: actualOptions.position, | ||
size: { | ||
value: 5 * actualOptions.scalar | ||
value: sizeFactor * actualOptions.scalar | ||
}, | ||
@@ -484,6 +492,6 @@ move: { | ||
gravity: { | ||
acceleration: actualOptions.gravity * 9.81 | ||
acceleration: actualOptions.gravity * defaultGravity | ||
}, | ||
speed: actualOptions.startVelocity * 3, | ||
decay: 1 - actualOptions.decay, | ||
speed: actualOptions.startVelocity * speedFactor, | ||
decay: decayOffset - actualOptions.decay, | ||
direction: -actualOptions.angle | ||
@@ -528,3 +536,3 @@ } | ||
size: { | ||
value: 5 * actualOptions.scalar | ||
value: sizeFactor * actualOptions.scalar | ||
}, | ||
@@ -549,6 +557,6 @@ links: { | ||
enable: true, | ||
acceleration: actualOptions.gravity * 9.81 | ||
acceleration: actualOptions.gravity * defaultGravity | ||
}, | ||
speed: actualOptions.startVelocity * 3, | ||
decay: 1 - actualOptions.decay, | ||
speed: actualOptions.startVelocity * speedFactor, | ||
decay: decayOffset - actualOptions.decay, | ||
direction: -actualOptions.angle, | ||
@@ -563,3 +571,3 @@ random: true, | ||
rotate: { | ||
value: actualOptions.flat ? 0 : { | ||
value: actualOptions.flat ? disableRotate : { | ||
min: 0, | ||
@@ -577,3 +585,3 @@ max: 360 | ||
enable: !actualOptions.flat, | ||
value: actualOptions.flat ? 0 : { | ||
value: actualOptions.flat ? disableTilt : { | ||
min: 0, | ||
@@ -658,3 +666,3 @@ max: 360 | ||
await initPlugins(engine_root_window_.tsParticles); | ||
const id = canvas.getAttribute("id") || "confetti"; | ||
const id = canvas.getAttribute("id") ?? "confetti"; | ||
canvas.setAttribute("id", id); | ||
@@ -661,0 +669,0 @@ return async (idOrOptions, confettiOptions) => { |
/*! For license information please see tsparticles.confetti.min.js.LICENSE.txt */ | ||
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("@tsparticles/engine"),require("@tsparticles/basic"),require("@tsparticles/shape-cards"),require("@tsparticles/plugin-emitters"),require("@tsparticles/shape-emoji"),require("@tsparticles/shape-heart"),require("@tsparticles/shape-image"),require("@tsparticles/updater-life"),require("@tsparticles/plugin-motion"),require("@tsparticles/shape-polygon"),require("@tsparticles/updater-roll"),require("@tsparticles/updater-rotate"),require("@tsparticles/shape-square"),require("@tsparticles/shape-star"),require("@tsparticles/updater-tilt"),require("@tsparticles/updater-wobble"));else if("function"==typeof define&&define.amd)define(["@tsparticles/engine","@tsparticles/basic","@tsparticles/shape-cards","@tsparticles/plugin-emitters","@tsparticles/shape-emoji","@tsparticles/shape-heart","@tsparticles/shape-image","@tsparticles/updater-life","@tsparticles/plugin-motion","@tsparticles/shape-polygon","@tsparticles/updater-roll","@tsparticles/updater-rotate","@tsparticles/shape-square","@tsparticles/shape-star","@tsparticles/updater-tilt","@tsparticles/updater-wobble"],t);else{var i="object"==typeof exports?t(require("@tsparticles/engine"),require("@tsparticles/basic"),require("@tsparticles/shape-cards"),require("@tsparticles/plugin-emitters"),require("@tsparticles/shape-emoji"),require("@tsparticles/shape-heart"),require("@tsparticles/shape-image"),require("@tsparticles/updater-life"),require("@tsparticles/plugin-motion"),require("@tsparticles/shape-polygon"),require("@tsparticles/updater-roll"),require("@tsparticles/updater-rotate"),require("@tsparticles/shape-square"),require("@tsparticles/shape-star"),require("@tsparticles/updater-tilt"),require("@tsparticles/updater-wobble")):t(e.window,e.window,e.window,e.window,e.window,e.window,e.window,e.window,e.window,e.window,e.window,e.window,e.window,e.window,e.window,e.window);for(var a in i)("object"==typeof exports?exports:e)[a]=i[a]}}(this,((e,t,i,a,s,r,o,n,l,p,d,c,u,h,f,y)=>(()=>{"use strict";var v={574:e=>{e.exports=t},533:t=>{t.exports=e},68:e=>{e.exports=a},82:e=>{e.exports=l},686:e=>{e.exports=i},151:e=>{e.exports=s},12:e=>{e.exports=r},885:e=>{e.exports=o},907:e=>{e.exports=p},652:e=>{e.exports=u},960:e=>{e.exports=h},84:e=>{e.exports=n},734:e=>{e.exports=d},59:e=>{e.exports=c},448:e=>{e.exports=f},83:e=>{e.exports=y}},w={};function m(e){var t=w[e];if(void 0!==t)return t.exports;var i=w[e]={exports:{}};return v[e](i,i.exports,m),i.exports}m.d=(e,t)=>{for(var i in t)m.o(t,i)&&!m.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},m.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),m.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var x={};return(()=>{m.r(x),m.d(x,{confetti:()=>j});var e=m(533);class t{constructor(){this.angle=90,this.count=50,this.spread=45,this.startVelocity=45,this.decay=.9,this.gravity=1,this.drift=0,this.ticks=200,this.position={x:50,y:50},this.colors=["#26ccff","#a25afd","#ff5e7e","#88ff5a","#fcff42","#ffa62d","#ff36ff"],this.shapes=["square","circle"],this.scalar=1,this.zIndex=100,this.disableForReducedMotion=!0,this.flat=!1,this.shapeOptions={}}get origin(){return{x:this.position.x/100,y:this.position.y/100}}set origin(e){this.position.x=100*e.x,this.position.y=100*e.y}get particleCount(){return this.count}set particleCount(e){this.count=e}load(t){if(!t)return;void 0!==t.angle&&(this.angle=t.angle);const i=t.count??t.particleCount;void 0!==i&&(this.count=i),void 0!==t.spread&&(this.spread=t.spread),void 0!==t.startVelocity&&(this.startVelocity=t.startVelocity),void 0!==t.decay&&(this.decay=t.decay),void 0!==t.flat&&(this.flat=t.flat),void 0!==t.gravity&&(this.gravity=t.gravity),void 0!==t.drift&&(this.drift=t.drift),void 0!==t.ticks&&(this.ticks=t.ticks);const a=t.origin;a&&!t.position&&(t.position={x:void 0!==a.x?100*a.x:void 0,y:void 0!==a.y?100*a.y:void 0});const s=t.position;s&&(void 0!==s.x&&(this.position.x=s.x),void 0!==s.y&&(this.position.y=s.y)),void 0!==t.colors&&((0,e.isArray)(t.colors)?this.colors=[...t.colors]:this.colors=t.colors);const r=t.shapeOptions;if(void 0!==r)for(const t in r){const i=r[t];i&&(this.shapeOptions[t]=(0,e.deepExtend)(this.shapeOptions[t]??{},i))}void 0!==t.shapes&&((0,e.isArray)(t.shapes)?this.shapes=[...t.shapes]:this.shapes=t.shapes),void 0!==t.scalar&&(this.scalar=t.scalar),void 0!==t.zIndex&&(this.zIndex=t.zIndex),void 0!==t.disableForReducedMotion&&(this.disableForReducedMotion=t.disableForReducedMotion)}}var i=m(574),a=m(686),s=m(68),r=m(151),o=m(12),n=m(885),l=m(84),p=m(82),d=m(907),c=m(734),u=m(59),h=m(652),f=m(960),y=m(448),v=m(83);let w=!1,g=!1;const b=new Map;async function q(e){if(!w){if(g)return new Promise((e=>{const t=setInterval((()=>{w&&(clearInterval(t),e())}),100)}));g=!0,await(0,s.loadEmittersPlugin)(e,!1),await(0,p.loadMotionPlugin)(e,!1),await(0,a.loadCardsShape)(e,!1),await(0,o.loadHeartShape)(e,!1),await(0,n.loadImageShape)(e,!1),await(0,d.loadPolygonShape)(e,!1),await(0,h.loadSquareShape)(e,!1),await(0,f.loadStarShape)(e,!1),await(0,r.loadEmojiShape)(e,!1),await(0,u.loadRotateUpdater)(e,!1),await(0,l.loadLifeUpdater)(e,!1),await(0,c.loadRollUpdater)(e,!1),await(0,y.loadTiltUpdater)(e,!1),await(0,v.loadWobbleUpdater)(e,!1),await(0,i.loadBasic)(e),g=!1,w=!0}}async function S(i){const a=new t;let s;a.load(i.options);const r=1e3*a.ticks/432e3;if(b.has(i.id)&&(s=b.get(i.id),s&&!s.destroyed)){const e=s;if(e.addEmitter)return void e.addEmitter({startCount:a.count,position:a.position,size:{width:0,height:0},rate:{delay:0,quantity:0},life:{duration:.1,count:1},particles:{color:{value:a.colors},shape:{type:a.shapes,options:a.shapeOptions},life:{count:1},opacity:{value:{min:0,max:1},animation:{enable:!0,sync:!0,speed:r,startValue:"max",destroy:"min"}},size:{value:5*a.scalar},move:{angle:{value:a.spread,offset:0},drift:{min:-a.drift,max:a.drift},gravity:{acceleration:9.81*a.gravity},speed:3*a.startVelocity,decay:1-a.decay,direction:-a.angle}}})}const o={fullScreen:{enable:!i.canvas,zIndex:a.zIndex},fpsLimit:120,particles:{number:{value:0},color:{value:a.colors},shape:{type:a.shapes,options:a.shapeOptions},opacity:{value:{min:0,max:1},animation:{enable:!0,sync:!0,speed:r,startValue:"max",destroy:"min"}},size:{value:5*a.scalar},links:{enable:!1},life:{count:1},move:{angle:{value:a.spread,offset:0},drift:{min:-a.drift,max:a.drift},enable:!0,gravity:{enable:!0,acceleration:9.81*a.gravity},speed:3*a.startVelocity,decay:1-a.decay,direction:-a.angle,random:!0,straight:!1,outModes:{default:"none",bottom:"destroy"}},rotate:{value:a.flat?0:{min:0,max:360},direction:"random",animation:{enable:!a.flat,speed:60}},tilt:{direction:"random",enable:!a.flat,value:a.flat?0:{min:0,max:360},animation:{enable:!0,speed:60}},roll:{darken:{enable:!0,value:25},enable:!a.flat,speed:{min:15,max:25}},wobble:{distance:30,enable:!a.flat,speed:{min:-15,max:15}}},detectRetina:!0,motion:{disable:a.disableForReducedMotion},emitters:{name:"confetti",startCount:a.count,position:a.position,size:{width:0,height:0},rate:{delay:0,quantity:0},life:{duration:.1,count:1}}};return s=await e.tsParticles.load({id:i.id,element:i.canvas,options:o}),b.set(i.id,s),s}async function j(t,i){let a,s;return await q(e.tsParticles),(0,e.isString)(t)?(s=t,a=i??{}):(s="confetti",a=t),S({id:s,options:a})}j.create=async(t,i)=>{if(!t)return j;await q(e.tsParticles);const a=t.getAttribute("id")||"confetti";return t.setAttribute("id",a),async(s,r)=>{let o,n;return(0,e.isString)(s)?(n=s,o=r??i):(n=a,o=s),S({id:n,canvas:t,options:o})}},j.version=e.tsParticles.version,(0,e.isSsr)()||(window.confetti=j)})(),x})())); | ||
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("@tsparticles/engine"),require("@tsparticles/plugin-emitters"),require("@tsparticles/basic"),require("@tsparticles/shape-cards"),require("@tsparticles/shape-emoji"),require("@tsparticles/shape-heart"),require("@tsparticles/shape-image"),require("@tsparticles/updater-life"),require("@tsparticles/plugin-motion"),require("@tsparticles/shape-polygon"),require("@tsparticles/updater-roll"),require("@tsparticles/updater-rotate"),require("@tsparticles/shape-square"),require("@tsparticles/shape-star"),require("@tsparticles/updater-tilt"),require("@tsparticles/updater-wobble"));else if("function"==typeof define&&define.amd)define(["@tsparticles/engine","@tsparticles/plugin-emitters","@tsparticles/basic","@tsparticles/shape-cards","@tsparticles/shape-emoji","@tsparticles/shape-heart","@tsparticles/shape-image","@tsparticles/updater-life","@tsparticles/plugin-motion","@tsparticles/shape-polygon","@tsparticles/updater-roll","@tsparticles/updater-rotate","@tsparticles/shape-square","@tsparticles/shape-star","@tsparticles/updater-tilt","@tsparticles/updater-wobble"],t);else{var i="object"==typeof exports?t(require("@tsparticles/engine"),require("@tsparticles/plugin-emitters"),require("@tsparticles/basic"),require("@tsparticles/shape-cards"),require("@tsparticles/shape-emoji"),require("@tsparticles/shape-heart"),require("@tsparticles/shape-image"),require("@tsparticles/updater-life"),require("@tsparticles/plugin-motion"),require("@tsparticles/shape-polygon"),require("@tsparticles/updater-roll"),require("@tsparticles/updater-rotate"),require("@tsparticles/shape-square"),require("@tsparticles/shape-star"),require("@tsparticles/updater-tilt"),require("@tsparticles/updater-wobble")):t(e.window,e.window,e.window,e.window,e.window,e.window,e.window,e.window,e.window,e.window,e.window,e.window,e.window,e.window,e.window,e.window);for(var a in i)("object"==typeof exports?exports:e)[a]=i[a]}}(this,((e,t,i,a,s,r,o,n,l,p,d,c,u,h,f,y)=>(()=>{"use strict";var m={574:e=>{e.exports=i},533:t=>{t.exports=e},68:e=>{e.exports=t},82:e=>{e.exports=l},686:e=>{e.exports=a},151:e=>{e.exports=s},12:e=>{e.exports=r},885:e=>{e.exports=o},907:e=>{e.exports=p},652:e=>{e.exports=u},960:e=>{e.exports=h},84:e=>{e.exports=n},734:e=>{e.exports=d},59:e=>{e.exports=c},448:e=>{e.exports=f},83:e=>{e.exports=y}},v={};function w(e){var t=v[e];if(void 0!==t)return t.exports;var i=v[e]={exports:{}};return m[e](i,i.exports,w),i.exports}w.d=(e,t)=>{for(var i in t)w.o(t,i)&&!w.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},w.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),w.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var x={};return(()=>{w.r(x),w.d(x,{confetti:()=>R});var e=w(533),t=w(68);class i{constructor(){this.angle=90,this.count=50,this.spread=45,this.startVelocity=45,this.decay=.9,this.gravity=1,this.drift=0,this.ticks=200,this.position={x:50,y:50},this.colors=["#26ccff","#a25afd","#ff5e7e","#88ff5a","#fcff42","#ffa62d","#ff36ff"],this.shapes=["square","circle"],this.scalar=1,this.zIndex=100,this.disableForReducedMotion=!0,this.flat=!1,this.shapeOptions={}}get origin(){return{x:this.position.x/e.percentDenominator,y:this.position.y/e.percentDenominator}}set origin(t){this.position.x=t.x*e.percentDenominator,this.position.y=t.y*e.percentDenominator}get particleCount(){return this.count}set particleCount(e){this.count=e}load(t){if(!t)return;void 0!==t.angle&&(this.angle=t.angle);const i=t.count??t.particleCount;void 0!==i&&(this.count=i),void 0!==t.spread&&(this.spread=t.spread),void 0!==t.startVelocity&&(this.startVelocity=t.startVelocity),void 0!==t.decay&&(this.decay=t.decay),void 0!==t.flat&&(this.flat=t.flat),void 0!==t.gravity&&(this.gravity=t.gravity),void 0!==t.drift&&(this.drift=t.drift),void 0!==t.ticks&&(this.ticks=t.ticks);const a=t.origin;a&&!t.position&&(t.position={x:void 0!==a.x?a.x*e.percentDenominator:void 0,y:void 0!==a.y?a.y*e.percentDenominator:void 0});const s=t.position;s&&(void 0!==s.x&&(this.position.x=s.x),void 0!==s.y&&(this.position.y=s.y)),void 0!==t.colors&&((0,e.isArray)(t.colors)?this.colors=[...t.colors]:this.colors=t.colors);const r=t.shapeOptions;if(void 0!==r)for(const t in r){const i=r[t];i&&(this.shapeOptions[t]=(0,e.deepExtend)(this.shapeOptions[t]??{},i))}void 0!==t.shapes&&((0,e.isArray)(t.shapes)?this.shapes=[...t.shapes]:this.shapes=t.shapes),void 0!==t.scalar&&(this.scalar=t.scalar),void 0!==t.zIndex&&(this.zIndex=t.zIndex),void 0!==t.disableForReducedMotion&&(this.disableForReducedMotion=t.disableForReducedMotion)}}var a=w(574),s=w(686),r=w(151),o=w(12),n=w(885),l=w(84),p=w(82),d=w(907),c=w(734),u=w(59),h=w(652),f=w(960),y=w(448),m=w(83);const v=9.81,g=5,b=3,q=1,S=0,j=0;let P=!1,O=!1;const z=new Map;async function M(e){if(!P){if(O)return new Promise((e=>{const t=setInterval((()=>{P&&(clearInterval(t),e())}),100)}));O=!0,await(0,t.loadEmittersPlugin)(e,!1),await(0,p.loadMotionPlugin)(e,!1),await(0,s.loadCardsShape)(e,!1),await(0,o.loadHeartShape)(e,!1),await(0,n.loadImageShape)(e,!1),await(0,d.loadPolygonShape)(e,!1),await(0,h.loadSquareShape)(e,!1),await(0,f.loadStarShape)(e,!1),await(0,r.loadEmojiShape)(e,!1),await(0,u.loadRotateUpdater)(e,!1),await(0,l.loadLifeUpdater)(e,!1),await(0,c.loadRollUpdater)(e,!1),await(0,y.loadTiltUpdater)(e,!1),await(0,m.loadWobbleUpdater)(e,!1),await(0,a.loadBasic)(e),O=!1,P=!0}}async function I(t){const a=new i;let s;a.load(t.options);const r=a.ticks*e.millisecondsToSeconds/(3.6*e.millisecondsToSeconds*120);if(z.has(t.id)&&(s=z.get(t.id),s&&!s.destroyed)){const e=s;if(e.addEmitter)return void await e.addEmitter({startCount:a.count,position:a.position,size:{width:0,height:0},rate:{delay:0,quantity:0},life:{duration:.1,count:1},particles:{color:{value:a.colors},shape:{type:a.shapes,options:a.shapeOptions},life:{count:1},opacity:{value:{min:0,max:1},animation:{enable:!0,sync:!0,speed:r,startValue:"max",destroy:"min"}},size:{value:g*a.scalar},move:{angle:{value:a.spread,offset:0},drift:{min:-a.drift,max:a.drift},gravity:{acceleration:a.gravity*v},speed:a.startVelocity*b,decay:q-a.decay,direction:-a.angle}}})}const o={fullScreen:{enable:!t.canvas,zIndex:a.zIndex},fpsLimit:120,particles:{number:{value:0},color:{value:a.colors},shape:{type:a.shapes,options:a.shapeOptions},opacity:{value:{min:0,max:1},animation:{enable:!0,sync:!0,speed:r,startValue:"max",destroy:"min"}},size:{value:g*a.scalar},links:{enable:!1},life:{count:1},move:{angle:{value:a.spread,offset:0},drift:{min:-a.drift,max:a.drift},enable:!0,gravity:{enable:!0,acceleration:a.gravity*v},speed:a.startVelocity*b,decay:q-a.decay,direction:-a.angle,random:!0,straight:!1,outModes:{default:"none",bottom:"destroy"}},rotate:{value:a.flat?S:{min:0,max:360},direction:"random",animation:{enable:!a.flat,speed:60}},tilt:{direction:"random",enable:!a.flat,value:a.flat?j:{min:0,max:360},animation:{enable:!0,speed:60}},roll:{darken:{enable:!0,value:25},enable:!a.flat,speed:{min:15,max:25}},wobble:{distance:30,enable:!a.flat,speed:{min:-15,max:15}}},detectRetina:!0,motion:{disable:a.disableForReducedMotion},emitters:{name:"confetti",startCount:a.count,position:a.position,size:{width:0,height:0},rate:{delay:0,quantity:0},life:{duration:.1,count:1}}};return s=await e.tsParticles.load({id:t.id,element:t.canvas,options:o}),z.set(t.id,s),s}async function R(t,i){let a,s;return await M(e.tsParticles),(0,e.isString)(t)?(s=t,a=i??{}):(s="confetti",a=t),I({id:s,options:a})}R.create=async(t,i)=>{if(!t)return R;await M(e.tsParticles);const a=t.getAttribute("id")??"confetti";return t.setAttribute("id",a),async(s,r)=>{let o,n;return(0,e.isString)(s)?(n=s,o=r??i):(n=a,o=s),I({id:n,canvas:t,options:o})}},R.version=e.tsParticles.version,(0,e.isSsr)()||(window.confetti=R)})(),x})())); |
@@ -1,1 +0,1 @@ | ||
/*! tsParticles Confetti v3.0.3 by Matteo Bruni */ | ||
/*! tsParticles Confetti v3.1.0 by Matteo Bruni */ |
@@ -7,3 +7,3 @@ (function (factory) { | ||
else if (typeof define === "function" && define.amd) { | ||
define(["require", "exports", "@tsparticles/engine", "./ConfettiOptions.js", "@tsparticles/basic", "@tsparticles/shape-cards", "@tsparticles/plugin-emitters", "@tsparticles/shape-emoji", "@tsparticles/shape-heart", "@tsparticles/shape-image", "@tsparticles/updater-life", "@tsparticles/plugin-motion", "@tsparticles/shape-polygon", "@tsparticles/updater-roll", "@tsparticles/updater-rotate", "@tsparticles/shape-square", "@tsparticles/shape-star", "@tsparticles/updater-tilt", "@tsparticles/updater-wobble"], factory); | ||
define(["require", "exports", "@tsparticles/engine", "@tsparticles/plugin-emitters", "./ConfettiOptions.js", "@tsparticles/basic", "@tsparticles/shape-cards", "@tsparticles/shape-emoji", "@tsparticles/shape-heart", "@tsparticles/shape-image", "@tsparticles/updater-life", "@tsparticles/plugin-motion", "@tsparticles/shape-polygon", "@tsparticles/updater-roll", "@tsparticles/updater-rotate", "@tsparticles/shape-square", "@tsparticles/shape-star", "@tsparticles/updater-tilt", "@tsparticles/updater-wobble"], factory); | ||
} | ||
@@ -15,6 +15,6 @@ })(function (require, exports) { | ||
const engine_1 = require("@tsparticles/engine"); | ||
const plugin_emitters_1 = require("@tsparticles/plugin-emitters"); | ||
const ConfettiOptions_js_1 = require("./ConfettiOptions.js"); | ||
const basic_1 = require("@tsparticles/basic"); | ||
const shape_cards_1 = require("@tsparticles/shape-cards"); | ||
const plugin_emitters_1 = require("@tsparticles/plugin-emitters"); | ||
const shape_emoji_1 = require("@tsparticles/shape-emoji"); | ||
@@ -32,2 +32,3 @@ const shape_heart_1 = require("@tsparticles/shape-heart"); | ||
const updater_wobble_1 = require("@tsparticles/updater-wobble"); | ||
const defaultGravity = 9.81, sizeFactor = 5, speedFactor = 3, decayOffset = 1, disableRotate = 0, disableTilt = 0; | ||
let initialized = false; | ||
@@ -42,3 +43,3 @@ let initializing = false; | ||
return new Promise((resolve) => { | ||
const interval = setInterval(() => { | ||
const timeout = 100, interval = setInterval(() => { | ||
if (!initialized) { | ||
@@ -49,3 +50,3 @@ return; | ||
resolve(); | ||
}, 100); | ||
}, timeout); | ||
}); | ||
@@ -76,3 +77,3 @@ } | ||
let container; | ||
const fpsLimit = 120, opacitySpeed = (actualOptions.ticks * 1000) / (3600 * fpsLimit); | ||
const fpsLimit = 120, fpsLimitFactor = 3.6, opacitySpeed = (actualOptions.ticks * engine_1.millisecondsToSeconds) / (fpsLimitFactor * engine_1.millisecondsToSeconds * fpsLimit); | ||
if (ids.has(params.id)) { | ||
@@ -83,3 +84,3 @@ container = ids.get(params.id); | ||
if (alias.addEmitter) { | ||
alias.addEmitter({ | ||
await alias.addEmitter({ | ||
startCount: actualOptions.count, | ||
@@ -121,3 +122,3 @@ position: actualOptions.position, | ||
size: { | ||
value: 5 * actualOptions.scalar, | ||
value: sizeFactor * actualOptions.scalar, | ||
}, | ||
@@ -134,6 +135,6 @@ move: { | ||
gravity: { | ||
acceleration: actualOptions.gravity * 9.81, | ||
acceleration: actualOptions.gravity * defaultGravity, | ||
}, | ||
speed: actualOptions.startVelocity * 3, | ||
decay: 1 - actualOptions.decay, | ||
speed: actualOptions.startVelocity * speedFactor, | ||
decay: decayOffset - actualOptions.decay, | ||
direction: -actualOptions.angle, | ||
@@ -175,3 +176,3 @@ }, | ||
size: { | ||
value: 5 * actualOptions.scalar, | ||
value: sizeFactor * actualOptions.scalar, | ||
}, | ||
@@ -196,6 +197,6 @@ links: { | ||
enable: true, | ||
acceleration: actualOptions.gravity * 9.81, | ||
acceleration: actualOptions.gravity * defaultGravity, | ||
}, | ||
speed: actualOptions.startVelocity * 3, | ||
decay: 1 - actualOptions.decay, | ||
speed: actualOptions.startVelocity * speedFactor, | ||
decay: decayOffset - actualOptions.decay, | ||
direction: -actualOptions.angle, | ||
@@ -211,3 +212,3 @@ random: true, | ||
value: actualOptions.flat | ||
? 0 | ||
? disableRotate | ||
: { | ||
@@ -227,3 +228,3 @@ min: 0, | ||
value: actualOptions.flat | ||
? 0 | ||
? disableTilt | ||
: { | ||
@@ -307,3 +308,3 @@ min: 0, | ||
await initPlugins(engine_1.tsParticles); | ||
const id = canvas.getAttribute("id") || "confetti"; | ||
const id = canvas.getAttribute("id") ?? "confetti"; | ||
canvas.setAttribute("id", id); | ||
@@ -310,0 +311,0 @@ return async (idOrOptions, confettiOptions) => { |
@@ -38,9 +38,9 @@ (function (factory) { | ||
return { | ||
x: this.position.x / 100, | ||
y: this.position.y / 100, | ||
x: this.position.x / engine_1.percentDenominator, | ||
y: this.position.y / engine_1.percentDenominator, | ||
}; | ||
} | ||
set origin(value) { | ||
this.position.x = value.x * 100; | ||
this.position.y = value.y * 100; | ||
this.position.x = value.x * engine_1.percentDenominator; | ||
this.position.y = value.y * engine_1.percentDenominator; | ||
} | ||
@@ -88,4 +88,4 @@ get particleCount() { | ||
data.position = { | ||
x: origin.x !== undefined ? origin.x * 100 : undefined, | ||
y: origin.y !== undefined ? origin.y * 100 : undefined, | ||
x: origin.x !== undefined ? origin.x * engine_1.percentDenominator : undefined, | ||
y: origin.y !== undefined ? origin.y * engine_1.percentDenominator : undefined, | ||
}; | ||
@@ -92,0 +92,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
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
857268
12295
Updated@tsparticles/basic@^3.1.0
Updated@tsparticles/engine@^3.1.0