PageSourceSearch

http://www.newpeaksolutions.com/wp-content/plugins/gt3-pagebuilder/js/animate.js?ver=3.9.1

js newpeaksolutions.com collected 2026-10-08 04:38:46 UTC 4,114 bytes, 151 lines download raw bytes

1/*
2 * jQuery appear plugin
3 *
4 * Copyright (c) 2012 Andrey Sidorov
5 * licensed under MIT license.
6 *
7 * https://github.com/morr/jquery.appear/
8 *
9 * Version: 0.3.3
10 */
11(function($) {
12    var selectors = [];
13
14    var check_binded = false;
15    var check_lock = false;
16    var defaults = {
17        interval: 250,
18        force_process: false
19    }
20    var $window = $(window);
21
22    var $prior_appeared;
23
24    function process() {
25        check_lock = false;
26        for (var index = 0; index < selectors.length; index++) {
27            var $appeared = $(selectors[index]).filter(function() {
28                return $(this).is(':appeared');
29            });
30
31            $appeared.trigger('appear', [$appeared]);
32
33            if ($prior_appeared) {
34                var $disappeared = $prior_appeared.not($appeared);
35                $disappeared.trigger('disappear', [$disappeared]);
36            }
37            $prior_appeared = $appeared;
38        }
39    }
40
41    // "appeared" custom filter
42    $.expr[':']['appeared'] = function(element) {
43        var $element = $(element);
44        if (!$element.is(':visible')) {
45            return false;
46        }
47
48        var window_left = $window.scrollLeft();
49        var window_top = $window.scrollTop();
50        var offset = $element.offset();
51        var left = offset.left;
52        var top = offset.top;
53
54        if (top + $element.height() >= window_top &&
55            top - ($element.data('appear-top-offset') || 0) <= window_top + $window.height() &&
56            left + $element.width() >= window_left &&
57            left - ($element.data('appear-left-offset') || 0) <= window_left + $window.width()) {
58            return true;
59        } else {
60            return false;
61        }
62    }
63
64    $.fn.extend({
65        // watching for element's appearance in browser viewport
66        appear: function(options) {
67            var opts = $.extend({}, defaults, options || {});
68            var selector = this.selector || this;
69            if (!check_binded) {
70                var on_check = function() {
71                    if (check_lock) {
72                        return;
73                    }
74                    check_lock = true;
75
76                    setTimeout(process, opts.interval);
77                };
78
79                $(window).scroll(on_check).resize(on_check);
80                check_binded = true;
81            }
82
83            if (opts.force_process) {
84                setTimeout(process, opts.interval);
85            }
86            selectors.push(selector);
87            return $(selector);
88        }
89    });
90
91    $.extend({
92        // force elements's appearance check
93        force_appear: function() {
94            if (check_binded) {
95                process();
96                return true;
97            };
98            return false;
99        }
100    });
101})(jQuery);
102
103var isMobile = false;
104
105(function( $ ) {
106    "use strict";
107
108    $(function() {
109
110        /* --- MOBILE DETECT --- */
111        if (navigator.userAgent.match(/Android/i) ||
112            navigator.userAgent.match(/webOS/i) ||
113            navigator.userAgent.match(/iPhone/i) ||
114            navigator.userAgent.match(/iPad/i)||
115            navigator.userAgent.match(/iPod/i) ||
116            navigator.userAgent.match(/BlackBerry/i)) {
117            isMobile = true;
118        }
119
120        /* --- ADD NECESSARY CLASS --- */
121        if (isMobile == true) {
122            $('.animated').removeClass('animated');
123            $('.op0').removeClass('op0');
124        }
125
126        /* --- ANIMATE CONTENT --- */
127        if (isMobile == false) {
128            $('*[data-animated]').addClass('animated');
129        }
130
131        function animated_contents() {
132            $(".animated:appeared").each(function (i) {
133                var $this    = $(this),
134                    animated = $(this).data('animated');
135
136                setTimeout(function () {
137                    $this.addClass(animated);
138                }, 100 * i);
139
140            });
141        }
142
143        if (isMobile == false) {
144            animated_contents();
145            $(window).scroll(function () {
146                animated_contents();
147            });
148        }
149    });
150
151}(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.