const anime = require('animejs').default;

const { TIMES } = require('../../constants');

function Invert(id, idle) {
    return anime({
        targets: [document.getElementById(id)],
        rotate: 180,
        delay: TIMES.TARGET_DELAY_MS,
        duration: TIMES.TARGET_DURATION_MS * 0.45,
        easing: 'easeInOutElastic',
        direction: 'alternate',
        begin: idle.pause,
        complete: idle.play,
    });
}

module.exports = Invert;
