initial commit

This commit is contained in:
2026-03-16 13:53:01 +02:00
parent 631dc7df36
commit 81e6e0a7a2
23381 changed files with 8224173 additions and 0 deletions

View File

@@ -0,0 +1,212 @@
/**
* Abstract Tween base object.
* Uses `ease npm` for all ease functions.
* For ease types, refer to [ease APIs]{@link https://www.npmjs.com/package/eases}.
* @class Tween
* @memberof jibo.face
*/
/**
* `true` if the tween is to be paused.
* @name jibo.face.Tween#paused
* @type {Boolean}
*/
/**
* The local lerp value for just this tween.
* @name jibo.face.Tween#_time
* @type {Number}
* @protected
*/
/**
* Duration in milliseconds.
* @name jibo.face.Tween#_duration
* @type {Number}
* @protected
*/
/**
* Finished callback
* @name jibo.face.Tween#_complete
* @type {Function}
* @private
*/
/**
* Flag used to block tween from being manually stopped.
* @name jibo.face.Tween#_inProcess
* @type {Boolean}
* @private
*/
/**
* the number of milliseconds to delay this tween from playing from the time it was added to the TweenMgr
* @name jibo.face.Tween#_delay
* @type {Number}
* @private
*/
/**
* Elapsed time in milliseconds
* @name jibo.face.Tween#_elapsed
* @type {Number}
* @private
*/
/**
* Starting value
* @name jibo.face.Tween#_start
* @type {Object}
* @private
*/
/**
* Ending value
* @name jibo.face.Tween#_end
* @type {Object}
* @private
*/
/**
* Ease callback.
* @name jibo.face.Tween#_ease
* @type {Function}
* @private
*/
/**
* Target for tweening.
* @name jibo.face.Tween#_target
* @type {Object}
* @private
*/
/**
* Initial the tween.
* @method jibo.face.Tween#init
* @param {*} [target] The thing to tween.
* @param {Object} options Options for tweening.
* @param {Object} [options.to] The values to tween the object to.
* @param {Object} [options.from] The initial values to set the object to.
* @param {String} [options.ease='linear'] The ease function to use.
* @param {int} [options.delay=0] The delay to start.
* @param {int} [options.duration=500] Length of tween, in millseconds.
* @param {Function} [complete] Callback function, if any.
*/
/**
* Update the tween value.
* @method jibo.face.Tween#reset
* @param {Number} v0 start number
* @param {Number} v1 end number
* @param {Number} t Time
* @private
*/
/**
* The delay of start of tween in milliseconds.
* @name jibo.face.Tween#delay
* @type {Number}
*/
/**
* The duration of this tween.
* @name jibo.face.Tween#duration
* @type {Number}
* @readOnly
*/
/**
* The current time from 0 to 1.
* @name jibo.face.Tween#time
* @type {Number}
* @readOnly
*/
/**
* The target to tween.
* @name jibo.face.Tween#target
* @type {any}
* @readOnly
*/
/**
* Flag indicating if tween is in a process that should not be manually stopped.
* @name jibo.face.Tween#inProcess
* @type {Boolean}
* @readOnly
*/
/**
* Call the finished callback.
* @method jibo.face.Tween#completed
*/
/**
* Event when tween is completed.
* @event jibo.face.Tween#complete
* @param {*} target The target of tween.
*/
/**
* Update the tween value.
* @method jibo.face.Tween#update
* @param {Number} elapsed Milliseconds since the last update.
*/
/**
* Event when tween value has changed.
* @event jibo.face.Tween#change
* @param {*} value The value or values set.
* @param {*} target The target of tween.
*/
/**
* Assign a collection of properties.
* @method jibo.face.Tween#assign
* @param {Object} values Map of properties to set
* @private
*/
/**
* Assign a specific property and value to the target.
* @method jibo.face.Tween#assignValue
* @param {String} prop Property name.
* @param {Number|String} value Value to set.
* @private
*/
/**
* Update the tween value.
* @method jibo.face.Tween#lerp
* @param {Number} v0 start number
* @param {Number} v1 end number
* @param {Number} t Time
* @private
*/
/**
* Auto-generate the start key values.
* @method jibo.face.Tween#startDefaults
* @param {Object} to end keys
* @private
* @return {Object} Default start keys
*/
/**
* Auto-generate the end key values.
* @method jibo.face.Tween#endDefaults
* @param {Object} from start keys
* @private
* @return {Object} Default end keys
*/
/**
* Check that both objects have the same keys.
* @method jibo.face.Tween#validate
* @private
* @param {Object|Number} obj1 Object 1 to compare
* @param {Object|Number} obj2 Object 2 to compare
* @return {Boolean} `true` if both have the same keys.
*/

