Некодим© 2020-2026 Некодим
Готовые модификации для вашего сайта. Улучшайте функциональность и дизайн без программирования.
var numberWithoutLetter = removeNumberSpace.split(' ');
1314 numberWithoutLetter.forEach(function (item) {1315 if (!isNaN(parseInt(item.replace(/[^\d., ]+/g, ''), 10))) {1316 number.push(item.replace(/[^\d., ]+/g, ''));1321 var decimalLength = 0;1322 var isFloat = false;1323 var isComma = false;1324 curElem.removeAttribute('data-animate-number-count');1326 if (numberDotOrComma !== null) {1327 isComma = numberDotOrComma[0].indexOf(',') !== -1;1330 number.forEach(function (item, i) {1331 if (numberDotOrComma !== null) {1333 if (item.indexOf(',') !== -1) {1334 itemSplitArr = item.split(',');1336 if (item.indexOf('.') !== -1) {1337 itemSplitArr = item.split('.');1339 if (item.indexOf(',') !== -1 || item.indexOf('.') !== -1) {1340 decimalLength = itemSplitArr[1].length;1341 number[i] = +itemSplitArr.join('.');1347 var animatedNumber = curElem.querySelector('.t-animate__number');1349 var maxNum = Number(number[0]) || 0;1351 var round = Math.pow(10, decimalLength);1356 // value in ms of one iteration which increasing the startNum1358 var animationStep = 0;1359 var interval = setInterval(function () {1360 // 9 - to create round value without zero as last number in value [from 1000 to 1111]1361 startNum += maxNum / (timer * 9);1364 animationStep = (Math.round(startNum) / round).toFixed(decimalLength) + '';1366 animationStep = Math.floor(startNum) + '';1369 if (numberWithSpace.length > 1) {1370 animationStep = animationStep.replace(/(\d)(?=(\d{3})+([^\d]|$))/g, '$1 ');1373 animationStep = animationStep.replace(/\./g, ',');1375 if (animatedNumber) animatedNumber.textContent = animationStep;1376 if (startNum >= maxNum) {1377 clearInterval(interval);1378 curElem.innerHTML = text;1379 var curElSpan = curElem.querySelectorAll('span');1380 Array.prototype.forEach.call(curElSpan, function (span) {1381 span.setAttribute('style', style);1388 /* ---------- functions, which set animation state after DOMContentLoaded ---------- */1391 * Set animation state1393 * @param {HTMLElement[]} animGroupsBlocks - animated group block list1394 * @param {HTMLElement[]} animChainsBlocks - animated chain block list1395 * @param {HTMLElement[]} animElems - animated elements list1397 function t_animate__setAnimationState(animGroupsBlocks, animChainsBlocks, animElems) {1398 var viewTop = window.pageYOffset;1399 var viewBottom = viewTop + window.innerHeight;