PageSourceSearch

https://villainville.fr/tpl/1/js/main.js

js villainville.fr collected 2026-10-03 01:50:36 UTC 10,183 bytes, 324 lines download raw bytes

1$(document).ready(function () {
2    function fct_exist(fct) {
3        return typeof(fct) === "function";
4    }
5
6    $('.scrollbar-inner').scrollbar();
7
8    // Internal page - Contact form
9    // Add an `active` class when user click on input field in a form
10    // With this class, the underline effect is launch
11    // $(".intern-page .form-control").focus(function () {
12    //     $(".form-group").removeClass("active");
13    //     $(this).parent().addClass("active");
14    // });
15
16    // Internal page - Rapid access (a fixed bottom section)
17    // Not used for now
18    // $(".rapid-access-btn").click(function () {
19    //     $(this).closest(".rapid-access").toggleClass("show");
20    // });
21
22
23    $('.pictureGallery').each(function (element) {
24        let elm = $(this);
25        let carouselType = elm.data('type');
26
27        switch (carouselType) {
28            case 'simple':
29                elm.slick();
30                break;
31            case 'multiple':
32                elm.slick({
33                    lazyLoad: 'ondemand',
34                    infinite: true,
35                    slidesToShow: 3,
36                    slidesToScroll: 3,
37                    responsive: [
38                        {
39                            breakpoint: 1024,
40                            settings: {
41                                slidesToShow: 3,
42                                slidesToScroll: 3,
43                                infinite: true,
44                                dots: true
45                            }
46                        },
47                        {
48                            breakpoint: 768,
49                            settings: {
50                                slidesToShow: 2,
51                                slidesToScroll: 2
52                            }
53                        },
54                        {
55                            breakpoint: 480,
56                            settings: {
57                                slidesToShow: 1,
58                                slidesToScroll: 1
59                            }
60                        }
61                    ]
62                });
63                break;
64            case 'responsive':
65                elm.slick({
66                    lazyLoad: 'ondemand',
67                    dots: false,
68                    infinite: false,
69                    speed: 300,
70                    slidesToShow: 4,
71                    slidesToScroll: 4,
72                    responsive: [
73                        {
74                            breakpoint: 1024,
75                            settings: {
76                                slidesToShow: 3,
77                                slidesToScroll: 3,
78                                infinite: true,
79                                dots: true
80                            }
81                        },
82                        {
83                            breakpoint: 768,
84                            settings: {
85                                slidesToShow: 2,
86                                slidesToScroll: 2
87                            }
88                        },
89                        {
90                            breakpoint: 480,
91                            settings: {
92                                slidesToShow: 1,
93                                slidesToScroll: 1
94                            }
95                        }
96                    ]
97                });
98                break;
99            case 'center':
100                elm.slick({
101                    lazyLoad: 'ondemand',
102                    dots: false,
103                    centerMode: true,
104                    centerPadding: '60px',
105                    slidesToShow: 3,
106                    responsive: [
107                        {
108                            breakpoint: 768,
109                            settings: {
110                                arrows: false,
111                                centerMode: true,
112                                centerPadding: '40px',
113                                slidesToShow: 3
114                            }
115                        },
116                        {
117                            breakpoint: 480,
118                            settings: {
119                                arrows: false,
120                                centerMode: true,
121                                centerPadding: '40px',
122                                slidesToShow: 1
123                            }
124                        }
125                    ]
126                });
127                break;
128            case 'fade':
129                elm.slick({
130                    lazyLoad: 'ondemand',
131                    dots: false,
132                    infinite: true,
133                    speed: 500,
134                    fade: true,
135                    cssEase: 'linear'
136                });
137                break;
138        }
139    });
140
141    if (fct_exist($('.eventCarousel1').slick)) {
142        $('.eventCarousel1').slick({
143            dots: true,
144            arrows: false,
145            infinite: true,
146            slidesPerRow: 2,
147            rows: 2,
148            responsive: [
149                {
150                breakpoint: 1024,
151                settings: {
152                    slidesPerRow: 2,
153                    rows: 2,
154                }
155                },
156                {
157                breakpoint: 768,
158                settings: {
159                    slidesToShow: 1,
160                    slidesPerRow: 1,
161                    rows: 1,
162                }
163                },
164                {
165                breakpoint: 480,
166                settings: {
167                    slidesToShow: 1,
168                    slidesPerRow: 1,
169                    rows: 1,
170                }
171                }
172            ]
173        });
174    }
175
176    if (fct_exist($('.carousel-2').owlCarousel)) {
177        $('.carousel-2').owlCarousel({
178            loop: true,
179            margin: 30,
180            nav: false,
181            linked: ".carousel_2",
182            responsive: {
183                0: {
184                    items: 1
185                },
186                768: {
187                    items: 2
188                },
189                1000: {
190                    items: 2
191                }
192            }
193        });
194
195        // $(".eventCarousel1").owlCarousel({
196        //     nav: false,
197        //     dots: false,
198        //     mouseDrag: false,
199        //     responsive: {
200        //         0: {
201        //             items: 1
202        //         },
203        //         768: {
204        //             items: 1
205        //         },
206        //         1000: {
207        //             items: 1
208        //         }
209        //     },
210        //     margin: 30,
211        //     linked: ".eventCarousel2"
212        // });
213
214        // var sync2 = $(".eventCarousel2");
215        // $(sync2).owlCarousel({
216        //     nav: false,
217        //     loop: true,
218        //     mouseDrag: false,
219        //     responsive: {
220        //         0: {
221        //             items: 1
222        //         },
223        //         768: {
224        //             items: 2
225        //         },
226        //         1000: {
227        //             items: 2
228        //         }
229        //     },
230        //     margin: 30,
231        //     linked: sync2.prev()
232        // }).on('initialized.owl.carousel linked.to.owl.carousel', function () {
233        //     sync2.find('.owl-item.current').removeClass('current');
234        //     var current = sync2.find('.owl-item.active.center').length ? sync2.find('.owl-item.active.center') : sync2.find('.owl-item.active').eq(0);
235        //     current.addClass('current');
236        // });
237
238        $('.carousel-3').owlCarousel({
239            margin: 30,
240            nav: false,
241            responsive: {
242                0: {
243                    items: 1
244                },
245                768: {
246                    items: 2
247                },
248                1000: {
249                    items: 3
250                }
251            }
252        })
253
254        $('.carousel-5').owlCarousel({
255            margin: 35,
256            nav: false,
257            responsive: {
258                0: {
259                    items: 2
260                },
261                768: {
262                    items: 3
263                },
264                1000: {
265                    items: 5
266                }
267            }
268        })
269    }
270
271});
272
273$(window).scroll(function() {
274    if ($(".navbar").offset().top > 50) {
275
276      if($(".img-scrolled").length > 0){
277        console.log("img scrolled exist");
278        $('.navbar .img').addClass('scrolled');
279      }else{
280        $('.navbar .img').addClass('animate');
281      }
282    } else {
283        $('.navbar .img').removeClass('scrolled');
284        $('.navbar .img').removeClass('animate');
285    }
286  });
287
288
289$(function () {
290    $('[data-toggle="tooltip"]').tooltip({
291        container: 'body'
292    });
293    $('[data-toggle="popover"]').popover({
294        container: 'body',
295        template:  '<div class="popover tooltip" role="tooltip"><div class="arrow"></div><div class="popover-body tooltip-inner"></div></div>'
296    });
297    $('*[data-type="PDF"] a, a[data-type="PDF"]').on('click', function(e) {
298        if ($('#pdfModal').length > 0) {
299            e.preventDefault();
300            $('#pdfModal').find('embed').attr('src', $(this).attr('data-href') || $(this).attr('href'));
301            $('#pdfModal').modal('show');
302        }
303    });
304})
305
306window.addEventListener('load', function () {
307    setTimeout(function() {
308        let input_for_label = document.getElementsByName("g-recaptcha-response");
309        let label = document.createElement("label");
310        if (input_for_label.length) {
311            label.setAttribute('aria-label', 'CAPTCHA Label');
312            label.setAttribute('for', input_for_label[0].getAttribute('id'));
313            input_for_label[0].insertAdjacentElement("beforebegin", label);
314        }
315
316        input_for_label = document.getElementsByName("h-captcha-response");
317        if (input_for_label.length) {
318            label = document.createElement("label");
319            label.setAttribute('aria-label', 'CAPTCHA Label');
320            label.setAttribute('for', input_for_label[0].getAttribute('id'));
321            input_for_label[0].insertAdjacentElement("beforebegin", label);
322        }
323    }, 1000)
324}
324)

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.