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

© 2020-2026 Некодим

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

Компания

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

Полезное

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

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

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

tilda-animation-2.0.js

Код файла
Версия от 04.12.2026, 04:03:53 МСК
Оригинал на CDNСнимок 56c3b845Полный текст
2601 * and joining of connected scripts (e.g. Arabic).2602 * @param {HTMLElement} element - animated text element2603 */2604function t_animate__unwrapAnimatedTextLetters(element) {2605	const wordElements = element.querySelectorAll('.t-animate__word');2606 2607	wordElements.forEach(wordElement => {2608		if (wordElement.querySelector('.t-animate__letter')) {2609			wordElement.textContent = wordElement.textContent;2610		}2611	});2612
История файла и сравнение версий
  • 04.12.2026, 04:03:53 · 56c3b845
}
2613
2614/**
2615 * Unwrap each line of animated text
2616 * @param {HTMLElement|null} element - optional specific element to prepare, if null, prepares all elements with the specified animation styles
2617 */
2618function t_animate__unwrapAnimatedTextLines(element = null) {
2619 const animatedTextElements = t_animate__getAnimatedTextElements(
2620 ['line-fade-in-right-gradient', 'line-fade-in-left-gradient'],
2621 element
2622 );
2623
2624 animatedTextElements.forEach(animatedTextElement => {
2625 t_animate__unwrapAnimatedTextElementLines(animatedTextElement);
2626 });
2627}
2628
2629/**
2630 * Wrap each word of animated text with a span for specific animation styles
2631 * @param {HTMLElement|null} element - optional specific element to prepare, if null, prepares all elements with the specified animation styles
2632 */
2633function t_animate__wrapAnimatedTextLines(element = null) {
2634 t_animate__unwrapAnimatedTextLines(element);
2635
2636 const animatedTextElements = t_animate__getAnimatedTextElements(
2637 ['line-fade-in-right-gradient', 'line-fade-in-left-gradient'],
2638 element
2639 );
2640
2641 animatedTextElements.forEach(animatedTextElement => {
2642 t_animate__wrapAnimatedTextElementLines(animatedTextElement);
2643 });
2644}
2645
2646/**
2647 * Get base delay from element's transition-delay style
2648 * @param {HTMLElement} element - element to get delay from
2649 * @returns {number} - delay in seconds
2650 */
2651function t_animate__getElementBaseDelay(element) {
2652 const transitionDelay = element.style.transitionDelay || window.getComputedStyle(element).transitionDelay;
2653 const parsedTransitionDelay = parseFloat(transitionDelay);
2654
2655 if (isNaN(parsedTransitionDelay) || parsedTransitionDelay === 0) {
2656 return 0;
2657 }
2658
2659 if (transitionDelay.includes('ms')) {
2660 return parsedTransitionDelay / 1000;
2661 }
2662
2663 return parsedTransitionDelay;
2664}
2665
2666/**
2667 * @typedef {Object} TextDecoration
2668 * @property {string[]} lines - array of text decoration lines (e.g., ['underline', 'line-through'])
2669 * @property {string} style - text decoration style (e.g., 'solid', 'dashed')
2670 * @property {string} color - text decoration color (e.g., '#000000')
2671 * @property {string} thickness - text decoration thickness (e.g., '2px')
2672 */
2673
2674/**
2675 * Get text decoration properties of a node
2676 * @param {CSSStyleDeclaration} computedStyle - computed style of the node
2677 * @param {TextDecoration|null} parentTextDecoration - inherited text decoration from parent
2678 * @returns {TextDecoration|null} - object with text decoration properties or null if none
2679 */
2680function t_animate__getTextDecoration(computedStyle, parentTextDecoration) {
2681 const textDecorationLine = computedStyle.textDecorationLine;
2682
2683 if (!textDecorationLine || textDecorationLine === 'none') {
2684 return parentTextDecoration;
2685 }
2686
2687 const textDecorationStyle = computedStyle.textDecorationStyle;
2688 const textDecorationColor = computedStyle.textDecorationColor;
2689 const textDecorationThickness = computedStyle.textDecorationThickness;
2690
2691 return {
2692 lines: [...(parentTextDecoration?.lines ?? []), textDecorationLine],
2693 style: textDecorationStyle,
2694 color: textDecorationColor,
2695 thickness: textDecorationThickness,
2696 };
2697}
2698
2699/**
2700 * Get text vertical align of a node
Предыдущие 100 строкСледующие 100 строк