PageSourceSearch

https://drivocar.netlify.app/js/waypoints.min.js

js drivocar.netlify.app collected 2026-10-03 10:40:08 UTC 13,193 bytes, 305 lines download raw bytes

vendor: 13,193 bytes, lines 1-305
1/*  Waypoints - 4.0.1  |  Copyright © 2011-2016 Caleb Troughton  |  Licensed under the MIT license.  |  https://github.com/imakewebthings/waypoints/blob/master/licenses.txt*/ ! function() {
2    "use strict";
3
4    function t(o) {
5        if (!o) throw new Error("No options passed to Waypoint constructor");
6        if (!o.element) throw new Error("No element option passed to Waypoint constructor");
7        if (!o.handler) throw new Error("No handler option passed to Waypoint constructor");
8        this.key = "waypoint-" + e, this.options = t.Adapter.extend({}, t.defaults, o), this.element = this.options.element, this.adapter = new t.Adapter(this.element), this.callback = o.handler, this.axis = this.options.horizontal ? "horizontal" : "vertical", this.enabled = this.options.enabled, this.triggerPoint = null, this.group = t.Group.findOrCreate({
9            name: this.options.group,
10            axis: this.axis
11        }), this.context = t.Context.findOrCreateByElement(this.options.context), t.offsetAliases[this.options.offset] && (this.options.offset = t.offsetAliases[this.options.offset]), this.group.add(this), this.context.add(this), i[this.key] = this, e += 1
12    }
13    var e = 0,
14        i = {};
15    t.prototype.queueTrigger = function(t) {
16        this.group.queueTrigger(this, t)
17    }, t.prototype.trigger = function(t) {
18        this.enabled && this.callback && this.callback.apply(this, t)
19    }, t.prototype.destroy = function() {
20        this.context.remove(this), this.group.remove(this), delete i[this.key]
21    }, t.prototype.disable = function() {
22        return this.enabled = !1, this
23    }, t.prototype.enable = function() {
24        return this.context.refresh(), this.enabled = !0, this
25    }, t.prototype.next = function() {
26        return this.group.next(this)
27    }, t.prototype.previous = function() {
28        return this.group.previous(this)
29    }, t.invokeAll = function(t) {
30        var e = [];
31        for (var o in i) e.push(i[o]);
32        for (var n = 0, r = e.length; r > n; n++) e[n][t]()
33    }, t.destroyAll = function() {
34        t.invokeAll("destroy")
35    }, t.disableAll = function() {
36        t.invokeAll("disable")
37    }, t.enableAll = function() {
38        t.Context.refreshAll();
39        for (var e in i) i[e].enabled = !0;
40        return this
41    }, t.refreshAll = function() {
42        t.Context.refreshAll()
43    }, t.viewportHeight = function() {
44        return window.innerHeight || document.documentElement.clientHeight
45    }, t.viewportWidth = function() {
46        return document.documentElement.clientWidth
47    }, t.adapters = [], t.defaults = {
48        context: window,
49        continuous: !0,
50        enabled: !0,
51        group: "default",
52        horizontal: !1,
53        offset: 0
54    }, t.offsetAliases = {
55        "bottom-in-view": function() {
56            return this.context.innerHeight() - this.adapter.outerHeight()
57        },
58        "right-in-view": function() {
59            return this.context.innerWidth() - this.adapter.outerWidth()
60        }
61    }, window.Waypoint = t
62}(),
63function() {
64    "use strict";
65
66    function t(t) {
67        window.setTimeout(t, 1e3 / 60)
68    }
69
70    function e(t) {
71        this.element = t, this.Adapter = n.Adapter, this.adapter = new this.Adapter(t), this.key = "waypoint-context-" + i, this.didScroll = !1, this.didResize = !1, this.oldScroll = {
72            x: this.adapter.scrollLeft(),
73            y: this.adapter.scrollTop()
74        }, this.waypoints = {
75            vertical: {},
76            horizontal: {}
77        }, t.waypointContextKey = this.key, o[t.waypointContextKey] = this, i += 1, n.windowContext || (n.windowContext = !0, n.windowContext = new e(window)), this.createThrottledScrollHandler(), this.createThrottledResizeHandler()
78    }
79    var i = 0,
80        o = {},
81        n = window.Waypoint,
82        r = window.onload;
83    e.prototype.add = function(t) {
84        var e = t.options.horizontal ? "horizontal" : "vertical";
85        this.waypoints[e][t.key] = t, this.refresh()
86    }, e.prototype.checkEmpty = function() {
87        var t = this.Adapter.isEmptyObject(this.waypoints.horizontal),
88            e = this.Adapter.isEmptyObject(this.waypoints.vertical),
89            i = this.element == this.element.window;
90        t && e && !i && (this.adapter.off(".waypoints"), delete o[this.key])
91    }, e.prototype.createThrottledResizeHandler = function() {
92        function t() {
93            e.handleResize(), e.didResize = !1
94        }
95        var e = this;
96        this.adapter.on("resize.waypoints", function() {
97            e.didResize || (e.didResize = !0, n.requestAnimationFrame(t))
98        })
99    }, e.prototype.createThrottledScrollHandler = function() {
100        function t() {
101            e.handleScroll(), e.didScroll = !1
102        }
103        var e = this;
104        this.adapter.on("scroll.waypoints", function() {
105            (!e.didScroll || n.isTouch) && (e.didScroll = !0, n.requestAnimationFrame(t))
106        })
107    }, e.prototype.handleResize = function() {
108        n.Context.refreshAll()
109    }, e.prototype.handleScroll = function() {
110        var t = {},
111            e = {
112                horizontal: {
113                    newScroll: this.adapter.scrollLeft(),
114                    oldScroll: this.oldScroll.x,
115                    forward: "right",
116                    backward: "left"
117                },
118                vertical: {
119                    newScroll: this.adapter.scrollTop(),
120                    oldScroll: this.oldScroll.y,
121                    forward: "down",
122                    backward: "up"
123                }
124            };
125        for (var i in e) {
126            var o = e[i],
127                n = o.newScroll > o.oldScroll,
128                r = n ? o.forward : o.backward;
129            for (var s in this.waypoints[i]) {
130                var a = this.waypoints[i][s];
131                if (null !== a.triggerPoint) {
132                    var l = o.oldScroll < a.triggerPoint,
133                        h = o.newScroll >= a.triggerPoint,
134                        p = l && h,
135                        u = !l && !h;
136                    (p || u) && (a.queueTrigger(r), t[a.group.id] = a.group)
137                }
138            }
139        }
140        for (var c in t) t[c].flushTriggers();
141        this.oldScroll = {
142            x: e.horizontal.newScroll,
143            y: e.vertical.newScroll
144        }
145    }, e.prototype.innerHeight = function() {
146        return this.element == this.element.window ? n.viewportHeight() : this.adapter.innerHeight()
147    }, e.prototype.remove = function(t) {
148        delete this.waypoints[t.axis][t.key], this.checkEmpty()
149    }, e.prototype.innerWidth = function() {
150        return this.element == this.element.window ? n.viewportWidth() : this.adapter.innerWidth()
151    }, e.prototype.destroy = function() {
152        var t = [];
153        for (var e in this.waypoints)
154            for (var i in this.waypoints[e]) t.push(this.waypoints[e][i]);
155        for (var o = 0, n = t.length; n > o; o++) t[o].destroy()
156    }, e.prototype.refresh = function() {
157        var t, e = this.element == this.element.window,
158            i = e ? void 0 : this.adapter.offset(),
159            o = {};
160        this.handleScroll(), t = {
161            horizontal: {
162                contextOffset: e ? 0 : i.left,
163                contextScroll: e ? 0 : this.oldScroll.x,
164                contextDimension: this.innerWidth(),
165                oldScroll: this.oldScroll.x,
166                forward: "right",
167                backward: "left",
168                offsetProp: "left"
169            },
170            vertical: {
171                contextOffset: e ? 0 : i.top,
172                contextScroll: e ? 0 : this.oldScroll.y,
173                contextDimension: this.innerHeight(),
174                oldScroll: this.oldScroll.y,
175                forward: "down",
176                backward: "up",
177                offsetProp: "top"
178            }
179        };
180        for (var r in t) {
181            var s = t[r];
182            for (var a in this.waypoints[r]) {
183                var l, h, p, u, c, d = this.waypoints[r][a],
184                    f = d.options.offset,
185                    w = d.triggerPoint,
186                    y = 0,
187                    g = null == w;
188                d.element !== d.element.window && (y = d.adapter.offset()[s.offsetProp]), "function" == typeof f ? f = f.apply(d) : "string" == typeof f && (f = parseFloat(f), d.options.offset.indexOf("%") > -1 && (f = Math.ceil(s.contextDimension * f / 100))), l = s.contextScroll - s.contextOffset, d.triggerPoint = Math.floor(y + l - f), h = w < s.oldScroll, p = d.triggerPoint >= s.oldScroll, u = h && p, c = !h && !p, !g && u ? (d.queueTrigger(s.backward), o[d.group.id] = d.group) : !g && c ? (d.queueTrigger(s.forward), o[d.group.id] = d.group) : g && s.oldScroll >= d.triggerPoint && (d.queueTrigger(s.forward), o[d.group.id] = d.group)
189            }
190        }
191        return n.requestAnimationFrame(function() {
192            for (var t in o) o[t].flushTriggers()
193        }), this
194    }, e.findOrCreateByElement = function(t) {
195        return e.findByElement(t) || new e(t)
196    }, e.refreshAll = function() {
197        for (var t in o) o[t].refresh()
198    }, e.findByElement = function(t) {
199        return o[t.waypointContextKey]
200    }, window.onload = function() {
201        r && r(), e.refreshAll()
202    }, n.requestAnimationFrame = function(e) {
203        var i = window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || t;
204        i.call(window, e)
205    }, n.Context = e
206}(),
207function() {
208    "use strict";
209
210    function t(t, e) {
211        return t.triggerPoint - e.triggerPoint
212    }
213
214    function e(t, e) {
215        return e.triggerPoint - t.triggerPoint
216    }
217
218    function i(t) {
219        this.name = t.name, this.axis = t.axis, this.id = this.name + "-" + this.axis, this.waypoints = [], this.clearTriggerQueues(), o[this.axis][this.name] = this
220    }
221    var o = {
222            vertical: {},
223            horizontal: {}
224        },
225        n = window.Waypoint;
226    i.prototype.add = function(t) {
227        this.waypoints.push(t)
228    }, i.prototype.clearTriggerQueues = function() {
229        this.triggerQueues = {
230            up: [],
231            down: [],
232            left: [],
233            right: []
234        }
235    }, i.prototype.flushTriggers = function() {
236        for (var i in this.triggerQueues) {
237            var o = this.triggerQueues[i],
238                n = "up" === i || "left" === i;
239            o.sort(n ? e : t);
240            for (var r = 0, s = o.length; s > r; r += 1) {
241                var a = o[r];
242                (a.options.continuous || r === o.length - 1) && a.trigger([i])
243            }
244        }
245        this.clearTriggerQueues()
246    }, i.prototype.next = function(e) {
247        this.waypoints.sort(t);
248        var i = n.Adapter.inArray(e, this.waypoints),
249            o = i === this.waypoints.length - 1;
250        return o ? null : this.waypoints[i + 1]
251    }, i.prototype.previous = function(e) {
252        this.waypoints.sort(t);
253        var i = n.Adapter.inArray(e, this.waypoints);
254        return i ? this.waypoints[i - 1] : null
255    }, i.prototype.queueTrigger = function(t, e) {
256        this.triggerQueues[e].push(t)
257    }, i.prototype.remove = function(t) {
258        var e = n.Adapter.inArray(t, this.waypoints);
259        e > -1 && this.waypoints.splice(e, 1)
260    }, i.prototype.first = function() {
261        return this.waypoints[0]
262    }, i.prototype.last = function() {
263        return this.waypoints[this.waypoints.length - 1]
264    }, i.findOrCreate = function(t) {
265        return o[t.axis][t.name] || new i(t)
266    }, n.Group = i
267}(),
268function() {
269    "use strict";
270
271    function t(t) {
272        this.$element = e(t)
273    }
274    var e = window.jQuery,
275        i = window.Waypoint;
276    e.each(["innerHeight", "innerWidth", "off", "offset", "on", "outerHeight", "outerWidth", "scrollLeft", "scrollTop"], function(e, i) {
277        t.prototype[i] = function() {
278            var t = Array.prototype.slice.call(arguments);
279            return this.$element[i].apply(this.$element, t)
280        }
281    }), e.each(["extend", "inArray", "isEmptyObject"], function(i, o) {
282        t[o] = e[o]
283    }), i.adapters.push({
284        name: "jquery",
285        Adapter: t
286    }), i.Adapter = t
287}(),
288function() {
289    "use strict";
290
291    function t(t) {
292        return function() {
293            var i = [],
294                o = arguments[0];
295            return t.isFunction(arguments[0]) && (o = t.extend({}, arguments[1]), o.handler = arguments[0]), this.each(function() {
296                var n = t.extend({}, o, {
297                    element: this
298                });
299                "string" == typeof n.context && (n.context = t(this).closest(n.context)[0]), i.push(new e(n))
300            }), i
301        }
302    }
303    var e = window.Waypoint;
304    window.jQuery && (window.jQuery.fn.waypoint = t(window.jQuery)), window.Zepto && (window.Zepto.fn.waypoint = t(window.Zepto))
305}();

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.