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

© 2020-2026 Некодим

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

Компания

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

Полезное

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

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

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

tilda-animation-2.0.js

Код файла
Версия от 04.12.2026, 04:03:53 МСК
Оригинал на CDNСнимок 56c3b845Полный текст
2401			return acc;2402		}, [])2403		.map(({ words }) => words);2404 2405	return lines;2406}2407 2408/**2409 * Prepare word by word animation to the left.2410 * Split text into lines and reverse the order of words in each line.2411 * Add animation delay for each word by increment.2412 * @param {HTMLElement|null} element - optional specific element to prepare, if null, prepares all elements with the specified animation styles
История файла и сравнение версий
  • 04.12.2026, 04:03:53 · 56c3b845
2413 */
2414function t_animate__prepareWordByWordAnimationToLeft(element = null) {
2415 const wordDelayIncrement = 0.06;
2416 const animatedTextElements = t_animate__getAnimatedTextElements(['word-fade-in-left'], element);
2417
2418 animatedTextElements.forEach(animatedTextElement => {
2419 const lines = t_animate__getElementLines(animatedTextElement);
2420 const linesWithReversedWords = lines.map(line => line.reverse());
2421 const baseDelay = t_animate__getElementBaseDelay(animatedTextElement);
2422 let wordIndex = 0;
2423
2424 linesWithReversedWords.forEach(lineElement => {
2425 lineElement.forEach(wordElement => {
2426 t_animate__setTextParticleDelay(wordElement, baseDelay + wordIndex * wordDelayIncrement);
2427
2428 if (!t_animate__isWhitespaceParticle(wordElement)) {
2429 wordIndex++;
2430 }
2431 });
2432 });
2433 });
2434}
2435
2436/**
2437 * Prepare line by line animation.
2438 * Add animation delay for each line by increment.
2439 * @param {HTMLElement|null} element - optional specific element to prepare, if null, prepares all elements with the specified animation styles
2440 */
2441function t_animate__prepareLinesFadeInAnimation(element = null) {
2442 const lineDelayIncrement = 0.12;
2443 const animatedTextElements = t_animate__getAnimatedTextElements(['line-fade-in-up-masked'], element);
2444
2445 animatedTextElements.forEach(animatedTextElement => {
2446 const lines = t_animate__getElementLines(animatedTextElement);
2447 const baseDelay = t_animate__getElementBaseDelay(animatedTextElement);
2448
2449 lines.forEach((words, lineIndex) => {
2450 words.forEach(word => {
2451 t_animate__setTextParticleDelay(word, baseDelay + lineIndex * lineDelayIncrement);
2452 });
2453 });
2454 });
2455}
2456
2457/**
2458 * Prepare line by line animation for wrapped lines (line-fade-in-right-gradient, line-fade-in-left-gradient).
2459 * Add animation delay for each line by increment.
2460 * @param {HTMLElement|null} element - optional specific element to prepare, if null, prepares all elements with the specified animation styles
2461 */
2462function t_animate__prepareLinesFadeInWrappedAnimation(element = null) {
2463 const lineDelayIncrement = 0.12;
2464 const animatedTextElements = t_animate__getAnimatedTextElements(
2465 ['line-fade-in-right-gradient', 'line-fade-in-left-gradient'],
2466 element
2467 );
2468
2469 animatedTextElements.forEach(animatedTextElement => {
2470 const lines = animatedTextElement.querySelectorAll('.t-animate__line');
2471 const baseDelay = t_animate__getElementBaseDelay(animatedTextElement);
2472
2473 lines.forEach((line, lineIndex) => {
2474 const lineDelay = baseDelay + lineIndex * lineDelayIncrement;
2475
2476 line.style.animationDelay = `${lineDelay}s`;
2477 });
2478 });
2479}
2480
2481/**
2482 * Prepare letter by letter animation (letter-bounce-in-up).
2483 * Add animation delay for each letter by increment, index is continuous through the whole element.
2484 * Increment is proportional to the letter animation duration, so the whole animation slows down with longer duration.
2485 * Strict words are not split into letters, so they are animated as a single letter.
2486 * @param {HTMLElement} element - specific element to prepare
2487 * @param {number|null} duration - letter animation duration in seconds, if null, default duration is used
2488 */
2489function t_animate__prepareLetterByLetterAnimation(element, duration = null) {
2490 const defaultLetterDuration = 0.36;
2491 const letterDelayRatio = 0.1;
2492 const maxLetterDelayIncrement = 0.1;
2493 const letterDuration = duration ?? defaultLetterDuration;
2494 const letterDelayIncrement = Math.min(letterDuration * letterDelayRatio, maxLetterDelayIncrement);
2495 const animatedTextElements = t_animate__getAnimatedTextElements(['letter-bounce-in-up'], element);
2496
2497 animatedTextElements.forEach(animatedTextElement => {
2498 const particles = animatedTextElement.querySelectorAll(
2499 '.t-animate__letter, .t-animate__word_strict, .t-animate__word_whitespace'
2500 );
Предыдущие 100 строкСледующие 100 строк