PageSourceSearch

https://www.opodo.fr/blog/wp-content/themes/opodo-blog-new-theme/assets/js/main.js

js opodo.fr collected 2026-09-25 20:14:21 UTC 4,103 bytes, 121 lines download raw bytes

1
2    // Navbar scroll effect
3    const navbar = document.getElementById('navbar');
4    window.addEventListener('scroll', () => {
5        navbar.classList.toggle('scrolled', window.scrollY > 50);
6    });
7
8    // Toggle mobile menu
9    const menuToggleIcon = document.getElementById('menuToggleIcon');
10const mobileMenu = document.getElementById('mobileMenu');
11
12menuToggleIcon.addEventListener('click', () => {
13    mobileMenu.classList.toggle('show'); // Toggle mobile menu visibility
14
15    // Toggle icon between hamburger and X
16    if (mobileMenu.classList.contains('show')) {
17        menuToggleIcon.innerHTML = '×'; // X icon
18        menuToggleIcon.classList.add('open');
19    } else {
20        menuToggleIcon.innerHTML = '☰'; // Hamburger icon
21        menuToggleIcon.classList.remove('open');
22    }
23});
24
25
26 
27
28    
29    document.addEventListener('DOMContentLoaded', function () {
30        const moreCategories = document.getElementById('moreCategoriesDesktop');
31        const modal = document.getElementById('additionalCategoriesModal');
32        const closeModal = document.getElementById('closeAdditionalModal');
33    
34        if (moreCategories && modal && closeModal) {
35            moreCategories.addEventListener('click', () => {
36                modal.style.display = 'flex'; // Show the modal
37                setTimeout(() => modal.classList.add('show'), 10); // Trigger transition with a small delay
38            });
39    
40            closeModal.addEventListener('click', () => {
41                modal.classList.remove('show'); // Hide the modal
42                modal.addEventListener('transitionend', () => {
43                    modal.style.display = 'none'; // Hide the modal completely after transition
44                }, { once: true });
45            });
46    
47            // Close modal when clicking outside of it
48            window.addEventListener('click', (event) => {
49                if (event.target === modal) {
50                    modal.classList.remove('show');
51                    modal.addEventListener('transitionend', () => {
52                        modal.style.display = 'none';
53                    }, { once: true });
54                }
55            });
56        } else {
57            console.error("Some elements are missing in the DOM.");
58        }
59    });
60    
61    
62
63
64
65function switchTab(event, tabId, group) {
66const sectionTabs = event.target.parentElement.querySelectorAll('.tab-button');
67const sectionContainers = document.querySelectorAll(`.cards-container[id*='-${group}']`);
68
69// Resetear solo la sección correspondiente
70sectionTabs.forEach(button => button.classList.remove('active'));
71sectionContainers.forEach(container => {
72    container.classList.remove('active');
73});
74
75// Activar la tab y contenido correspondiente
76event.target.classList.add('active');
77document.getElementById(`${tabId}-${group}`).classList.add('active');
78}
79
80
81
82
83
84document.addEventListener("DOMContentLoaded", function () {
85    document.querySelectorAll(".share-button").forEach(button => {
86        button.addEventListener("click", function (event) {
87            event.stopPropagation(); // Prevent the click from bubbling up
88            const dropdown = this.nextElementSibling; // Get the next element (dropdown)
89            const isOpen = dropdown.classList.toggle("open");
90            
91            if (isOpen) {
92                this.classList.add("open");
93            } else {
94                this.classList.remove("open");
95            }
96        });
97    });
98
99    document.addEventListener("click", (event) => {
100        if (!event.target.closest(".share-container")) {
101            document.querySelectorAll(".dropdown").forEach(dropdown => {
102                dropdown.classList.remove("open");
103            });
104            document.querySelectorAll(".share-button").forEach(button => {
105                button.classList.remove("open");
106            });
107        }
108    });
109});
110
111
112
113
114document.addEventListener("DOMContentLoaded", function () {
115    const isIOS = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;
116    if (isIOS) {
117      document.body.classList.add("is-ios");
118    }
119  });
120
121  

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.