UNPKG

@tsparticles/editor

Version:

tsParticles Configuration Editor

66 lines (65 loc) 2.05 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.HoverEventsOptionsEditor = void 0; const object_gui_1 = require("object-gui"); const EditorBase_1 = require("../../../../EditorBase"); class HoverEventsOptionsEditor extends EditorBase_1.EditorBase { constructor(particles) { super(particles); } addToGroup(parent) { this.group = parent.addGroup("onHover", "Hover Events"); this.options = this.group.data; this.addParallax(); this.addProperties(); } addParallax() { const parallax = this.group.addGroup("parallax", "Parallax"); parallax.addProperty("enable", "Enable", object_gui_1.EditorType.boolean).change(() => { void this.particles().refresh(); }); parallax.addProperty("force", "Force", object_gui_1.EditorType.number).change(() => { void this.particles().refresh(); }); parallax.addProperty("smooth", "Smooth", object_gui_1.EditorType.number).change(() => { void this.particles().refresh(); }); } addProperties() { this.group.addProperty("enable", "Enable", object_gui_1.EditorType.boolean).change(() => { void this.particles().refresh(); }); this.group .addProperty("mode", "Mode", object_gui_1.EditorType.select) .change(() => { void this.particles().refresh(); }) .addItems([ { value: "attract", }, { value: "bubble", }, { value: "connect", }, { value: "grab", }, { value: "light", }, { value: "repulse", }, { value: "slow", }, { value: "trail", }, ]); } } exports.HoverEventsOptionsEditor = HoverEventsOptionsEditor;