Некодим логотипНекодим
МодификацииПубликацииНекодИИмЦены
Некодим логотипНекодим

© 2020-2026 Некодим

Готовые модификации для вашего сайта. Улучшайте функциональность и дизайн без программирования.

Компания

  • Контакты
  • Публичная оферта
  • Политика конфиденциальности
  • Согласие на обработку данных
  • Лицензионное соглашение
  • Реферальная программа

Полезное

  • Модификации
  • Публикации
  • Каталог блоков Tilda
  • MCP для агентов
  • Журнал изменений
  • Доска почёта

Личный кабинет

  • Вход
  • Регистрация
  • Цены
Журнал измененийИстория GitФайлыTilda MCP
Каталог файлов

tilda-animation-2.0.js

Код файла
Версия от 04.12.2026, 04:03:53 МСК
Оригинал на CDNСнимок 56c3b845Полный текст
1401	t_animate__setGroupsBlocksState(animGroupsBlocks, viewTop, viewBottom);1402 1403	animChainsBlocks.forEach(function (curBlock) {1404		t_animate__assignChainDelay(curBlock, viewBottom, viewTop);1405		t_animate__checkSectionButtonAnimation__outOfTurn(curBlock);1406	});1407 1408	t_animate__setAnimELemsState(animElems, viewTop, viewBottom);1409 1410	window.addEventListener('resize', t_throttle(t_animate__removeInlineAnimStyles));1411}1412
История файла и сравнение версий
  • 04.12.2026, 04:03:53 · 56c3b845
1413/**
1414 * Set state for animElems group
1415 * @param {HTMLElement[]} animElems - animated elements list
1416 * @param {number} viewTop
1417 * @param {number} viewBottom
1418 */
1419function t_animate__setAnimELemsState(animElems, viewTop, viewBottom) {
1420 animElems.forEach(function (curElem) {
1421 var curElemOffsetTop = curElem.getBoundingClientRect().top + window.pageYOffset;
1422 if (curElemOffsetTop < viewTop - 500) {
1423 t_animate__removeAnimationClass(curElem, 'no-hover');
1424
1425 // fix for numbers with anchor link
1426 if (t_animate__getAttrByResBase(curElem, 'style') === 'animatednumber') {
1427 t_animate__animateNumbers(curElem);
1428 }
1429
1430 return true;
1431 }
1432 var curElemTrigger = t_animate__detectElemTriggerOffset(curElem, viewBottom);
1433 t_animate__setCustomAnimSettings(curElem, curElemOffsetTop, viewBottom);
1434 if (curElemOffsetTop < curElemTrigger && !curElem.closest('.t1093')) {
1435 t_animate__removeNoHoverClassFromBtns(curElem);
1436 t_animate__startElementAnimation(curElem, true);
1437 if (t_animate__getAttrByResBase(curElem, 'style') === 'animatednumber') {
1438 t_animate__animateNumbers(curElem);
1439 }
1440 }
1441 if (curElemOffsetTop >= curElemTrigger || curElem.closest('.t1093')) {
1442 curElem.classList.add('t-animate_wait');
1443 }
1444 });
1445}
1446
1447/**
1448 * Set state for animGroupsBlocks group
1449 * @param {HTMLElement[]} animGroupsBlocks - animated group elements list
1450 * @param {number} viewTop
1451 * @param {number} viewBottom
1452 */
1453function t_animate__setGroupsBlocksState(animGroupsBlocks, viewTop, viewBottom) {
1454 animGroupsBlocks.forEach(function (curBlock) {
1455 var curBlockAnimElems = curBlock.querySelectorAll('.t-animate');
1456 curBlockAnimElems = Array.prototype.filter.call(curBlockAnimElems, function (animEl) {
1457 return !(animEl.getAttribute('data-animate-chain') === 'yes');
1458 });
1459 var curBlockOffset = curBlock.getBoundingClientRect().top + window.pageYOffset;
1460 t_animate__removeAnimFromHiddenSlides(curBlock);
1461 var sectionHeadDelay = t_animate__assignSectionDelay(curBlock);
1462 t_animate__assignGroupDelay(curBlock, sectionHeadDelay);
1463 Array.prototype.forEach.call(curBlockAnimElems, function (el) {
1464 var parentIsHidden = el.closest('.t397__off') || el.closest('.t395__off') || el.closest('.t400__off');
1465 if (el.classList.contains('t-animate_no-hover') && parentIsHidden) {
1466 el.classList.remove('t-animate_no-hover');
1467 }
1468 if (curBlockOffset <= viewTop - 100) {
1469 t_animate__saveSectionHeaderStartTime(curBlock);
1470 t_animate__removeAnimationClass(el, 'no-hover');
1471 el.style.transitionDelay = '';
1472 return true;
1473 }
1474 if (curBlockOffset < viewBottom && curBlockOffset > viewTop - 100) {
1475 // if button is part of section with chain animation, it should wait till the end of chain animation
1476 t_animate__makeSectionButtonWait(curBlock);
1477 if (!el.classList.contains('.t-animate__btn-wait-chain')) {
1478 t_animate__removeNoHoverClassFromBtns(el);
1479 if (parentIsHidden) {
1480 el.classList.add('t-animate_wait');
1481 } else {
1482 t_animate__startElementAnimation(el, false);
1483 }
1484 }
1485 }
1486 if (curBlockOffset >= viewBottom) {
1487 el.classList.add('t-animate_wait');
1488 }
1489 });
1490 });
1491}
1492
1493/**
1494 * Set animation state for animChainsBlocks group
1495 *
1496 * @param {HTMLElement[] | NodeList} animChainsBlocks - animated chain blocks
1497 */
1498function t_animate__setAnimationStateChains(animChainsBlocks) {
1499 if (!animChainsBlocks || !animChainsBlocks.length) return false;
1500 var viewTop = window.pageYOffset;
Предыдущие 100 строкСледующие 100 строк