PageSourceSearch

https://www.twodudes-brasserie.com/js/DEV/main.js?vers=341768

js twodudes-brasserie.com collected 2026-10-04 23:25:50 UTC 11,163 bytes, 440 lines download raw bytes

1// DELAUNAY
2// MAIN
3
4// VARS GLOBALES
5var _full = {};
6_full.move;
7_full.nb_slide = 0;
8var mobile = {};
9mobile.step = 768;
10mobile.state = false;
11var blazy = "";
12var _dev = true;
13var _in_dev = false;
14var _consent_cookies = true;
15var _reval_played_first = false;
16var _no_scroll = false;
17var player;
18
19
20$(document).ready(function () {
21
22
23
24
25    //mobileConsole.show();
26    var ua = navigator.userAgent;
27    //alert(ua);
28    //$("html, body").animate({ scrollTop: 0 },0);
29
30    // // get position html
31    // $("html").css("position", "fixed");
32    // setTimeout(function () {
33    //     $("html").css("position", "static");
34    // }, 1200);
35
36
37    // TweenMax.to($("body"), 1.2, {
38    //     opacity: 1, delay: .5, onComplete: function () {
39    //         common.init();
40    //         home.anim_acc();
41    //         _reval_played_first = true;
42    //     }
43    // });
44
45    TweenMax.to($(".__back_transition"), 2, {
46        opacity: 0, display: "none", delay: 0, onComplete: function () {
47            $(this).css({"top": "100vh", "display": "none"});
48        }
49    });
50
51    //splt({reveal: true,target:'.splt_reveal'});
52
53
54    //common.init();
55
56
57    // CONTROL STEP
58    common.getWINDOW();
59    if (common.$windowW < mobile.step) {
60        mobile.state = true;
61        $(".m-remove").remove();
62    } else {
63        $(".d-remove").remove();
64        mobile.state = false;
65    }
66
67    // RATIO
68    var ratio = window.devicePixelRatio;
69
70
71    if (_dev === false) {
72        console.log = function () {
73        };
74    }
75
76
77    // $(".js-modal-btn").modalVideo({
78    //     channel: 'vimeo',
79    //     autoplay: true,
80    //     portrait: true,
81    //     color: '#ff6600',
82    //     title: false,
83    //     width: "80%",
84    //     allowFullScreen: true
85    // });
86
87
88    if (/Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent)) {
89        //alert(navigator.userAgent);
90        // Do something
91        _no_scroll = false;
92        //$("body").addClass("_ipad");
93        //$("body").css("overflow-y","auto");
94        //alert("-->");
95    } else {
96        // Do something else
97        _no_scroll = false;
98
99        // $(".__custom_scroll").mCustomScrollbar({
100        //     theme: "dark",
101        //     mouseWheel: {
102        //         scrollAmount: 250
103        //     }
104        // });
105        //
106        // $(".__custom_scroll_white").mCustomScrollbar({
107        //     theme: "white",
108        //     mouseWheel: {
109        //         scrollAmount: 250
110        //     }
111        // });
112
113    }
114
115
116    $(window).on("debouncedresize", function () {
117        common.getWINDOW();
118
119        if ($("._map").length > 0) {
120            var _w = $("._map").width();
121            $("._map").height(_w);
122        }
123        // alert(common.$windowW);
124        // if (common.$windowW > mobile.step && mobile.state === false) {
125        //     location.reload();
126        // }
127        // common.getWINDOW();
128        //
129        //
130        if (common.$windowW <= mobile.step && mobile.state === false) {
131            location.reload();
132            mobile.state = true;
133        } else {
134            if (common.$windowW >= mobile.step && mobile.state === true) {
135                location.reload();
136                mobile.state = false;
137            }
138        }
139
140        // if(mobile.state === false){
141        //     menu.closeContact();
142        // }
143        // menu.closeDESKTOP();
144
145    });
146
147
148    //REQUEST
149    var requestAnimationFrame = window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || window.msRequestAnimationFrame;
150
151
152    // BARBA
153    Barba.Pjax.init();
154    Barba.Prefetch.init();
155    Barba.BaseView.init();
156    Barba.Utils.deferred();
157
158
159    Barba.Dispatcher.on('newPageReady', function (currentStatus, oldStatus, container) {
160    });
161
162    menu.init();
163    common.checkLinks();
164
165
166    //****************************************************************************************************************** BASE VIEW
167
168
169    //HOME
170    var Home = Barba.BaseView.extend({
171        namespace: 'home',
172        onEnter: function () {
173            menu.activBARBA(true);
174        },
175        onEnterCompleted: function () {
176            common.init();
177        },
178        onLeave: function () {
179            scroll.destroy();
180            menu.closeMenu();
181        },
182        onLeaveCompleted: function () {
183        }
184    });
185    Home.init();
186
187    //BAR
188    var Bar = Barba.BaseView.extend({
189        namespace: 'bar',
190        onEnter: function () {
191            menu.activBARBA(true);
192        },
193        onEnterCompleted: function () {
194            common.init();
195        },
196        onLeave: function () {
197            scroll.destroy();
198            menu.closeMenu();
199        },
200        onLeaveCompleted: function () {
201        }
202    });
203    Bar.init();
204
205    //FOOD
206    var Food = Barba.BaseView.extend({
207        namespace: 'food',
208        onEnter: function () {
209            menu.activBARBA(true);
210        },
211        onEnterCompleted: function () {
212            common.init();
213        },
214        onLeave: function () {
215            scroll.destroy();
216            menu.closeMenu();
217        },
218        onLeaveCompleted: function () {
219        }
220    });
221    Food.init();
222
223    //MAGASIN
224    var Magasin = Barba.BaseView.extend({
225        namespace: 'magasin',
226        onEnter: function () {
227            menu.activBARBA(true);
228        },
229        onEnterCompleted: function () {
230            common.init();
231        },
232        onLeave: function () {
233            scroll.destroy();
234            menu.closeMenu();
235        },
236        onLeaveCompleted: function () {
237        }
238    });
239    Magasin.init();
240
241    //BIERES
242    var Bieres = Barba.BaseView.extend({
243        namespace: 'bieres',
244        onEnter: function () {
245            menu.activBARBA(true);
246        },
247        onEnterCompleted: function () {
248            common.init();
249            bieres.isotope();
250        },
251        onLeave: function () {
252            scroll.destroy();
253            menu.closeMenu();
254            //home.out();
255        },
256        onLeaveCompleted: function () {
257        }
258    });
259    Bieres.init();
260
261    //IMAGES
262    var Images = Barba.BaseView.extend({
263        namespace: 'images',
264        onEnter: function () {
265            menu.activBARBA(true);
266        },
267        onEnterCompleted: function () {
268            common.init();
269            images.init();
270        },
271        onLeave: function () {
272            scroll.destroy();
273            menu.closeMenu();
274            images.out();
275        },
276        onLeaveCompleted: function () {
277        }
278    });
279    Images.init();
280
281
282    ////////////////////////////////////////////////////////////////////////////////////
283    // PAGES
284
285
286    //FAQ
287    var FAQ = Barba.BaseView.extend({
288        namespace: 'faq',
289        onEnter: function () {
290            menu.activBARBA(true);
291        },
292        onEnterCompleted: function () {
293            common.init();
294            annexes.faq();
295        },
296        onLeave: function () {
297            scroll.destroy();
298            menu.closeMenu();
299        },
300        onLeaveCompleted: function () {
301        }
302    });
303    FAQ.init();
304
305
306    //ANNEXES
307    var Annexes = Barba.BaseView.extend({
308        namespace: 'mentions',
309        onEnter: function () {
310            menu.activBARBA(true);
311        },
312        onEnterCompleted: function () {
313            common.init();
314        },
315        onLeave: function () {
316            scroll.destroy();
317            menu.closeMenu();
318        },
319        onLeaveCompleted: function () {
320        }
321    });
322    Annexes.init();
323
324
325    //CONTACT
326    var Contact = Barba.BaseView.extend({
327        namespace: 'contact',
328        onEnter: function () {
329            menu.activBARBA(true);
330        },
331        onEnterCompleted: function () {
332            common.init();
333            contact.swiper();
334            contact.loadAPI();
335        },
336        onLeave: function () {
337            scroll.destroy();
338            menu.closeMenu();
339        },
340        onLeaveCompleted: function () {
341        }
342    });
343    Contact.init();
344
345
346    //NOT FOUND
347    var NOFOUND = Barba.BaseView.extend({
348        namespace: '404',
349        onEnter: function () {
350        },
351        onEnterCompleted: function () {
352            common.init();
353            //reveal.init();
354        },
355        onLeave: function () {
356            scroll.destroy();
357            menu.closeDESKTOP();
358            //menu.closeMOBILE();
359        },
360        onLeaveCompleted: function () {
361        }
362    });
363    NOFOUND.init();
364
365
366    var lastClickEl;
367
368
369    Barba.Dispatcher.on('linkClicked', function (el, currentStatus, oldStatus, container) {
370        transitions.elClicked = el;
371    });
372
373
374    Barba.Pjax.getTransition = function (e) {
375
376        var elt = $(transitions.elClicked);
377
378        //if (transitions.play === false) {
379        transitions.next = elt.data("menu");
380        transitions.play = true;
381        return transitions.BasicTransition;
382        //}
383
384
385        e.preventDefault();
386        e.stopPropagation();
387    };
388
389    Barba.BaseCache.reset();
390    Barba.Pjax.start();
391
392
393    //SOCIAL SHARING
394    // $(document).on("click", ".js-social-share", function (e) {
395    //     e.preventDefault();
396    //     share.popup($(this).attr("href"), 500, 300);
397    // });
398
399    //SOCIAL SHARING
400    $(document).on("click", ".js-social-share", function (e) {
401
402
403        var url = $(this).attr("href");
404        //console.log(url);
405
406        var dualScreenLeft = window.screenLeft != undefined ? window.screenLeft : screen.left;
407        var dualScreenTop = window.screenTop != undefined ? window.screenTop : screen.top;
408        var width = window.innerWidth ? window.innerWidth : document.documentElement.clientWidth ? document.documentElement.clientWidth : screen.width;
409        var height = window.innerHeight ? window.innerHeight : document.documentElement.clientHeight ? document.documentElement.clientHeight : screen.height;
410
411        var left = ((width / 2) - (500 / 2)) + dualScreenLeft;
412        var top = ((height / 2) - (300 / 2)) + dualScreenTop
413
414        window.open(
415            url,
416            "",
417            "menubar=no,toolbar=no,resizable=yes,scrollbars=yes,width=" 
417+ 500 + ",height=" + 300 + ",top=" + top + ",left=" + left
418        );
419
420        e.preventDefault();
421
422    });
423
424
425    $(document).on("mouseenter", ".js-btn", function (e) {
426        var parentOffset = $(this).offset(),
427            relX = e.pageX - parentOffset.left,
428            relY = e.pageY - parentOffset.top;
429        $(this).find('._mask').css({top: relY, left: relX});
430    });
431
432    $(document).on("mouseleave", ".js-btn", function (e) {
433        var parentOffset = $(this).offset(),
434            relX = e.pageX - parentOffset.left,
435            relY = e.pageY - parentOffset.top;
436        $(this).find('._mask').css({top: relY, left: relX});
437    });
438
439
440});

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.