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

© 2020-2026 Некодим

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

Компания

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

Полезное

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

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

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

tilda-animation-2.0.js

Код файла
Версия от 04.12.2026, 04:03:53 МСК
Оригинал на CDNСнимок 56c3b845Полный текст
2701 * @param {CSSStyleDeclaration} computedStyle - computed style of the node2702 * @param {string|null} parentVerticalAlign - inherited vertical align from parent2703 * @returns {string|null} - vertical align value or null if none2704 */2705function t_animate__getTextVerticalAlign(computedStyle, parentVerticalAlign) {2706	const verticalAlign = computedStyle.verticalAlign;2707 2708	if (!verticalAlign || verticalAlign === 'baseline' || verticalAlign === 'middle') {2709		return parentVerticalAlign;2710	}2711 
История файла и сравнение версий
  • 04.12.2026, 04:03:53 · 56c3b845
2712
return verticalAlign;
2713}
2714
2715/**
2716 * @typedef {Object} TextStyleOptions
2717 * @property {string|null} verticalAlign - vertical align value (e.g., 'baseline', 'middle', 'sub', 'super') or null if none
2718 * @property {TextDecoration|null} textDecoration - text decoration properties or null if none
2719 */
2720
2721/**
2722 * Get text style options of a node, including vertical align and text decoration, considering inherited styles from parent.
2723 * @param {Node} node - node to get text style options from
2724 * @param {TextStyleOptions|null} parentTextStyleOptions - inherited text style options from parent
2725 * @returns {TextStyleOptions} - object with verticalAlign and textDecoration properties
2726 */
2727function t_animate__getTextStyleOptions(node, parentTextStyleOptions) {
2728 const { verticalAlign: parentVerticalAlign = null, textDecoration: parentTextDecoration = null } =
2729 parentTextStyleOptions ?? {};
2730 const computedStyle = window.getComputedStyle(node);
2731
2732 const verticalAlign = t_animate__getTextVerticalAlign(computedStyle, parentVerticalAlign);
2733 const textDecoration = t_animate__getTextDecoration(computedStyle, parentTextDecoration);
2734
2735 return { verticalAlign, textDecoration };
2736}
2737
2738/**
2739 * Create word mask wrapper for word animation
2740 * @returns {HTMLSpanElement}
2741 */
2742function t_animate__createWordMaskWrapper() {
2743 const wrapper = document.createElement('span');
2744 wrapper.className = 't-animate__word-mask-wrapper';
2745
2746 return wrapper;
2747}
2748
2749/**
2750 * Create word span with animation
2751 * @param {string} text - text content for the span
2752 * @param {TextDecoration|null} textDecoration - inherited text decoration from parent
2753 * @param {boolean} isMasked - whether the word should be wrapped in a mask wrapper
2754 * @returns {HTMLSpanElement}
2755 */
2756function t_animate__createWord(text, textDecoration, isMasked = false) {
2757 const span = document.createElement('span');
2758 span.className = 't-animate__word';
2759
2760 span.style.textDecorationLine = textDecoration?.lines?.join(' ') || '';
2761 span.style.textDecorationStyle = textDecoration?.style || '';
2762 span.style.textDecorationColor = textDecoration?.color || '';
2763 span.style.textDecorationThickness = textDecoration?.thickness || '';
2764 span.textContent = text;
2765
2766 if (!isMasked) {
2767 return span;
2768 }
2769
2770 const wrapper = t_animate__createWordMaskWrapper();
2771 wrapper.appendChild(span);
2772
2773 return wrapper;
2774}
2775
2776/**
2777 * Create strict inline word span for complex text nodes (like superscripts with underline).
2778 * Such node will be inline and have more simple animation without transforms.
2779 * @param {string} text - text content for the span
2780 * @returns {HTMLSpanElement}
2781 */
2782function t_animate__createStrictWord(text) {
2783 const span = document.createElement('span');
2784 span.className = 't-animate__word t-animate__word_strict';
2785 span.textContent = text;
2786
2787 return span;
2788}
2789
2790/**
2791 * Create whitespace span for word animation
2792 * @param {string} text - text content for the span
2793 * @returns {HTMLSpanElement}
2794 */
2795function t_animate__createWhitespaceWord(text) {
2796 const span = document.createElement('span');
2797 span.className = 't-animate__word t-animate__word_whitespace';
2798 span.textContent = text;
2799
2800 return span;
Предыдущие 100 строкСледующие 100 строк