Server IP : 192.158.238.246 / Your IP : 3.143.7.75 Web Server : LiteSpeed System : Linux uniform.iwebfusion.net 4.18.0-553.27.1.lve.1.el8.x86_64 #1 SMP Wed Nov 20 15:58:00 UTC 2024 x86_64 User : jenniferflocom ( 1321) PHP Version : 8.1.32 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/jenniferflocom/www/wp-content/plugins/hunk-companion/open-shop/assets/js/ |
Upload File : |
/**************/ // OpenShopLib /**************/ (function ($) { var OpenShopLib = { init: function (){ this.bindEvents(); }, bindEvents: function (){ var $this = this; if($('#thunk-slider').length!==0){ $this.jssor_slider2_init(); } if($('#thunk-single-slider').length!==0){ $this.jssor_slider1_init(); } $this.product_slide_margin_padding(); $this.Top2Slider(); $this.product_slide_2row(); }, jssor_slider2_init : function () { var options = { $AutoPlay: open_shop.open_shop_top_slider_optn, //[Optional] Auto play or not, to enable slideshow, this option must be set to greater than 0. Default value is 0. 0: no auto play, 1: continuously, 2: stop at last slide, 4: stop on click, 8: stop on user navigation (by arrow/bullet/thumbnail/drag/arrow key navigation) $AutoPlaySteps: 1, //[Optional] Steps to go for each navigation request (this options applys only when slideshow disabled), the default value is 1 $Idle:4000, //[Optional] Interval (in milliseconds) to go for next slide since the previous stopped if the slider is auto playing, default value is 3000 $PauseOnHover: 1, //[Optional] Whether to pause when mouse over if a slider is auto playing, 0 no pause, 1 pause for desktop, 2 pause for touch device, 3 pause for desktop and touch device, 4 freeze for desktop, 8 freeze for touch device, 12 freeze for desktop and touch device, default value is 1 $ArrowKeyNavigation: 1, //[Optional] Steps to go for each navigation request by pressing arrow key, default value is 1. $SlideDuration: open_shop.open_shop_top_slider_speed, //[Optional] Specifies default duration (swipe) for slide in milliseconds, default value is 500 $MinDragOffsetToSlide: 20, //[Optional] Minimum drag offset to trigger slide, default value is 20 //$SlideWidth: 600, //[Optional] Width of every slide in pixels, default value is width of 'slides' container //$SlideHeight: 300, //[Optional] Height of every slide in pixels, default value is height of 'slides' container $SlideSpacing: 0, //[Optional] Space between each slide in pixels, default value is 0 $UISearchMode: 1, //[Optional] The way (0 parellel, 1 recursive, default value is 1) to search UI components (slides container, loading screen, navigator container, arrow navigator container, thumbnail navigator container etc). $PlayOrientation: 1, //[Optional] Orientation to play slide (for auto play, navigation), 1 horizental, 2 vertical, 5 horizental reverse, 6 vertical reverse, default value is 1 $DragOrientation: 3, //[Optional] Orientation to drag slide, 0 no drag, 1 horizental, 2 vertical, 3 either, default value is 1 (Note that the $DragOrientation should be the same as $PlayOrientation when $Cols is greater than 1, or parking position is not 0) $BulletNavigatorOptions: { //[Optional] Options to specify and enable navigator or not $Class: $JssorBulletNavigator$, //[Required] Class to create navigator instance $ChanceToShow: 2, //[Required] 0 Never, 1 Mouse Over, 2 Always $ActionMode: 1, //[Optional] 0 None, 1 act by click, 2 act by mouse hover, 3 both, default value is 1 $Rows: 1, //[Optional] Specify lanes to arrange items, default value is 1 $SpacingX:5, //[Optional] Horizontal space between each item in pixel, default value is 0 $SpacingY:5, //[Optional] Vertical space between each item in pixel, default value is 0 $Orientation: 1 //[Optional] The orientation of the navigator, 1 horizontal, 2 vertical, default value is 1 }, $ArrowNavigatorOptions: { $Class: $JssorArrowNavigator$, //[Requried] Class to create arrow navigator instance $ChanceToShow: 2 //[Required] 0 Never, 1 Mouse Over, 2 Always }, $ThumbnailNavigatorOptions: { $Class: $JssorThumbnailNavigator$, //[Required] Class to create thumbnail navigator instance $ChanceToShow: 2, //[Required] 0 Never, 1 Mouse Over, 2 Always $ActionMode: 0, //[Optional] 0 None, 1 act by click, 2 act by mouse hover, 3 both, default value is 1 $NoDrag: true, //[Optional] Disable drag or not, default value is false $Orientation: 2 //[Optional] Orientation to arrange thumbnails, 1 horizental, 2 vertical, default value is 1 } }; var jssor_slider2 = new $JssorSlider$('thunk-slider', options); /*#region responsive code begin*/ //you can remove responsive code if you don't want the slider scales while window resizing function ScaleSlider() { var parentWidth = jssor_slider2.$Elmt.parentNode.clientWidth; if (parentWidth) jssor_slider2.$ScaleWidth(Math.min(parentWidth, 1000)); else $Jssor$.$Delay(ScaleSlider, 30); } ScaleSlider(); $Jssor$.$AddEvent(window, "load", ScaleSlider); $Jssor$.$AddEvent(window, "resize", ScaleSlider); $Jssor$.$AddEvent(window, "orientationchange", ScaleSlider); /*#endregion responsive code end*/ }, jssor_slider1_init : function () { var options = { $AutoPlay: open_shop.open_shop_top_slider_optn, //[Optional] Auto play or not, to enable slideshow, this option must be set to greater than 0. Default value is 0. 0: no auto play, 1: continuously, 2: stop at last slide, 4: stop on click, 8: stop on user navigation (by arrow/bullet/thumbnail/drag/arrow key navigation) $AutoPlaySteps: 1, //[Optional] Steps to go for each navigation request (this options applys only when slideshow disabled), the default value is 1 $Idle:4000, //[Optional] Interval (in milliseconds) to go for next slide since the previous stopped if the slider is auto playing, default value is 3000 $PauseOnHover: 1, //[Optional] Whether to pause when mouse over if a slider is auto playing, 0 no pause, 1 pause for desktop, 2 pause for touch device, 3 pause for desktop and touch device, 4 freeze for desktop, 8 freeze for touch device, 12 freeze for desktop and touch device, default value is 1 $ArrowKeyNavigation: 1, //[Optional] Steps to go for each navigation request by pressing arrow key, default value is 1. $SlideDuration: open_shop.open_shop_top_slider_speed, //[Optional] Specifies default duration (swipe) for slide in milliseconds, default value is 500 $MinDragOffsetToSlide: 20, //[Optional] Minimum drag offset to trigger slide, default value is 20 //$SlideWidth: 600, //[Optional] Width of every slide in pixels, default value is width of 'slides' container //$SlideHeight: 300, //[Optional] Height of every slide in pixels, default value is height of 'slides' container $SlideSpacing: 0, //[Optional] Space between each slide in pixels, default value is 0 $UISearchMode: 1, //[Optional] The way (0 parellel, 1 recursive, default value is 1) to search UI components (slides container, loading screen, navigator container, arrow navigator container, thumbnail navigator container etc). $PlayOrientation: 1, //[Optional] Orientation to play slide (for auto play, navigation), 1 horizental, 2 vertical, 5 horizental reverse, 6 vertical reverse, default value is 1 $DragOrientation: 3, //[Optional] Orientation to drag slide, 0 no drag, 1 horizental, 2 vertical, 3 either, default value is 1 (Note that the $DragOrientation should be the same as $PlayOrientation when $Cols is greater than 1, or parking position is not 0) $BulletNavigatorOptions: { //[Optional] Options to specify and enable navigator or not $Class: $JssorBulletNavigator$, //[Required] Class to create navigator instance $ChanceToShow: 2, //[Required] 0 Never, 1 Mouse Over, 2 Always $ActionMode: 1, //[Optional] 0 None, 1 act by click, 2 act by mouse hover, 3 both, default value is 1 $Rows: 1, //[Optional] Specify lanes to arrange items, default value is 1 $SpacingX:5, //[Optional] Horizontal space between each item in pixel, default value is 0 $SpacingY:5, //[Optional] Vertical space between each item in pixel, default value is 0 $Orientation:1 //[Optional] The orientation of the navigator, 1 horizontal, 2 vertical, default value is 1 }, $ArrowNavigatorOptions: { $Class: $JssorArrowNavigator$, //[Requried] Class to create arrow navigator instance $ChanceToShow: 2 //[Required] 0 Never, 1 Mouse Over, 2 Always }, $ThumbnailNavigatorOptions: { $Class: $JssorThumbnailNavigator$, //[Required] Class to create thumbnail navigator instance $ChanceToShow: 2, //[Required] 0 Never, 1 Mouse Over, 2 Always $ActionMode: 0, //[Optional] 0 None, 1 act by click, 2 act by mouse hover, 3 both, default value is 1 $NoDrag: true, //[Optional] Disable drag or not, default value is false $Orientation: 2 //[Optional] Orientation to arrange thumbnails, 1 horizental, 2 vertical, default value is 1 } }; var jssor_slider2 = new $JssorSlider$('thunk-single-slider', options); /*#region responsive code begin*/ //you can remove responsive code if you don't want the slider scales while window resizing function ScaleSlider(){ var parentWidth = jssor_slider2.$Elmt.parentNode.clientWidth; if (parentWidth) jssor_slider2.$ScaleWidth(Math.min(parentWidth, 920)); else $Jssor$.$Delay(ScaleSlider, 30); } ScaleSlider(); $Jssor$.$AddEvent(window, "load", ScaleSlider); $Jssor$.$AddEvent(window, "resize", ScaleSlider); $Jssor$.$AddEvent(window, "orientationchange", ScaleSlider); /*#endregion responsive code end*/ }, Top2Slider:function(){ var owl = $('.thunk-top2-slide'); owl.owlCarousel({ items:1, nav: true, navText: ["<i class='brand-nav fa fa-angle-left'></i>", "<i class='brand-nav fa fa-angle-right'></i>"], loop:open_shop.open_shop_top_slider_optn, dots: false, smartSpeed:500, autoHeight: false, margin:0, autoplay:open_shop.open_shop_top_slider_optn, }); // add animate.css class(es) to the elements to be animated function setAnimation ( _elem, _InOut ) { // Store all animationend event name in a string. // cf animate.css documentation var animationEndEvent = 'webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend'; _elem.each ( function () { var $elem = $(this); var $animationType = 'animated ' + $elem.data( 'animation-' + _InOut ); $elem.addClass($animationType).one(animationEndEvent, function () { $elem.removeClass($animationType); // remove animate.css Class at the end of the animations }); }); } // Fired before current slide change owl.on('change.owl.carousel', function(event) { var $currentItem = $('.owl-item', owl).eq(event.item.index); var $elemsToanim = $currentItem.find("[data-animation-out]"); setAnimation ($elemsToanim, 'out'); }); // Fired after current slide has been changed var round = 0; owl.on('changed.owl.carousel', function(event) { var $currentItem = $('.owl-item', owl).eq(event.item.index); var $elemsToanim = $currentItem.find("[data-animation-in]"); setAnimation ($elemsToanim, 'in'); }) owl.on('translated.owl.carousel', function(event) { console.log (event.item.index, event.page.count); if (event.item.index == (event.page.count - 1)) { if (round < 1) { round++ console.log (round); } else { owl.trigger('stop.owl.autoplay'); var owlData = owl.data('owl.carousel'); owlData.settings.autoplay = false; //don't know if both are necessary owlData.options.autoplay = false; owl.trigger('refresh.owl.carousel'); } } }); }, product_slide_margin_padding : function () { $(document).ready(function(){ $(".thunk-product").hover(function() { $('.thunk-slide .owl-stage-outer').css("margin", "-6px -6px -100px"); $('.thunk-slide .owl-stage-outer').css("padding", "6px 6px 100px"); $('.thunk-slide .owl-nav').css("top", "-52px"); $('.product-slide-widget .thunk-slide .owl-nav').css("top", "81px"); }, function() { $('.thunk-slide .owl-stage-outer').css("margin", "0"); $('.thunk-slide .owl-stage-outer').css("padding", "0"); $('.thunk-slide .owl-nav').css("top", "-58px"); $('.product-slide-widget .thunk-slide .owl-nav').css("top", "75px"); }); }); }, product_slide_2row : function () { //**************************/ //owl2row plugin //**************************/ ;(function ($, window, document, undefined) { Owl2row = function (scope) { this.owl = scope; this.owl.options = $.extend({}, Owl2row.Defaults, this.owl.options); //link callback events with owl carousel here this.handlers = { 'initialize.owl.carousel': $.proxy(function (e) { if (this.owl.settings.owl2row) { this.build2row(this); } }, this) }; this.owl.$element.on(this.handlers); }; Owl2row.Defaults = { owl2row: false, owl2rowTarget: 'item', owl2rowContainer: 'owl2row-item', owl2rowDirection: 'utd' // ltr }; //mehtods: Owl2row.prototype.build2row = function(thisScope){ var carousel = $(thisScope.owl.$element); var carouselItems = carousel.find('.' + thisScope.owl.options.owl2rowTarget); var aEvenElements = []; var aOddElements = []; $.each(carouselItems, function (index, item) { if ( index % 2 === 0 ) { aEvenElements.push(item); } else { aOddElements.push(item); } }); carousel.empty(); switch (thisScope.owl.options.owl2rowDirection) { case 'ltr': thisScope.leftToright(thisScope, carousel, carouselItems); break; default : thisScope.upTodown(thisScope, aEvenElements, aOddElements, carousel); } }; Owl2row.prototype.leftToright = function(thisScope, carousel, carouselItems){ var o2wContainerClass = thisScope.owl.options.owl2rowContainer; var owlMargin = thisScope.owl.options.margin; var carouselItemsLength = carouselItems.length; var firsArr = []; var secondArr = []; //console.log(carouselItemsLength); if (carouselItemsLength %2 === 1) { carouselItemsLength = ((carouselItemsLength - 1)/2) + 1; } else { carouselItemsLength = carouselItemsLength/2; } //console.log(carouselItemsLength); $.each(carouselItems, function (index, item) { if (index < carouselItemsLength) { firsArr.push(item); } else { secondArr.push(item); } }); $.each(firsArr, function (index, item) { var rowContainer = $('<div class="' + o2wContainerClass + '"/>'); var firstRowElement = firsArr[index]; firstRowElement.style.marginBottom = owlMargin + 'px'; rowContainer .append(firstRowElement) .append(secondArr[index]); carousel.append(rowContainer); }); }; Owl2row.prototype.upTodown = function(thisScope, aEvenElements, aOddElements, carousel){ var o2wContainerClass = thisScope.owl.options.owl2rowContainer; var owlMargin = thisScope.owl.options.margin; $.each(aEvenElements, function (index, item) { var rowContainer = $('<div class="' + o2wContainerClass + '"/>'); var evenElement = aEvenElements[index]; evenElement.style.marginBottom = owlMargin + 'px'; rowContainer .append(evenElement) .append(aOddElements[index]); carousel.append(rowContainer); }); }; /** * Destroys the plugin. */ Owl2row.prototype.destroy = function() { var handler, property; for (handler in this.handlers) { this.owl.dom.$el.off(handler, this.handlers[handler]); } for (property in Object.getOwnPropertyNames(this)) { typeof this[property] !== 'function' && (this[property] = null); } }; $.fn.owlCarousel.Constructor.Plugins['owl2row'] = Owl2row; })( window.Zepto || window.jQuery, window, document ); //end of owl2row plugin }, } OpenShopLib.init(); })(jQuery);