Home Reference Source
import FlareJS from '@sims2001/flarejs/src/flare.js'
public class | source

FlareJS

Welcome to Flare.js!

Constructor Summary

Public Constructor
public

Member Summary

Public Members
public
public
public

Method Summary

Public Methods
public

Destroy FlareJS and remove all EventHandlers;

public

reset()

Reset FlareJS to add EventHandlers to new Elements

public

start()

Start FlareEffects and reset all Backgrounds

public

stop()

Stop FlareEffects and reset all Backgrounds

public

toggle()

Toggle start() and stop() of the FlareJS instance

Private Methods
private

addFlareEvents(glowObject: object)

Add MouseMove and MouseLeave EventHandler to the given glowObject

private

Generates

private

handleFlareEvent(event: event, glowObject: object)

Handle the MouseMove Event

private

Initial All FlareEffects

private

resetBackground(glowObject: object)

Set the Elements background to its default Value

Public Constructors

public constructor() source

Public Members

public eventHandlers: *[] source

public initialized: boolean source

public isPaused: boolean source

Public Methods

public destroy() source

Destroy FlareJS and remove all EventHandlers;

public reset() source

Reset FlareJS to add EventHandlers to new Elements

public start() source

Start FlareEffects and reset all Backgrounds

public stop() source

Stop FlareEffects and reset all Backgrounds

public toggle() source

Toggle start() and stop() of the FlareJS instance

Private Methods

private addFlareEvents(glowObject: object) source

Add MouseMove and MouseLeave EventHandler to the given glowObject

Params:

Name Type Attribute Description
glowObject object

Object containing the Element and its default background

private generateGradientString(x: number, y: number, background: string): string source

Generates

Params:

Name Type Attribute Description
x number

the x position of the FlareEffect

y number

the y position of the FlareEffect

background string

the background color of the current element;

Return:

string

private handleFlareEvent(event: event, glowObject: object) source

Handle the MouseMove Event

Params:

Name Type Attribute Description
event event

MouseMove Event to calculate x and y

glowObject object

Object containing the Element and its default background

private initFlares() source

Initial All FlareEffects

private resetBackground(glowObject: object) source

Set the Elements background to its default Value

Params:

Name Type Attribute Description
glowObject object

Object containing the Element and its default background