nord vpnnord vpn
Ad

Untitled

mail@pastecode.io avatar
unknown
plain_text
a month ago
12 kB
1
Indexable
Never
(function () {
  try {
    /* main variables */
    var debug = 0;
    var variation_name = "";
    var $;
    /* 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);
    }

    addScript = function () {
      waitForElement("head", function () {
        var cssScript = '<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/tiny-slider/2.9.4/tiny-slider.css">';
        document.querySelector('head').insertAdjacentHTML('beforeend', cssScript);
        var tinnyScript = document.createElement('script');
        tinnyScript.src = 'https://cdnjs.cloudflare.com/ajax/libs/tiny-slider/2.9.2/min/tiny-slider.js';
        document.body.appendChild(tinnyScript);
      }, 50, 15000);
    }
    addScript();

    waitForTns = function (callback) {
      var interval = setInterval(function () {
        if (window.tns != undefined) {
          clearInterval(interval);
          callback();
        }
      }, 50);
      setTimeout(function () {
        clearInterval(interval);
      }, 15000)
    }

    var data = [
      {
        "name": "Smiths Falls - Smiths Falls",
        "comment": "The boat was clean; the staff at Smith Falls friendly and helpful.  We had a great time. The only concern was that the boat wasn't very well stocked. There was a partial roll of toilet paper and one small trash bag. I didn't expect to have to buy everything including but not limited to- more toilet paper, sponges, soap (dish, hand and shower), paper towels, foil, etc. We would like to go overseas next time and will be even more limited in how much we can bring along. The other thing that didn't sit particularly well was having a list of chores upon departure when I paid a premium fee for cleaning.",
        "rating": 4,
      },
      {
        "name": "Ottawa - Smiths Falls",
        "comment": "Boat condition and equipment was good.  Pre trip intro was the worst I’ve had in three previous canal boat rentals including one with Leboat.  Also, I never received a written explanation of my engine hours deposit.",
        "rating": 4,
      },
      {
        "name": "Trebes - Castelnaudary",
        "comment": "In general, service was good.  However, when you insist boats to be returned at 9am, and then only open the office at 9am, the logical conclusion is a long line of people waiting.  Suggest you stagger the returns.",
        "rating": 4,
      },
      {
        "name": "Smiths Falls - Smiths Falls",
        "comment": "Everyone we interacted with on the Le Boat staff was helpful and friendly.",
        "rating": 5,
      },
      {
        "name": " Messac - Messac",
        "comment": "The crew at Messac base all deserve kudos for providing all the information, including maps and boat essentials needed to have a great experience.",
        "rating": 5,
      },
      {
        "name": "Migennes - Migennes",
        "comment": "Excellent experience.  Folks there are friendly, professional, helpful and responsive.",
        "rating": 5,
      },
      {
        "name": "Tannay - Tannay",
        "comment": "Service was excellent. Erin did an amazing job of giving us information and service.",
        "rating": 5,
      },
      {
        "name": " Le Mas d'Agenais - Castelnaudary",
        "comment": "The boat was prepped and ready upon our arrival. The staff assisted us with some issues related to using our US debit/credit cards to pay for our taxi. The bikes were all in excellent condition. The checkout drive was smooth, and we felt the staff sent us out very well prepared for our tour in Elegance. Because we would be on a more extended tour than many, the base sent out a van with additional fuel to make absolutely sure that we had no issues and maximum ejoyment for our extra long trip.",
        "rating": 5,
      }
    ]

    function generateRatingHTML(rating) {
      let filledStarsWidth = 0;

      if (rating === 1) {
        filledStarsWidth = 20;
      } else if (rating === 2) {
        filledStarsWidth = 40;
      } else if (rating === 3) {
        filledStarsWidth = 60;
      } else if (rating === 4) {
        filledStarsWidth = 80;
      } else {
        filledStarsWidth = 100; // Default to 100% for rating=5
      }

      const html = `
    <div class="feefowidget-section-rating-verified">
      <feefowidget-rating-stars colour="yellow" rating="${rating}">
        <div class="feefowidget-rating-container">
          <div class="feefowidget-rating-wrapper">
            <div class="empty-stars">
              ${Array(5)
          .fill()
          .map(
            (_, index) =>
              `<i style="" class="feefowidget-star feefowidget-icon feefowidget-icon-star-o feefowidget-star-colour-yellow"></i>`
          )
          .join('')}
            </div>
            <div class="filled-stars" style="width: ${filledStarsWidth}%;">
              ${Array(5)
          .fill()
          .map(
            (_, index) =>
              `<i style="" class="feefowidget-star feefowidget-icon feefowidget-icon-star feefowidget-star-colour-yellow"></i>`
          )
          .join('')}
            </div>
          </div>
        </div>
      </feefowidget-rating-stars>
    </div>
  `;

      console.log(html);
    }

    // Example usage:
    // generateRatingHTML(5); // Generates HTML for rating 5
    // generateRatingHTML(4); // Generates HTML for rating 4
    // generateRatingHTML(1); // Generates HTML for rating 1


    let egstring = `
    <div class="eg-card-container">
    <div class="eg-card">
        <div class="eg-customer-feedback">
            <p>What customers say</p>
            <a class="view-all-feedback" href="">View ALL verified feedback ></a>
        </div>
        <div class="eg-reviews">
            <div class="eg-review">
                <div class="eg-badge">
                    <div class="eg-image">
                        <img src="https://svgshare.com/i/zF0.svg">
                    </div>
                    <div class="eg-image">
                        <img src="https://svgshare.com/i/zEH.svg">
                    </div>
                </div>
                <div class="eg-text">
                    <p>Wonderful way to see the countryside! You can't be in a rush on a trip like this, so we just meandered
                        down the Canal
                        and stopped whenever and wherever we wanted. Excellent food and wine and all the people we met were
                        great!</p>
                    <span>Seema Dutta</span>
                </div>
            </div>
            <div class="eg-review">
                <div class="eg-badge">
                    <div class="eg-image">
                        <img src="https://svgshare.com/i/zF0.svg">
                    </div>
                    <div class="eg-image">
                        <img src="https://svgshare.com/i/zEH.svg">
                    </div>
                </div>
                <div class="eg-text">
                    <p>Wonderful way to see the countryside! You can't be in a rush on a trip like this, so we just meandered
                        down the Canal
                        and stopped whenever and wherever we wanted. Excellent food and wine and all the people we met were
                        great!</p>
                    <span>Seema Dutta</span>
                </div>
            </div>
            <div class="eg-review">
                <div class="eg-badge">
                    <div class="eg-image">
                        <img src="https://svgshare.com/i/zF0.svg">
                    </div>
                    <div class="eg-image">
                        <img src="https://svgshare.com/i/zEH.svg">
                    </div>
                </div>
                <div class="eg-text">
                    <p>Wonderful way to see the countryside! You can't be in a rush on a trip like this, so we just meandered
                        down the Canal
                        and stopped whenever and wherever we wanted. Excellent food and wine and all the people we met were
                        great!</p>
                    <span>Seema Dutta</span>
                </div>
            </div>
        </div>
    </div>
</div>`

    /* Variation Init */
    function init() {
      waitForTns(function () {
        if (!document.querySelector(".eg-card-container")) {
          document.querySelector('.panel-panel-inner > .container > div:nth-child(5) > .info-block-flow:last-child').insertAdjacentHTML("beforebegin", egstring);
          if (window.innerWidth < 767) {
            tns({
              container: '.eg-reviews',
              items: 1.15,
              loop: true,
              mouseDrag: true,
              slideBy: 1,
              mouseDrag: true,
              swipeAngle: false,
              speed: 400,
              autoplay: true,
              autoplayTimeout: 4000,
              navPosition: "bottom",
            });
          }
        }
      });
    }

    /* Initialize variation */
    waitForElement('.panel-panel-inner > div:last-child .landing-pane-section', init, 50, 15000);
  } catch (e) {
    if (debug) console.log(e, "error in Test" + variation_name);
  }
})();































