/**
 * @since Last modified: 2024-07-20 16:16:05
 * @namespace curveFns
 * @description Animation motion curve collection.
 * @see {@link https://codepen.io/axui/pen/WNPPVqB|demo @ codepen}
 */
'use strict';
const curveFns = {
    /**
    * @memberOf curveFns
    * @description uniform motion.
    * @param {number} t - The x value of curve.Ranges:[0,1].
    * @returns {number} Return The y value of curve.
    * @see {@link https://codepen.io/axui/pen/WNPPVqB|demo @ codepen}
    * @example
    * ax.curveFns.linear('0.2');
    */
    linear: (t) => t,
    /**
* @memberOf curveFns
* @description Start slowly, and the back journey becomes faster.
* @param {number} t - The x value of curve.Ranges:[0,1].
* @returns {number} Return The y value of curve.
* @see {@link https://codepen.io/axui/pen/WNPPVqB|demo @ codepen}
* @example
* ax.curveFns.easeIn('0.2');
*/
    ease: (t) => ((1 - t) ** 2) * t * 3 * 0.3 + (t ** 2) * (1 - t) * 3 * 1 + t ** 3,
    /**
    * @memberOf curveFns
    * @description Start slowly, and the back journey becomes faster.
    * @param {number} t - The x value of curve.Ranges:[0,1].
    * @returns {number} Return The y value of curve.
    * @see {@link https://codepen.io/axui/pen/WNPPVqB|demo @ codepen}
    * @example
    * ax.curveFns.easeIn('0.2');
    */
    easeIn: (t) => (t ** 2) * (1 - t) * 3 * 0.2 + t ** 3,
    /**
    * @memberOf curveFns
    * @description Start soon, slower after the journey.
    * @param {number} t - The x value of curve.Ranges:[0,1].
    * @returns {number} Return The y value of curve.
    * @see {@link https://codepen.io/axui/pen/WNPPVqB|demo @ codepen}
    * @example
    * ax.curveFns.easeOut('0.2');
    */
    easeOut: (t) => ((1 - t) ** 2) * t * 3 * 0.8 + (t ** 2) * (1 - t) * 3 * 1 + t ** 3,
    /**
    * @memberOf curveFns
    * @description Start slowly, the medium range is fast, and the post -range becomes slower.
    * @param {number} t - The x value of curve.Ranges:[0,1].
    * @returns {number} Return The y value of curve.
    * @see {@link https://codepen.io/axui/pen/WNPPVqB|demo @ codepen}
    * @example
    * ax.curveFns.easeInOut('0.2');
    */
    easeInOut: (t) => t < 0.5 ? Math.sqrt(0.5 * t) : -Math.sqrt(0.5 * (-t + 1)) + 1,
    /**
    * @memberOf curveFns
    * @description Start quickly, the medium is slow, and the post -journey becomes faster.
    * @param {number} t - The x value of curve.Ranges:[0,1].
    * @returns {number} Return The y value of curve.
    * @see {@link https://codepen.io/axui/pen/WNPPVqB|demo @ codepen}
    * @example
    * ax.curveFns.easeOutIn('0.2');
    */
    easeOutIn: (t) => t < 0.5 ? 2 * t ** 2 : -2 * (t - 1) ** 2 + 1,
};
export default curveFns;
