PageSourceSearch

https://riverbankapartments.co.ke/wp-content/themes/riverbank/js/parallax.min.js

js riverbankapartments.co.ke collected 2026-09-26 08:04:06 UTC 12,293 bytes, 169 lines download raw bytes

1! function (t, i, e) {
2    "use strict";
3
4    function s(t, i) {
5        this.element = t, this.layers = t.getElementsByClassName("layer");
6        var e = {
7            calibrateX: this.data(this.element, "calibrate-x"),
8            calibrateY: this.data(this.element, "calibrate-y"),
9            invertX: this.data(this.element, "invert-x"),
10            invertY: this.data(this.element, "invert-y"),
11            limitX: this.data(this.element, "limit-x"),
12            limitY: this.data(this.element, "limit-y"),
13            scalarX: this.data(this.element, "scalar-x"),
14            scalarY: this.data(this.element, "scalar-y"),
15            frictionX: this.data(this.element, "friction-x"),
16            frictionY: this.data(this.element, "friction-y"),
17            originX: this.data(this.element, "origin-x"),
18            originY: this.data(this.element, "origin-y")
19        };
20        for (var s in e) null === e[s] && delete e[s];
21        this.extend(this, r, i, e), this.calibrationTimer = null, this.calibrationFlag = !0, this.enabled = !1, this.depths = [], this.raf = null, this.bounds = null, this.ex = 0, this.ey = 0, this.ew = 0, this.eh = 0, this.ecx = 0, this.ecy = 0, this.erx = 0, this.ery = 0, this.cx = 0, this.cy = 0, this.ix = 0, this.iy = 0, this.mx = 0, this.my = 0, this.vx = 0, this.vy = 0, this.onMouseMove = this.onMouseMove.bind(this), this.onDeviceOrientation = this.onDeviceOrientation.bind(this), this.onOrientationTimer = this.onOrientationTimer.bind(this), this.onCalibrationTimer = this.onCalibrationTimer.bind(this), this.onAnimationFrame = this.onAnimationFrame.bind(this), this.onWindowResize = this.onWindowResize.bind(this), this.initialise()
22    }
23    var n = "Parallax",
24        o = 30,
25        r = {
26            relativeInput: !1,
27            clipRelativeInput: !1,
28            calibrationThreshold: 100,
29            calibrationDelay: 500,
30            supportDelay: 500,
31            calibrateX: !1,
32            calibrateY: !0,
33            invertX: !0,
34            invertY: !0,
35            limitX: !1,
36            limitY: !1,
37            scalarX: 10,
38            scalarY: 10,
39            frictionX: .1,
40            frictionY: .1,
41            originX: .5,
42            originY: .5
43        };
44    s.prototype.extend = function () {
45        if (arguments.length > 1)
46            for (var t = arguments[0], i = 1, e = arguments.length; e > i; i++) {
47                var s = arguments[i];
48                for (var n in s) t[n] = s[n]
49            }
50    }, s.prototype.data = function (t, i) {
51        return this.deserialize(t.getAttribute("data-" + i))
52    }, s.prototype.deserialize = function (t) {
53        return "true" === t ? !0 : "false" === t ? !1 : "null" === t ? null : !isNaN(parseFloat(t)) && isFinite(t) ? parseFloat(t) : t
54    }, s.prototype.camelCase = function (t) {
55        return t.replace(/-+(.)?/g, function (t, i) {
56            return i ? i.toUpperCase() : ""
57        })
58    }, s.prototype.transformSupport = function (s) {
59        for (var n = i.createElement("div"), o = !1, r = null, a = !1, h = null, l = null, p = 0, c = this.vendors.length; c > p; p++)
60            if (null !== this.vendors[p] ? (h = this.vendors[p][0] + "transform", l = this.vendors[p][1] + "Transform") : (h = "transform", l = "transform"), n.style[l] !== e) {
61                o = !0;
62                break
63            }
64        switch (s) {
65            case "2D":
66                a = o;
67                break;
68            case "3D":
69                if (o) {
70                    var m = i.body || i.createElement("body"),
71                        u = i.documentElement,
72                        y = u.style.overflow;
73                    i.body || (u.style.overflow = "hidden", u.appendChild(m), m.style.overflow = "hidden", m.style.background = ""), m.appendChild(n), n.style[l] = "translate3d(1px,1px,1px)", r = t.getComputedStyle(n).getPropertyValue(h), a = r !== e && r.length > 0 && "none" !== r, u.style.overflow = y, m.removeChild(n)
74                }
75        }
76        return a
77    }, s.prototype.ww = null, s.prototype.wh = null, s.prototype.wcx = null, s.prototype.wcy = null, s.prototype.wrx = null, s.prototype.wry = null, s.prototype.portrait = null, s.prototype.desktop = !navigator.userAgent.match(/(iPhone|iPod|iPad|Android|BlackBerry|BB10|mobi|tablet|opera mini|nexus 7)/i), s.prototype.vend
77ors = [null, ["-webkit-", "webkit"], ["-moz-", "Moz"], ["-o-", "O"], ["-ms-", "ms"]], s.prototype.motionSupport = !!t.DeviceMotionEvent, s.prototype.orientationSupport = !!t.DeviceOrientationEvent, s.prototype.orientationStatus = 0, s.prototype.transform2DSupport = s.prototype.transformSupport("2D"), s.prototype.transform3DSupport = s.prototype.transformSupport("3D"), s.prototype.propertyCache = {}, s.prototype.initialise = function () {
78        this.transform3DSupport && this.accelerate(this.element);
79        var i = t.getComputedStyle(this.element);
80        "static" === i.getPropertyValue("position") && (this.element.style.position = "relative"), this.updateLayers(), this.updateDimensions(), this.enable(), this.queueCalibration(this.calibrationDelay)
81    }, s.prototype.updateLayers = function () {
82        this.layers = this.element.getElementsByClassName("layer"), this.depths = [];
83        for (var t = 0, i = this.layers.length; i > t; t++) {
84            var e = this.layers[t];
85            this.transform3DSupport && this.accelerate(e), e.style.position = t ? "absolute" : "relative", e.style.display = "block", e.style.left = 0, e.style.top = 0, this.depths.push(this.data(e, "depth") || 0)
86        }
87    }, s.prototype.updateDimensions = function () {
88        this.ww = t.innerWidth, this.wh = t.innerHeight, this.wcx = this.ww * this.originX, this.wcy = this.wh * this.originY, this.wrx = Math.max(this.wcx, this.ww - this.wcx), this.wry = Math.max(this.wcy, this.wh - this.wcy)
89    }, s.prototype.updateBounds = function () {
90        this.bounds = this.element.getBoundingClientRect(), this.ex = this.bounds.left, this.ey = this.bounds.top, this.ew = this.bounds.width, this.eh 
90= this.bounds.height, this.ecx = this.ew * this.originX, this.ecy = this.eh * this.originY, this.erx = Math.max(this.ecx, this.ew - this.ecx), this.ery = Math.max(this.ecy, this.eh - this.ecy)
91    }, s.prototype.queueCalibration = function (t) {
92        clearTimeout(this.calibrationTimer), this.calibrationTimer = setTimeout(this.onCalibrationTimer, t)
93    }, s.prototype.enable = function () {
94        this.enabled || (this.enabled = !0, this.orientationSupport ? (this.portrait = null, t.addEventListener("deviceorientation", this.onDeviceOrientation), setTimeout(this.onOrientationTimer, this.supportDelay)) : (this.cx = 0, this.cy = 0, this.portrait = !1, t.addEventListener("mousemove", this.onMouseMove)), t.addEventListener("resize", this.onWindowResize), this.raf = requestAnimationFrame(this.onAnimationFrame))
95    }, s.prototype.disable = function () {
96        this.enabled && (this.enabled = !1, this.orientationSupport ? t.removeEventListener("deviceorientation", this.onDeviceOrientation) : t.removeEventListener("mousemove", this.onMouseMove), t.removeEventListener("resize", this.onWindowResize), cancelAnimationFrame(this.raf))
97    }, s.prototype.calibrate = function (t, i) {
98        this.calibrateX = t === e ? this.calibrateX : t, this.calibrateY = i === e ? this.calibrateY : i
99    }, s.prototype.invert = function (t, i) {
100        this.invertX = t === e ? this.invertX : t, this.invertY = i === e ? this.invertY : i
101    }, s.prototype.friction = function (t, i) {
102        this.frictionX = t === e ? this.frictionX : t, this.frictionY = i === e ? this.frictionY : i
103    }, s.prototype.scalar = function (t, i) {
104        this.scalarX = t === e ? this.scalarX : t, this.scalarY = i === e ? this.scalarY : i
105    }, s.prototype.limit = function (t, i) {
106        this.limitX = t === e ? this.limitX : t, this.limitY = i === e ? this.limitY : i
107    }, s.prototype.origin = function (t, i) {
108        this.originX = t === e ? this.originX : t, this.originY = i === e ? this.originY : i
109    }, s.prototype.clamp = function (t, i, e) {
110        return t = Math.max(t, i), t = Math.min(t, e)
111    }, s.prototype.css = function (t, i, s) {
112        var n = this.propertyCache[i];
113        if (!n)
114            for (var o = 0, r = this.vendors.length; r > o; o++)
115                if (n = null !== this.vendors[o] ? this.camelCase(this.vendors[o][1] + "-" + i) : i, t.style[n] !== e) {
116                    this.propertyCache[i] = n;
117                    break
118                }
119        t.style[n] = s
120    }, s.prototype.accelerate = function (t) {
121        this.css(t, "transform", "translate3d(0,0,0)"), this.css(t, "transform-style", "preserve-3d"), this.css(t, "backface-visibility", "hidden")
122    }, s.prototype.setPosition = function (t, i, e) {
123        i += "px", e += "px", this.transform3DSupport ? this.css(t, "transform", "translate3d(" + i + "," + e + ",0)") : this.transform2DSupport ? this.css(t, "transform", "translate(" + i + "," + e + ")") : (t.style.left = i, t.style.top = e)
124    }, s.prototype.onOrientationTimer = function () {
125        this.orientationSupport && 0 === this.orientationStatus && (this.disable(), this.orientationSupport = !1, this.enable())
126    }, s.prototype.onCalibrationTimer = function () {
127        this.calibrationFlag = !0
128    }, s.prototype.onWindowResize = function () {
129        this.updateDimensions()
130    }, s.prototype.onAnimationFrame = function () {
131        this.updateBounds();
132        var t = this.ix - this.cx,
133            i = this.iy - this.cy;
134        (Math.abs(t) > this.calibrationThreshold || Math.abs(i) > this.calibrationThreshold) && this.queueCalibration(0), this.portrait ? (this.mx = this.calibrateX ? i : this.iy, this.my = this.calibrateY ? t : this.ix) : (this.mx = this.calibrateX ? t : this.ix, this.my = this.calibrateY ? i : this.iy), this.mx *= this.ew * (this.scalarX / 100), this.my *= this.eh * (this.scalarY / 100), isNaN(parseFloat(this.limitX)) || (this.mx = this.clamp(this.mx, -this.limitX, this.limitX)), isNaN(parseFloat(this.limitY)) || (this.my = this.clamp(this.my, -this.limitY, this.limitY)), this.vx += (this.mx - this.vx) * this.frictionX, this.vy += (this.my - this.vy) * this.frictionY;
135        for (var e = 0, s = this.layers.length; s > e; e++) {
136            var n = this.layers[e],
137                o = this.depths[e],
138                r = this.vx * o * (this.invertX ? -1 : 1),
139                a = this.vy * o * (this.invertY ? -1 : 1);
140            this.setPosition(n, r, a)
141        }
142        this.raf = requestAnimationFrame(this.onAnimationFrame)
143    }, s.prototype.onDeviceOrientation = function (t) {
144        if (!this.desktop && null !== t.beta && null !== t.gamma) {
145            this.orientationStatus = 1;
146            var i = (t.beta || 0) / o,
147                e = (t.gamma || 0) / o,
148                s = this.wh > this.ww;
149            this.portrait !== s && (this.portrait = s, this.calibrationFlag = !0), this.calibrationFlag && (this.calibrationFlag = !1, this.cx = i, this.cy = e), this.ix = i, this.iy = e
150        }
151    }, s.prototype.onMouseMove = function (t) {
152        var i = t.clientX,
153            e = t.clientY;
154        !this.orientationSupport && this.relativeInput ? (this.clipRelativeInput && (i = Math.max(i, this.ex), i = Math.min(i, this.ex + this.ew), e = Math.max(e, this.ey), e = Math.min(e, this.ey + this.eh)), this.ix = (i - this.ex - this.ecx) / this.erx, this.iy = (e - this.ey - this.ecy) / this.ery) : (this.ix = (i - this.wcx) / this.wrx, this.iy = (e - this.wcy) / this.wry)
155    }, t[n] = s
156}(window, document),
157function () {
158    for (var t = 0, i = ["ms", "moz", "webkit", "o"], e = 0; e < i.length && !window.requestAnimationFrame; ++e) window.requestAnimationFrame = window[i[e] + "RequestAnimationFrame"], window.cancelAnimationFrame = window[i[e] + "CancelAnimationFrame"] || window[i[e] + "CancelRequestAnimationFrame"];
159    window.requestAnimationFrame || (window.requestAnimationFrame = function (i) {
160        var e = (new Date).getTime(),
161            s = Math.max(0, 16 - (e - t)),
162            n = window.setTimeout(function () {
163                i(e + s)
164            }, s);
165        return t = e + s, n
166    }), window.cancelAnimationFrame || (window.cancelAnimationFrame = function (t) {
167        clearTimeout(t)
168    })
169}();

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.