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

© 2020-2026 Некодим

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

Компания

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

Полезное

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

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

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

tilda-t136.js

Код файла
Версия от 18.08.2026, 07:00:16 МСК
Оригинал на CDNСнимок 56c3b845Полный текст
201SequenceController.prototype.getItemHeight = function (el) {202    var txtBlock = el.querySelector("[data-hook='item-text']");203    var computedTop = parseFloat(getComputedStyle(txtBlock).top);204    txtBlock.style.top = computedTop + 'px';205    var totalHeight = Math.max(txtBlock.clientHeight + computedTop, this.itemHeight);206    return totalHeight;207};208 209SequenceController.prototype.fixTextBlocksPosition = function (node) {210    var txtBlocks = Array.prototype.slice.call(node.querySelectorAll('[data-hook="item-text"]'), 0);211    txtBlocks.forEach(function (el) {
История файла и сравнение версий
  • 18.08.2026, 07:00:16 · 56c3b845
212
var backgroundSibling = el.parentNode.querySelector("[data-hook='item-background']");
213 backgroundSibling.style.top = '-' + el.clientHeight + 'px';
214 });
215};
216
217SequenceController.prototype.unergisterBlock = function (node) {
218 for (var i = 0, l = this.sequenceObjects.length, index = null; i < l; i++) {
219 if (this.sequenceObjects[i].sequenceBlock === node) {
220 index = i;
221 break;
222 }
223 }
224 if (index !== null) {
225 this.sequenceObjects.splice(index, 1);
226 return true;
227 }
228 return false;
229};
230/**
231 * @param {HTMLElement} el
232 * @returns {Number|number}
233 */
234SequenceController.prototype.getAbsoluteTopOffset = function (el) {
235 var topOffset = el.offsetTop;
236 el = el.offsetParent;
237 while (el != null) {
238 topOffset += el.offsetTop;
239 el = el.offsetParent;
240 }
241 return topOffset;
242};
243/**
244 * @param {Boolean} direction
245 * 1 - from top to bottom
246 * 0 - from bottom to top
247 */
248SequenceController.prototype.processSequence = function (sequenceObject) {
249 if (sequenceObject.started == false) {
250 sequenceObject.prevBackgroundColor = document.body.style.backgroundColor;
251 document.body.style.backgroundColor = 'rgb(0, 0, 0)';
252 sequenceObject.started = true;
253 }
254
255 var sequenceItems = sequenceObject.items;
256 var currentItemIndex = null;
257 var node;
258 var backgroundHolderStyle;
259 var opacity;
260
261 for (var i = 0, l = sequenceItems.length, nodeRect; i < l; i++) {
262 node = sequenceItems[i].node;
263 nodeRect = node.getBoundingClientRect();
264
265 if (
266 nodeRect.top < this.itemTransitionTop &&
267 nodeRect.bottom < nodeRect.height + this.itemTransitionTop &&
268 nodeRect.bottom > this.itemTransitionTop
269 ) {
270 currentItemIndex = i;
271 break;
272 }
273 }
274
275 if (currentItemIndex == null) {
276 return;
277 }
278 opacity = nodeRect.top / this.itemTransitionTop;
279 if (opacity > 1) {
280 opacity = 1;
281 } else if (opacity < 0) {
282 opacity = 0;
283 }
284
285 for (var i = 0, l = sequenceItems.length; i < l; i++) {
286 (node = sequenceItems[i].node), (backgroundHolderStyle = sequenceItems[i].backgroundHolder.style);
287 if (backgroundHolderStyle.position != 'fixed') {
288 backgroundHolderStyle.position = 'fixed';
289 }
290 if (i == currentItemIndex) {
291 /* transitted already */
292 backgroundHolderStyle.opacity = 1 - opacity;
293 node.querySelector('.txt-holder').style.opacity = 1 - opacity;
294 } else if (i == currentItemIndex - 1) {
295 backgroundHolderStyle.opacity = opacity;
296 node.querySelector('.txt-holder').style.opacity = opacity;
297 } else {
298 backgroundHolderStyle.opacity = 0;
299 node.querySelector('.txt-holder').style.opacity = 0;
300 }
Предыдущие 100 строкСледующие 100 строк