PageSourceSearch

https://www.timemultimedia.it/2021/wp-content/themes/tm-9studio/as…/jquery.onepage-scroll.min.js

js timemultimedia.it collected 2026-10-02 23:47:53 UTC 15,379 bytes, 328 lines download raw bytes

1!function (e) {
2    var t = {
3        sectionContainer: "section",
4        easing: "ease",
5        animationTime: 1e3,
6        pagination: true,
7        updateURL: false,
8        keyboard: true,
9        beforeMove: null,
10        afterMove: null,
11        loop: true,
12        responsiveFallback: false,
13        direction: "vertical"
14    };
15    e.fn.swipeEvents = function () {
16        return this.each(function () {
17            function i(e) {
18                var i = e.originalEvent.touches;
19                if (i && i.length) {
20                    t = i[0].pageX;
21                    n = i[0].pageY;
22                    r.bind("touchmove", s)
23                }
24            }
25
26            function s(e) {
27                var i = e.originalEvent.touches;
28                if (i && i.length) {
29                    var o = t - i[0].pageX;
30                    var u = n - i[0].pageY;
31                    if (o >= 50) {
32                        r.trigger("swipeLeft")
33                    }
34                    if (o <= -50) {
35                        r.trigger("swipeRight")
36                    }
37                    if (u >= 50) {
38                        r.trigger("swipeUp")
39                    }
40                    if (u <= -50) {
41                        r.trigger("swipeDown")
42                    }
43                    if (Math.abs(o) >= 50 || Math.abs(u) >= 50) {
44                        r.unbind("touchmove", s)
45                    }
46                }
47            }
48
49            var t, n, r = e(this);
50            r.bind("touchstart", i)
51        })
52    };
53    e.fn.onepage_scroll = function (n) {
54        function o() {
55            var t = false;
56            var n = typeof r.responsiveFallback;
57            if (n == "number") {
58                t = e(window).width() < r.responsiveFallback
59            }
60            if (n == "boolean") {
61                t = r.responsiveFallback
62            }
63            if (n == "function") {
64                valFunction = r.responsiveFallback();
65                t = valFunction;
66                typeOFv = typeof t;
67                if (typeOFv == "number") {
68                    t = e(window).width() < valFunction
69                }
70            }
71            if (t) {
72                e("body").addClass("disabled-onepage-scroll");
73                e(document).unbind("mousewheel DOMMouseScroll MozMousePixelScroll");
74                i.swipeEvents().unbind("swipeDown swipeUp")
75            } else {
76                if (e("body").hasClass("disabled-onepage-scroll")) {
77                    e("body").removeClass("disabled-onepage-scroll");
78                    e("html, body, .wrapper").animate({scrollTop: 0}, "fast")
79                }
80                i.swipeEvents().bind("swipeDown", function (t) {
81                    if (!e("body").hasClass("disabled-onepage-scroll"))t.preventDefault();
82                    i.moveUp()
83                }).bind("swipeUp", function (t) {
84                    if (!e("body").hasClass("disabled-onepage-scroll"))t.preventDefault();
85                    i.moveDown()
86                });
87                e(document).bind("mousewheel DOMMouseScroll MozMousePixelScroll", function (e) {
88                    e.preventDefault();
89                    var t = e.originalEvent.wheelDelta || -e.originalEvent.detail;
90                    u(e, t)
91                })
92            }
93        }
94
95        function u(e, t) {
96            deltaOfInterest = t;
97            var n = (new Date).getTime();
98            if (n - lastAnimation < quietPeriod + r.animationTime) {
99                e.preventDefault();
100                return
101            }
102            if (deltaOfInterest < 0) {
103                i.moveDown()
104            } else {
105                i.moveUp()
106            }
107            lastAnimation = n
108        }
109
110        var r = e.extend({}, t, n), i = e(this), s = e(r.sectionContainer);
111        total = s.length, status = "off", topPos = 0, leftPos = 0, lastAnimation = 0, quietPeriod = 500, paginationList = "";
112        e.fn.transformPage = function (t, n, r) {
113            if (typeof t.beforeMove == "function")t.beforeMove(r);
114            if (e("html").hasClass("ie8")) {
115                if (t.direction == "horizontal") {
116                    var s = i.width() / 100 * n;
117                    e(this).animate({left: s + "px"}, t.animationTime)
118                } else {
119                    var s = i.height() / 100 * n;
120                    e(this).animate({top: s + "px"}, t.animationTime)
121                }
122            } else {
123                e(this).css({
124                    "-webkit-transform": t.direction == "horizontal" ? "translate3d(" + n + "%, 0, 0)" : "translate3d(0, " + n + "%, 0)",
125                    "-webkit-transition": "all " + t.animationTime + "ms " + t.easing,
126                    "-moz-transform": t.direction == "horizontal" ? "translate3d(" + n + "%, 0, 0)" : "translate3d(0, " + n + "%, 0)",
127                    "-moz-transition": "all " + t.animationTime + "ms " + t.easing,
128                    "-ms-transform": t.direction == "horizontal" ? "translate3d(" + n + "%, 0, 0)" : "translate3d(0, " + n + "%, 0)",
129                    "-ms-transition": "all " + t.animationTime + "ms " + t.easing,
130                    transform: t.direction == "horizontal" ? "translate3d(" + n + "%, 0, 0)" : "translate3d(0, " + n + "%, 0)",
131                    transition: "all " + t.animationTime + "ms " + t.easing
132                })
133            }
134            e(this).one("webkitTransitionEnd otransitionend oTransitionEnd msTransitionEnd transitionend", function (e) {
135                if (typeof t.afterMove == "function")t.afterMove(r)
136            })
137        };
138        e.fn.moveDown = function () {
139            var t = e(this);
140            index = e(r.sectionContainer + ".active").data("index");
141            current = e(r.sectionContainer + "[data-index='" + index + "']");
142            next = e(r.sectionContainer + "[data-index='" + (index + 1) + "']");
143            if (next.length < 1) {
144                if (r.loop == true) {
145                    pos = 0;
146                    next = e(r.sectionContainer + "[data-index='1']")
147                } else {
148                    return
149                }
150            } else {
151                pos = index * 100 * -1
152            }
153            if (typeof r.beforeMove == "function")r.beforeMove(next.data("index"));
154            current.removeClass("active");
155            next.addClass("active");
156            if (r.pagination == true) {
157                e(".onepage-pagination li a" + "[data-index='" + index + "']").removeClass("active");
158                e(".onepage-pagination li a" + "[data-index='" + next.data("index") + "']").addClass("active")
159            }
160            e("body")[0].className = e("body")[0].className.replace(/\bviewing-page-\d.*?\b/g, "");
161            e("body").addClass("viewing-page-" + next.data("index"));
162            if (history.replaceState && r.updateURL == true) {
163                var n = window.location.href.substr(0, window.location.href.indexOf("#")) + "#" + (index + 1);
164                history.pushState({}, document.title, n)
165            }
166            t.transformPage(r, pos, next.data("index"))
167        };
168        e.fn.moveUp = function () {
169            var t = e(this);
170            index = e(r.sectionContainer + ".active").data("index");
171            current = e(r.sectionContainer + "[data-index='" + index + "']");
172            next = e(r.sectionContainer + "[data-index='" + (index - 1) + "']");
173            if (next.length < 1) {
174                if (r.loop == true) {
175                    pos = (total - 1) * 100 * -1;
176                    next = e(r.sectionContainer + "[data-index='" + total + "']")
177                } else {
178                    return
179                }
180            } else {
181                pos = (next.data("index") - 1) * 100 * -1
182            }
183            if (typeof r.beforeMove == "function")r.beforeMove(next.data("index"));
184            current.removeClass("active");
185            next.addClass("active");
186            if (r.pagination == true) {
187                e(".onepage-pagination li a" + "[data-index='" + index + "']").removeClass("active");
188                e(".onepage-pagination li a" + "[data-index='" + next.data("index") + "']").addClass("active")
189            }
190            e("body")[0].className = e("body")[0].className.replace(/\bviewing-page-\d.*?\b/g, "");
191            e("body").addClass("viewing-page-" + next.data("index"));
192            if (history.replaceState && r.updateURL == true) {
193                var n = window.location.href.substr(0, window.location.href.indexOf("#")) + "#" + (index - 1);
194                history.pushState({}, document.title, n)
195            }
196            t.transformPage(r, pos, next.data("index"))
197        };
198        e.fn.moveTo = function (t) {
199            current = e(r.sectionContainer + ".active");
200            next = e(r.sectionContainer + "[data-index='" + t + "']");
201            if (next.length > 0) {
202                if (typeof r.beforeMove == "function")r.beforeMove(next.data("index"));
203                current.removeClass("active");
204                next.addClass("active");
205                e(".onepage-pagination li a" + ".active").removeClass("active");
206                e(".onepage-pagination li a" + "[data-index='" + t + "']").addClass("active");
207                e("body")[0].className = e("body")[0].className.replace(/\bviewing-page-\d.*?\b/g, "");
208                e("body").addClass("viewing-page-" + next.data("index"));
209                pos = (t - 1) * 100 * -1;
210                if (history.replaceState && r.updateURL == true) {
211                    var n = window.location.href.substr(0, window.location.href.indexOf("#")) + "#" + (t - 1);
212                    history.pushState({}, document.title, n)
213                }
214                i.transformPage(r, pos, t)
215            }
216        };
217        i.addClass("onepage-wrapper").css("position", "relative");
218        e.each(s, function (t) {
219            e(this).css({position: "absolute", top: topPos + "%"}).addClass("section").attr("data-index", t + 1);
220            e(this).css({
221                position: "absolute",
222                left: r.direction == "horizontal" ? leftPos + "%" : 0,
223                top: r.direction == "vertical" || r.direction != "horizontal" ? topPos + "%" : 0
224            });
225            if (r.direction == "horizontal")leftPos = leftPos + 100; else topPos = topPos + 100;
226            if (r.pagination == true) {
227                paginationList += "<li><a data-index='" + (t + 1) + "' href='#" + (t + 1) + "'></a></li>"
228            }
229        });
230        i.swipeEvents().bind("swipeDown", function (t) {
231            if (!e("body").hasClass("disabled-onepage-scroll"))t.preventDefault();
232            i.moveUp()
233        }).bind("swipeUp", function (t) {
234            if (!e("body").hasClass("disabled-onepage-scroll"))t.preventDefault();
235            i.moveDown()
236        });
237        if (r.pagination == true) {
238            if (e("ul.onepage-pagination").length < 1)e("<ul class='onepage-pagination'></ul>").prependTo("body");
239            if (r.direction == "horizontal") {
240                posLeft = i.find(".onepage-pagination").width() / 2 * -1;
241                i.find(".onepage-pagination").css("margin-left", posLeft)
242            } else {
243                posTop = i.find(".onepage-pagination").height() / 2 * -1;
244                i.find(".onepage-pagination").css("margin-top", posTop)
245            }
246            e("ul.onepage-pagination").html(paginationList)
247        }
248        if (window.location.hash != "" && window.location.hash != "#1") {
249            init_index = window.location.hash.replace("#", "");
250            if (parseInt(init_index) <= total && parseInt(init_index) > 0) {
251                e(r.sectionContainer + "[data-index='" + init_index + "']").addClass("active");
252                e("body").addClass("viewing-page-" + init_index);
253                if (r.pagination == true)e(".onepage-pagination li a" + "[data-index='" + init_index + "']").addClass("active");
254                next = e(r.sectionContainer + "[data-index='" + init_index + "']");
255                if (next) {
256                    next.addClass("active");
257                    if (r.pagination == true)e(".onepage-pagination li a" + "[data-index='" + init_index + "']").addClass("active");
258                    e("body")[0].className = e("body")[0].className.replace(/\bviewing-page-\d.*?\b/g, "");
259                    e("body").addClass("viewing-page-" + next.data("index"));
260                    if (history.replaceState && r.updateURL == true) {
261                        var a = window.location.href.substr(0, window.location.href.indexOf("#")) + "#" + init_index;
262                        history.pushState({}, document.title, a)
263                    }
264                }
265                pos = (init_index - 1) * 100 * -1;
266                i.transformPage(r, pos, init_index)
267            } else {
268                e(r.sectionContainer + "[data-index='1']").addClass("active");
269                e("body").addClass("viewing-page-1");
270                if (r.pagination == true)e(".onepage-pagination li a" + "[data-index='1']").addClass("active")
271            }
272        } else {
273            e(r.sectionContainer + "[data-index='1']").addClass("active");
274            e("body").addClass("viewing-page-1");
275            if (r.pagination == true)e(".onepage-pagination li a" + "[data-index='1']").addClass("active")
276        }
277        if (r.pagination == true) {
278            e(".onepage-pagination li a").click(function () {
279                var t = e(this).data("index");
280                i.moveTo(t)
281            })
282        }
283        e(document).bind("mousewheel DOMMouseScroll MozMousePixelScroll", function (t) {
284            t.preventDefault();
285            var n = t.originalEvent.wheelDelta || -t.originalEvent.detail;
286            if (!e("body").hasClass("disabled-onepage-scroll"))u(t, n)
287        });
288        if (r.responsiveFallback != false) {
289            e(window).resize(function () {
290                o()
291            });
292            o()
293        }
294        if (r.keyboard == true) {
295            e(document).keydown(function (t) {
296                var n = t.target.tagName.toLowerCase();
297                if (!e("body").hasClass("disabled-onepage-scroll")) {
298                    switch (t.which) {
299                        case 38:
300                            if (n != "input" && n != "textarea")i.moveUp();
301                            break;
302                        case 40:
303                            if (n != "input" && n != "textarea")i.moveDown();
304                            break;
305                        case 32:
306                            if (n != "input" && n != "textarea")i.moveDown();
307                            break;
308                        case 33:
309                            if (n != "input" && n != "textarea")i.moveUp();
310                            break;
311                        case 34:
312                            if (n != "input" && n != "textarea")i.moveDown();
313                            break;
314                        case 36:
315                            i.moveTo(1);
316                            break;
317                        case 35:
318                            i.moveTo(total);
319                            break;
320                        default:
321                            return
322                    }
323                }
324            })
325        }
326        return false
327    }
328}(window.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.