define([ 'jquery', 'Magezon_Builder/js/vimeo/player', 'Magezon_Builder/js/parallax', 'Magezon_Builder/js/responsive-typography', 'Magezon_Core/js/jquery.magnific-popup.min', 'waypoints' ], function ($, Vimeo) { var mgzInit = function() { var height = $(window).height(); $(document).find('.mgz-row-full-height').each(function(index, el) { $(this).css('min-height', height); $(this).children('.mgz-element-inner').css('min-height', height); $(this).children().children('.mgz-element-row-content').css('min-height', height); }); // ANIMATION if ($(".mgz-animated:not(.mgz_start_animation)").length) { $(".mgz-animated:not(.mgz_start_animation)").waypoint(function() { var self = this; var delayTime = 0; if ($(this.element).data('animation-delay')) { delayTime = $(this.element).data('animation-delay'); } var durationTime = 0; if ($(this.element).data('animation-duration')) { durationTime = $(this.element).data('animation-duration'); } if (durationTime) $(self.element).css("animation-duration", durationTime + 's'); setTimeout(function() { $(self.element).addClass("mgz_start_animation animated") }, delayTime * 1000); }, { offset: "85%" }); } // WAYPOINT if ($(".mgz-waypoint").length) { $(".mgz-waypoint").waypoint(function() { if (!$(this.element).hasClass('mgz-animation-applied')) { $(this.element).trigger('mgz:animation:run'); $(this.element).addClass('mgz-animation-applied'); } }, { offset: "85%", triggerOnce: true }); } $('.magezon-builder').find('.mgz-magnific-link').each(function(index, el) { var type = $(this).data('type') ? $(this).data('type') : 'image'; var options = { type: type, mainClass: $(this).data('main-class'), removalDelay: 300, fixedContentPos: true, fixedBgPos: true, image: { verticalFit: true } } if ($(this).data('zoom')) { if (options['mainClass']) { options['mainClass'] += ' mfp-no-margins mfp-with-zoom'; } else { options['mainClass'] = 'mfp-no-margins mfp-with-zoom'; } options['zoom'] = { enabled: true, duration: 300 }; } $(this).magnificPopup(options); }); $('.magezon-builder').find('.mgz-magnific-gallery').each(function(index, el) { var options = { delegate: 'a', type: 'image', tLoading: 'Loading image #%curr%...', mainClass: 'mgz-mfp', fixedContentPos: true, gallery: { enabled: true, navigateByImgClick: true, preload: [0,1] } } $(this).magnificPopup(options); }); $('.magezon-builder').find('.mgz-magnific').each(function(index, el) { var type = $(this).data('type') ? $(this).data('type') : 'image'; var options = {}; switch (type) { case 'gallery': var delegate = 'a'; options = { delegate: delegate, type: 'image', tLoading: 'Loading image #%curr%...', mainClass: 'mgz-mfp', fixedContentPos: true, gallery: { enabled: true, navigateByImgClick: true, preload: [0,1] }, iframe: { markup: '