UNPKG

@tsparticles/editor

Version:

tsParticles Configuration Editor

62 lines (61 loc) 1.79 kB
import { EditorType } from "object-gui"; import { EditorBase } from "../../../../EditorBase"; export class HoverEventsOptionsEditor extends 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", EditorType.boolean).change(() => { void this.particles().refresh(); }); parallax.addProperty("force", "Force", EditorType.number).change(() => { void this.particles().refresh(); }); parallax.addProperty("smooth", "Smooth", EditorType.number).change(() => { void this.particles().refresh(); }); } addProperties() { this.group.addProperty("enable", "Enable", EditorType.boolean).change(() => { void this.particles().refresh(); }); this.group .addProperty("mode", "Mode", EditorType.select) .change(() => { void this.particles().refresh(); }) .addItems([ { value: "attract", }, { value: "bubble", }, { value: "connect", }, { value: "grab", }, { value: "light", }, { value: "repulse", }, { value: "slow", }, { value: "trail", }, ]); } }