Некодим© 2020-2026 Некодим
Готовые модификации для вашего сайта. Улучшайте функциональность и дизайн без программирования.
* @param {HTMLElement[]} animChainsBlocks - list of animated chain blocks
914 * @param {HTMLElement[]} animElems - list of animated elements917 function t_animate__animateOnScroll(animGroupsBlocks, animChainsBlocks, animElems) {918 if (!animGroupsBlocks.length && !animChainsBlocks.length && !animElems.length) return;919 var viewTop = window.pageYOffset;920 var viewBottom = viewTop + window.innerHeight;921 var newAnimGroupsBlocks = t_animate__animateGroups(animGroupsBlocks, viewBottom, viewTop);922 var newAnimChainsBlocks = t_animate__animateChainsBlocks(animChainsBlocks, viewBottom, viewTop);923 var newAnimElems = t_animate__animateElems(animElems, viewBottom, viewTop);924 return [newAnimGroupsBlocks, newAnimChainsBlocks, newAnimElems];928 * Animate grouped blocks. Called inside t_animate__animateOnScroll930 * @param {HTMLElement[]} animGroupsBlocks - list of animated group blocks931 * @param {number} viewBottom - bottom position of viewport933 function t_animate__animateGroups(animGroupsBlocks, viewBottom) {934 animGroupsBlocks.forEach(function (currentBlock) {935 if (currentBlock.curTopOffset < viewBottom) {936 var currentBlockEls = currentBlock.querySelectorAll('.t-animate');937 currentBlockEls = Array.prototype.filter.call(currentBlockEls, function (el) {939 el.classList.contains('t-animate__btn-wait-chain') ||940 el.getAttribute('data-animate-chain') === 'yes'943 t_animate__makeSectionButtonWait(currentBlock);944 t_animate__saveSectionHeaderStartTime(currentBlock);945 Array.prototype.forEach.call(currentBlockEls, function (currentBlockEl) {946 currentBlockEl.classList.remove('t-animate_wait');947 t_animate__removeNoHoverClassFromBtns(currentBlockEl);948 t_animate__startElementAnimation(currentBlockEl, false);953 return animGroupsBlocks;957 * Animate chain blocks958 * @param {HTMLElement[]} animChainsBlocks - list of animation chain blocks959 * @param {number} viewBottom - bottom position of viewport961 function t_animate__animateChainsBlocks(animChainsBlocks, viewBottom) {962 animChainsBlocks.forEach(function (curBlock) {963 if (curBlock.itemsOffsets[0] < viewBottom && curBlock.querySelectorAll('.t-animate_wait').length) {964 t_animate__animateChainItemsOnScroll(curBlock, viewBottom);965 if (curBlock.itemsOffsets.length) {966 t_animate__checkSectionButtonAnimation__outOfTurn(curBlock);971 return animChainsBlocks;975 * Animate common elements. Called inside t_animate__animateOnScroll977 * @param {HTMLElement[]} animElems - list of animated elements978 * @param {number} viewBottom - bottom position of viewport980 function t_animate__animateElems(animElems, viewBottom, viewTop) {981 Array.prototype.filter.call(animElems, function (el) {982 var curElemTrigger = t_animate__detectElemTriggerOffset(el, viewBottom);983 if (el.curTopOffset < curElemTrigger) {984 el.classList.remove('t-animate_wait');985 t_animate__removeNoHoverClassFromBtns(el);986 t_animate__startElementAnimation(el, false);987 if (t_animate__getAttrByResBase(el, 'style') === 'animatednumber') {988 t_animate__animateNumbers(el);993 if (el.curTopOffset < viewTop) {