View File

@@ -0,0 +1,94 @@
/**
* Manage the tweens.
* Uses `ease npm` for all ease functions.
* For ease types, refer to [ease APIs]{@link https://www.npmjs.com/package/eases}.
* @class TweenManager
* @memberof jibo.face
*/
/**
* Collection of tweens.
* @private
* @name jibo.face.TweenManager._tweens
* @type {Array<jibo.face.Tween>}
*/
/**
* Collection of tweens to pool (recycle).
* @private
* @name jibo.face.TweenManager._tweens
* @type {Array<jibo.face.Tween>}
*/
/**
* Add a tween to play.
* @method jibo.face.TweenManager.play
* @param {Object} target The object to tween.
* @param {Object} options Options for tweening.
* @param {Object} options.to The values to tween the object to.
* @param {Object} [options.from] The initial values to set the object to.
* @param {String} [options.ease='linear'] The ease function to use.
* @param {int} [options.delay=0] The delay to start.
* @param {int} [options.duration=500] Length of tween, in millseconds.
* @param {Function} [complete] Function callback wehen completed
* @return {jibo.face.Tween} Instance of new tween.
*/
/**
* Play a set of tweens.
* @method jibo.face.TweenManager.playSet
* @param {Array<Object>} targets The list of items to tween.
* @param {Object} options Options for tweening.
* @param {Number} options.to The value to tween to.
* @param {Number} [options.from=0] The initial value to tween.
* @param {String} [options.ease='linear'] The ease function to use.
* @param {int} [options.delay=0] The delay to start.
* @param {int} [options.duration=500] Length of tween, in millseconds.
* @param {Object|Function} [setOptions] Either the set options for complete function
* @param {Number} [setOptions.focus=0] Index to lead with if `setOptions.delay` is set.
* @param {Boolean} [setOptions.focusIsLast=false] `true` if `setOptions.focus` is first in.
* @param {Number} [setOptions.delay=0] Milliseconds delay between items.
* @param {Function} [setOptions.complete] Function callback wehen completed
* @param {Boolean} [setOptions.completeOnFirst=false] If 'true' fires callback after first tween completes, if `false` fires after all tween complete
*/
/**
* Stop a tween by target or stop all tweens.
* @method jibo.face.TweenManager.stop
* @param {Object} [target] The tween target, if non is specified, all tweens removed.
* @return {Boolean} If the tween was deleted.
*/
/**
* Stop all tweens whose targets return true against provided method.
* @method jibo.face.TweenManager.stopCheck
* @param {Function} check - Function must take a tween target and return a boolean,
* passing an additional Object to test against is optional.
* @param {any} [against] - Object to test against in check method.
*/
/**
* Pause or resume all tweens.
* @name jibo.face.TweenManager.paused
* @type {Boolean}
*/
/**
* Update the tweens.
* @method jibo.face.TweenManager.update
* @param {int} elapsed Time elapsed in Milliseconds since the last update.
*/
/**
* Recycle the tween.
* @method jibo.face.TweenManager._pool
* @private
* @param {jibo.face.Tween} tween Tween to re-pool
*/
/**
* Recycle the tween.
* @method jibo.face.TweenManager._create
* @private
* @return {jibo.face.Tween} Tween to use
*/