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

© 2020-2026 Некодим

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

Компания

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

Полезное

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

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

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

tilda-animation-2.0.js

Код файла
Версия от 04.12.2026, 04:03:53 МСК
Оригинал на CDNСнимок 56c3b845Полный текст
3101				if (existedContainerIndex >= 0) {3102					const { leftPart, rightPart } = splitElement(container, [...restPath, word]);3103					const newContainer = document.createDocumentFragment();3104 3105					prevElements.splice(existedContainerIndex, 1, leftPart);3106					elements.push(rightPart);3107 3108					newContainer.append(leftPart, rightPart);3109					root.replaceChild(newContainer, container);3110				} else if (!elements.includes(container)) {3111					elements.push(container);3112
История файла и сравнение версий
  • 04.12.2026, 04:03:53 · 56c3b845
}
3113 }
3114
3115 elementsLineInfoList.push({ root, elements });
3116 }
3117
3118 return elementsLineInfoList;
3119 }
3120
3121 /**
3122 * Get a slice of child nodes from a parent element between two specified child elements.
3123 * @param {Node} parentElement - the parent element containing the child nodes
3124 * @param {Node} fromElement - the starting child node of the slice
3125 * @param {Node} toElement - the ending child node of the slice
3126 * @returns {Node[]} - array of child nodes between fromElement and toElement (inclusive)
3127 */
3128 function getElementChildrenSlice(parentElement, fromElement, toElement) {
3129 const childList = Array.from(parentElement.childNodes);
3130 const firstChildIndex = childList.findIndex(child => child === fromElement);
3131 const lastChildIndex = childList.findIndex(child => child === toElement);
3132
3133 if (firstChildIndex < 0 || lastChildIndex < 0) {
3134 return [];
3135 }
3136
3137 const minChildIndex = Math.min(firstChildIndex, lastChildIndex);
3138 const maxChildIndex = Math.max(firstChildIndex, lastChildIndex);
3139
3140 return childList.slice(minChildIndex, maxChildIndex + 1);
3141 }
3142
3143 /**
3144 * Wrap a slice of child nodes from a parent element between two specified child elements with a new wrapper element.
3145 * @param {Node} node - the parent element containing the child nodes
3146 * @param {Node} fromElement - the starting child node of the slice
3147 * @param {Node} toElement - the ending child node of the slice
3148 */
3149 function wrapNodeInnerElementsByLine(node, fromElement, toElement) {
3150 const rootChildrenSlice = getElementChildrenSlice(node, fromElement, toElement);
3151
3152 if (!rootChildrenSlice.length) {
3153 return;
3154 }
3155
3156 const lineWrapper = t_animate__createLine();
3157
3158 rootChildrenSlice[0].before(lineWrapper);
3159 lineWrapper.append(...rootChildrenSlice);
3160 }
3161
3162 const lines = t_animate__getElementLines(node);
3163 const elementsLineInfoList = splitNodeInnerElementsByLines(node, lines);
3164
3165 elementsLineInfoList.forEach(({ root, elements }) => {
3166 const firstElement = elements.at(0);
3167 const lastElement = elements.at(-1);
3168
3169 wrapNodeInnerElementsByLine(root, firstElement, lastElement);
3170 });
3171}
3172
3173/**
3174 * Check IE browser
3175 *
3176 * @returns {Boolean} - if ie browser return true
3177 */
3178function t_animate__checkIE() {
3179 var sAgent = window.navigator.userAgent;
3180 var Idx = sAgent.indexOf('MSIE');
3181 var ieVersion = '';
3182 var oldIE = false;
3183 if (Idx > 0) {
3184 ieVersion = parseInt(sAgent.substring(Idx + 5, sAgent.indexOf('.', Idx)));
3185 if (ieVersion === 8 || ieVersion === 9) {
3186 oldIE = true;
3187 }
3188 }
3189 return oldIE;
3190}
Предыдущие 100 строк