Home Reference Source Test Repository
public class | source

PaperWave

Provides all the logic to produce a one-time rippling effect.

Constructor Summary

Public Constructor
public

constructor(objectPattern: {"$": *, "recenters": *, "center": *, "initialOpacity": *, "opacityDecayVelocity": *}): PaperWave

Initializes a new instance of the PaperWave class with the specified PaperRipple instance.

Member Summary

Public Members
public

Represents the object wrapped around the main DOM element that belongs to the current instance.

public

Represents the object wrapped around the wave DOM element that belongs to the current instance.

public

Determines whether the wave should start a movement from the center of its container.

public

Gets or sets the color of the wave.

public

Gets or sets the container metrics of the wave.

public get

Gets the wave's current position.

public

Gets or sets the end position of the wave.

public

Gets initial opacity of the wave.

public get

Determines whether the animation of rippling effect completed or not.

public get

Determines whether the wave reached its max radius or not.

public get

Determines whether the pointing device is still in interaction with the current wave.

public get

Determines whether the wave is fully opaque or not.

public

Gets or sets max radius of the wave.

public get

Gets the total interaction time.

public get

Gets the wave's opacity at the current time.

public

Gets opacity decay velocity of the wave.

public get

Gets the wave's outer opacity at the current time.

public get

Gets the wave's radius at the current time.

public

Determines whether the wave should be re-centered towards the center of its container.

public

Gets or sets the start position of the wave.

public get

Gets the time in milliseconds elapsed from the moment where interaction with the wave was started.

public get

Gets the time in seconds elapsed since the moment where interaction with the wave was started.

public

Gets or sets the time of starting interaction with the wave.

public get

Gets the time in milliseconds elapsed from the moment where interaction with the wave was ended.

public get

Gets the time in seconds elapsed since the moment where interaction with the wave was ended.

public

Gets or sets the time of ending interaction with the wave.

public get

Gets the wave's translation fraction value.

Method Summary

Public Methods
public

Performs ripple-down effect on the current wave.

public

Performs updating of the wave's values.

public

Removes the wave from a DOM.

public

Resets all the wave's values.

public

Performs ripple-up effect on the current wave.

Public Constructors

public constructor(objectPattern: {"$": *, "recenters": *, "center": *, "initialOpacity": *, "opacityDecayVelocity": *}): PaperWave source

Initializes a new instance of the PaperWave class with the specified PaperRipple instance.

Params:

NameTypeAttributeDescription
objectPattern {"$": *, "recenters": *, "center": *, "initialOpacity": *, "opacityDecayVelocity": *}
  • default: {"$":null,"recenters":null,"center":null,"initialOpacity":null,"opacityDecayVelocity":null}

Return:

PaperWave

The new instance of a class.

Example:

var paperWave = new PaperWave(paperRipple);

paperWave.downAction(null);
paperWave.upAction();

if (paperWave.isAnimationCompleted) {
    paperWave.remove();
}

Public Members

public $: Object source

Represents the object wrapped around the main DOM element that belongs to the current instance.

public $wave: Object source

Represents the object wrapped around the wave DOM element that belongs to the current instance.

public center: Boolean source

Determines whether the wave should start a movement from the center of its container.

public color: String source

Gets or sets the color of the wave.

public containerRect: ElementRect source

Gets or sets the container metrics of the wave.

public get currentPosition: {x: Number, y: Number}: * source

Gets the wave's current position.

Return:

{x: Number, y: Number}

Object containing coordinates of the wave's current position.

public endPosition: {x: Number, y: Number} source

Gets or sets the end position of the wave.

public initialOpacity: Number source

Gets initial opacity of the wave.

public get isAnimationComplete: Boolean: * source

Determines whether the animation of rippling effect completed or not.

Return:

Boolean

true, if so, otherwise false.

public get isMaxRadiusReached: Boolean: * source

Determines whether the wave reached its max radius or not.

Return:

Boolean

true, if so, otherwise false.

public get isTouchDown: Boolean: * source

Determines whether the pointing device is still in interaction with the current wave.

Return:

Boolean

true, if so, otherwise false.

public get isWaveFullyOpaque: Boolean: * source

Determines whether the wave is fully opaque or not.

Return:

Boolean

true, if so, otherwise false.

public maxRadius: Number source

Gets or sets max radius of the wave.

public get mouseInteractionSeconds: Number: * source

Gets the total interaction time.

Return:

Number

The time in seconds

public get opacity: Number: * source

Gets the wave's opacity at the current time.

Return:

Number

The value of the wave's opacity.

public opacityDecayVelocity: Number source

Gets opacity decay velocity of the wave.

public get outerOpacity: Number: * source

Gets the wave's outer opacity at the current time.

Return:

Number

The value of the wave's outer opacity.

public get radius: Number: * source

Gets the wave's radius at the current time.

Return:

Number

The value of the wave's radius.

public recenters: Boolean source

Determines whether the wave should be re-centered towards the center of its container.

public startPosition: {x: Number, y: Number} source

Gets or sets the start position of the wave.

public get touchDownElapsed: Number: * source

Gets the time in milliseconds elapsed from the moment where interaction with the wave was started.

Return:

Number

The time in milliseconds.

public get touchDownElapsedSeconds: Number: * source

Gets the time in seconds elapsed since the moment where interaction with the wave was started.

Return:

Number

The time in seconds.

public touchDownStarted: Number source

Gets or sets the time of starting interaction with the wave.

public get touchUpElapsed: Number: * source

Gets the time in milliseconds elapsed from the moment where interaction with the wave was ended.

Return:

Number

The time in milliseconds.

public get touchUpElapsedSeconds: number: * source

Gets the time in seconds elapsed since the moment where interaction with the wave was ended.

Return:

number

The time in seconds.

public touchUpStarted: Number source

Gets or sets the time of ending interaction with the wave.

public get translationFraction: Number: * source

Gets the wave's translation fraction value.

Return:

Number

The value of the wave's translation fraction.

Public Methods

public downAction(event: Event | Object): PaperWave source

Performs ripple-down effect on the current wave.

Params:

NameTypeAttributeDescription
event Event | Object
  • optional
  • default: null

An object containing coordinates of interaction point to set start position of ripple effect.

Return:

PaperWave

Current instance for method chaining.

public draw(): PaperWave source

Performs updating of the wave's values.

Return:

PaperWave

Current instance for method chaining.

public remove(): PaperWave source

Removes the wave from a DOM.

Return:

PaperWave

Current instance for method chaining.

public resetDefaults(): PaperWave source

Resets all the wave's values.

Return:

PaperWave

Current instance for method chaining.

public upAction(): PaperWave source

Performs ripple-up effect on the current wave.

Return:

PaperWave

Current instance for method chaining.