PageSourceSearch

https://noo.ma/cdn/shop/t/332/assets/footer-tagline-fit.js?v=26821444226597596341785227460

js noo.ma collected 2026-10-03 21:24:31 UTC 3,059 bytes, 2 lines download raw bytes

1class FooterTaglineFit extends HTMLElement{#resizeObserver=null;#mutationObserver=null;#fitFrame=null;#reflowHandler=()=>{this.refit()};connectedCallback(){this.#resizeObserver=new ResizeObserver(this.#reflowHandler),this.#resizeObserver.observe(this),this.#mutationObserver=new MutationObserver(this.#reflowHandler),this.#mutationObserver.observe(this,{childList:!0,subtree:!0,characterData:!0}),window.addEventListener("resize",this.#reflowHandler),window.addEventListener("weglot:ready",this.#reflowHandler),window.Weglot?.on?.("languageChanged",this.#reflowHandler),this.refit(),requestAnimationFrame(()=>this.refit()),requestAnimationFrame(()=>requestAnimationFrame(()=>this.refit()))}disconnectedCallback(){this.#resizeObserver?.disconnect(),this.#mutationObserver?.disconnect(),window.removeEventListener("resize",this.#reflowHandler),window.removeEventListener("weglot:ready",this.#reflowHandler),window.Weglot?.off?.("languageChanged",this.#reflowHandler),this.#fitFrame&&cancelAnimationFrame(this.#fitFrame)}refit(){this.#fitFrame&&cancelAnimationFrame(this.#fitFrame),this.#fitFrame=requestAnimationFrame(()=>{this.#fitFrame=null,this.#fit()})}#fit(){const fitMaxWidth=Number.parseInt(this.dataset.fitMaxWidth??"1019",10),minFontSize=Number.parseFloat(this.dataset.minFontSize??"14"),dataMaxFontSize=Number.parseFloat(this.dataset.maxFontSize??"46"),isCompact=!window.matchMedia(`(min-width: ${fitMaxWidth+1}px)`).matches,textEl=this.querySelector("[data-footer-tagline-text]");if(!(textEl instanceof HTMLElement)||!this.textContent?.trim())return;const containerWidth=this.getBoundingClientRect().width;if(containerWidth<=0)return;this.style.fontSize="";let maxFontSize=dataMaxFontSize;if(!isCompact){const cssFontSize=Number.parseFloat(getComputedStyle(this).fontSize);Number.isFinite(cssFontSize)&&cssFontSize>0&&(maxFontSize=cssFontSize)}this.style.fontSize=`${maxFontSize}px`;let textWidth=textEl.getBoundingClientRect().width;if(textWidth<=0)return;if(textWidth<=containerWidth){isCompact||(this.style.fontSize="");return}let fontSize=maxFontSize*containerWidth/textWidth;if(fontSize=Math.max(minFontSize,fontSize),this.style.fontSize=`${Math.round(fontSize*100)/100}px`,textWidth=textEl.getBoundingClientRect().width,textWidth<=0)return;const refinedSize=fontSize*containerWidth/textWidth-.15;fontSize=Math.max(minFontSize,refinedSize),this.style.fontSize=`${Math.round(fontSize*100)/100}px`}}const initFooterTaglineFit=()=>{customElements.get("footer-tagline-fit")||customElements.define("footer-tagline-fit",FooterTaglineFit),document.querySelectorAll("footer-tagline-fit").forEach(element=>{element instanceof FooterTaglineFit&&element.refit()})};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",initFooterTaglineFit,{once:!0}):initFooterTaglineFit(),document.fonts?.ready?.then(()=>{document.querySelectorAll("footer-tagline-fit").forEach(element=>{element instanceof FooterTaglineFit&&element.refit()})});
2//# sourceMappingURL=/cdn/shop/t/332/assets/footer-tagline-fit.js.map?v=26821444226597596341785227460

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.