PageSourceSearch

https://problembox.pl/wp-content/themes/appbox/js/scripts.js?ver=1.1

js problembox.pl collected 2026-10-02 01:09:06 UTC 23,825 bytes, 853 lines download raw bytes

1/*
2| ----------------------------------------------------------------------------------
3| TABLE OF CONTENT
4| ----------------------------------------------------------------------------------
5-CAROUSEL SETTING     
6-Go to top animation   
7-Search Field Animation   
8-More App
9-Mobile Menu Animation
10-Popup Settings
11-Placeholder for IE
12-Scroll to top button
13*/
14
15/*	new WOW().init();*/
16
17
18jQuery(document).ready(function ($) {
19
20
21    "use strict";
22	
23	function is_yellow_pencil() {
24		if ($("body").hasClass("yp-yellow-pencil")) {
25			return true;
26		} else {
27			return false;
28		}
29	}
30	
31    /////////////////////////////////////////////////////////////////
32    // Mobile Menu Animation
33    /////////////////////////////////////////////////////////////////
34
35    $('.mobileMenuNav').on('click', function (e) {
36        $('body').toggleClass('openMenu');
37    });
38
39
40
41
42    /////////////////////////////////////////////////////////////////
43    //   Dropdown Menu Fade
44    /////////////////////////////////////////////////////////////////
45
46
47    $(".dropdown").hover(
48        function () {
49            $('.dropdown-menu', this).stop(true, true).slideDown("fast");
50            $(this).toggleClass('open');
51        }
52        , function () {
53            $('.dropdown-menu', this).stop(true, true).slideUp("fast");
54            $(this).toggleClass('open');
55        }
56    );
57
58
59    $(".yamm .navbar-nav>li").hover(
60        function () {
61            $('.dropdown-menu', this).fadeIn("fast");
62        }
63        , function () {
64            $('.dropdown-menu', this).fadeOut("fast");
65        });
66
67
68    window.prettyPrint && prettyPrint();
69    $(document).on('click', '.yamm .dropdown-menu', function (e) {
70        e.stopPropagation();
71    });
72
73
74
75    ////////////////////////////////////////////  
76    //  full-width
77    ///////////////////////////////////////////  
78
79
80    function Skew() {
81
82
83        var windowWidth = $(window).width();
84        var widthContainer = $('.container').width();
85
86        var fullWidth1 = windowWidth - widthContainer;
87        var fullWidth2 = fullWidth1 / 2 - 15;
88
89        $('.row-strech-default .skew_prepended,.row-strech-default .skew_appended ').css("width", windowWidth);
90        $('.row-strech-default .skew_prepended,.row-strech-default .skew_appended ').css("margin-left", -fullWidth2);
91
92    }
93
94
95    Skew();
96
97    $(window).resize(function () {
98        Skew();
99    });
100
101
102    /////////////////////////////////////////////////////////////////
103    // CAROUSEL SETTING
104    /////////////////////////////////////////////////////////////////
105
106
107    $(".enable-owl-carousel").each(function (i) {
108
109        var minslides = $(this).data("min-slides");
110        var auto_play = $(this).data("autoplay");
111
112        $(this).owlCarousel({
113
114            items: minslides
115            , autoPlay: auto_play
116        , });
117
118    });
119
120    $("aside .product_list_widget").owlCarousel({
121        singleItem: true
122        , autoPlay: 4000
123    });
124
125
126
127
128    $("#owl-reviews , .owl-blog_carousel ").owlCarousel({
129        singleItem: true
130        , autoPlay: 4000
131    });
132
133    $("#owl-trending").owlCarousel({
134        items: 4
135    , });
136    $("#owl-members").owlCarousel({
137        items: 6
138    , });
139    $("#owl-screenshots").each(function (i) {
140
141        var auto_play = $(this).data("autoplay");
142
143        $(this).owlCarousel({
144            items: 3
145            , navigation: true
146            , navigationText: ['', '']
147            , pagination: false
148            , itemsCustom: [
149			[0, 1]
150			
151                , [650, 2]
152			
153                , [950, 3]
154			
155                , ]
156            , autoPlay: auto_play
157        , });
158
159    });
160    $(".owl-blog_carousel").owlCarousel({
161        singleItem: true
162        , transitionStyle: "fadeUp"
163    , });
164    $("#owl-trend_carousel").owlCarousel({
165        singleItem: true
166        , autoPlay: 4000
167    });
168    $("#owl-app-screenshot").owlCarousel({
169        singleItem: true
170        , autoPlay: 4500
171    });
172
173    /////////////////////////////////////////////////////////////////
174    // Go to top animation
175    /////////////////////////////////////////////////////////////////
176
177    $(".goToTop").on('click', function (e) {
178        e.preventDefault();
179        $('html,body').animate({
180            scrollTop: 0
181        }, 'slow');
182    });
183
184
185
186
187    $('.button').hover(
188        function () {
189            $(this).addClass('hvr-push');
190        }
191        , function () {
192            $(this).removeClass('hvr-push');
193        });
194
195
196
197    /////////////////////////////////////
198    //  Scroll Animation
199    /////////////////////////////////////
200
201
202
203
204
205    if ($(".animate-scroll").length) {
206
207
208        window.sr = ScrollReveal({
209            mobile: false
210            , reset: true
211        });
212
213        sr.reveal('.scroller');
214
215    }
216
217
218
219    /////////////////////////////////////////////////////////////////
220    // LOADER
221    /////////////////////////////////////////////////////////////////
222
223
224
225    var $preloader = $('#page-preloader')
226        , $spinner = $preloader.find('.spinner-loader');
227    $spinner.fadeOut();
228    $preloader.delay(50).fadeOut('slow');
229
230
231
232
233    /////////////////////////////////////
234    //  Sticky Header
235    /////////////////////////////////////
236
237
238
239
240
241    if ($(".home-section").length) {
242
243
244
245        var headerSticky = $(".layout-theme").data("header");
246        var headerTop = $(".layout-theme").data("header-top");
247
248
249        if (headerSticky.length) {
250            $(window).on('scroll', function () {
251                var winH = $(window).scrollTop();
252                var $pageHeader = $('.header');
253                if (winH > headerTop) {
254
255                    $('.yamm').addClass("animated");
256                    $('.yamm').addClass("animation-done");
257                    $('.yamm').addClass("bounce");
258                    $pageHeader.addClass(headerSticky);
259
260
261
262                } else {
263
264                    $('.yamm').removeClass("bounce");
265                    $('.yamm').removeClass("animated");
266                    $('.yamm').removeClass("animation-done");
267                    $pageHeader.removeClass('sticky');
268
269                }
270
271
272            });
273        }
274
275    }
276
277
278
279
280
281
282    /////////////////////////////////////////////////////////////////
283    // Search Field Animation
284    /////////////////////////////////////////////////////////////////
285
286    $(".iconSearch").on('click', function (e) {
287        e.preventDefault();
288        $('.header').toggleClass('active');
289    });
290
291
292
293    /////////////////////////////////////////////////////////////////
294    // Animation
295    /////////////////////////////////////////////////////////////////
296
297
298
299    $('.animated:not(.animation-done)').waypoint(function () {
300
301
302
303        var animation = $(this).data('animation');
304
305        $(this).addClass('animation-done').addClass(animation);
306
307    }, {
308        triggerOnce: true
309        , offset: '90%'
310    });
311
312
313    /////////////////////////////////////////////////////////////////
314    // More App
315    /////////////////////////////////////////////////////////////////
316
317    $('.showAllAppBtn').on('click', function (e) {
318        e.preventDefault();
319        $('.app-product-item').removeClass('hidden').addClass('fadeInUp');
320        $(this).addClass('hidden');
321    });
322
323
324
325
326
327
328    ////////////////////////////////////////////  
329    //  HREF TARGET
330    ///////////////////////////////////////////  
331
332
333
334
335    if ($('body').length) {
336        $(window).on('scroll', function () {
337            var winH = $(window).scrollTop();
338
339            if (winH > 500) {
340                $(".goToTop").addClass('scroll-top-view');
341            } else {
342                $(".goToTop").removeClass('scroll-top-view');
343            }
344        });
345    }
346
347
348    $('.scroll-top').click(function (event) {
349        event.preventDefault();
350
351        $('html, body').animate({
352            scrollTop: 0
353        }, 300);
354    });
355
356
357
358
359
360    $(function () {
361        $('.scroll[href*="#"]:not([href="#"])').click(function () {
362            if (location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') && location.hostname == this.hostname) {
363                var target = $(this.hash);
364                target = target.length ? target : $('[name=' + this.hash.slice(1) + ']');
365                if (target.length) {
366                    $('html,body').animate({
367                        scrollTop: target.offset().top
368                    }, 1000);
369                    return false;
370                }
371            }
372        });
373    });
374
375
376
377    $('a[href*="vimeo.com"]').magnificPopup({
378        disableOn: 700
379        , type: 'iframe'
380        , mainClass: 'mfp-fade'
381        , removalDelay: 160
382        , preloader: false
383        , fixedContentPos: false
384    });
385
386
387    $('a[href*="youtube.com"]').magnificPopup({
388        disableOn: 700
389        , type: 'iframe'
390        , mainClass: 'mfp-fade'
391        , removalDelay: 160
392        , preloader: false
393        , fixedContentPos: false
394    });
395
396
397
398
399
400});
401
402
403
404// ----------------------------------------------------------------------------------------------------
405// ScrollMe
406// A jQuery plugin for adding simple scrolling effects to web pages
407// http://scrollme.nckprsn.com
408// ----------------------------------------------------------------------------------------------------
409
410var scrollme = (function ($) {
411    // ----------------------------------------------------------------------------------------------------
412    // ScrollMe object
413
414    var _this = {};
415
416    // ----------------------------------------------------------------------------------------------------
417    // Properties
418
419    var $document = $(document);
420    var $window = $(window);
421
422    _this.body_height = 0;
423
424    _this.viewport_height = 0;
425
426    _this.viewport_top = 0;
427    _this.viewport_bottom = 0;
428
429    _this.viewport_top_previous = -1;
430
431    _this.elements = [];
432    _this.elements_in_view = [];
433
434    _this.property_defaults = {
435        'opacity': 1
436        , 'translatex': 0
437        , 'translatey': 0
438        , 'translatez': 0
439        , 'rotatex': 0
440        , 'rotatey': 0
441        , 'rotatez': 0
442        , 'scale': 1
443        , 'scalex': 1
444        , 'scaley': 1
445        , 'scalez': 1
446    };
447
448    _this.scrollme_selector = '.scrollme';
449    _this.animateme_selector = '.animateme';
450
451    _this.update_interval = 10;
452
453    // Easing functions
454
455    _this.easing_functions = {
456        'linear': function (x) {
457            return x;
458        },
459
460        'easeout': function (x) {
461            return x * x * x;
462        },
463
464        'easein': function (x) {
465            x = 1 - x;
466            return 1 - (x * x * x);
467        },
468
469        'easeinout': function (x) {
470            if (x < 0.5) {
471                return (4 * x * x * x);
472            } else {
473                x = 1 - x;
474                return 1 - (4 * x * x * x);
475            }
476        }
477    };
478
479    // Document events to bind initialisation to
480
481    _this.init_events = [
482		'ready'
483		
484        , 'page:load', // Turbolinks
485		'page:change' // Turbolinks
486	];
487
488    // ----------------------------------------------------------------------------------------------------
489    // Initialisation conditions
490
491    _this.init_if = function () {
492        return true;
493    }
494
495    // ----------------------------------------------------------------------------------------------------
496    // Initialisation
497
498    _this.init = function () {
499        // Cancel if initialisation conditions not met
500
501        if (!_this.init_if()) return false;
502
503        // Load all elements to animate
504
505        _this.init_elements();
506
507        // Get element & viewport sizes
508
509        _this.on_resize();
510
511        // Recalculate heights & positions on resize and rotate
512
513        $window.on('resize orientationchange', function () {
514            _this.on_resize();
515        });
516
517        // Recalculate heights & positions when page is fully loaded + a bit just in case
518
519        $window.load(function () {
520            setTimeout(function () {
521                _this.on_resize();
522            }, 100)
523        });
524
525        // Start animating
526
527        setInterval(_this.update, _this.update_interval);
528
529        return true;
530    }
531
532    // ----------------------------------------------------------------------------------------------------
533    // Get list and pre-load animated elements
534
535    _this.init_elements = function () {
536        // For each reference element
537
538        $(_this.scrollme_selector).each(function () {
539            var element = {};
540
541            element.element = $(this);
542
543            var effects = [];
544
545            // For each animated element
546
547            $(this).find(_this.animateme_selector).addBack(_this.animateme_selector).each(function () {
548                // Get effect details
549
550                var effect = {};
551
552                effect.element = $(this);
553
554                effect.when = effect.element.data('when');
555                effect.from = effect.element.data('from');
556                effect.to = effect.element.data('to');
557
558                if (effect.element.is('[data-crop]')) {
559                    effect.crop = effect.element.data('crop');
560                } else {
561                    effect.crop = true;
562                }
563
564                if (effect.element.is('[data-easing]')) {
565                    effect.easing = _this.easing_functions[effect.element.data('easing')]
566                } else {
567                    effect.easing = _this.easing_functions['easeout'];
568                }
569
570                // Get animated properties
571
572                var properties = {};
573
574                if (effect.element.is('[data-opacity]')) properties.opacity = effect.element.data('opacity');
575                if (effect.element.is('[data-translatex]')) properties.translatex = effect.element.data('translatex');
576                if (effect.element.is('[data-translatey]')) properties.translatey = effect.element.data('translatey');
577                if (effect.element.is('[data-translatez]')) properties.translatez = effect.element.data('translatez');
578                if (effect.element.is('[data-rotatex]')) properties.rotatex = effect.element.data('rotatex');
579                if (effect.element.is('[data-rotatey]')) properties.rotatey = effect.element.data('rotatey');
580                if (effect.element.is('[data-rotatez]')) properties.rotatez = effect.element.data('rotatez');
581                if (effect.element.is('[data-scale]')) properties.scale = effect.element.data('scale');
582                if (effect.element.is('[data-scalex]')) properties.scalex = effect.element.data('scalex');
583                if (effect.element.is('[data-scaley]')) properties.scaley = effect.element.data('scaley');
584                if (effect.element.is('[data-scalez]')) properties.scalez = effect.element.data('scalez');
585
586                effect.properties = properties;
587
588                effects.push(effect);
589            });
590
591            element.effects = effects;
592
593            _this.elements.push(element);
594        });
595    }
596
597    // ----------------------------------------------------------------------------------------------------
598    // Update elements
599
600    _this.update = function () {
601        window.requestAnimationFrame(function () {
602            _this.update_viewport_position();
603
604            if (_this.viewport_top_previous != _this.viewport_top) {
605                _this.update_elements_in_view();
606                _this.animate();
607            }
608
609            _this.viewport_top_previous = _this.viewport_top;
610        });
611    }
612
613    // ----------------------------------------------------------------------------------------------------
614    // Animate stuff
615
616    _this.animate = function () {
617        // For each element in viewport
618
619        var elements_in_view_length = _this.elements_in_view.length;
620
621        for (var i = 0; i < elements_in_view_length; i++) {
622            var element = _this.elements_in_view[i];
623
624            // For each effect
625
626            var effects_length = element.effects.length;
627
628            for (var e = 0; e < effects_length; e++) {
629                var effect = element.effects[e];
630
631                // Get effect animation boundaries
632
633                switch (effect.when) {
634                case 'view': // Maintained for backwards compatibility
635                case 'span':
636                    var start = element.top - _this.viewport_height;
637                    var end = element.bottom;
638                    break;
639
640                case 'exit':
641                    var start = element.bottom - _this.viewport_height;
642                    var end = element.bottom;
643                    break;
644
645                default:
646                    var start = element.top - _this.viewport_height;
647                    var end = element.top;
648                    break;
649                }
650
651                // Crop boundaries
652
653                if (effect.crop) {
654                    if (start < 0) start = 0;
655                    if (end > (_this.body_height - _this.viewport_height)) end = _this.body_height - _this.viewport_height;
656                }
657
658                // Get scroll position of reference selector
659
660                var scroll = (_this.viewport_top - start) / (end - start);
661
662                // Get relative scroll position for effect
663
664                var from = effect['from'];
665                var to = effect['to'];
666
667                var length = to - from;
668
669                var scroll_relative = (scroll - from) / length;
670
671                // Apply easing
672
673                var scroll_eased = effect.easing(scroll_relative);
674
675                // Get new value for each property
676
677                var opacity = _this.animate_value(scroll, scroll_eased, from, to, effect, 'opacity');
678                var translatey = _this.animate_value(scroll, scroll_eased, from, to, effect, 'translatey');
679                var translatex = _this.animate_value(scroll, scroll_eased, from, to, effect, 'translatex');
680                var translatez = _this.animate_value(scroll, scroll_eased, from, to, effect, 'translatez');
681                var rotatex = _this.animate_value(scroll, scroll_eased, from, to, effect, 'rotatex');
682                var rotatey = _this.animate_value(scroll, scroll_eased, from, to, effect, 'rotatey');
683                var rotatez = _this.animate_value(scroll, scroll_eased, from, to, effect, 'rotatez');
684                var scale = _this.animate_value(scroll, scroll_eased, from, to, effect, 'scale');
685                var scalex = _this.animate_value(scroll, scroll_eased, from, to, effect, 'scalex');
686                var scaley = _this.animate_value(scroll, scroll_eased, from, to, effect, 'scaley');
687                var scalez = _this.animate_value(scroll, scroll_eased, from, to, effect, 'scalez');
688
689                // Override scale values
690
691                if ('scale' in effect.properties) {
692                    scalex = scale;
693                    scaley = scale;
694                    scalez = scale;
695                }
696
697                // Update properties
698
699                effect.element.css({
700                    'opacity': opacity
701                    , 'transform': 'translate3d( ' + translatex + 'px , ' + translatey + 'px , ' + translatez + 'px ) rotateX( ' + rotatex + 'deg ) rotateY( ' + rotatey + 'deg ) rotateZ( ' + rotatez + 'deg ) scale3d( ' + scalex + ' , ' + scaley + ' , ' + scalez + ' )'
702                });
703            }
704        }
705    }
706
707    // ----------------------------------------------------------------------------------------------------
708    // Calculate property values
709
710    _this.animate_value = function (scroll, scroll_eased, from, to, effect, property) {
711        var value_default = _this.property_defaults[property];
712
713        // Return default value if property is not animated
714
715        if (!(property in effect.properties)) return value_default;
716
717        var value_target = effect.properties[property];
718
719        var forwards = (to > from) ? true : false;
720
721        // Return boundary value if outside effect boundaries
722
723        if (scroll < from && forwards) {
724            return value_default;
725        }
726        if (scroll > to && forwards) {
727            return value_target;
728        }
729
730        if (scroll > from && !forwards) {
731            return value_default;
732        }
733        if (scroll < to && !forwards) {
734            return value_target;
735        }
736
737        // Calculate new property value
738
739        var new_value = value_default + (scroll_eased * (value_target - value_default));
740
741        // Round as required
742
743        switch (property) {
744        case 'opacity':
745            new_value = new_value.toFixed(2);
746            break;
747        case 'translatex':
748            new_value = new_value.toFixed(0);
749            break;
750        case 'translatey':
751            new_value = new_value.toFixed(0);
752            break;
753        case 'translatez':
754            new_value = new_value.toFixed(0);
755            break;
756        case 'rotatex':
757            new_value = new_value.toFixed(1);
758            break;
759        case 'rotatey':
760            new_value = new_value.toFixed(1);
761            break;
762        case 'rotatez':
763            new_value = new_value.toFixed(1);
764            break;
765        case 'scale':
766            new_value = new_value.toFixed(3);
767            break;
768        default:
769            break;
770        }
771
772        // Done
773
774        return new_value;
775    }
776
777    // ----------------------------------------------------------------------------------------------------
778    // Update viewport position
779
780    _this.update_viewport_position = function () {
781        _this.viewport_top = $window.scrollTop();
782        _this.viewport_bottom = _this.viewport_top + _this.viewport_height;
783    }
784
785    // ----------------------------------------------------------------------------------------------------
786    // Update list of elements in view
787
788    _this.update_elements_in_view = function () {
789        _this.elements_in_view = [];
790
791        var elements_length = _this.elements.length;
792
793        for (var i = 0; i < elements_length; i++) {
794            if ((_this.elements[i].top < _this.viewport_bottom) && (_this.elements[i].bottom > _this.viewport_top)) {
795                _this.elements_in_view.push(_this.elements[i]);
796            }
797        }
798    }
799
800    // ----------------------------------------------------------------------------------------------------
801    // Stuff to do on resize
802
803    _this.on_resize = function () {
804        // Update viewport/element data
805
806        _this.update_viewport();
807        _this.update_element_heights();
808
809        // Update display
810
811        _this.update_viewport_position();
812        _this.update_elements_in_view();
813        _this.animate();
814    }
815
816    // ----------------------------------------------------------------------------------------------------
817    // Update viewport parameters
818
819    _this.update_viewport = function () {
820        _this.body_height = $document.height();
821        _this.viewport_height = $window.height();
822    }
823
824    // ----------------------------------------------------------------------------------------------------
825    // Update height of animated elements
826
827    _this.update_element_heights = function () {
828        var elements_length = _this.elements.length;
829
830        for (var i = 0; i < elements_length; i++) {
831            var element_height = _this.elements[i].element.outerHeight();
832            var position = _this.elements[i].element.offset();
833
834            _this.elements[i].height = element_height;
835            _this.elements[i].top = position.top;
836            _this.elements[i].bottom = position.top + element_height;
837        }
838    }
839
840    // ----------------------------------------------------------------------------------------------------
841    // Bind initialisation
842
843    $document.on(_this.init_events.join(' '), function () {
844        _this.init();
845    });
846
847    // ----------------------------------------------------------------------------------------------------
848
849    return _this;
850
851    // ----------------------------------------------------------------------------------------------------
852
853})(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.