export const numberDisplay = (num, el, expired, flip) => {

    const element = typeof el === 'string' ? document.querySelector(el) : el;
    let prevDateNum = num - 1;
    let prevDateNumMin = prevDateNum < 0 ? 59 : prevDateNum;
    let prevDate = prevDateNumMin < 10 ? `0${prevDateNumMin}` : prevDateNumMin;
    let date = num < 10 ? `0${num}` : num;
    if (element){
        element.innerHTML = `
            <div class="develux-timer-countnum-backtop">${expired ? "00" : prevDate}</div>
            <div class="develux-timer-countnum-backbottom">${expired ? "00" : prevDate}</div>
            <div class="develux-timer-countnum-top">${expired ? "00" : date}</div>
            <div class="develux-timer-countnum-bottom">${expired ? "00" : date}</div>
            <div class="develux-timer-countnum-line"></div>
        `;
        if (flip) {
            element.classList.add("animate");
        } else {
            element.classList.remove("animate");
        }

    }

};

