tsparticles
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.
43 lines (42 loc) • 1.88 kB
JavaScript
import { loadAbsorbersPlugin } from "@tsparticles/plugin-absorbers";
import { loadDestroyUpdater } from "@tsparticles/updater-destroy";
import { loadEmittersPlugin } from "@tsparticles/plugin-emitters";
import { loadEmittersShapeCircle } from "@tsparticles/plugin-emitters-shape-circle";
import { loadEmittersShapeSquare } from "@tsparticles/plugin-emitters-shape-square";
import { loadExternalDragInteraction } from "@tsparticles/interaction-external-drag";
import { loadExternalTrailInteraction } from "@tsparticles/interaction-external-trail";
import { loadRollUpdater } from "@tsparticles/updater-roll";
import { loadSlim } from "@tsparticles/slim";
import { loadTextShape } from "@tsparticles/shape-text";
import { loadTiltUpdater } from "@tsparticles/updater-tilt";
import { loadTwinkleUpdater } from "@tsparticles/updater-twinkle";
import { loadWobbleUpdater } from "@tsparticles/updater-wobble";
export async function loadFull(engine) {
engine.checkVersion("4.1.0");
await engine.pluginManager.register(async (e) => {
const loadEmittersPluginBundle = async (e) => {
await loadEmittersPlugin(e);
await Promise.all([
loadEmittersShapeCircle(e),
loadEmittersShapeSquare(e),
]);
}, loadInteractivityForFull = async (e) => {
await loadSlim(e);
await Promise.all([
loadExternalDragInteraction(e),
loadExternalTrailInteraction(e),
loadAbsorbersPlugin(e),
loadEmittersPluginBundle(e),
]);
};
await Promise.all([
loadInteractivityForFull(e),
loadDestroyUpdater(e),
loadRollUpdater(e),
loadTiltUpdater(e),
loadTwinkleUpdater(e),
loadWobbleUpdater(e),
loadTextShape(e),
]);
});
}