Данный скрипт взят с mo-tilda.ru
Days
Hours
Minutes
Seconds
13 : 23 : 34 : 10
днів
годин
хвилин
секунд
0 0
0 0
ГОДИН
СЕКУНД
ХВИЛИН
00
:
:
00
00
ЗНИЖКА ЗАКІНЧУЄТЬС ЧЕРЕЗ:
<!--!ANNEXX!--><!--!ANX815-1!--!><!--![{"id":"","data":""},{"id":"anxcommentblock","data":""},{"id":"date-time","data":"2023-05-28 00:00"},{"id":"tz","data":"minus3"},{"id":"days","data":""},{"id":"nullhour","data":"false"},{"id":"hours","data":".tn-elem__5888424651683698442488"},{"id":"minutes","data":".tn-elem__5888424651683698437304"},{"id":"seconds","data":".tn-elem__5888424651683658425460"},{"id":"adddaystohours","data":"false"},{"id":"days_text","data":""},{"id":"days_1","data":""},{"id":"days_2","data":""},{"id":"days_5","data":""},{"id":"hours_text","data":".tn-elem__5888424651683658075793"},{"id":"hours_1","data":"годин"},{"id":"hours_2","data":"годин"},{"id":"hours_5","data":"годин"},{"id":"minutes_text","data":".tn-elem__5888424651683658095472"},{"id":"minutes_1","data":"хвилин"},{"id":"minutes_2","data":"хвилин"},{"id":"minutes_5","data":"хвилин"},{"id":"seconds_text","data":".tn-elem__5888424651683658095059"},{"id":"seconds_1","data":"секунд"},{"id":"seconds_2","data":"секунд"},{"id":"seconds_5","data":"секунд"}]!--><script> $('head').append('<style>' + (function () { return " , , .tn-elem__5888424651683698442488 , .tn-elem__5888424651683658075793 , .tn-elem__5888424651683698437304 , .tn-elem__5888424651683658095472 , .tn-elem__5888424651683658425460 , .tn-elem__5888424651683658095059".replace(/\s/g,"").split(/,\s|,/g).filter(function(e) { return e }).join(","); }()) + ' { display: none; }</style>'); $(function() { setTimeout(function() { let $days = $('').length ? $('').find('.tn-atom') : false, $daysText = $('').length ? $('').find('.tn-atom') : false, daysText1 = 'день' ? 'день' : 'день', daysText2 = 'дня' ? 'дня' : 'дня', daysText5 = 'дней' ? 'дней' : 'дней', $hours = $('.tn-elem__5888424651683698442488').length ? $('.tn-elem__5888424651683698442488').find('.tn-atom') : false, $hoursText = $('.tn-elem__5888424651683658075793').length ? $('.tn-elem__5888424651683658075793').find('.tn-atom') : false, hoursText1 = 'годин' ? 'годин' : 'час', hoursText2 = 'годин' ? 'годин' : 'часа', hoursText5 = 'годин' ? 'годин' : 'часов', $minutes = $('.tn-elem__5888424651683698437304').length ? $('.tn-elem__5888424651683698437304').find('.tn-atom') : false, $minutesText = $('.tn-elem__5888424651683658095472').length ? $('.tn-elem__5888424651683658095472').find('.tn-atom') : false, minutesText1 = 'хвилин' ? 'хвилин' : 'минута', minutesText2 = 'хвилин' ? 'хвилин' : 'минуты', minutesText5 = 'хвилин' ? 'хвилин' : 'минут', $seconds = $('.tn-elem__5888424651683658425460').length ? $('.tn-elem__5888424651683658425460').find('.tn-atom') : false, $secondsText = $('.tn-elem__5888424651683658095059').length ? $('.tn-elem__5888424651683658095059').find('.tn-atom') : false, secondsText1 = 'секунд' ? 'секунд' : 'секунда', secondsText2 = 'секунд' ? 'секунд' : 'секунды', secondsText5 = 'секунд' ? 'секунд' : 'секунд', date = new Date(('2023-07-12 00:00').replace(/-/g, "/")), tz = (function() { let tz = "minus3"; if (/plus/.test(tz)) { return +tz.replace('plus','+'); } else return +tz.replace('minus','-'); }()), tzScript = (date.getTimezoneOffset() / 60) - tz, diffTZ = tzScript <= 0 ? true : false, offsetTZUser = diffTZ ? 0 - tzScript : 0 + tzScript, rend = false; function declOfNum(number, words) { return words[(number % 100 > 4 && number % 100 < 20) ? 2 : [2, 0, 1, 1, 1, 2][(number % 10 < 5) ? Math.abs(number) % 10 : 5]]; } function nullTime() { return diffTZ ? (Date.parse(date) - (Date.now() - offsetTZUser * 60 * 60 * 1000)) / 1000 > 0 : (Date.parse(date) - (Date.now() + offsetTZUser * 60 * 60 * 1000)) / 1000 > 0 } if (nullTime()) { setInterval(timer, 1e3); timer(); function timer() { let timeLeft = diffTZ ? parseInt((Date.parse(date) - (Date.now() - offsetTZUser * 60 * 60 * 1000)) / 1000) : parseInt((Date.parse(date) - (Date.now() + offsetTZUser * 60 * 60 * 1000)) / 1000), days = Math.floor(timeLeft / 86400), hours = Math.floor((timeLeft - ($days ? (days * 86400) : !$days && !false ? (days * 86400) : 0)) / 3600), minutes = Math.floor(((timeLeft - ($days ? (days * 86400) : !$days && !false ? (days * 86400) : 0) - ($hours ? hours * 3600 : !$days && !false ? hours * 3600 : 0 )) / 60)), seconds = Math.floor((timeLeft - ($days ? (days * 86400) : !$days && !false ? (days * 86400) : 0) - ($hours ? hours * 3600 : !$days && !false ? hours * 3600 : 0) - ($minutes ? minutes * 60 : !$days && !false ? minutes * 60 : 0))); let hoursB = hours, minutesB = minutes, secondsB = seconds; if (false && days < "10") { days = "0" + days; } if (hours < "10") { hours = "0" + hours; } if (minutes < "10") { minutes = "0" + minutes; } if (seconds < "10") { seconds = "0" + seconds; } if (!nullTime()) { days = hours = minutes = seconds = hoursB = minutesB = secondsB = 0; } if ($days) $days.text(days); if ($daysText) $daysText.text(declOfNum(days, [daysText1, daysText2, daysText5])); if ($hours) $hours.text(hours); if ($hoursText) $hoursText.text(declOfNum(hoursB, [hoursText1, hoursText2, hoursText5])); if ($minutes) $minutes.text(minutes); if ($minutesText) $minutesText.text(declOfNum(minutesB, [minutesText1, minutesText2, minutesText5])); if ($seconds) $seconds.text(seconds); if ($secondsText) $secondsText.text(declOfNum(secondsB, [secondsText1, secondsText2, secondsText5])); if (!rend) { rend = true; if ($days) $('').css('display','table'); if ($daysText) $('').css('display','table'); if ($hours) $('.tn-elem__5888424651683698442488').css('display','table'); if ($hoursText) $('.tn-elem__5888424651683658075793').css('display','table'); if ($minutes) $('.tn-elem__5888424651683698437304').css('display','table'); if ($minutesText) $('.tn-elem__5888424651683658095472').css('display','table'); if ($seconds) $('.tn-elem__5888424651683658425460').css('display','table'); if ($secondsText) $('.tn-elem__5888424651683658095059').css('display','table'); } } } else { if ($days) $days.text(0); if ($hours) $hours.text(0); if ($minutes) $minutes.text(0); if ($seconds) $seconds.text(0); if ($daysText) $daysText.text(declOfNum(0, [daysText1, daysText2, daysText5])); if ($hoursText) $hoursText.text(declOfNum(0, [hoursText1, hoursText2, hoursText5])); if ($minutesText) $minutesText.text(declOfNum(0, [minutesText1, minutesText2, minutesText5])); if ($secondsText) $secondsText.text(declOfNum(0, [secondsText1, secondsText2, secondsText5])); if ($days) $('').css('display','table'); if ($daysText) $('').css('display','table'); if ($hours) $('.tn-elem__5888424651683698442488').css('display','table'); if ($hoursText) $('.tn-elem__5888424651683658075793').css('display','table'); if ($minutes) $('.tn-elem__5888424651683698437304').css('display','table'); if ($minutesText) $('.tn-elem__5888424651683658095472').css('display','table'); if ($seconds) $('.tn-elem__5888424651683658425460').css('display','table'); if ($secondsText) $('.tn-elem__5888424651683658095059').css('display','table'); } window.dispatchEvent(new CustomEvent('resize')); },navigator.userAgent.indexOf('Safari') !== -1 && navigator.userAgent.indexOf('iPhone') !== -1 ? 0 : 500); }); </script>
Days
Hours
Minutes
Seconds