PageSourceSearch

https://greenloo.org/wp-content/plugins/u-design-core/inc/plugins/alpus-flexbox/alpus-flexbox.js?ver=4.15.6

js greenloo.org collected 2026-10-04 22:57:00 UTC 25,240 bytes, 492 lines download raw bytes

1/**
2 * Alpha Elementor Preview
3 * 
4 * @author     Andon
5 * @package    Alpha Core FrameWork
6 * @subpackage Core
7 * @since      1.0
8 * 
9 */
10'use strict';
11
12(function ($) {
13    /**
14     * Setup AlphaElementorPreview
15     */
16    $(window).on('elementor/frontend/init', function () {
17        if (elementorFrontend && elementorModules.frontend && 'undefined' != typeof alpusFlexbox) {
18            alpusFlexbox.SlidesHandler.prototype.getSpaceBetween = function () {
19                let e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : null;
20                let kitSpacing = elementorFrontend.utils.controls.getResponsiveControlValue(elementorFrontend.config.kit, "space_between_widgets", "column", e),
21                    widgetSpacing = elementorFrontend.utils.controls.getResponsiveControlValue(this.getElementSettings(), "slide_spacing", "size", e);
22                return '' !== widgetSpacing ? widgetSpacing : kitSpacing;
23            }
24            alpusFlexbox.SlidesHandler.prototype.getSwiperOptions = function () {
25                const e = this.getElementSettings()
26                    , t = e.slides_to_show ? e.slides_to_show : 1
27                    , s = 1 === t
28                    , i = elementorFrontend.config.responsive.activeBreakpoints
29                    , n = {
30                        mobile: 1,
31                        tablet: s ? 1 : 2
32                    }
33                    , a = {
34                        autoplay: this.getAutoplayConfig(),
35                        grabCursor: false,
36                        initialSlide: this.getInitialSlide(),
37                        slidesPerView: t,
38                        slidesPerGroup: 1,
39                        parallax: "parallax" === e.transition,
40                        loop: "yes" === e.infinite,
41                        centeredSlides: "yes" === e.center_mode,
42                        speed: e.transition_speed,
43                        effect: e.transition,
44                        observeParents: !0,
45                        observer: !0,
46                        handleElementorBreakpoints: !0,
47                        watchSlidesProgress: true,
48                        on: {
49                            slideChange: () => {
50                                this.handleKenBurns()
51                            }
52                        },
53                        breakpoints: {}
54                    };
55                let o = t,
56                    index = 0,
57                    reverseBrk = Object.keys(i).reverse();
58
59                let globalSpace = (typeof this.getSpaceBetween() != 'undefined' && '' !== this.getSpaceBetween()) ? parseInt(this.getSpaceBetween()) : '';
60
61                reverseBrk.forEach((t => {
62                    const s = n[t] ? n[t] : o;
63                    var brkWidth = typeof reverseBrk[index + 1] == 'undefined' ? 0 : (i[reverseBrk[index + 1]].value + 1);
64                    if (t == 'tablet' || t == 'mobile') {
65                        a.breakpoints[brkWidth] = {
66                            slidesPerView: +e["slides_to_show_" + t] || s,
67                            slidesPerGroup: +e["slides_to_scroll_" + t] || 1
68                        };
69                    }
70                    var spaceBetween = this.getSpaceBetween(t);
71                    if (spaceBetween !== '' && typeof spaceBetween !== 'undefined') {
72                        spaceBetween = parseInt(spaceBetween);
73                        if (!index && globalSpace) {
74                            var parentWidth = typeof reverseBrk[index] == 'undefined' ? 0 : (i[reverseBrk[index]].value + 1);
75                            if (parentWidth) {
76                                if (typeof a.breakpoints[parentWidth] == 'undefined') {
77                                    if (parentWidth >= 1200) {
78                                        a.breakpoints[parentWidth] = {
79                                            slidesPerView: (typeof e.slides_to_show_xl != 'undefined' && e.slides_to_show_xl !== '') ? e.slides_to_show_xl : s,
80                                            slidesPerGroup: e.slides_to_scroll || 1,
81                                        };
82                                    } else {
83                                        a.breakpoints[parentWidth] = {};
84                                    }
85                                }
86                                a.breakpoints[parentWidth].spaceBetween = globalSpace;
87                            }
88                        }
89                        if (typeof a.breakpoints[brkWidth] == 'undefined') {
90                            if (brkWidth >= 1200) {
91                                a.breakpoints[brkWidth] = {
92                                    slidesPerView: (typeof e.slides_to_show_xl != 'undefined' && e.slides_to_show_xl !== '') ? e.slides_to_show_xl : s,
93                                    slidesPerGroup: e.slides_to_scroll || 1,
94                                };
95                            } else {
96                                a.breakpoints[brkWidth] = {};
97                            }
98                        }
99                        a.breakpoints[brkWidth].spaceBetween = spaceBetween;
100                    }
101                    o = +e["slides_to_show_" + t] || s
102                    index++;
103                }
104                ))
105
106                if (globalSpace !== '') {
107                    a.spaceBetween = globalSpace;
108                }
109
110                if (e.slides_to_show_xl) {
111                    a.breakpoints[1200] = typeof a.breakpoints[1200] != 'undefined' ? a.breakpoints[1200] : {};
112                    a.breakpoints[1200].slidesPerView = e.slides_to_show_xl || t;
113                    a.breakpoints[1200].slidesPerGroup = e.slides_to_scroll || 1;
114                }
115
116                a.breakpoints[992] = typeof a.breakpoints[992] != 'undefined' ? a.breakpoints[992] : {};
117                a.breakpoints[992].slidesPerView = t;
118                a.breakpoints[992].slidesPerGroup = e.slides_to_scroll || 1;
119
120                if (e.slides_to_show_min) {
121                    a.breakpoints[0] = typeof a.breakpoints[0] != 'undefined' ? a.breakpoints[0] : {};
122                    a.breakpoints[576] = Object.assign({}, a.breakpoints[0]);
123                    a.breakpoints[0].slidesPerView = e.slides_to_show_min || t;
124                    a.breakpoints[0].slidesPerGroup = e["slides_to_scroll_mobile"] || 1;
125                }
126                a.handleElementorBreakpoints = false;
127                const r = "arrows" === e.navigation || "both" === e.navigation
128                    , l = "dots" === e.navigation || "both" === e.navigation;
129                return r && (a.navigation = {
130                    prevEl: ".elementor-swiper-button-prev",
131                    nextEl: ".elementor-swiper-button-next"
132                }),
133                    e.autoheight && (a.autoHeight = 1),
134                    e.disable_drag && (a.allowTouchMove = !1),
135                    l && e.pagination && (a.pagination = {
136                        el: ".swiper-pagination",
137                        type: e.pagination,
138                        clickable: !0,
139                        renderBullet: e.dots_type == 'active_circle' ? function (index, className) {
140                            return '<span class="' + className + '"><svg width="70px" height="70px" viewBox="0 0 70 70" aria-hidden="true" xmlns="http://www.w3.org/2000/svg"><circle class="time" stroke-width="5" fill="none" stroke-linecap="round" cx="35" cy="35" r="28"></circle></svg></span>';
141                        } : null
142                    },
143                        "dynamic" == e.pagination && (a.pagination.dynamicBullets = !0,
144                            delete a.pagination.type)),
145                    !0 === a.loop && (a.loopedSlides = this.getSlidesCount()),
146                    s ? "fade" === a.effect && (a.fadeEffect = {
147                        crossFade: !0
148                    }) : a.slidesPerGroup = +e.slides_to_scroll || 1,
149                    "coverflow" == a.effect ? a.coverflowEffect = {
150                        rotate: 50,
151                        stretch: 0,
152                        depth: 100,
153                        modifier: 1,
154                        slideShadows: !0
155                    } : "creative" == a.effect ? a.creativeEffect = {
156                        prev: {
157                            shadow: !0,
158                            translate: [0, 0, -400]
159                        },
160                        next: {
161                            translate: ["100%", 0, 0]
162                        }
163                    } : "creative2" == a.effect ? (a.effect = "creative",
164                        a.creativeEffect = {
165                            perspective: !0,
166                            limitProgress: 2,
167                            shadowPerProgress: !0,
168                            prev: {
169                                shadow: !0,
170                                translate: ["-10%", 0, -200],
171                                rotate: [0, 0, -2]
172                            },
173                            next: {
174                                shadow: !1,
175                                translate: ["120%", 0, 0]
176                            }
177                        }) : "creative3" == a.effect ? (a.effect = "creative",
178                            a.creativeEffect = {
179                                prev: {
180                                    shadow: !0,
181                                    translate: ["-125%", 0, -800],
182                                    rotate: [0, 0, -90]
183                                },
184                                next: {
185                                    shadow: !0,
186                                    translate: ["125%", 0, -800],
187                                    rotate: [0, 0, 90]
188                                }
189                            }) : "creative4" == a.effect ? (a.effect = "creative",
190                                a.creativeEffect = {
191                                    prev: {
192                                        shadow: !0,
193                                        origin: "left center",
194                                        translate: ["-5%", 0, -200],
195                                        rotate: [0, 100, 0]
196                                    },
197                                    next: {
198                                        origin: "right center",
199                                        translate: ["5%", 0, -200],
200                                        rotate: [0, -100, 0]
201                                    }
202                                }) : "cube" == a.effect ? a.cubeEffect = {
203                                    shadow: !0,
204                                    slideShadows: !0,
205                                    shadowOffset: 20,
206                                    shadowScale: .94
207                                } : "coverflow2" == a.effect && (a.effect = "coverflow",
208                                    a.coverflowEffect = {
209                                        rotate: 0,
210                                        stretch: 0,
211                                        depth: 100,
212                                        modifier: 3,
213                                        slideShadows: !0
214                                    }),
215                    a
216            }
217
218            alpusFlexbox.SlidesHandler.prototype.initSlider = async function () {
219                const e = this.elements.$swiperContainer;
220                var timers = [];
221                if (!e.length)
222                    return;
223                if (1 >
223= this.getSlidesCount())
224                    return;
225                const t = elementorFrontend.utils.swiper;
226                var s = this.getSwiperOptions();
227                this.swiper = await new t(e, s),
228                    e.data("swiper", this.swiper),
229                    this.handleKenBurns();
230                const i = this.getElementSettings();
231                "creative2" == i.transition && this.elements.$swiperContainer.css("overflow", "visible"),
232                    i.pause_on_hover && this.togglePauseOnHover(!0);
233                const n = this.getSettings()
234                    , a = e.data(n.attributes.dataAnimation);
235
236                var wrapper = e.children('.swiper-wrapper'),
237                    cls = wrapper.attr('class');
238                var pattern = /gutter\-\w\w|cols\-\d|cols\-\w\w-\d|cols\-\w\w\w-\d/g;
239                var match = cls.match(pattern) || '';
240                if (match) {
241                    match.push('row');
242                    wrapper.data('swiper-layout', match);
243                    wrapper.attr('class', cls.replace(pattern, '').replace(/\s+/, ' ')).removeClass('row');
244                }
245
246                if ($.fn.lazyload && typeof theme.defaults.lazyload != 'undefined') {
247                    wrapper.find('[data-lazy]')
248                        .filter(function () {
249                            return !$(this).data('_lazyload_init');
250                        })
251                        .data('_lazyload_init', 1)
252                        .each(function () {
253                            $(this).lazyload(theme.defaults.lazyload);
254                        });
255                }
256
257                // If slider has animated items
258                var $anim_items = e.find('.elementor-invisible, .appear-animate, .animated').filter(':not(.elementor-column)');
259                if ($anim_items.length) {
260                    e.addClass('animation-slider');
261                    $anim_items.addClass('slide-animate').each(function () {
262                        var $this = $(this);
263                        var pre = $this.data('settings');
264                        if (pre) {
265                            var settings = {
266                                '_animation': pre._animation ? pre._animation : pre.animation
267                            };
268                            if (pre._animation_delay) {
269                                settings['_animation_delay'] = Number(pre._animation_delay);
270                            }
271                            $this
272                                .data('settings', settings)
273                                .attr('data-settings', JSON.stringify(settings));
274                        }
275                    });
276                }
277
278                // carousel content animation
279                e.find('.swiper-slide-active .slide-animate').each(function () {
280                    var $animation_item = $(this),
281                        duration;
282
283                    if ($animation_item.hasClass('animated-slow')) {
284                        duration = 2000;
285                    } else if ($animation_item.hasClass('animated-fast')) {
286                        duration = 750;
287                    } else {
288                        duration = 1000;
289                    }
290
291                    $animation_item.css('animation-duration', duration + 'ms');
292
293                    duration = duration ? duration : 750;
294                });
295
296                var $activeSlider = $(this.swiper.slides).slice(this.swiper.activeIndex, this.swiper.activeIndex + this.swiper.params.slidesPerView),
297                    $slideAnimations = $activeSlider.find('.slide-animate');
298                e.find('.swiper-slide .slide-animate').each(function () {
299                    if ($slideAnimations.index($(this)) >= 0) return;
300
301                    var $animation_item = $(this),
302                        settings = 'undefined' != typeof $animation_item.data('settings') ? $animation_item.data('settings') : {},
303                        duration,
304                        delay = settings._animation_delay ? settings._animation_delay : 0;
305
306                    var animation = '';
307                    if ('undefined' != typeof settings._animation) {
308                        animation = settings._animation;
309                    } else if ('undefined' != typeof settings.animation) {
310                        animation = settings.animation;
311                    } else if ('undefined' != typeof $animation_item.data('rocket-animation')) {
312                        animation = $animation_item.data('rocket-animation');
313                        if ('undefined' != typeof settings._animation_delay) {
314                            settings._animation = animation;
315                        } else {
316                            settings.animation = animation;
317                        }
318
319                        $animation_item.data('settings', settings);
320                    }
321
322                    if ($animation_item.hasClass('animated-slow')) {
323                        duration = 2000;
324                    } else if ($animation_item.hasClass('animated-fast')) {
325                        duration = 750;
326                    } else {
327                        duration = 1000;
328                    }
329
330                    $animation_item.css('animation-duration', duration + 'ms');
331
332                    duration = duration ? duration : 750;
333
334                    var temp = theme.requestTimeout(function () {
335                        $animation_item.removeClass(animation + ' animated');
336                        timers.splice(timers.indexOf(temp), 1)
337                    }, delay + duration);
338                });
339
340                this.swiper.on("slideResetTransitionEnd", function () {
341                    e.find('.swiper-slide .show-content').removeClass('show-content animated');
342
343                    var $activeSlider = $(this.slides).slice(this.activeIndex, this.activeIndex + this.params.slidesPerView),
344                        $slideAnimations = $activeSlider.find('.slide-animate');
345
346                    $slideAnimations.addClass('show-content');
347                })
348
349                this.swiper.on("slideChangeTransitionStart", function () {
350                    if (a) {
351                        e.find(n.selectors.slideInnerContents).removeClass(n.classes.animated + " " + a).hide()
352                    }
353                })
354
355                this.swiper.on("slideChangeTransitionEnd", function () {
356                    if (a) {
357                        e.find(n.selectors.slideInnerContents).show().addClass(n.classes.animated + " " + a)
358                    }
359
360                    e.find('.swiper-slide .show-content').removeClass('show-content animated');
361
362                    var $activeSlider = $(this.slides).slice(this.activeIndex, this.activeIndex + this.params.slidesPerView),
363                        $slideAnimations = $activeSlider.find('.slide-animate');
364
365                    /* clear all animations that are running. */
366                    if (e.hasClass("animation-slider")) {
367                        for (var i = 0; i < timers.length; i++) {
368                            theme.deleteTimeout(timers[i]);
369                        }
370                        timers = [];
371                    }
372
373                    $slideAnimations.each(function () {
374                        var $animation_item = $(this),
375                            settings = 'undefined' != typeof $animation_item.data('settings') ? $animation_item.data('settings') : {},
376                            duration,
377                            delay = settings._animation_delay ? settings._animation_delay : 0,
378                            aniName = settings._animation;
379
380                        if ($animation_item.hasClass('animated')) return;
381
382                        if ($animation_item.hasClass('animated-slow')) {
383                            duration = 2000;
384                        } else if ($animation_item.hasClass('animated-fast')) {
385                            duration = 750;
386                        } else {
387                            duration = 1000;
388                        }
389
390                        $animation_item.css({
391                            'animation-duration': duration + 'ms',
392                            'animation-delay': delay + 'ms',
393                            'transition-property': 'visibility, opacity',
394                            'transition-duration': duration + 'ms',
395                            'transition-delay': delay + 'ms',
396                        }).addClass(aniName);
397
398                        if ($animation_item.hasClass('maskLeft')) {
399                            $animation_item.css('width', 'fit-content');
400                            var width = $animation_item.width();
401                            $animation_item
402                                .css('width', 0)
403                                .css('transition', 'width ' + (duration ? duration : 750) + 'ms linear ' + (delay ? delay : '0s'))
404                                .css('width', width);
405                        }
406
407
408                        duration = duration ? duration : 750;
409                        $animation_item.addClass('show-content');
410
411                        var temp = theme.requestTimeout(function () {
412                            $animation_item.css('transition-property', '');
413                            $animation_item.css('transition-delay', '');
414                            $animation_item.css('transition-duration', '');
415
416                            timers.splice(timers.indexOf(temp), 1)
417                        }, (delay ? (delay + 200) : 200));
418                        timers.push(temp);
419                    });
420
421                    e.find('.swiper-slide .slide-animate').each(function () {
422                        var $animation_item = $(this),
423                            settings = 'undefined' != typeof $animation_item.data('settings') ? $animation_item.data('settings') : {};
424
425                        if ($slideAnimations.index($(this)) < 0 && settings) {
426                            var animation = '';
427                            if ('undefined' != typeof settings._animation) {
428                                animation = settings._animation;
429                            } else if ('undefined' != typeof settings.animation) {
430                                animation = settings.animation;
431                            } else if ('undefined' != typeof $animation_item.data('rocket-animation')) {
432                                animation = $animation_item.data('rocket-animation');
433                                if ('undefined' != typeof settings._animation_delay) {
434                                    settings._animation = animation;
435                                } else {
436                                    settings.animation = animation;
437                                }
438
439                                $animation_item.data('settings', settings);
440                            }
441
442                            $animation_item.removeClass(animation + ' animated appear-animation-visible elementor-invisible appear-animate');
443                        }
444                    });
445
446                    if (this.activeIndex == this.params.slidesPerView - 1) {
447                        this.emit('alpusflexbox.from.begin');
448                    }
449                })
450
451                this.swiper.on('fromEdge alpusflexbox.from.begin', function () {
452
453                    if (!this.params.loop) return;
454
455                    const slidesPerView = this.params.slidesPerView;
456                    var $activeSlides, $slideAnimations;
457
458                    if (this.activeIndex > slidesPerView - 1) {
459                        $activeSlides = $(this.slides).slice(slidesPerView + 1, slidesPerView * 2);
460                        $slideAnimations = $activeSlides.find('.slide-animate');
461                    } else {
462                        $activeSlides = $(this.slides).slice(- slidesPerView - 1, -1);
463                        $slideAnimations = $activeSlides.find('.slide-animate');
464                    }
465
466                    $slideAnimations.each(function () {
467                        var $animation_item = $(this),
468                            settings = 'undefined' != typeof $animation_item.data('settings') ? $animation_item.data('settings') : {};
469
470                        if (settings && !$animation_item.hasClass('show-content')) {
471                            $animation_item.addClass('show-content animated');
472                        }
473                    })
474                });
475                this.swiper.on('resize', function () {
476                    if (e.hasClass('animation-slider')) {
477                        e.find('.slider-slide-active .slide-animate').each(function () {
478                            $(this)
479                                .addClass('show-content')
480                                .css({
481                                    'animation-name': '',
482                                    'animation-duration': '',
483                                    'animation-delay': '',
484                                });
485                        });
486                    }
487                });
488            }
489        }
490
491    });
492})(jQuery);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.