PageSourceSearch

https://www.industrypainting.ca/wp-content/themes/IndustryPainting/js/parallax.min.js

js industrypainting.ca collected 2026-10-04 15:38:30 UTC 9,988 bytes, 192 lines download raw bytes

vendor: 9,988 bytes, lines 1-192
1/*!
2 * parallax.js v1.5.0 (http://pixelcog.github.io/parallax.js/)
3 * @copyright 2016 PixelCog, Inc.
4 * @license MIT (https://github.com/pixelcog/parallax.js/blob/master/LICENSE)
5 */
6! function (t, i, e, s)
7{
8    function o(i, e)
9    {
10        var h = this;
11        "object" == typeof e && (delete e.refresh, delete e.render, t.extend(this, e)), this.$element = t(i), !this.imageSrc && this.$element.is("img") && (this.imageSrc = this.$element.attr("src"));
12        var r = (this.position + "").toLowerCase().match(/\S+/g) || [];
13        if (r.length < 1 && r.push("center"), 1 == r.length && r.push(r[0]), "top" != r[0] && "bottom" != r[0] && "left" != r[1] && "right" != r[1] || (r = [r[1], r[0]]), this.positionX !== s && (r[0] = this.positionX.toLowerCase()), this.positionY !== s && (r[1] = this.positionY.toLowerCase()), h.positionX = r[0], h.positionY = r[1], "left" != this.positionX && "right" != this.positionX && (isNaN(parseInt(this.positionX)) ? this.positionX = "center" : this.positionX = parseInt(this.positionX)), "top" != this.positionY && "bottom" != this.positionY && (isNaN(parseInt(this.positionY)) ? this.positionY = "center" : this.positionY = parseInt(this.positionY)), this.position = this.positionX + (isNaN(this.positionX) ? "" : "px") + " " + this.positionY + (isNaN(this.positionY) ? "" : "px"), navigator.userAgent.match(/(iPod|iPhone|iPad)/)) return this.imageSrc && this.iosFix && !this.$element.is("img") && this.$element.css(
14            {
15                backgroundImage: "url(" + this.imageSrc + ")",
16                backgroundSize: "cover",
17                backgroundPosition: this.position
18            }), this;
19        if (navigator.userAgent.match(/(Android)/)) return this.imageSrc && this.androidFix && !this.$element.is("img") && this.$element.css(
20            {
21                backgroundImage: "url(" + this.imageSrc + ")",
22                backgroundSize: "cover",
23                backgroundPosition: this.position
24            }), this;
25        this.$mirror = t("<div />").prependTo(this.mirrorContainer);
26        var a = this.$element.find(">.parallax-slider"),
27            n = !1;
28        0 == a.length ? this.$slider = t("<img />").prependTo(this.$mirror) : (this.$slider = a.prependTo(this.$mirror), n = !0),
29            this.$mirror.addClass("parallax-mirror").css(
30            {
31                visibility: "hidden",
32                zIndex: this.zIndex,
33                position: "fixed",
34                top: 0,
35                left: 0,
36                overflow: "hidden"
37            }), this.$slider.addClass("parallax-slider").one("load", function ()
38        {
39            h.naturalHeight && h.naturalWidth || (h.naturalHeight = this.naturalHeight || this.height || 1, h.naturalWidth = this.naturalWidth || this.width || 1), h.aspectRatio = h.naturalWidth / h.naturalHeight, o.isSetup || o.setup(), o.sliders.push(h), o.isFresh = !1, o.requestRender()
40        }), n || (this.$slider[0].src = this.imageSrc), (this.naturalHeight && this.naturalWidth || this.$slider[0].complete || a.length > 0) && this.$slider.trigger("load")
41    }! function ()
42{
43    for (var t = 0, e = ["ms", "moz", "webkit", "o"], s = 0; s < e.length && !i.requestAnimationFrame; ++s) i.requestAnimationFrame = i[e[s] + "RequestAnimationFrame"], i.cancelAnimationFrame = i[e[s] + "CancelAnimationFrame"] || i[e[s] + "CancelRequestAnimationFrame"];
44    i.requestAnimationFrame || (i.requestAnimationFrame = function (e)
45    {
46        var s = (new Date).getTime(),
47            o = Math.max(0, 16 - (s - t)),
48            h = i.setTimeout(function ()
49            {
50                e(s + o)
51            }, o);
52        return t = s + o, h
53    }), i.cancelAnimationFrame || (i.cancelAnimationFrame = function (t)
54    {
55        clearTimeout(t)
56    })
57}(), t.extend(o.prototype,
58    {
59        speed: .2,
60        bleed: 0,
61        zIndex: -100,
62        iosFix: !0,
63        androidFix: !0,
64        position: "center",
65        overScrollFix: !1,
66        mirrorContainer: "body",
67        refresh: function ()
68        {
69            this.boxWidth = this.$element.outerWidth(), this.boxHeight = this.$element.outerHeight() + 2 * this.bleed, this.boxOffsetTop = this.$element.offset().top - this.bleed, this.boxOffsetLeft = this.$element.offset().left, this.boxOffsetBottom = this.boxOffsetTop + this.boxHeight;
70            var t, i = o.winHeight,
71                e = o.docHeight,
72                s = Math.min(this.boxOffsetTop, e - i),
73                h = Math.max(this.boxOffsetTop + this.boxHeight - i, 0),
74                r = this.boxHeight + (s - h) * (1 - this.speed) | 0,
75                a = (this.boxOffsetTop - s) * (1 - this.speed) | 0;
76            r * this.aspectRatio >= this.boxWidth ? (this.imageWidth = r * this.aspectRatio | 0, this.imageHeight = r, this.offsetBaseTop = a, t = this.imageWidth - this.boxWidth, "left" == this.positionX ? this.offsetLeft = 0 : "right" == this.positionX ? this.offsetLeft = -t : isNaN(this.positionX) ? this.offsetLeft = -t / 2 | 0 : this.offsetLeft = Math.max(this.positionX, -t)) : (this.imageWidth = this.boxWidth, this.imageHeight = this.boxWidth / this.aspectRatio | 0, this.offsetLeft = 0, t = this.imageHeight - r, "top" == this.positionY ? this.offsetBaseTop = a : "bottom" == this.positionY ? this.offsetBaseTop = a - t : isNaN(this.positionY) ? this.offsetBaseTop = a - t / 2 | 0 : this.offsetBaseTop = a + Math.max(this.positionY, -t))
77        },
78        render: function ()
79        {
80            var t = o.scrollTop,
81                i = o.scrollLeft,
82                e = this.overScrollFix ? o.overScroll : 0,
83                s = t + o.winHeight;
84            this.boxOffsetBottom > t && this.boxOffsetTop <= s ? (this.visibility = "visible", this.mirrorTop = this.boxOffsetTop - t, this.mirrorLeft = this.boxOffsetLeft - i, this.offsetTop = this.offsetBaseTop - this.mirrorTop * (1 - this.speed)) : this.visibility = "hidden", this.$mirror.css(
85                {
86                    transform: "translate3d(" + this.mirrorLeft + "px, " + (this.mirrorTop - e) + "px, 0px)",
87                    visibility: this.visibility,
88                    height: this.boxHeight,
89                    width: this.boxWidth
90                }), this.$slider.css(
91                {
92                    transform: "translate3d(" + this.offsetLeft + "px, " + this.offsetTop + "px, 0px)",
93                    position: "absolute",
94                    height: this.imageHeight,
95                    width: this.imageWidth,
96                    maxWidth: "none"
97                })
98        }
99    }), t.extend(o,
100    {
101        scrollTop: 0,
102        scrollLeft: 0,
103        winHeight: 0,
104        winWidth: 0,
105        docHeight: 1 << 30,
106        docWidth: 1 << 30,
107        sliders: [],
108        isReady: !1,
109        isFresh: !1,
110        isBusy: !1,
111        setup: function ()
112        {
113            function s()
114            {
115                if (p == i.pageYOffset) return i.requestAnimationFrame(s), !1;
116                p = i.pageYOffset, h.render(), i.requestAnimationFrame(s)
117            }
118            if (!this.isReady)
119            {
120                var h = this,
121                    r = t(e),
122                    a = t(i),
123                    n = function ()
124                    {
125                        o.winHeight = a.height(), o.winWidth = a.width(), o.docHeight = r.height(), o.docWidth = r.width()
126                    },
127                    l = function ()
128                    {
129                        var t = a.scrollTop(),
130                            i = o.docHeight - o.winHeight,
131                            e = o.docWidth - o.winWidth;
132                        o.scrollTop = Math.max(0, Math.min(i, t)), o.scrollLeft = Math.max(0, Math.min(e, a.scrollLeft())), o.overScroll = Math.max(t - i, Math.min(t, 0))
133                    };
134                a.on("resize.px.parallax load.px.parallax", function ()
135                {
136                    n(), h.refresh(), o.isFresh = !1, o.requestRender()
137                }).on("scroll.px.parallax load.px.parallax", function ()
138                {
139                    l(), o.requestRender()
140                }), n(), l(), this.isReady = !0;
141                var p = -1;
142                s()
143            }
144        },
145        configure: function (i)
146        {
147            "object" == typeof i && (delete i.refresh, delete i.render, t.extend(this.prototype, i))
148        },
149        refresh: function ()
150        {
151            t.each(this.sliders, function ()
152            {
153                this.refresh()
154            }), this.isFresh = !0
155        },
156        render: function ()
157        {
158            this.isFresh || this.refresh(), t.each(this.sliders, function ()
159            {
160                this.render()
161            })
162        },
163        requestRender: function ()
164        {
165            var t = this;
166            t.render(), t.isBusy = !1
167        },
168        destroy: function (e)
169        {
170            var s, h = t(e).data("px.parallax");
171            for (h.$mirror.remove(), s = 0; s < this.sliders.length; s += 1) this.sliders[s] == h && this.sliders.splice(s, 1);
172            t(e).data("px.parallax", !1), 0 === this.sliders.length && (t(i).off("scroll.px.parallax resize.px.parallax load.px.parallax"), this.isReady = !1, o.isSetup = !1)
173        }
174    });
175    var h = t.fn.parallax;
176    t.fn.parallax = function (s)
177    {
178        return this.each(function ()
179        {
180            var h = t(this),
181                r = "object" == typeof s && s;
182            this == i || this == e || h.is("body") ? o.configure(r) : h.data("px.parallax") ? "object" == typeof s && t.extend(h.data("px.parallax"), r) : (r = t.extend(
183                {}, h.data(), r), h.data("px.parallax", new o(this, r))), "string" == typeof s && ("destroy" == s ? o.destroy(this) : o[s]())
184        })
185    }, t.fn.parallax.Constructor = o, t.fn.parallax.noConflict = function ()
186    {
187        return t.fn.parallax = h, this
188    }, t(function ()
189    {
190        t('[data-parallax="scroll"]').parallax()
191    })
192}(jQuery, window, document);

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.