Linux heracles.o2switch.net 4.18.0-553.62.1.lve.el8.x86_64 #1 SMP Mon Jul 21 17:50:35 UTC 2025 x86_64
/
home
/
ophq1335
/
www
/
wp-content
/
plugins
/
divi-modules-pro
/
scripts
/
/home/ophq1335/www/wp-content/plugins/divi-modules-pro/scripts/frontend.js
;(function ( $, window, document, undefined ) { 'use strict'; if (window.ETBuilderBackend && window.ETBuilderBackend.defaults) { window.ETBuilderBackend.defaults.dmpro_before_after_slider = { before_image: '', after_image: '' }; } $(".dmpro-lottie-icon").each(function() { let $this = $(this); let $data = $this.data("options"); lottie.searchAnimations(); let $lottie = lottie.loadAnimation({ container: this, renderer: 'svg', loop: $data.loop, autoplay: $data.autoplay, path: $data.path, rendererSettings: { progressiveLoad: false } }); if(!$data.autoplay){ $lottie.addEventListener('DOMLoaded', function(){ $lottie.goToAndStop(parseInt($data.start_frame) , true) }) } if($data.autoplay && $data.stop_on_hover === 'on') { $(this).parent().mouseenter( function() { $lottie.pause(); }); $(this).parent().mouseleave( function() { $lottie.play(); }); } else if(!$data.autoplay && $data.play_on_hover === 'on') { $(this).parent().mouseenter( function() { $lottie.play(); }); $(this).parent().mouseleave( function() { $lottie.pause(); }); } $lottie.setSpeed($data.speed); $lottie.setDirection($data.direction); }); $('.dmpro_flip_box').parents('.et_pb_row').css("-webkit-transform", "translateZ(0)"); $(".dmpro_image_accordion").each(function() { $(this).dmpro_image_accordion(); }); $('.dmpro_scroll_image').each(function(index, value) { let $this = $(this), data = value.querySelector('.dmpro-scroll-image').dataset, direction = data.direction, type = data.type, reverse = data.reverse, scroll_element = $this.find(".dmpro-image-scroll-container"), scroll_image = scroll_element.find('.dmpro-image-scroll-image img'), scroll_vertical = scroll_element.find(".dmpro-image-scroll-vertical"), scroll_overlay = scroll_element.find(".dmpro-image-scroll-overlay"), scroll_value = null, translate = ''; function start_scroll_image() { scroll_image.css("transform", translate + "(-" + scroll_value + "px)"); } function end_scroll_image() { scroll_image.css("transform", translate + "(0px)"); } function set_scroll_image() { if (direction === "vertical") { scroll_value = scroll_image.height() - scroll_element.height(); translate = "translateY"; } else { scroll_value = scroll_image.width() - scroll_element.width(); translate = "translateX"; } } if (type === "on_hover") { if (reverse === 'on') { set_scroll_image(); start_scroll_image(); } scroll_element.mouseenter(function() { scroll_element.removeClass("dmpro-container-scroll-anim-reset"); set_scroll_image(); reverse === 'on' ? end_scroll_image() : start_scroll_image(); }); scroll_element.mouseleave(function() { reverse === 'on' ? start_scroll_image() : end_scroll_image(); }); } else { if (direction !== "vertical") { let scroll_animate = false; scroll_element.on('mousewheel DOMMouseScroll', function(e){ disable_body_scroll(e, scroll_element); if(scroll_animate) return; scroll_animate = true; let scroll_value = scroll_element.scrollLeft() + (e.originalEvent.deltaY * 2) scroll_element.animate({scrollLeft: scroll_value }, 500,function(){ scroll_animate = false; }) }) scroll_overlay.css({ "width": scroll_image.width(), "height": scroll_image.height() }); } } function disable_body_scroll(e, ele) { var e0 = e.originalEvent, delta = e0.wheelDelta || -e0.detail; ele.scrollTop += ( delta < 0 ? 1 : -1 ) * 30; e.preventDefault(); } }); $( window ).on("load", function (e) { $('.dmpro_carousel').each(function(index, value) { let $this = $(this); var data = value.querySelector('.dmpro-carousel-main').dataset; let selector = "." + $this.attr('class').split(' ').join('.') + " .swiper-container"; var navigation = "on" === data.navigation && { nextEl: ".dmpro_carousel .dmpro-sbn" + data.ordernumber, prevEl: ".dmpro_carousel .dmpro-sbp" + data.ordernumber }; var dynamicbullets = ('on' == data.dynamicbullets) ? true : false; var pagination = "on" === data.pagination && { el: ".dmpro_carousel .dmpro-sp" + data.ordernumber, clickable: true, dynamicBullets: dynamicbullets, dynamicMainBullets: 1 }; var cfe = { rotate: Number(parseInt(data.rotate)), stretch: 5, depth: 100, modifier: 1, slideShadows: data.shadow, }; let mySwiper = new Swiper(selector, { slidesPerView: Number(data.columnsphone), spaceBetween: Number(data.spacebetween_phone), speed: Number(data.speed), loop: "on" === data.loop, autoplay: "on" === data.autoplay && { delay: data.autoplayspeed }, effect: data.effect, coverflowEffect: "coverflow" === data.effect ? cfe : null, navigation: navigation, pagination: pagination, centeredSlides: "on" === data.centered, slideClass: "dmpro_carousel_child", wrapperClass: "dmpro-carousel-wrapper", setWrapperSize: true, observer: true, observeParents: true, observeSlideChildren: true, breakpoints: { 768: { slidesPerView: Number(data.columnstablet), spaceBetween: Number(data.spacebetween_tablet) > 0 ? Number(data.spacebetween_tablet) : Number(0), }, 981: { slidesPerView: Number(data.columnsdesktop), spaceBetween: Number(data.spacebetween) > 0 ? Number(data.spacebetween) : Number(0), } } }); if ('on' === data.pauseonhover && 'on' === data.autoplay) { $this.find('.swiper-container').on('mouseenter', function(e) { mySwiper.autoplay.stop(); }); $this.find('.swiper-container').on('mouseleave', function(e) { mySwiper.autoplay.start(); }); } }); $('.dmpro_hover_box').each(function() { let $this = $(this); let $container = $this.find('.dmpro-hover-box-container'); let $content = $container.find('.dmpro-hover-box-content'); let $hover = $container.find('.dmpro-hover-box-hover'); if ('on' === $container.attr('data-force_square')) { new ResizeSensor($this, function() { let width = $container.width(); $container.height(width); $content.outerHeight(width); $hover.outerHeight(width); }); let width = $container.width(); $container.height(width); $content.outerHeight(width); $hover.outerHeight(width); } }); }); window.addEventListener("load", function() { window.dmp_initFlipboxes(); }); window.addEventListener("orientationchange", function() { window.dmp_initFlipboxes(); }, false ); window.addEventListener("resize", function() { window.dmp_initFlipboxes(); }, false ); window.dmp_initFlipboxes = function() { setTimeout(() => { $('.dmpro_flip_box').each(function() { let $this = $(this); if ('on' === $this.find('.dmpro-flip-box-container').attr('data-dynamic_height')) { let $wrapper = $this.find(".dmpro-flip-box-inner-wrapper") , $front = $this.find('.dmpro-flip-box-front-side-innner') , $back = $this.find('.dmpro-flip-box-back-side-innner'); function calculateHeight( $element ) { let height = 0; $element.children().each(function() { height = height + $( this ).outerHeight(true); }); return $element.outerHeight( true ) - $element.height() + height; } function setWrapperHeight( $wrapper ) { let height = Math.max( calculateHeight( $front ), calculateHeight( $back ) ); $wrapper.height( height ); } setWrapperHeight( $wrapper ); } if ('on' === $this.find('.dmpro-flip-box-container').attr('data-force_square')) { let $wrapper = $this.find(".dmpro-flip-box-inner-wrapper"); $wrapper.height( $wrapper.width() ); } }); }, 1); } window.dmp_initFlipboxesSensor = function() { const config = { attributes: true, childList: true, subtree: true } , callback = function( mutationsList, observer ) { mutationsList.forEach(function( mutation ) { if ( mutation.type === 'attributes' ) { let target = $( mutation.target ); if ( target.hasClass('lazyload') || target.hasClass('lazyloading') || target.hasClass('lazyloaded') ) { window.dmp_initFlipboxes(); } } if ( mutation.type === 'childList' ) { window.dmp_initFlipboxes(); } }); } , observer = new MutationObserver( callback ); $('.dmpro_flip_box').each( function() { observer.observe( this, config ); }); } window.dmp_initFlipboxesSensor(); })( jQuery, window, document );