dafne.sirio.stbm.it Open in urlscan Pro
2a02:26f0:7100:998::3198  Public Scan

URL: https://dafne.sirio.stbm.it/utility-fe/prod/web-components/ame-mh.min.js
Submission: On November 01 via api from IT — Scanned from IT

Form analysis 0 forms found in the DOM

Text Content

class AmeMh extends HTMLElement{constructor(){super()}connectedCallback(){this.config(),document.querySelector(this.selectorWrapper).classList.add("mh2021Page")}config(){let t=document.createElement("style");t.textContent=this.style(),this.appendChild(t),this.insertAdjacentHTML("beforeend",this.template()),this.js()}template(){let t='\n            <div id="mh2021" class="mhInView">\n                <div id="adv-gpt-masthead-leaderboard-container1" class="mh2021Strip adv strip"></div>\n            </div>\n            <div id="mh2021Fake"></div>\n            <div id="bottomStrip2021">\n                <div id="gpt_stripmobile"></div>\n            </div>\n        ';return window.location.hostname.includes("thewom")&&(t+='\n            <div id="padding-strip" class="thewom-ticker">\n                <span class="thewom-cat">\n                </span>\n            </div>\n        '),t}style(){let t=`\n            :root {\n                --altezzaMh2021: 33vw;\n                --bgMh2021: #fff;\n                --bgMh2021Page: #fff;\n            }\n            #mh2021 {\n                height: var(--altezzaMh2021);\n                width: 100vw;\n                position: fixed;\n                top: 0;\n                left: 0;\n                overflow: hidden;\n            }\n            #mh2021.mhForeground {\n                z-index: 9999;\n            }\n            #mh2021Fake {\n                height: var(--altezzaMh2021);\n                width: 90vw;\n                position: absolute;\n                top: 0;\n                left: 5vw;\n                overflow: hidden;\n                z-index: -100;\n            }\n            .mh2021Page {\n                margin-top: 0;\n                transition: margin 300ms ease-in-out;\n                position: relative;\n                z-index: 1;\n                ${"rgba(0, 0, 0, 0)"==window.getComputedStyle(document.querySelector(this.selectorWrapper)).backgroundColor?"background:var(--bgMh2021Page);":""}\n            }\n            .mh2021Strip {\n                width: 100vw;\n                max-height: var(--altezzaMh2021);\n                overflow: hidden;\n                background: var(--bgMh2021);\n                display: flex;\n                justify-content: center;\n                align-items: flex-start;\n            }\n            #bottomStrip2021 {\n                width: 100vw;\n                height: 100px;\n                position: fixed;\n                bottom: -100px;\n                left: 0;\n                display: flex;\n                justify-content: center;\n                align-items: start;\n                z-index: 99999;\n                background-color: rgba(255,255,255,.8);\n                transform: translateY(0);\n                transition: transform 50ms ease-in-out;\n            }\n            #bottomStrip2021 > div {\n                display: flex;\n                justify-content: center;\n                align-items: center;\n            }\n            @media all and (min-width: 1000px) {\n                :root {\n                    --altezzaMh2021 : 250px;\n                }\n                .mh2021Strip {\n                    background: ${this.bgMh?this.bgMh:"var(--bgMh2021)"};\n                }\n            }\n        `;return window.location.hostname.includes("thewom")&&(t+="\n            .thewom-ticker {\n                font-family: 'Poppins', sans-serif;\n                position: fixed;\n                background-color: #110029;\n                height: 0;\n                line-height: 35px;\n                width: 100vw;\n                font-size:25px;\n                overflow: hidden;\n                white-space: nowrap;\n                transform: translateY(-100%);\n            }\n            .thewom-ticker a {\n                color: #FFF;\n            }\n            #mh2021.mhForeground ~ .thewom-ticker {\n                z-index: 9999;\n                top: var(--margin-top-adv);\n                transform: translateY(0%);\n            }\n            #padding-strip .thewom-cat {\n                width: 100%;\n                height: 100%;\n                display: block;\n                background-image: url('https://dafne.sirio.stbm.it/utility-fe/prod/web-components/img/TheWom.svg?ver=1');\n                background-position: center;\n                background-size: auto 60%;\n                background-repeat: repeat-x;\n                opacity: .8;\n            }\n            #padding-strip .thewom-logo {\n                max-height: 19px;\n                width:auto;\n                margin-bottom: -1px;\n            }\n            @media all and (min-width: 1000px) {\n                .thewom-ticker {\n                    height: 35px;\n                }\n            }\n        "),t}js(){if(window.googletag=window.googletag||{cmd:[]},"true"!=this.disableStrip&&!document.querySelector(".no-strip-mobile")){"function"==typeof startStripMobile&&postTcfReady(()=>{setTimeout(()=>{document.getElementById("flyfirst-mobile-placement")?0==document.getElementById("flyfirst-mobile-placement").childNodes.length?startStripMobile("fallback timer"):console.log("[strip mobile 2021] fallback fallita per presenza flyfirst"):startStripMobile("fallback timer")},2e4)})}}get selectorWrapper(){return this.getAttribute("selector-wrapper")}get bgMh(){return this.getAttribute("bg-mh")}get disableStrip(){return this.getAttribute("disable-strip")}static strip_animation(){let t,e=document.querySelector("ame-mh"),n=e.getAttribute("enable-events"),i=e.getAttribute("disable-strip"),o=Number(e.getAttribute("view-time-limit")),r=Number(e.getAttribute("first-delay")),a=o&&""!=o?o:5e3,l=r&&""!=r?r:3e3,s=document.getElementById("mh2021"),d=document.getElementById("mh2021Fake"),m=document.querySelector(".mh2021Page"),h=document.querySelector(".mh2021Strip"),c=document.querySelector("#padding-strip"),g=document.getElementById("flyfirst-mobile-placement"),p=0;let u=(t,e)=>{localStorage.getItem("mh2021Debug")&&console.log("[mh2021] - "+t,e)};if(0==(h.offsetHeight||0))return u("Strip ad altezza 0 -> return false"),!1;if(void 0!==window.stripanimationrun)return console.warn("[mh2021] - ATTENZIONE! Strip animation richiamata più volte!"),!1;window.stripanimationrun=1,"true"==n&&(window.gtag?gtag("event","Start",{event_category:"mh2021",event_label:document.location.href,non_interaction:!0}):window.ga&&ga("send","event","mh2021","Start",document.location.href,{nonInteraction:!0}));let f=t=>{u("mh2021PageInTopView",t),b.disconnect();let e=s.firstElementChild.offsetHeight;e<=50&&(e=0);let i=0;c&&(i=c.offsetHeight),m.style.marginTop=e+i+"px",p=1,"true"==n&&(window.gtag?gtag("event",t,{event_category:"mh2021",event_label:document.location.href,non_interaction:!0}):window.ga&&ga("send","event","mh2021",t,document.location.href,{nonInteraction:!0}))};setTimeout(()=>{t&&f("In top view all'inizio")},l+100),setTimeout(()=>{if(u("Fix inizio",performance.now()),s.classList.add("mhForeground"),c){let t=s.firstElementChild.offsetHeight;c.style.setProperty("--margin-top-adv",t+"px")}},l+400),setTimeout(()=>{u("Defix",performance.now()),s.classList.remove("mhForeground"),"true"==i||document.querySelector(".no-strip-mobile")||g&&0==g.childNodes.length&&setTimeout(()=>{"function"==typeof startStripMobile&&startStripMobile("mh fixed")},1e3)},l+a+400);let b=new IntersectionObserver((e,n)=>{e.forEach(e=>{e.isIntersecting?(0==p&&0==t&&f("Ritorno in top view"),t=!0):t=!1})},{rootMargin:"0px",threshold:1});u("Start observer",""),b.observe(d)}static callbackStripMobile(){googletag.pubads().addEventListener("slotOnload",function(t){if(t.slot===stripmobile){console.log("[strip mobile 2021] slotOnload");let t=document.getElementById("bottomStrip2021"),e=document.getElementById("gpt_stripmobile").offsetHeight;console.log("[strip mobile 2021] height:",e),t.style.transform="translateY("+-1*e+"px)"}})}}customElements.define("ame-mh",AmeMh);
//# sourceMappingURL=ame-mh.min.js.map