Каталог файловtilda-animation-2.0.js
1501 var viewBottom = viewTop + window.innerHeight;1502 Array.prototype.forEach.call(animChainsBlocks, function (curBlock) {1503 t_animate__assignChainDelay(curBlock, viewBottom, viewTop);1504 t_animate__checkSectionButtonAnimation__outOfTurn(curBlock);1505 });1506}1507 1508/**1509 * Return section head delay. Used for animGroupsBlocks1510 *1511 * @param {HTMLElement} curBlock - current element1512
История файла и сравнение версий
* @returns {number} - section head delay
1514function t_animate__assignSectionDelay(curBlock) { 1515 var sectionHeadDelay = 0; 1516 var sectionTitle = curBlock.querySelectorAll('.t-section__title.t-animate'); 1517 var sectionDescr = curBlock.querySelectorAll('.t-section__descr.t-animate'); 1518 if (sectionTitle.length) { 1519 sectionHeadDelay = 0.16; 1521 if (sectionDescr.length) { 1522 Array.prototype.forEach.call(sectionDescr, function (descr) { 1523 descr.style.transitionDelay = sectionHeadDelay + 's'; 1525 sectionHeadDelay += 0.16; 1527 return sectionHeadDelay; 1531 * Add style transition-delay for current element. 1532 * Depends on which elements are in current block 1533 * @param {HTMLElement} curBlock - current block 1534 * @param {number} sectionHeadDelay - delay 1536function t_animate__assignGroupDelay(curBlock, sectionHeadDelay) { 1538 if (curBlock.querySelectorAll('[data-animate-order]').length) { 1539 t_animate__assignOrderedElemsDelay(curBlock, sectionHeadDelay); 1541 var elemImg = curBlock.querySelectorAll('.t-img.t-animate'); 1542 var elemSubtitle = curBlock.querySelectorAll('.t-uptitle.t-animate'); 1543 var elemTitle = curBlock.querySelectorAll('.t-title.t-animate'); 1544 elemTitle = Array.prototype.filter.call(elemTitle, function (title) { 1545 return !title.classList.contains('t-section__title'); 1547 var elemDescr = curBlock.querySelectorAll('.t-descr.t-animate'); 1548 elemDescr = Array.prototype.filter.call(elemDescr, function (descr) { 1549 return !descr.classList.contains('t-section__descr'); 1551 var elemBtn = curBlock.querySelectorAll('.t-btn.t-animate, .t-btnwrapper.t-animate'); 1552 elemBtn = Array.prototype.filter.call(elemBtn, function (descr) { 1553 return !descr.closest('.t-section__bottomwrapper'); 1555 var elemTimer = curBlock.querySelectorAll('.t-timer.t-animate'); 1556 var elemForm = curBlock.querySelectorAll('form.t-animate'); 1557 if (elemImg.length) { 1560 if (elemSubtitle.length) { 1561 Array.prototype.forEach.call(elemSubtitle, function (subTitle) { 1562 subTitle.style.transitionDelay = animDelay + 's'; 1565 if (elemSubtitle.length) { 1566 animDelay = animDelay + 0.3; 1568 if (elemTitle.length) { 1569 Array.prototype.forEach.call(elemTitle, function (title) { 1570 title.style.transitionDelay = animDelay + 's'; 1573 if (elemTitle.length) { 1574 animDelay = animDelay + 0.3; 1576 if (elemDescr.length) { 1577 Array.prototype.forEach.call(elemDescr, function (descr) { 1578 descr.style.transitionDelay = animDelay + 's'; 1581 if (elemDescr.length) { 1582 animDelay = animDelay + 0.3; 1584 if (elemSubtitle.length || elemTitle.length || elemDescr.length) { 1585 animDelay = animDelay + 0.2; 1587 if (elemTimer.length) { 1588 Array.prototype.forEach.call(elemTimer, function (timer) { 1589 timer.style.transitionDelay = animDelay + 's'; 1592 if (elemTimer.length) { 1593 animDelay = animDelay + 0.5; 1595 if (elemBtn.length) { 1596 elemBtn[0].style.transitionDelay = animDelay + 's'; 1598 if (elemBtn.length === 2) { 1599 animDelay = animDelay + 0.4;