PageSourceSearch

https://www.nikon.fr/dist-client/PageBackgroundAnimator-Chunk-4343e9398f51c3be8d22.js

js nikon.fr collected 2026-09-24 17:53:51 UTC 6,083 bytes, 2 lines download raw bytes

1(globalThis.webpackChunknikon_client=globalThis.webpackChunknikon_client||[]).push([[8841],{4108(t,e,n){"use strict";n.r(e),n.d(e,{default:()=>s});var r=n(82822),o=n(24675),i=n(19551),a=n.n(i),c=n(59471);const s=()=>{const t=(0,o.I)(),e=(0,c.useRef)(""),n=(0,c.useRef)(void 0),i=(0,c.useRef)(null),s=(0,c.useRef)([]),u=(0,c.useRef)([]),l=(0,r.A)(),d=(0,c.useRef)(null);return(0,c.useEffect)(()=>{const r=setTimeout(()=>{const r=document.getElementById("animated-background-page-container");if(!r)return()=>({});t||(r.style.transition="background-color 1s ease");const o=Array.from(document.querySelectorAll("div[data-background-color]")).filter(t=>t.getBoundingClientRect().height>0);if(0===o.length)return()=>({});u.current=o,o.forEach((t,e)=>{const n=e>0?o[e-1]:null,r=t.getAttribute("data-background-color"),i=n?.getAttribute("data-background-color");i&&r!==i&&t.classList.add("fade-up");t.querySelectorAll("section").forEach(t=>{t.style.backgroundColor="transparent"})});const c=e=>{Array.from(document.querySelectorAll("div[data-background-color] *")).filter(t=>Array.from(t.classList).some(t=>t.includes("dark:bg-")||t.includes("dark:text-")||t.includes("dark:border-"))).forEach(n=>{n.style.transition=e&&!t?"background-color 1s ease, color 1s ease, border-color 1s ease":""})},l=()=>{clearTimeout(n.current),n.current=setTimeout(()=>{c(!1)},1300)},f=(t,e)=>{if(t instanceof HTMLSpanElement){const n=Array.from(t.classList);if(n.some(t=>t.startsWith("from-"))){const r=n.includes("bg-gradient-to-l")?"to left":n.includes("bg-gradient-to-r")?"to right":"";r&&(t.style.backgroundImage=`linear-gradient(${r}, ${e}, transparent)`,s.current=[...s.current,t])}}},g=()=>{""!==r.style.transition||0!==window.scrollY||t||(r.style.transition="background-color 1s ease");const n=4*window.innerHeight/6,o=u.current;o.forEach(t=>{const e=t.getBoundingClientRect().top-200;e<n&&t.classList.add("active"),e>=window.innerHeight&&t.classList.remove("active")});const a=o.findLast(t=>t.getBoundingClientRect().top<n),d=a?.getAttribute("data-background-color")||"";requestAnimationFrame(()=>{if(d!==e.current){if(r.style.backgroundColor=d||"",e.current=d,i.current&&(i.current.disconnect(),s.current?.forEach(t=>{t.style.backgroundImage=""}),s.current=[]),i.current=new MutationObserver(t=>{t.forEach(t=>{t.addedNodes.forEach(t=>{f(t,d)})})}),a){a.querySelectorAll("span").forEach(t=>{f(t,d)}),i.current.observe(a,{childList:!0,subtree:!0})}"#0A0203"===d?(c(!0),r.classList.add("dark"),l()):r.classList.contains("dark")&&(c(!0),r.classList.remove("dark"),l())}})};g();const v=a()(g,100);window.addEventListener("scroll",v,{passive:!0}),window.addEventListener("resize",v,{passive:!0}),d.current=()=>{v.cancel(),window.removeEventListener("scroll",v),window.removeEventListener("resize",v),r.style.backgroundColor="",r.style.transition="",r.classList.remove("dark")}},100);return()=>{clearTimeout(r),d.current?.(),d.current=null}},[l]),null}},82822(t,e,n){"use strict";n.d(e,{A:()=>o});var r=n(59471);const o=()=>{const[t,e]=(0,r.useState)(null);return(0,r.useEffect)(()=>{const t=()=>e(window.location.pathname);t(),window.addEventListener("popstate",t);const n=window.history.pushState,r=window.history.replaceState,o=t=>function(...e){const n=t.apply(this,e);return window.dispatchEvent(new Event("custom:navigation")),n};return window.history.pushState=o(n),window.history.replaceState=o(r),window.addEventListener("custom:navigation",t),()=>{window.removeEventListener("popstate",t),window.removeEventListener("custom:navigation",t),window.history.pushState=n,window.history.replaceState=r}},[]),t}},19551(t){var e="Expected a function",n=/^\s+|\s+$/g,r=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,i=/^0o[0-7]+$/i,a=parseInt,c="object"==typeof globalThis&&globalThis&&globalThis.Object===Object&&globalThis,s="object"==typeof self&&self&&self.Object===Object&&self,u=c||s||Function("return this")(),l=Object.prototype.toString,d=Math.max,f=Math.min,g=function(){return u.Date.now()};function v(t,n,r){var o,i,a,c,s,u,l=0,v=!1,p=!1,h=!0;if("function"!=typeof t)throw new TypeError(e);function b(e){var n=o,r=i;return o=i=void 0,l=e,c=t.apply(r,n)}function y(t){var e=t-u;return void 0===u||e>=n||e<0||p&&t-l>=a}function k(){var t=g();if(y(t))return E(t);s=setTimeout(k,function(t){var e=n-(t-u);return p?f(e,a-(t-l)):e}(t))}function E(t){return s=void 0,h&&o?b(t):(o=i=void 0,c)}function L(){var t=g(),e=y(t);if(o=arguments,i=this,u=t,e){if(void 0===s)return function(t){return l=t,s=setTimeout(k,n),v?b(t):c}(u);if(p)return s=setTimeout(k,n),b(u)}return void 0===s&&(s=setTimeout(k,n)),c}return n=m(n)||0,w(r)&&(v=!!r.leading,a=(p="maxWait"in r)?d(m(r.maxWait)||0,n):a,h="trailing"in r?!!r.trailing:h),L.cancel=function(){void 0!==s&&clearTimeout(s),l=0,o=u=i=s=void 0},L.flush=function(){return void 0===s?c:E(g())},L}function w(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function m(t){if("number"==typeof t)return t;if(function(t){return"symbol"==typeof t||function(t){return!!t&&"object"==typeof t}(t)&&"[object Symbol]"==l.call(t)}(t))return NaN;if(w(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=w(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(n,"");var c=o.test(t);return c||i.test(t)?a(t.slice(2),c?2:8):r.test(t)?NaN:+t}t.exports=function(t,n,r){var o=!0,i=!0;if("function"!=typeof t)throw new TypeError(e);return w(r)&&(o="leading"in r?!!r.leading:o,i="trailing"in r?!!r.trailing:i),v(t,n,{leading:o,maxWait:n,trailing:i})}},24675(t,e,n){"use strict";n.d(e,{I:()=>a});var r=n(62179),o=n(97936),i=n(59471);function a(){!o.r.current&&(0,r.Uu)();const[t]=(0,i.useState)(o.O.current);return t}},62179(t,e,n){"use strict";n.d(e,{Uu:()=>i});var r=n(97936);const o="undefined"!=typeof window;function i(){if(r.r.current=!0,o)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>r.O.current=t.matches;t.addEventListener("change",e),e()}else r.O.current=!1}},97936(t,e,n){"use strict";n.d(e,{O:()=>r,r:()=>o});const r={current:null},o={current:!1}}}]);
2//# sourceMappingURL=PageBackgroundAnimator-Chunk-4343e9398f51c3be8d22.js.map

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.