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

© 2020-2026 Некодим

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

Компания

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

Полезное

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

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

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

tilda-animation-2.0.js

Код файла
Версия от 04.12.2026, 04:03:53 МСК
Оригинал на CDNСнимок 56c3b845Полный текст
1/**2 * tilda-animation3 * работает в блоках, где анимация может быть подключена к его элементам - заголовок, подзаголовок,4 * анимированные цифры и т.д.5 */6 7/**8 * tilda-animation9 * work with:10 *  - basicly animated elements like: titles, subtitles, paragraphs, buttons (fadeIn, fadeInTop, fadeInBottom, fadeInLeft, fadeInRight etc.)11 *  - numbers animation (for blocks CL19, FR402, FR403, FR501 etc)12 *  - basic animation in Zero Block, but fixing and parallax doing tilda-animation-ext
История файла и сравнение версий
  • 04.12.2026, 04:03:53 · 56c3b845
13 *
14 *
15 * how does it work by steps
16 * 1) check the document readystate if it is not 'loading' than start init otherwise wait for DOMContentLoaded
17 * 2) init function
18 * - check all cases when we need to turn off animation
19 * - wrap all text elements with custom opacity
20 * - add no hover class to btns
21 * - check for animation type fadeInLeft if they it exists than added overflow-x: hidden to #allrecords
22 * - prepair all elements with number animation
23 * - replace number part with span with 0
24 * - dublicate all el styles to new span
25 * 3) start animation function after 1.5s delay
26 * - get all animated blocks/elems into 3 Node lists
27 * 1) grouped animation blocks
28 * 2) chain animation blocks
29 * 3) other animation elements
30 * - if there is a mobile device than additionally check
31 * and remove animation class (.t-animate) from all blocks
32 * except elements in zero-block with mobile animtion turned on
33 * - set state for all animated groups of blocks depends on their position on the screen
34 * 1) grouped animation blocks
35 * 2) chain animation blocks
36 * 3) other animation elements
37 * - regroup animated groups of blocks
38 * - if the intersection observer is exist than set it, special observer for each array EXCEPT CHAIN ANIMMATION (grouped, other els)
39 * - for chain animation we set scroll event on window
40 * we check first element in chain array and add it class t-animate__chain_first-in-row,
41 * to let the new row be animated as soon, as the first element in previous row is animated
42 *
43 */
44
45if (document.readyState !== 'loading') {
46 t_animate__init();
47} else {
48 document.addEventListener('DOMContentLoaded', t_animate__init);
49}
50
51/**
52 * Init animation
53 *
54 * @returns {void} - if user stay in edit mode, animation off, etc.
55 */
56function t_animate__init() {
57 // check if we need to turn off animation
58 if (!t_animate__checkAnimationAvailability()) return;
59
60 // generaty startes styles for custom resolutions
61 t_animate__generateStyles();
62
63 // wrap animated text elements with custom opacity
64 t_animate__wrapTextWithOpacity();
65
66 // adding t-animate_no-hover to animated btns
67 t_animate__addNoHoverClassToBtns();
68
69 // check for fadeInLeft elements
70 t_animate__preventHorizontalScroll();
71
72 if (document.documentElement.clientWidth >= 980) {
73 t_animate__wrapTextAnimationsWords();
74 }
75
76 // prepair number for animation
77 if (document.documentElement.clientWidth >= 1200) {
78 t_animate__parseNumberText();
79 }
80
81 /**
82 * На разрешении меньше 1200px анимация отключена, поэтому показываем элементы сразу,
83 * не дожидаясь отложенного старта анимации
84 */
85 if (window.innerWidth < 1200) {
86 t_animate__checkMobile(Array.from(document.querySelectorAll('.t-animate')));
87 }
88
89 // letters are wrapped after mobile check, so text of elements without mobile animation isn't split into letters
90 t_animate__wrapAnimatedTextLetters();
91
92 // below 980px text animations are available only for ZeroBlock elements with mobile animation, which are left after mobile check
93 if (document.documentElement.clientWidth < 980) {
94 t_animate__wrapTextAnimationsWords('.t396');
95 }
96
97 // start animation using setTimeout because
98 // if don't than animation will be triggered
99 // immediately and some styles/images may be not downloaded yet
100 setTimeout(function () {
Следующие 100 строк