function fadeUp(el, options = {})
{
    // 0. do things with the options
    options = Object.assign({}, { split: .6, speed: DEFAULT_SPEED }, options);

    // 1. work out how things are split
    let fFadeTime  = options.split * options.speed;
    let fSlideTime = options.speed - fFadeTime;

    // 2. start to fade things
    return new Promise(resolve =>
    {
        fadeOut(el, fFadeTime).then(() =>
        {
            // a. when it’s faded out, replace it with a DOM element of the same height
            let elTmp = document.createElement('div');
            elTmp.classList.add('fx__tmp');
            elTmp.style.height = `${el.clientHeight}px`;

            // b. switch things around
            el.parentNode.insertBefore(elTmp, el);
            el.style.display = 'none';
            el.setAttribute('aria-hidden', 'true');

            // c. slide the temp element away
            slideUp(elTmp, fSlideTime).then(() =>
            {
                // remove our errant node and callback
                elTmp.parentNode.removeChild(elTmp);
                resolve();
            });
        })
    });
}
/**
 * Kooky combination effect, where the element is faded out and then slid up. This uses a proxy element to work around
 * limitations in what animating max-height is capable of.
 *
 * @param   {HTMLElement} el - the unfortunate victim
 * @param   {Object} options - an object containing speed and split options
 * @return  {Promise} a Promise that is resolved when the effect completes
 */
Kooky combination effect, where the element is faded out and then slid up. This uses a proxy element to work around
limitations in what animating max-height is capable of.

@param   {HTMLElement} el - the unfortunate victim
@param   {Object} options - an object containing speed and split options
@return  {Promise} a Promise that is resolved when the effect completes
Kooky combination effect where the element is faded out and then slid up . This uses a proxy element to work around limitations in what animating max - height is capable of . @param { HTMLElement } el - the unfortunate victim @param { Object } options - an object containing speed and split options @return { Promise } a Promise that is resolved when the effect completes
function fadeUp(el, options = {})
{
    options = Object.assign({}, { split: .6, speed: DEFAULT_SPEED }, options);
    let fFadeTime  = options.split * options.speed;
    let fSlideTime = options.speed - fFadeTime;
    return new Promise(resolve =>
    {
        fadeOut(el, fFadeTime).then(() =>
        {
            let elTmp = document.createElement('div');
            elTmp.classList.add('fx__tmp');
            elTmp.style.height = `${el.clientHeight}px`;
            el.parentNode.insertBefore(elTmp, el);
            el.style.display = 'none';
            el.setAttribute('aria-hidden', 'true');
            slideUp(elTmp, fSlideTime).then(() =>
            {
                elTmp.parentNode.removeChild(elTmp);
                resolve();
            });
        })
    });
}
function fadeUp ( el , options = { } ) { options = Object . assign ( { } , { split : .6 , speed : DEFAULT_SPEED } , options ) ; let fFadeTime = options . split * options . speed ; let fSlideTime = options . speed - fFadeTime ; return new Promise ( resolve => { fadeOut ( el , fFadeTime ) . then ( ( ) => { let elTmp = document . createElement ( 'div' ) ; elTmp . classList . add ( 'fx__tmp' ) ; elTmp . style . height = ` ${ el . clientHeight } ` ; el . parentNode . insertBefore ( elTmp , el ) ; el . style . display = 'none' ; el . setAttribute ( 'aria-hidden' , 'true' ) ; slideUp ( elTmp , fSlideTime ) . then ( ( ) => { elTmp . parentNode . removeChild ( elTmp ) ; resolve ( ) ; } ) ; } ) } ) ; }
Kooky combination effect, where the element is faded out and then slid up.
Kooky combination effect where the element is faded out and then slid up .
// 0. do things with the options // 1. work out how things are split // 2. start to fade things // a. when it’s faded out, replace it with a DOM element of the same height // b. switch things around // c. slide the temp element away // remove our errant node and callback