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.

34 lines (33 loc) 1.16 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Lighter = void 0; const Utils_1 = require("../../Utils"); const Modes_1 = require("../../Enums/Modes"); class Lighter { constructor(container) { this.container = container; } interact(particle) { const container = this.container; const options = container.actualOptions; if (options.interactivity.events.onHover.enable && container.interactivity.status === "mousemove") { const mousePos = this.container.interactivity.mouse.position; if (mousePos) { container.canvas.drawParticleShadow(particle, mousePos); } } } isEnabled() { const container = this.container; const mouse = container.interactivity.mouse; const events = container.actualOptions.interactivity.events; if (!(events.onHover.enable && mouse.position)) { return false; } const hoverMode = events.onHover.mode; return Utils_1.Utils.isInArray(Modes_1.HoverMode.light, hoverMode); } reset() { } } exports.Lighter = Lighter;