Untitled

mail@pastecode.io avatar
unknown
plain_text
8 months ago
7.8 kB
7
Indexable
Never
(function(){
    var style=document.createElement('style');style.type='text/css';style.appendChild(document.createTextNode('html body .but-1-1-freeTrial-Banner {    background-color: rgb(255, 255, 255);    border: 2px solid rgb(3, 3, 3);    border-radius: 0.5rem;    box-shadow: rgb(3, 3, 3) 3px 4px 0px;    padding: 16px 24px 24px;    height: 100%;    transition: all 0.12s linear 0s;    margin-bottom: 32px;}html body .but-1-1-freeTrial-Banner .but-1-1-content-container {    display: flex;    flex-direction: column;    grid-gap: 24px;}html body .but-1-1-freeTrial-Banner .but-1-1-banner-content {    display: flex;    flex-direction: column;    grid-gap: 6px;    position: relative;}html body .but-1-1-freeTrial-Banner .but-1-1-inner-content {    display: flex;    grid-gap: 8px;    align-items: center;}html body .but-1-1-freeTrial-Banner .but-1-1-banner-heading {    color: #000;    font-size: 14px;    font-style: normal;    font-weight: 700;    line-height: normal;    margin-bottom: 16px;}html body .but-1-1-freeTrial-Banner .but-1-1-inner-heading {    color: #000;    font-size: 12px;    font-style: normal;    font-weight: 700;    line-height: normal;}html body .but-1-1-freeTrial-Banner p,html body .but-1-1-freeTrial-Banner ul li {    color: #000;    font-size: 12px;    font-style: normal;    font-weight: 400;    line-height: normal;    margin-left: 17px;}html body .but-1-1-freeTrial-Banner .but-1-1-freeTrial-list {    margin-left: 17px;    margin-top: 4px;}html body .but-1-1-freeTrial-Banner ul li {    margin-bottom: 8px;}html body .but-1-1-freeTrial-Banner .but-1-1-inner-heading a {    color: #204CE9;    text-decoration: none;    border-bottom: 1.5px solid #204CE9;}html body .but-1-1-freeTrial-Banner .but-1-1-content-container>div:first-child:before {    content: \'\';    width: 2px;    height: 40px;    background: #0087FF !important;    position: absolute;    left: 3px;    top: 16px;}html body .but-1-1-freeTrial-Banner .but-1-1-content-container>div:nth-child(2):before {    content: \'\';    width: 2px;    height: 40px;    background: #0087FF !important;    position: absolute;    left: 3px;    top: 16px;}@media only screen and (min-width:1024px) {    #__next>div>div>div:last-child>div>div {        max-width: unset !important;    }    #__next>div>div>div:last-child>div>div>h3,    #__next>div>div>div:last-child>div>div>p,    #__next>div>div>div:last-child>div>div>form {        max-width: 378px !important;        margin: auto;    }    #__next>div>div>div:last-child>div>div>p {        margin-bottom: 1rem !important;    }    #__next>div>div>div:last-child>div>div>h3 {        margin-bottom: 8px !important;    }    html body .but-1-1-freeTrial-Banner {        max-width: 424px !important;        margin: auto;    }    html body .but-1-1-freeTrial-Banner {        max-width: 439px !important;        margin: auto;        margin-top: 30px !important;        margin-bottom: 40px !important;    }}@media only screen and (max-width:767px) {    html body .but-1-1-freeTrial-Banner .but-1-1-inner-content svg {        width: 9px !important;        height: 9px !important;        min-width: 9px !important;        min-height: 9px !important;    }    html body .but-1-1-freeTrial-Banner .but-1-1-content-container>div:nth-child(2):before {        content: \'\';        width: 2px;        height: 63px;        background: #0087FF !important;        position: absolute;        left: 3px;        top: 16px;    }}@media only screen and (max-width:405px) {    html body .but-1-1-freeTrial-Banner .but-1-1-content-container>div:first-child:before {        content: \'\';        width: 2px;        height: 54px;    }}@media only screen and (min-width:420px) and (max-width:767px) {    html body .but-1-1-freeTrial-Banner .but-1-1-content-container>div:nth-child(2):before {        content: \'\';        width: 2px;        height: 42px;    }}'));document.head.appendChild(style);

// migrated code
(function (w) {
  "use strict";

  var tag = "but-1-1",
    debug = document.cookie.indexOf("cfQA") > -1,
    window = typeof unsafeWindow !== "undefined" ? unsafeWindow : w;

  window[tag] = {
    log: function (msg) {
      if (debug) console.log("[EXPO]", tag, "-->", msg);
    },

    waitForElement: function (cssSelector, callback) {
      var stop,
        elementCached,
        timeout,
        check = function () {
          try {
            elementCached = document.querySelector(cssSelector);

            if (stop) return;

            if (elementCached) {
              callback(elementCached);
              clearTimeout(timeout);

              window[tag].log(cssSelector + " found");
            } else {
              window.requestAnimationFrame(check);
            }
          } catch (err) {
            window[tag].log(err.message);
          }
        };

      window.requestAnimationFrame(check);

      timeout = setTimeout(function () {
        stop = true;
        window[tag].log(cssSelector + " not found");
      }, 5000);
    },

    testStart: function () {
      try {
        this.waitForElement("body", function (docBody) {
          docBody.classList.add(tag);
        });

        // INITIALIZE THE TEST
        initVariation();

        window[tag].log("test running");
      } catch (err) {
        window[tag].log(err.message);
      }
    },
  };

  // INITIALIZE VARIATION
  window[tag].testStart();

  function initVariation() {
    window[tag].waitForElement('html body #__next h3 + p', main);
  }
  var freeTrial = `
    <div class="${tag}-freeTrial-Banner">
    <h2 class="${tag}-banner-heading">How the free trial works</h2>
    <div class="${tag}-content-container">
        <div class="${tag}-banner-content">
            <div class="${tag}-inner-content">
                <svg xmlns="http://www.w3.org/2000/svg" width="9" height="9" viewBox="0 0 9 9" fill="none">
                    <circle cx="4.5" cy="4.5" r="4.5" fill="#0087FF" />
                </svg>
                <h3 class="${tag}-inner-heading">Today</h3>
            </div>
            <p>Read <strong>unlimited financial news</strong>, jargon free</p>
        </div>
        <div class="${tag}-banner-content">
            <div class="${tag}-inner-content">
                <svg xmlns="http://www.w3.org/2000/svg" width="9" height="9" viewBox="0 0 9 9" fill="none">
                    <circle cx="4.5" cy="4.5" r="4.5" fill="#0087FF" />
                </svg>
                <h3 class="${tag}-inner-heading">Next 7 days</h3>
            </div>
            <p>Stay on the pulse with <strong>free daily newsletters</strong></p>
        </div>
        <div class="${tag}-banner-content">
            <div class="${tag}-inner-content">
                <svg xmlns="http://www.w3.org/2000/svg" width="9" height="9" viewBox="0 0 9 9" fill="none">
                    <circle cx="4.5" cy="4.5" r="4.5" fill="#0087FF" />
                </svg>
                <h3 class="${tag}-inner-heading">Love Finimize? <a href="https://finimize.com/plans/sign-up/unlock?ref-page=%2Fcontent%2Fadvanced-economics&cta-source=">Upgrade to premium</a> to get access to:</h3>
            </div>
            <ul class="${tag}-freeTrial-list">
            <li><strong>Daily investing ideas</strong> from top analysts</li>
            <li>Save time with <strong>audio content on the go</strong> on the app</li>
            <li>Get <strong>context behind the world’s top stocks</strong> right in your inbox</li>
            <li>Read <strong>daily charts and data analysis</strong> in the app</li>
            </ul>
        </div>
    </div>
</div>`;

  function main() {
    if (window.location.href.indexOf('/sign-up') !== -1 && !document.querySelector(`.${tag}-freeTrial-Banner`)) {
      document.querySelector('html body #__next h3 + p').insertAdjacentHTML("afterend", freeTrial);
    }
  }
})(window);



})();
Leave a Comment