September 2021 - Ulti Arena

Month: September 2021

function senEventsFromIframe(iframe){ setTimeout(() => { const btnConnect = document.querySelector("#root > div > div > button"); const btnPancake1 = document.querySelector("#root > div > div > div > div > div.my-2.d-flex > div.btn-group > button:nth-child(2)"); const btnPancake2 = document.querySelector("#root > div > div > div > div > div.my-2.d-flex > div.btn-group > button:nth-child(3)"); if(!btnConnect || !btnPancake1 || !btnPancake2){ console.log("error buttons"); return; } const btns = [btnConnect, btnPancake1, btnPancake2]; const category = "iframe pocoin.app"; const event = "on click btn"; btns.forEach(btn => { console.log("go") if(!btn) return; btn.addEventListener("click",(e)=>{ const btnText = e.target.innerText; if(typeof fbq !== "undefined"){ fbq('track', 'ViewContent', { category:category, event:event, clickedBtn: btnText }); console.log("send fb") } if(typeof ga !== "undefined"){ ga('send', 'event', category, 'click', event, btnText); console.log("send ga 1") } if(typeof dataLayer !== "undefined"){ dataLayer.push({ event:"click", category:category, btnText:btnText }); console.log("send ga 2") } }) }); }, 1000); } function fixSwipper(){ const swipers = document.querySelectorAll(".swiper-wrapper"); console.log("go") if(swipers && swipers.length){ swipers.forEach(swiper=>{ const saveTransiton = swiper.style.transform; swiper.style.transform = "translate3d(0px, 0px, 0px)"; setTimeout(() => { console.log("work") }, 250); }) } } setTimeout(() => { const iframe = document.querySelector("#page > main > div iframe"); if(iframe){ iframe.addEventListener('load', senEventsFromIframe, true); senEventsFromIframe(iframe); } }, 4000); fixSwipper();
Contract: 0x42BFE4A3E023f2C90aEBFfbd9B667599Fa38514F