Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
4.7 kB
1
Indexable
Never
(function () {
  if(!document.querySelector(".egContainer")){
  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);
    }

    const newSection = `
    <div class="egContainer eg-full-fleed">
    <div class="egCopy">
        <h4 class="egPlans">Affordable Payment Plans and No Hidden Fees</h4>
        <h2 class="egTitle">The Average Cost of Dental Implants Will Vary</h2>
        <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Quis <br/> ipsum suspendisse ultrices gravida. Risus commodo viverra maecenas accumsan lacus vel facilisis.</p>
    </div>

    <div class="eg-overview-wrapper">
            <div class="eg-callouts-container">

                <div class="eg-callouts">
                    <h3 class="eg-title">Single Teeth</h3>
                    <p class="eg-info">Starting at approximately</p>
                      <span id="egCost">$000*</span>
                      <p class='eg-info info'>per month for 36 months</p>
                      <span class='egOr'>or</span> <br/>
                      <span id='egCost'>$0,000*</span>                    
                    <a href="#">Learn more <img class='egImg' src='https://img.icons8.com/external-neu-royyan-wijaya/32/a1d855/external-arrow-neu-arrow-neu-royyan-wijaya-7.png'/></a>
                </div>

                <div class="eg-callouts">
                    <h3 class="eg-title">Multiple Teeth</h3>
                    <p class="eg-info">Starting at approximately</p>
                      <span id="egCost">$000*</span>
                      <p class='eg-info info'>per month for 36 months</p>
                      <span class='egOr'>or</span> <br/>
                      <span id='egCost'>$0,000*</span>
                      <a href="#">Learn more <img class='egImg' src='https://img.icons8.com/external-neu-royyan-wijaya/32/a1d855/external-arrow-neu-arrow-neu-royyan-wijaya-7.png'/></a>
                </div>

                <div class="eg-callouts">
                    <h3 class="eg-title">Upper or Lower</h3>
                    <p class="eg-info">Starting at approximately</p>
                      <span id="egCost">$000*</span>
                      <p class='eg-info info'>per month for 36 months</p>
                      <span class='egOr'>or</span> <br/>
                      <span id='egCost'>$0,000*</span>
                      <a href="#">Learn more <img class='egImg' src='https://img.icons8.com/external-neu-royyan-wijaya/32/a1d855/external-arrow-neu-arrow-neu-royyan-wijaya-7.png'/></a>
                </div>

                <div class="eg-callouts">
                    <h3 class="eg-title">Full: Upper & <br/> Lower</h3>
                    <p class="eg-info info">Starting at approximately</p>
                      <span id="egCost">$000*</span>
                      <p class='eg-info'>per month for 36 months</p>
                      <span class='egOr'>or</span> <br/>
                      <span id='egCost'>$0,000*</span>                    
                      <a href="#">Learn more <img class='egImg' src='https://img.icons8.com/external-neu-royyan-wijaya/32/a1d855/external-arrow-neu-arrow-neu-royyan-wijaya-7.png'/></a>
                </div>
            </div>
        </div>

    <div class="egFooter">
        <p>*Treatment costs can vary case by case due to many factors that need to be considered during treatment to customize implants to specific patients.<br/> Cost is determined on a case by case basis and financing is available for those who qualify.</p>

        <a href="https://www.eonclinics.com/schedule-appointment/" id="egAnchor">Book a Consultation to Review Costs</a>
    </div>
</div>`
    
    /* Variation Init */
    function init() {
      /* start your code here */

      if (window.location.pathname == '/') {
        document.querySelector("article > div.entry-content > div:nth-child(10)").insertAdjacentHTML("beforebegin" , newSection);        
      }
    }

    /* Initialize variation */
    waitForElement('article > div.entry-content > div:nth-child(10)', init, 50, 15000);
  } catch (e) {
    if (debug) console.log(e, "error in Test" + variation_name);
  }
  }
})();