const timerWrap = document.getElementById('timerWrap');
const priceNew = document.querySelector('.price-new');
const priceOld = document.querySelector('.price-old-final');
const ctaBtn = document.getElementById('ctaBtn');
function revertPrice() {
priceNew.innerHTML = '402
GEL';
priceOld.style.display = 'none';
timerWrap.innerHTML = '
⏱ ფასდაკლების დრო ამოიწურა
';
ctaBtn.setAttribute('href', "#order:Biohacker's Set=402");
}
function tick() {
const remaining = DURATION - (Date.now() - startTime);
if (remaining <= 0) {
revertPrice();
clearInterval(interval);
return;
}
const totalSec = Math.floor(remaining / 1000);
const mins = Math.floor(totalSec / 60);
const secs = totalSec % 60;
els.minTens.textContent = Math.floor(mins / 10);
els.minOnes.textContent = mins % 10;
els.secTens.textContent = Math.floor(secs / 10);
els.secOnes.textContent = secs % 10;
if (remaining < 2 * 60 * 1000) {
Object.values(els).forEach(el => el.classList.add('pulse'));
}
}
tick();
const interval = setInterval(tick, 1000);
})();