UNPKG

@tsparticles/confetti

Version:

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.

298 lines (240 loc) 38.4 kB
/*! * Author : Matteo Bruni * MIT license: https://opensource.org/licenses/MIT * Demo / Generator : https://particles.js.org/ * GitHub : https://www.github.com/matteobruni/tsparticles * How to use? : Check the GitHub README * v3.9.1 */ /* * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development"). * This devtool is neither made for production nor for readable output files. * It uses "eval()" calls to create a separate source file in the browser devtools. * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/) * or disable the default devtool with "devtool: false". * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/). */ (function webpackUniversalModuleDefinition(root, factory) { if(typeof exports === 'object' && typeof module === 'object') 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/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/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__tsparticles_engine__, __WEBPACK_EXTERNAL_MODULE__tsparticles_plugin_emitters__, __WEBPACK_EXTERNAL_MODULE__tsparticles_basic__, __WEBPACK_EXTERNAL_MODULE__tsparticles_shape_cards__, __WEBPACK_EXTERNAL_MODULE__tsparticles_shape_emoji__, __WEBPACK_EXTERNAL_MODULE__tsparticles_shape_heart__, __WEBPACK_EXTERNAL_MODULE__tsparticles_shape_image__, __WEBPACK_EXTERNAL_MODULE__tsparticles_updater_life__, __WEBPACK_EXTERNAL_MODULE__tsparticles_plugin_motion__, __WEBPACK_EXTERNAL_MODULE__tsparticles_shape_polygon__, __WEBPACK_EXTERNAL_MODULE__tsparticles_updater_roll__, __WEBPACK_EXTERNAL_MODULE__tsparticles_updater_rotate__, __WEBPACK_EXTERNAL_MODULE__tsparticles_shape_square__, __WEBPACK_EXTERNAL_MODULE__tsparticles_shape_star__, __WEBPACK_EXTERNAL_MODULE__tsparticles_updater_tilt__, __WEBPACK_EXTERNAL_MODULE__tsparticles_updater_wobble__) => { return /******/ (() => { // webpackBootstrap /******/ "use strict"; /******/ var __webpack_modules__ = ({ /***/ "./dist/browser/ConfettiOptions.js": /*!*****************************************!*\ !*** ./dist/browser/ConfettiOptions.js ***! \*****************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ ConfettiOptions: () => (/* binding */ ConfettiOptions)\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 ConfettiOptions {\n constructor() {\n this.angle = 90;\n this.count = 50;\n this.spread = 45;\n this.startVelocity = 45;\n this.decay = 0.9;\n this.gravity = 1;\n this.drift = 0;\n this.ticks = 200;\n this.position = {\n x: 50,\n y: 50\n };\n this.colors = [\"#26ccff\", \"#a25afd\", \"#ff5e7e\", \"#88ff5a\", \"#fcff42\", \"#ffa62d\", \"#ff36ff\"];\n this.shapes = [\"square\", \"circle\"];\n this.scalar = 1;\n this.zIndex = 100;\n this.disableForReducedMotion = true;\n this.flat = false;\n this.shapeOptions = {};\n }\n get origin() {\n return {\n x: this.position.x / _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.percentDenominator,\n y: this.position.y / _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.percentDenominator\n };\n }\n set origin(value) {\n this.position.x = value.x * _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.percentDenominator;\n this.position.y = value.y * _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.percentDenominator;\n }\n get particleCount() {\n return this.count;\n }\n set particleCount(value) {\n this.count = value;\n }\n load(data) {\n if ((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isNull)(data)) {\n return;\n }\n if (data.angle !== undefined) {\n this.angle = data.angle;\n }\n const count = data.count ?? data.particleCount;\n if (count !== undefined) {\n this.count = count;\n }\n if (data.spread !== undefined) {\n this.spread = data.spread;\n }\n if (data.startVelocity !== undefined) {\n this.startVelocity = data.startVelocity;\n }\n if (data.decay !== undefined) {\n this.decay = data.decay;\n }\n if (data.flat !== undefined) {\n this.flat = data.flat;\n }\n if (data.gravity !== undefined) {\n this.gravity = data.gravity;\n }\n if (data.drift !== undefined) {\n this.drift = data.drift;\n }\n if (data.ticks !== undefined) {\n this.ticks = data.ticks;\n }\n const origin = data.origin;\n if (origin && !data.position) {\n data.position = {\n x: origin.x !== undefined ? origin.x * _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.percentDenominator : undefined,\n y: origin.y !== undefined ? origin.y * _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.percentDenominator : undefined\n };\n }\n const position = data.position;\n if (position) {\n if (position.x !== undefined) {\n this.position.x = position.x;\n }\n if (position.y !== undefined) {\n this.position.y = position.y;\n }\n }\n if (data.colors !== undefined) {\n if ((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isArray)(data.colors)) {\n this.colors = [...data.colors];\n } else {\n this.colors = data.colors;\n }\n }\n const options = data.shapeOptions;\n if (options !== undefined) {\n for (const shape in options) {\n const item = options[shape];\n if (item) {\n this.shapeOptions[shape] = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.deepExtend)(this.shapeOptions[shape] ?? {}, item);\n }\n }\n }\n if (data.shapes !== undefined) {\n if ((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isArray)(data.shapes)) {\n this.shapes = [...data.shapes];\n } else {\n this.shapes = data.shapes;\n }\n }\n if (data.scalar !== undefined) {\n this.scalar = data.scalar;\n }\n if (data.zIndex !== undefined) {\n this.zIndex = data.zIndex;\n }\n if (data.disableForReducedMotion !== undefined) {\n this.disableForReducedMotion = data.disableForReducedMotion;\n }\n }\n}\n\n//# sourceURL=webpack://@tsparticles/confetti/./dist/browser/ConfettiOptions.js?\n}"); /***/ }), /***/ "./dist/browser/confetti.js": /*!**********************************!*\ !*** ./dist/browser/confetti.js ***! \**********************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ confetti: () => (/* binding */ confetti)\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 _tsparticles_plugin_emitters__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @tsparticles/plugin-emitters */ \"@tsparticles/plugin-emitters\");\n/* harmony import */ var _tsparticles_plugin_emitters__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_tsparticles_plugin_emitters__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _ConfettiOptions_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./ConfettiOptions.js */ \"./dist/browser/ConfettiOptions.js\");\n/* harmony import */ var _tsparticles_basic__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @tsparticles/basic */ \"@tsparticles/basic\");\n/* harmony import */ var _tsparticles_basic__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_tsparticles_basic__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _tsparticles_shape_cards__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @tsparticles/shape-cards */ \"@tsparticles/shape-cards\");\n/* harmony import */ var _tsparticles_shape_cards__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_tsparticles_shape_cards__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _tsparticles_shape_emoji__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @tsparticles/shape-emoji */ \"@tsparticles/shape-emoji\");\n/* harmony import */ var _tsparticles_shape_emoji__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_tsparticles_shape_emoji__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _tsparticles_shape_heart__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @tsparticles/shape-heart */ \"@tsparticles/shape-heart\");\n/* harmony import */ var _tsparticles_shape_heart__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_tsparticles_shape_heart__WEBPACK_IMPORTED_MODULE_6__);\n/* harmony import */ var _tsparticles_shape_image__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @tsparticles/shape-image */ \"@tsparticles/shape-image\");\n/* harmony import */ var _tsparticles_shape_image__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_tsparticles_shape_image__WEBPACK_IMPORTED_MODULE_7__);\n/* harmony import */ var _tsparticles_updater_life__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @tsparticles/updater-life */ \"@tsparticles/updater-life\");\n/* harmony import */ var _tsparticles_updater_life__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_tsparticles_updater_life__WEBPACK_IMPORTED_MODULE_8__);\n/* harmony import */ var _tsparticles_plugin_motion__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @tsparticles/plugin-motion */ \"@tsparticles/plugin-motion\");\n/* harmony import */ var _tsparticles_plugin_motion__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_tsparticles_plugin_motion__WEBPACK_IMPORTED_MODULE_9__);\n/* harmony import */ var _tsparticles_shape_polygon__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @tsparticles/shape-polygon */ \"@tsparticles/shape-polygon\");\n/* harmony import */ var _tsparticles_shape_polygon__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_tsparticles_shape_polygon__WEBPACK_IMPORTED_MODULE_10__);\n/* harmony import */ var _tsparticles_updater_roll__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @tsparticles/updater-roll */ \"@tsparticles/updater-roll\");\n/* harmony import */ var _tsparticles_updater_roll__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_tsparticles_updater_roll__WEBPACK_IMPORTED_MODULE_11__);\n/* harmony import */ var _tsparticles_updater_rotate__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @tsparticles/updater-rotate */ \"@tsparticles/updater-rotate\");\n/* harmony import */ var _tsparticles_updater_rotate__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(_tsparticles_updater_rotate__WEBPACK_IMPORTED_MODULE_12__);\n/* harmony import */ var _tsparticles_shape_square__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @tsparticles/shape-square */ \"@tsparticles/shape-square\");\n/* harmony import */ var _tsparticles_shape_square__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(_tsparticles_shape_square__WEBPACK_IMPORTED_MODULE_13__);\n/* harmony import */ var _tsparticles_shape_star__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @tsparticles/shape-star */ \"@tsparticles/shape-star\");\n/* harmony import */ var _tsparticles_shape_star__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(_tsparticles_shape_star__WEBPACK_IMPORTED_MODULE_14__);\n/* harmony import */ var _tsparticles_updater_tilt__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @tsparticles/updater-tilt */ \"@tsparticles/updater-tilt\");\n/* harmony import */ var _tsparticles_updater_tilt__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(_tsparticles_updater_tilt__WEBPACK_IMPORTED_MODULE_15__);\n/* harmony import */ var _tsparticles_updater_wobble__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @tsparticles/updater-wobble */ \"@tsparticles/updater-wobble\");\n/* harmony import */ var _tsparticles_updater_wobble__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(_tsparticles_updater_wobble__WEBPACK_IMPORTED_MODULE_16__);\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nconst defaultGravity = 9.81,\n sizeFactor = 5,\n speedFactor = 3,\n decayOffset = 1,\n disableRotate = 0,\n disableTilt = 0;\nlet initialized = false;\nlet initializing = false;\nconst ids = new Map();\nasync function initPlugins(engine) {\n if (initialized) {\n return;\n }\n if (initializing) {\n return new Promise(resolve => {\n const timeout = 100,\n interval = setInterval(() => {\n if (!initialized) {\n return;\n }\n clearInterval(interval);\n resolve();\n }, timeout);\n });\n }\n initializing = true;\n engine.checkVersion(\"3.9.1\");\n await (0,_tsparticles_plugin_emitters__WEBPACK_IMPORTED_MODULE_1__.loadEmittersPlugin)(engine, false);\n await (0,_tsparticles_plugin_motion__WEBPACK_IMPORTED_MODULE_9__.loadMotionPlugin)(engine, false);\n await (0,_tsparticles_shape_cards__WEBPACK_IMPORTED_MODULE_4__.loadCardsShape)(engine, false);\n await (0,_tsparticles_shape_heart__WEBPACK_IMPORTED_MODULE_6__.loadHeartShape)(engine, false);\n await (0,_tsparticles_shape_image__WEBPACK_IMPORTED_MODULE_7__.loadImageShape)(engine, false);\n await (0,_tsparticles_shape_polygon__WEBPACK_IMPORTED_MODULE_10__.loadPolygonShape)(engine, false);\n await (0,_tsparticles_shape_square__WEBPACK_IMPORTED_MODULE_13__.loadSquareShape)(engine, false);\n await (0,_tsparticles_shape_star__WEBPACK_IMPORTED_MODULE_14__.loadStarShape)(engine, false);\n await (0,_tsparticles_shape_emoji__WEBPACK_IMPORTED_MODULE_5__.loadEmojiShape)(engine, false);\n await (0,_tsparticles_updater_rotate__WEBPACK_IMPORTED_MODULE_12__.loadRotateUpdater)(engine, false);\n await (0,_tsparticles_updater_life__WEBPACK_IMPORTED_MODULE_8__.loadLifeUpdater)(engine, false);\n await (0,_tsparticles_updater_roll__WEBPACK_IMPORTED_MODULE_11__.loadRollUpdater)(engine, false);\n await (0,_tsparticles_updater_tilt__WEBPACK_IMPORTED_MODULE_15__.loadTiltUpdater)(engine, false);\n await (0,_tsparticles_updater_wobble__WEBPACK_IMPORTED_MODULE_16__.loadWobbleUpdater)(engine, false);\n await (0,_tsparticles_basic__WEBPACK_IMPORTED_MODULE_3__.loadBasic)(engine);\n initializing = false;\n initialized = true;\n}\nasync function setConfetti(params) {\n const actualOptions = new _ConfettiOptions_js__WEBPACK_IMPORTED_MODULE_2__.ConfettiOptions();\n actualOptions.load(params.options);\n let container;\n const fpsLimit = 120,\n fpsLimitFactor = 3.6,\n opacitySpeed = actualOptions.ticks * _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.millisecondsToSeconds / (fpsLimitFactor * _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.millisecondsToSeconds * fpsLimit);\n if (ids.has(params.id)) {\n container = ids.get(params.id);\n if (container && !container.destroyed) {\n const alias = container;\n if (alias.addEmitter) {\n await alias.addEmitter({\n startCount: actualOptions.count,\n position: actualOptions.position,\n size: {\n width: 0,\n height: 0\n },\n rate: {\n delay: 0,\n quantity: 0\n },\n life: {\n duration: 0.1,\n count: 1\n },\n particles: {\n color: {\n value: actualOptions.colors\n },\n shape: {\n type: actualOptions.shapes,\n options: actualOptions.shapeOptions\n },\n life: {\n count: 1\n },\n opacity: {\n value: {\n min: 0,\n max: 1\n },\n animation: {\n enable: true,\n sync: true,\n speed: opacitySpeed,\n startValue: \"max\",\n destroy: \"min\"\n }\n },\n size: {\n value: sizeFactor * actualOptions.scalar\n },\n move: {\n angle: {\n value: actualOptions.spread,\n offset: 0\n },\n drift: {\n min: -actualOptions.drift,\n max: actualOptions.drift\n },\n gravity: {\n acceleration: actualOptions.gravity * defaultGravity\n },\n speed: actualOptions.startVelocity * speedFactor,\n decay: decayOffset - actualOptions.decay,\n direction: -actualOptions.angle\n },\n rotate: {\n value: actualOptions.flat ? disableRotate : {\n min: 0,\n max: 360\n },\n direction: \"random\",\n animation: {\n enable: !actualOptions.flat,\n speed: 60\n }\n },\n tilt: {\n direction: \"random\",\n enable: !actualOptions.flat,\n value: actualOptions.flat ? disableTilt : {\n min: 0,\n max: 360\n },\n animation: {\n enable: true,\n speed: 60\n }\n },\n roll: {\n darken: {\n enable: true,\n value: 25\n },\n enable: !actualOptions.flat,\n speed: {\n min: 15,\n max: 25\n }\n },\n wobble: {\n distance: 30,\n enable: !actualOptions.flat,\n speed: {\n min: -15,\n max: 15\n }\n }\n }\n });\n return;\n }\n }\n }\n const particlesOptions = {\n fullScreen: {\n enable: !params.canvas,\n zIndex: actualOptions.zIndex\n },\n fpsLimit: 120,\n particles: {\n number: {\n value: 0\n },\n color: {\n value: actualOptions.colors\n },\n shape: {\n type: actualOptions.shapes,\n options: actualOptions.shapeOptions\n },\n opacity: {\n value: {\n min: 0,\n max: 1\n },\n animation: {\n enable: true,\n sync: true,\n speed: opacitySpeed,\n startValue: \"max\",\n destroy: \"min\"\n }\n },\n size: {\n value: sizeFactor * actualOptions.scalar\n },\n links: {\n enable: false\n },\n life: {\n count: 1\n },\n move: {\n angle: {\n value: actualOptions.spread,\n offset: 0\n },\n drift: {\n min: -actualOptions.drift,\n max: actualOptions.drift\n },\n enable: true,\n gravity: {\n enable: true,\n acceleration: actualOptions.gravity * defaultGravity\n },\n speed: actualOptions.startVelocity * speedFactor,\n decay: decayOffset - actualOptions.decay,\n direction: -actualOptions.angle,\n random: true,\n straight: false,\n outModes: {\n default: \"none\",\n bottom: \"destroy\"\n }\n },\n rotate: {\n value: actualOptions.flat ? disableRotate : {\n min: 0,\n max: 360\n },\n direction: \"random\",\n animation: {\n enable: !actualOptions.flat,\n speed: 60\n }\n },\n tilt: {\n direction: \"random\",\n enable: !actualOptions.flat,\n value: actualOptions.flat ? disableTilt : {\n min: 0,\n max: 360\n },\n animation: {\n enable: true,\n speed: 60\n }\n },\n roll: {\n darken: {\n enable: true,\n value: 25\n },\n enable: !actualOptions.flat,\n speed: {\n min: 15,\n max: 25\n }\n },\n wobble: {\n distance: 30,\n enable: !actualOptions.flat,\n speed: {\n min: -15,\n max: 15\n }\n }\n },\n detectRetina: true,\n motion: {\n disable: actualOptions.disableForReducedMotion\n },\n emitters: {\n name: \"confetti\",\n startCount: actualOptions.count,\n position: actualOptions.position,\n size: {\n width: 0,\n height: 0\n },\n rate: {\n delay: 0,\n quantity: 0\n },\n life: {\n duration: 0.1,\n count: 1\n }\n }\n };\n container = await _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.tsParticles.load({\n id: params.id,\n element: params.canvas,\n options: particlesOptions\n });\n ids.set(params.id, container);\n return container;\n}\nasync function confetti(idOrOptions, confettiOptions) {\n await initPlugins(_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.tsParticles);\n let options;\n let id;\n if ((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isString)(idOrOptions)) {\n id = idOrOptions;\n options = confettiOptions ?? {};\n } else {\n id = \"confetti\";\n options = idOrOptions;\n }\n return setConfetti({\n id,\n options\n });\n}\nconfetti.create = async (canvas, options) => {\n if (!canvas) {\n return confetti;\n }\n await initPlugins(_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.tsParticles);\n const id = canvas.getAttribute(\"id\") ?? \"confetti\";\n canvas.setAttribute(\"id\", id);\n return async (idOrOptions, confettiOptions) => {\n let subOptions;\n let subId;\n if ((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isString)(idOrOptions)) {\n subId = idOrOptions;\n subOptions = confettiOptions ?? options;\n } else {\n subId = id;\n subOptions = idOrOptions;\n }\n return setConfetti({\n id: subId,\n canvas,\n options: subOptions\n });\n };\n};\nconfetti.init = async () => {\n await initPlugins(_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.tsParticles);\n};\nconfetti.version = \"3.9.1\";\nif (!(0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isSsr)()) {\n window.confetti = confetti;\n}\n\n//# sourceURL=webpack://@tsparticles/confetti/./dist/browser/confetti.js?\n}"); /***/ }), /***/ "./dist/browser/index.js": /*!*******************************!*\ !*** ./dist/browser/index.js ***! \*******************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ confetti: () => (/* reexport safe */ _confetti_js__WEBPACK_IMPORTED_MODULE_0__.confetti)\n/* harmony export */ });\n/* harmony import */ var _confetti_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./confetti.js */ \"./dist/browser/confetti.js\");\n\n\n//# sourceURL=webpack://@tsparticles/confetti/./dist/browser/index.js?\n}"); /***/ }), /***/ "@tsparticles/basic": /*!******************************************************************************************************************************!*\ !*** external {"commonjs":"@tsparticles/basic","commonjs2":"@tsparticles/basic","amd":"@tsparticles/basic","root":"window"} ***! \******************************************************************************************************************************/ /***/ ((module) => { module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_basic__; /***/ }), /***/ "@tsparticles/engine": /*!*********************************************************************************************************************************!*\ !*** external {"commonjs":"@tsparticles/engine","commonjs2":"@tsparticles/engine","amd":"@tsparticles/engine","root":"window"} ***! \*********************************************************************************************************************************/ /***/ ((module) => { module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_engine__; /***/ }), /***/ "@tsparticles/plugin-emitters": /*!************************************************************************************************************************************************************!*\ !*** external {"commonjs":"@tsparticles/plugin-emitters","commonjs2":"@tsparticles/plugin-emitters","amd":"@tsparticles/plugin-emitters","root":"window"} ***! \************************************************************************************************************************************************************/ /***/ ((module) => { module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_plugin_emitters__; /***/ }), /***/ "@tsparticles/plugin-motion": /*!******************************************************************************************************************************************************!*\ !*** external {"commonjs":"@tsparticles/plugin-motion","commonjs2":"@tsparticles/plugin-motion","amd":"@tsparticles/plugin-motion","root":"window"} ***! \******************************************************************************************************************************************************/ /***/ ((module) => { module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_plugin_motion__; /***/ }), /***/ "@tsparticles/shape-cards": /*!************************************************************************************************************************************************!*\ !*** external {"commonjs":"@tsparticles/shape-cards","commonjs2":"@tsparticles/shape-cards","amd":"@tsparticles/shape-cards","root":"window"} ***! \************************************************************************************************************************************************/ /***/ ((module) => { module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_shape_cards__; /***/ }), /***/ "@tsparticles/shape-emoji": /*!************************************************************************************************************************************************!*\ !*** external {"commonjs":"@tsparticles/shape-emoji","commonjs2":"@tsparticles/shape-emoji","amd":"@tsparticles/shape-emoji","root":"window"} ***! \************************************************************************************************************************************************/ /***/ ((module) => { module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_shape_emoji__; /***/ }), /***/ "@tsparticles/shape-heart": /*!************************************************************************************************************************************************!*\ !*** external {"commonjs":"@tsparticles/shape-heart","commonjs2":"@tsparticles/shape-heart","amd":"@tsparticles/shape-heart","root":"window"} ***! \************************************************************************************************************************************************/ /***/ ((module) => { module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_shape_heart__; /***/ }), /***/ "@tsparticles/shape-image": /*!************************************************************************************************************************************************!*\ !*** external {"commonjs":"@tsparticles/shape-image","commonjs2":"@tsparticles/shape-image","amd":"@tsparticles/shape-image","root":"window"} ***! \************************************************************************************************************************************************/ /***/ ((module) => { module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_shape_image__; /***/ }), /***/ "@tsparticles/shape-polygon": /*!******************************************************************************************************************************************************!*\ !*** external {"commonjs":"@tsparticles/shape-polygon","commonjs2":"@tsparticles/shape-polygon","amd":"@tsparticles/shape-polygon","root":"window"} ***! \******************************************************************************************************************************************************/ /***/ ((module) => { module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_shape_polygon__; /***/ }), /***/ "@tsparticles/shape-square": /*!***************************************************************************************************************************************************!*\ !*** external {"commonjs":"@tsparticles/shape-square","commonjs2":"@tsparticles/shape-square","amd":"@tsparticles/shape-square","root":"window"} ***! \***************************************************************************************************************************************************/ /***/ ((module) => { module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_shape_square__; /***/ }), /***/ "@tsparticles/shape-star": /*!*********************************************************************************************************************************************!*\ !*** external {"commonjs":"@tsparticles/shape-star","commonjs2":"@tsparticles/shape-star","amd":"@tsparticles/shape-star","root":"window"} ***! \*********************************************************************************************************************************************/ /***/ ((module) => { module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_shape_star__; /***/ }), /***/ "@tsparticles/updater-life": /*!***************************************************************************************************************************************************!*\ !*** external {"commonjs":"@tsparticles/updater-life","commonjs2":"@tsparticles/updater-life","amd":"@tsparticles/updater-life","root":"window"} ***! \***************************************************************************************************************************************************/ /***/ ((module) => { module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_updater_life__; /***/ }), /***/ "@tsparticles/updater-roll": /*!***************************************************************************************************************************************************!*\ !*** external {"commonjs":"@tsparticles/updater-roll","commonjs2":"@tsparticles/updater-roll","amd":"@tsparticles/updater-roll","root":"window"} ***! \***************************************************************************************************************************************************/ /***/ ((module) => { module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_updater_roll__; /***/ }), /***/ "@tsparticles/updater-rotate": /*!*********************************************************************************************************************************************************!*\ !*** external {"commonjs":"@tsparticles/updater-rotate","commonjs2":"@tsparticles/updater-rotate","amd":"@tsparticles/updater-rotate","root":"window"} ***! \*********************************************************************************************************************************************************/ /***/ ((module) => { module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_updater_rotate__; /***/ }), /***/ "@tsparticles/updater-tilt": /*!***************************************************************************************************************************************************!*\ !*** external {"commonjs":"@tsparticles/updater-tilt","commonjs2":"@tsparticles/updater-tilt","amd":"@tsparticles/updater-tilt","root":"window"} ***! \***************************************************************************************************************************************************/ /***/ ((module) => { module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_updater_tilt__; /***/ }), /***/ "@tsparticles/updater-wobble": /*!*********************************************************************************************************************************************************!*\ !*** external {"commonjs":"@tsparticles/updater-wobble","commonjs2":"@tsparticles/updater-wobble","amd":"@tsparticles/updater-wobble","root":"window"} ***! \*********************************************************************************************************************************************************/ /***/ ((module) => { module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_updater_wobble__; /***/ }) /******/ }); /************************************************************************/ /******/ // The module cache /******/ var __webpack_module_cache__ = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ // Check if module is in cache /******/ var cachedModule = __webpack_module_cache__[moduleId]; /******/ if (cachedModule !== undefined) { /******/ return cachedModule.exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = __webpack_module_cache__[moduleId] = { /******/ // no module.id needed /******/ // no module.loaded needed /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /************************************************************************/ /******/ /* webpack/runtime/compat get default export */ /******/ (() => { /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = (module) => { /******/ var getter = module && module.__esModule ? /******/ () => (module['default']) : /******/ () => (module); /******/ __webpack_require__.d(getter, { a: getter }); /******/ return getter; /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/define property getters */ /******/ (() => { /******/ // define getter functions for harmony exports /******/ __webpack_require__.d = (exports, definition) => { /******/ for(var key in definition) { /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); /******/ } /******/ } /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/hasOwnProperty shorthand */ /******/ (() => { /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) /******/ })(); /******/ /******/ /* webpack/runtime/make namespace object */ /******/ (() => { /******/ // define __esModule on exports /******/ __webpack_require__.r = (exports) => { /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); /******/ } /******/ Object.defineProperty(exports, '__esModule', { value: true }); /******/ }; /******/ })(); /******/ /************************************************************************/ /******/ /******/ // startup /******/ // Load entry module and return exports /******/ // This entry module can't be inlined because the eval devtool is used. /******/ var __webpack_exports__ = __webpack_require__("./dist/browser/index.js"); /******/ /******/ return __webpack_exports__; /******/ })() ; });