-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.min.js
More file actions
1 lines (1 loc) · 2.69 KB
/
Copy pathscript.min.js
File metadata and controls
1 lines (1 loc) · 2.69 KB
1
!function(){"use strict";const e=document.getElementById("site-header"),t=document.getElementById("hamburger"),n=document.getElementById("mobile-nav"),r=document.getElementById("mobile-nav-close"),o=document.querySelectorAll(".mobile-nav-link, .mobile-nav-cta");function c(e){if("Tab"===e.key){var t=Array.from(n.querySelectorAll('button, a, [tabindex="0"]')),r=t[0],o=t[t.length-1];e.shiftKey?document.activeElement===r&&(e.preventDefault(),o.focus()):document.activeElement===o&&(e.preventDefault(),r.focus())}}function i(){n.classList.remove("is-open"),n.setAttribute("inert",""),t.classList.remove("is-open"),t.setAttribute("aria-expanded","false"),document.body.style.overflow="",t.focus(),document.removeEventListener("keydown",c)}t&&t.addEventListener("click",function(){n.classList.add("is-open"),n.removeAttribute("inert"),t.classList.add("is-open"),t.setAttribute("aria-expanded","true"),document.body.style.overflow="hidden",r.focus(),document.addEventListener("keydown",c)}),r&&r.addEventListener("click",i),o.forEach(function(e){e.addEventListener("click",i)}),document.addEventListener("keydown",function(e){"Escape"===e.key&&n&&n.classList.contains("is-open")&&i()});var a=document.getElementById("hero");window.addEventListener("scroll",function(){e&&((a?a.getBoundingClientRect().bottom:0)<0?e.classList.add("nav--scrolled"):e.classList.remove("nav--scrolled"))},{passive:!0});var s=document.querySelectorAll(".nav-link"),d=new IntersectionObserver(function(e){e.forEach(function(e){e.isIntersecting&&s.forEach(function(t){t.classList.remove("active"),t.getAttribute("href")==="#"+e.target.id&&t.classList.add("active")})})},{rootMargin:"-40% 0px -55% 0px"});if(["constat","approche","offres","resultats"].forEach(function(e){var t=document.getElementById(e);t&&d.observe(t)}),!window.matchMedia("(prefers-reduced-motion: reduce)").matches){var l=document.querySelectorAll(".card, .offre-card, .metric, .verbatim, .pillar, .faq-item, .transformation-card");l.forEach(function(e){e.classList.add("reveal")});var u=new IntersectionObserver(function(e){e.forEach(function(e){e.isIntersecting&&(e.target.classList.add("visible"),u.unobserve(e.target))})},{rootMargin:"0px 0px -60px 0px"});l.forEach(function(e){u.observe(e)})}var f=document.querySelectorAll(".faq-item");f.forEach(function(e){e.addEventListener("toggle",function(){e.open&&f.forEach(function(t){t!==e&&t.open&&(t.open=!1)})})});var m=document.querySelector(".ticker-wrapper"),v=document.getElementById("ticker-pause");if(v&&m){var p=v.querySelector(".ticker-pause-label");v.addEventListener("click",function(){var e=m.classList.toggle("ticker-paused");v.classList.toggle("is-paused",e),v.setAttribute("aria-pressed",String(e)),p&&(p.textContent=e?"Reprendre":"Pause")})}}();