HEX
Server: nginx/1.27.1
System: Linux in-3 5.15.0-161-generic #171-Ubuntu SMP Sat Oct 11 08:17:01 UTC 2025 x86_64
User: ivenus-clone (3297)
PHP: 7.4.33
Disabled: exec,passthru,shell_exec,system,proc_open,popen,parse_ini_file,show_source
Upload Files
File: /storage/v4513/ivenusin/public_html/wp-content/plugins/fluid-checkout/js/lib/animate-helper-230.js
/**
 * Animate Helper
 *
 * Provide a functions to handle animations and transitions gracefully.
 *
 * Author: Diego Versiani
 * Contact: https://diegoversiani.me
 */
( function() {

	// Initialize public methods object
	var animateHelper = {};
	window.AnimateHelper = animateHelper;



	/**
	 * Provide a crossbrowser way to determine which
	 * animationend event is supported by the current browser.
	 * 
	 * Based on the work of:
	 * Jonathan Suh - https://jonsuh.com/blog/detect-the-end-of-css-animations-and-transitions-with-javascript/
	 * David Walsh - https://davidwalsh.name/css-animation-callback
	 *
	 * @return  {String}  The animationend event name
	 */
    var getAnimationEvent = function() {
        var t,
        el = document.createElement("fakeelement");
		var animations = {
			'animation'      : 'animationend',
			'OAnimation'     : 'oAnimationEnd',
			'MozAnimation'   : 'animationend',
			'WebkitAnimation': 'webkitAnimationEnd'
		}

		for (t in animations){
			if (el.style[t] !== undefined){
				return animations[t];
			}
		}

		return 'animationend';
	};



	/**
	 * Play animation class on the element then call callback function
	 *
	 * @param   {Element}  	element         Element to add animation class to
	 * @param   {String}  	animationClass  Animation class name
	 * @param   {Function}  callback        Callback function to run after animation
	 */
	animateHelper.animateThenDo = function( element, animationClass, callback ) {
        // Set event handler
        element.addEventListener( getAnimationEvent(), function finish( e ) {
            // Remove animation class and event listener
            e.target.classList.remove( animationClass );
			e.target.removeEventListener( getAnimationEvent(), finish );
			
			// Do
            if ( typeof callback === 'function' ) callback( e.target, animationClass );
        } );

        // Play animation
        element.classList.add( animationClass );
    };



	/**
	 * Call callback function then play animation class on the element
	 *
	 * @param   {Element}  	element         Element to add animation class to
	 * @param   {String}  	animationClass  Animation class name
	 * @param   {Function}  callback        Callback function to run before animation
	 */
    animateHelper.doThenAnimate = function( element, animationClass, callback ) {
		// Do
		if ( typeof callback === 'function' ) callback( element, animationClass );
        
        // Set event handler
        element.addEventListener( getAnimationEvent(), function finish( e ) {
            // Remove animation class and event listener
            e.target.classList.remove( animationClass );
            e.target.removeEventListener( getAnimationEvent(), finish );
        } );

        // Play animation
        element.classList.add( animationClass );
	};

})();