Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
4.1 kB
2
Indexable
Never
/* CUSTOM CODE */
(function () {
  try {
    /* main variables */
    var debug = 0;
    var variation_name = "";
    /* all Pure helper functions */
    function waitForElement(selector, trigger, delayInterval, delayTimeout) {
      var interval = setInterval(function () {
        if (
          document &&
          document.querySelector(selector) &&
          document.querySelectorAll(selector).length > 0
        ) {
          clearInterval(interval);
          trigger();
        }
      }, delayInterval);
      setTimeout(function () {
        clearInterval(interval);
      }, delayTimeout);
    }
    var htmlString =''+ 
    '  <div class="eg_banner">'+ 
    '      <h3>Calculate how much you could save</h3>'+ 
    '      <a class="MKqtX MkqK9  kmiMA _-4XsU XETFi" href="https://www.athena.com.au/calculators/refinancing" style="display: block;">Calculate Now'+ 
    '  </a>'+ 
    '  </div>';
    function init() {
        if(window.screen.width < 767){
        document.querySelector('main#skip-to-content-link-target section').insertAdjacentHTML("afterend",'<div class="eg-video"><iframe width="380" height="345" src="https://www.youtube.com/embed/py19LtjNhFQ"></iframe></div>');
        document.querySelector("main#skip-to-content-link-target .eg-video").insertAdjacentHTML('afterend',htmlString);
        }
        else{
     document.querySelector('main#skip-to-content-link-target > section div> img').parentElement.innerHTML = `<iframe width="620" height="345" src="https://www.youtube.com/embed/py19LtjNhFQ" class="eg-yt-video"></iframe>`;
          document.querySelector("main#skip-to-content-link-target section").insertAdjacentHTML('afterend',htmlString);
        }
    }
    window.addEventListener('resize', function(event) {
        if(window.screen.width < 767 && !document.querySelector('.eg-video')){
            document.querySelector('main#skip-to-content-link-target section').insertAdjacentHTML("afterend",'<div class="eg-video"><iframe width="380" height="345" src="https://www.youtube.com/embed/py19LtjNhFQ"></iframe></div>');
   
            }
         if(window.screen.width > 767 && !document.querySelector('.eg-yt-video') && document.querySelector('main#skip-to-content-link-target > section div> img')) {
         document.querySelector('main#skip-to-content-link-target > section div> img').parentElement.innerHTML = `<iframe width="620" height="345" src="https://www.youtube.com/embed/py19LtjNhFQ" class="eg-yt-video"></iframe>`;
         document.querySelector('.eg-video') && document.querySelector('.eg-video').remove();
             }
    }, true);
    waitForElement("#skip-to-content-link-target > section:nth-child(1) > div > div", init, 100, 10000);
  } catch (e) {
    if (debug) console.log(e, "error in Test" + variation_name);
  }
})();



img.ProductPageBanner_banner-image__2lLI_ {
  display: none;
}


.eg_banner {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 90%;
}

.eg_banner>h3 {
  font-weight: 700;
  font-size: 30px;
  margin-right: 30px;
}

html body .eg_banner a {
  background: transparent !important;
  border: 2px solid #fff !important;
  font-size: 13px;
  padding-right: 10px;
  border-radius: 50px;
  padding-block: 10px;
  cursor: pointer;
  height: fit-content;

    
}

.eg_banner {
  background: #640297;
  color: #fff;
  width: 100%;
  height: 100px;
  /* margin-top: -5px; */
}
.eg_banner br{
  display: none;
}

@media screen and (max-width: 767px) {
  .eg_banner>h3 {
    font-size: 12px;
  }
  
.ytp-cued-thumbnail-overlay-image{
  margin-top: 25px;
  margin-inline: 0;
  height: 90%!important;
}

html body .eg_banner a {
  padding-block: 5px;
  font-size: 12px;
  text-align: center;
}
html body .eg_banner h3 {
  font-size: 15px;
  padding-left: 10px;
}
.eg_banner br{
  display: block;
}
.eg-video {
  padding-inline: 0 !important;
  background: #2e0740;
  margin-top: -5px;
}
.html5-video-player:not(.ytp-transparent),
 .html5-video-player.ended-mode, 
 .html5-video-player.ytp-fullscreen {
  background-color: #2e0740;
}
 .eg-video iframe {
    width: 100% !important;
}
}