Это первая доступная в Git версия файла.
1/**2* tilda-animation3* работает в блоках, где анимация может быть подключена к его элементам - заголовок, подзаголовок,4* анимированные цифры и т.д.5*/67/**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 * * * how does it work by steps * 1) check the document readystate if it is not 'loading' than start init otherwise wait for DOMContentLoaded * 2) init function * - check all cases when we need to turn off animation * - wrap all text elements with custom opacity * - add no hover class to btns * - check for animation type fadeInLeft if they it exists than added overflow-x: hidden to #allrecords * - prepair all elements with number animation * - replace number part with span with 0 * - dublicate all el styles to new span * 3) start animation function after 1.5s delay * - get all animated blocks/elems into 3 Node lists * 1) grouped animation blocks * 2) chain animation blocks * 3) other animation elements * - if there is a mobile device than additionally check * and remove animation class (.t-animate) from all blocks * except elements in zero-block with mobile animtion turned on * - set state for all animated groups of blocks depends on their position on the screen * 1) grouped animation blocks * 2) chain animation blocks * 3) other animation elements * - regroup animated groups of blocks * - if the intersection observer is exist than set it, special observer for each array EXCEPT CHAIN ANIMMATION (grouped, other els) * - for chain animation we set scroll event on window * we check first element in chain array and add it class t-animate__chain_first-in-row, * to let the new row be animated as soon, as the first element in previous row is animated * */if (document.readyState !== 'loading') { t_animate__init();} else { document.addEventListener('DOMContentLoaded', t_animate__init);}/** * Init animation * * @returns {void} - if user stay in edit mode, animation off, etc. */function t_animate__init() { // check if we need to turn off animation if (!t_animate__checkAnimationAvailability()) return; // generaty startes styles for custom resolutions t_animate__generateStyles(); // wrap animated text elements with custom opacity t_animate__wrapTextWithOpacity(); // adding t-animate_no-hover to animated btns t_animate__addNoHoverClassToBtns(); // check for fadeInLeft elements t_animate__preventHorizontalScroll(); if (document.documentElement.clientWidth >= 980) { t_animate__wrapTextAnimationsWords(); } // prepair number for animation if (document.documentElement.clientWidth >= 1200) { t_animate__parseNumberText(); } /** * На разрешении меньше 1200px анимация отключена, поэтому показываем элементы сразу, * не дожидаясь отложенного старта анимации */ if (window.innerWidth < 1200) { t_animate__checkMobile(Array.from(document.querySelectorAll('.t-animate'))); } // letters are wrapped after mobile check, so text of elements without mobile animation isn't split into letters t_animate__wrapAnimatedTextLetters(); // below 980px text animations are available only for ZeroBlock elements with mobile animation, which are left after mobile check if (document.documentElement.clientWidth < 980) { t_animate__wrapTextAnimationsWords('.t396'); } // start animation using setTimeout because // if don't than animation will be triggered // immediately and some styles/images may be not downloaded yet setTimeout(function () {