UNPKG

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.17 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Attract = void 0; class Attract { constructor() { this.enable = false; this.rotate = { x: 3000, y: 3000, }; } get rotateX() { return this.rotate.x; } set rotateX(value) { this.rotate.x = value; } get rotateY() { return this.rotate.y; } set rotateY(value) { this.rotate.y = value; } load(data) { var _a, _b, _c, _d; if (data === undefined) { return; } if (data.enable !== undefined) { this.enable = data.enable; } const rotateX = (_b = (_a = data.rotate) === null || _a === void 0 ? void 0 : _a.x) !== null && _b !== void 0 ? _b : data.rotateX; if (rotateX !== undefined) { this.rotate.x = rotateX; } const rotateY = (_d = (_c = data.rotate) === null || _c === void 0 ? void 0 : _c.y) !== null && _d !== void 0 ? _d : data.rotateY; if (rotateY !== undefined) { this.rotate.y = rotateY; } } } exports.Attract = Attract;