html body .eg-card .eg-customer-feedback {
    padding: 16px 0px 16px 0px !important;
}

html body .eg-card .eg-customer-feedback>p {
    font-family: Effra;
    font-size: 18px;
    font-weight: 700;
    line-height: 20px;
    letter-spacing: 0.20000000298023224px;
    text-align: left;
    color: #004587 !important;
}

html body .eg-card .eg-customer-feedback>a {
    font-family: Effra;
    font-size: 16px;
    font-weight: 400;
    line-height: 23px;
    letter-spacing: 0em;
    text-align: center;
    color: #FF7D20 !important;
}

html body .eg-card .eg-reviews {
    display: flex;
    flex-direction: row !important;
    justify-content: center;
    align-items: center;
    grid-gap: 24px !important;
}

html body .eg-card .eg-review .eg-badge {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    grid-gap: 10px !important;
    margin-bottom: 10px !important;
}

html body .eg-review .eg-text>p {
    font-family: Effra;
    font-size: 16px;
    font-weight: 400;
    line-height: 24px;
    letter-spacing: 0.20000000298023224px;
    text-align: center;
    color: #1D1F21;
}

html body .eg-review .eg-text>span {
    font-family: Effra;
    font-size: 18px;
    font-weight: 700;
    line-height: 20px;
    letter-spacing: 0.20000000298023224px;
    text-align: center !important;
}

html body .eg-review .eg-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

html body .eg-reviews>.eg-review {
    box-shadow: 0px 2px 4px 0px #1C366033;
    background: #FFFFFF;
    padding: 16px !important;
}

html body .eg-card-container {
    margin-bottom: 20px !important;
}

html body .eg-card .tns-outer button {
    display: none !important;
}

@media only screen and (max-width:767px) {
    html body .eg-review .eg-badge {
        margin-bottom: 5px;
    }

    html body .eg-review .eg-text>p {
        padding: 10px;
        line-height: 25px !important;
        margin-bottom: 25px !important;
    }

    html body .eg-card .eg-review .eg-badge {
        margin-bottom: 0px !important;
    }
}

nord vpnnord vpn
Ad