Каталог файловtilda-cover-1.0.js
501 *502 * @param {HTMLElement} el - current element503 * @param {string} height - height of el504 */505function t_cover__createYoutubeCover(el, height) {506 if (el.querySelector('iframe')) return;507 var windowScrollTop = window.pageYOffset;508 var windowHeight = window.innerHeight;509 var elHeight = t_cover__getPureHeight(el);510 var elTopPos = el.getBoundingClientRect().top + windowScrollTop;511 var elBottomPos = elTopPos + elHeight;512
История файла и сравнение версий
var windowBottomPos = windowScrollTop + windowHeight;
515 if (windowBottomPos > elTopPos - padding && elBottomPos + padding >= windowScrollTop) { 516 t_onFuncLoad('processYoutubeVideo', function () { 517 window.processYoutubeVideo(el, height); 523 * create cover for HTML5 video when user will scroll to the current video 525 * @param {HTMLElement} el - current element 526 * @param {object} coverParams - current params for cover 527 * @param {Boolean} isHeightMoreVH - boolean value of height the largest then viewport height 528 * @param {Boolean} isFixedParallax - parallax fixed 529 * @param {Boolean} hasLoop - is cover video looped 530 * @param {Boolean} isMuted - is cover video muted 532function t_cover__createHTMLVideoCover(el, coverParams, isHeightMoreVH, isFixedParallax, hasLoop, isMuted) { 533 if (el.querySelector('video')) return; 534 var windowScrollTop = window.pageYOffset; 535 var windowHeight = window.innerHeight; 536 var elHeight = t_cover__getPureHeight(el); 537 var elTopPos = el.getBoundingClientRect().top + windowScrollTop; 538 var elBottomPos = elHeight + elTopPos; 539 var windowBottom = windowScrollTop + windowHeight; 541 if (windowBottom > elTopPos - padding && windowScrollTop <= elBottomPos + padding) { 542 t_cover__createAndProcessHTML5Video(el, coverParams, hasLoop, isMuted); 547 * create cover for iframe videos, when user will scroll to the current video 549 * @param {HTMLElement} el - current element 550 * @param {string} height - height of el 552function t_cover__createIframeCover(el, params) { 553 if (el.querySelector('iframe')) return; 554 var windowScrollTop = window.pageYOffset; 555 var windowHeight = window.innerHeight; 556 var elHeight = t_cover__getPureHeight(el); 557 var elTopPos = el.getBoundingClientRect().top + windowScrollTop; 558 var elBottomPos = elTopPos + elHeight; 559 var windowBottomPos = windowScrollTop + windowHeight; 562 if (windowBottomPos > elTopPos - padding && elBottomPos + padding >= windowScrollTop) { 563 t_onFuncLoad('t_videoprocessor__processIframeVideo', function () { 564 window.t_videoprocessor__processIframeVideo(el, params); 570 * delivery current element to tilda-video-processor function t_videoprocessor__processHTML5Video, 571 * and process html5 video 573 * @param {HTMLElement} el 574 * @param {Object} coverParams 575 * @param {Boolean} hasLoop 576 * @param {Boolean} isMuted 578function t_cover__createAndProcessHTML5Video(el, coverParams, hasLoop, isMuted) { 579 t_onFuncLoad('t_videoprocessor__processHTML5Video', function () { 580 t_videoprocessor__processHTML5Video(el, { 581 mp4: coverParams['video-url-mp4'], 583 webm: coverParams['video-url-webm'], 588 position: 'absolute', 590 textReplacement: false,