This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public fadeInAudioElementVolume (start: number, end: number, duration: number, callback?: Function): void { | |
const delta: number = end - start; | |
let startTime: number = null; | |
let t: number; | |
let factor: number; | |
let frame: any; | |
const tweenLoop: FrameRequestCallback = (time?: number) => { | |
if (!time) { | |
time = new Date().getTime(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public iterateBackwards (arrayLength: number, index: number): number { | |
return index = (index <= 0) ? arrayLength - 1 : --index, index; | |
} | |
public iterateForwards (arrayLength: number, index: number): number { | |
return index = (index >= arrayLength - 1) ? 0 : ++index, index; | |
} | |
/* | |
* Usage |