1/** 2 * ÐбÑаÑнÑй оÑÑÑÑÑ Ð´Ð»Ñ Ð¿Ñомо-блока "ТоваÑÑ Ð´Ð½Ñ" 3 */ 4(function() { 5 'use strict'; 6 7 function initDayProductsCountdown() { 8 const countdownElement = document.querySelector('.dayproducts-promo-countdown'); 9 10 if (!countdownElement) { 11 return; 12 } 13 14 function updateCountdown() { 15 const now = new Date(); 16 const midnight = new Date(); 17 midnight.setHours(24, 0, 0, 0); 18 19 const diff = midnight - now; 20 21 if (diff <= 0) { 22 // ÐÑÐµÐ¼Ñ Ð¸ÑÑекло 23 countdownElement.innerHTML = '<div class="countdown-item"><span class="countdown-value">00</span><span class="countdown-label">ЧаÑов</span></div><div class="countdown-item"><span class="countdown-value">00</span><span class="countdown-label">ÐинÑÑ</span></div><div class="countdown-item"><span class="countdown-value">00</span><span class="countdown-label">СекÑнд</span></div>'; 24 return; 25 } 26 27 const hours = Math.floor(diff / (1000 * 60 * 60)); 28 const minutes = Math.floor((diff % (1000 * 60 * 60)) / (1000 * 60)); 29 const seconds = Math.floor((diff % (1000 * 60)) / 1000); 30 31 const hoursStr = String(hours).padStart(2, '0'); 32 const minutesStr = String(minutes).padStart(2, '0'); 33 const secondsStr = String(seconds).padStart(2, '0'); 34 35 countdownElement.innerHTML = ` 36 <div class="countdown-item"> 37 <span class="countdown-value">${hoursStr}</span> 38 <span class="countdown-label">ЧаÑов</span> 39 </div> 40 <div class="countdown-item"> 41 <span class="countdown-value">${minutesStr}</span> 42 <span class="countdown-label">ÐинÑÑ</span> 43 </div> 44 <div class="countdown-item"> 45 <span class="countdown-value">${secondsStr}</span> 46 <span class="countdown-label">СекÑнд</span> 47 </div> 48 `; 49 } 50 51 // ÐеÑвое обновление 52 updateCountdown(); 53 54 // ÐбновлÑем каждÑÑ ÑекÑÐ½Ð´Ñ 55 setInterval(updateCountdown, 1000); 56 } 57 58 // ÐниÑиализаÑÐ¸Ñ Ð¿Ñи загÑÑзке DOM 59 if (document.readyState === 'loading') { 60 document.addEventListener('DOMContentLoaded', initDayProductsCountdown); 61 } else { 62 initDayProductsCountdown(); 63 } 64})();
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.