Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
11 kB
2
Indexable
Never
(function () {
  /* 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);
  }

  
  function init() {

      if ($(window).width() < 767){
          waitForSlick(function() {
              var $ = window.jQuery;
              if($('.plan-container-card')){
                  window.jQuery('.plan-container-card').slick({
                      infinite: false,
                      dots: true,
                      slidesToShow: 1.3,
                      centerMode: false,
                    });
              }
             if($('.addOnsCard')){
                  window.jQuery('.addOnsCard').slick({
                      infinite: false,
                      dots: true,
                      slidesToShow: 1.3,
                      centerMode: false,
                  });  
              }
              if($('.select-plan__categories-selection__container__categories')){
                  window.jQuery('.select-plan__categories-selection__container__categories').slick({
                      infinite: false,
                      dots: true,
                      slidesToShow: 1.3,
                      centerMode: false,
                      });  
              }

            });
        $('.plan-container-card.Shahry .plan-card__benfit-text > div:nth-child(5) > p').html('International mins');
      }
      addScript();

  }

  function waitForSlick(trigger) {
    var interval = setInterval(function () {
        if (window.jQuery.fn.slick != undefined) {
            clearInterval(interval);
            trigger();
        }
    }, 50);
    setTimeout(function () {
        clearInterval(interval);
    }, 15000)
  }

  function addScript() {
    var cssScript=''+ 
    "<link rel='stylesheet' href='https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.8.1/slick.css'/>";
    document.querySelector('head').insertAdjacentHTML('beforeend', cssScript);
        
    var swiperScript = document.createElement('script');
    swiperScript.src = 'https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.8.1/slick.min.js';
   // document.getElementsByTagName('head')[0].appendChild(swiperScript);
    }

 var egNext = '<span>Next Plan </span> <i class="fa fa-angle-right" aria-hidden="true"></i>';
 var egPrev = '<i class="fa fa-angle-left" aria-hidden="true"></i> <span>Previous Plan</span>';

    function init2(){
      $('.plan-container-card .slick-next').html(egNext)
      $('.plan-container-card .slick-prev').html(egPrev)
      $('.addOnsCard .slick-next').html(egNext)
      $('.addOnsCard .slick-prev').html(egPrev)
      $('.select-plan__categories-selection__container__categories .slick-next').html('<span>Next plan </span> <i class="fa fa-angle-right" aria-hidden="true"></i>')
      $('.select-plan__categories-selection__container__categories .slick-prev').html('<i class="fa fa-angle-left" aria-hidden="true"></i> <span>Previous plan</span>')
    }

  waitForElement('.select-plan__categories-selection__container__categories', init, 50, 10000);
  waitForElement('.select-plan__categories-selection__container__categories .slick-next', init2, 50, 10000);

})();



<style>
@media screen and (max-width:767px) {
  .select-plan__fold-section .slick-arrow, .select-plan__benfits-section .slick-arrow {
    display: none !important;
}
  .plan-card__benfit-text__title {
 padding-bottom: 10px;
  }
  .ooredoo-tooltip {
  font-size: 70%;
  }
  .plan-card__promotion-recommand {
  width: 35%;
    display: inline-block;
  }
    
    .plan-container-card .slick-active,
    .addOnsCard .slick-active,
    .select-plan__categories-selection__container__categories .slick-active{
        opacity: 1;
    }
    .addOnsCard .slick-slide .addOns.card{
        width: 100% !important;
    }
    .select-plan__categories-selection__container__categories .slick-slide .category-card {
        width: auto !important;
    }
    html body .plan-container-card .slick-arrow .fa,
    html body .addOnsCard .slick-arrow .fa,
    html body .select-plan__categories-selection__container__categories .slick-arrow .fa{
        font-size: 34px;
        color: #221e20;
    }
    html body .plan-container-card .slick-next:before, 
    html body .plan-container-card .slick-prev:before,
    html body .addOnsCard .slick-next:before, 
    html body .addOnsCard .slick-prev:before,
    html body .select-plan__categories-selection__container__categories .slick-next:before, 
    html body .select-plan__categories-selection__container__categories .slick-prev:before{
        display: none;
    }
    html body .plan-container-card .slick-next, 
    html body .addOnsCard .slick-next, 
    html body .select-plan__categories-selection__container__categories .slick-next,
    html body .plan-container-card .slick-prev, 
    html body .addOnsCard .slick-prev, 
    html body .select-plan__categories-selection__container__categories .slick-prev{
        width: 35px !important;
        background: #c3c3c38c;
        height: 35px !important;
        border-radius: 100%;
        z-index: 1;
    }
    html body .plan-container-card .slick-next .fa, 
    html body .addOnsCard .slick-next .fa, 
    html body .select-plan__categories-selection__container__categories .slick-next .fa{
        right: -2px;
        position: relative;
        top: -1px;
    }
    html body .plan-container-card .slick-prev .fa, 
    html body .addOnsCard .slick-prev .fa, 
    html body .select-plan__categories-selection__container__categories .slick-prev .fa{
        right: 2px;
        top: -1px;
        position: relative;
    }
    html body .plan-container-card .slick-prev,
    html body .plan-container-card .slick-next{
        top: 35% !important;
    }

    html body .plan-container-card .slick-prev, 
    html body .addOnsCard .slick-prev, 
    html body .select-plan__categories-selection__container__categories .slick-prev {
        color: #221e20;
        /* width: auto !important; */
        display: inline-flex;
        align-items: center;
        justify-content: center;
        top: 50%;
        /* bottom: -20px; */
        left: 0px;
        right: auto;
        font-size: 14px;
    }
  
    html body .plan-container-card .slick-next, 
    html body .addOnsCard .slick-next, 
    html body .select-plan__categories-selection__container__categories .slick-next {
        color: #221e20;
        right: 10px;
        /* width: auto !important; */
        display: inline-flex;
        align-items: center;
        justify-content: center;
        top: 50%;
        /* bottom: -20px; */
        font-size: 14px;
    }
 
    
    /* html body .plan-container-card .slick-prev, 
    html body .plan-container-card .slick-next{
        bottom: -20px !important;
    } */
    html body .plan-container-card .slick-next span, 
    html body .plan-container-card .slick-prev span, 
    html body .addOnsCard .slick-next span, 
    html body .addOnsCard .slick-prev span, 
    html body .select-plan__categories-selection__container__categories .slick-next span, 
    html body .select-plan__categories-selection__container__categories .slick-prev span {
        color: #221e20;
        display: none !important;
        width: auto;
        line-height: 1;
        margin: 0px 6px;
        font-size: 14px;
    }
 
  
    /* html body .plan-container-card .slick-dots,
    html body .addOnsCard .slick-dots,
    html body .select-plan__categories-selection__container__categories .slick-dots{
        top: calc(100% + 10px);
    } */
    html body .select-plan__fold-section .upgrade-your-world {
        margin-top: 0px;
        padding-right: 15px;
    }
    html body .container.select-plan__fold-section {
        padding-right: 0px;
    }
    
    html body .select-plan__fold-section .title-wrap {
        padding-right: 15px;
    }
    html body .select-plan__benfits-section {
        padding-right: 0px;
        padding-left: 15px;
    }
    
    html body .select-plan__categories-selection__container__categories {
        padding-right: 0px !important;
    }
    
    html body .select-plan__categories-selection__container__title,
    html body .container.shahry-addons-container {
        padding-right: 30px;
    }
    html body .contactFaq.container {
        width: calc(100% - 30px);
        left: -6px;
    }
    html body .slick-next[aria-disabled="true"] span, 
    html body .slick-prev[aria-disabled="true"] span, 
    html body .slick-next[aria-disabled="true"] i, 
    html body .slick-prev[aria-disabled="true"] i {
        color:#a5a3a3 !important;
        
    }
    /* html body .plan-container-card  .slick-dots li.slick-active button,
    html body .addOnsCard .slick-dots li.slick-active button,
    html body .select-plan__categories-selection__container__categories .slick-dots li.slick-active button{
        width: 15px!important;
        margin-right: 5px!important;
        
    }
    html body .select-plan__categories-selection__container__categories .slick-dots li.slick-active,
    html body .addOnsCard .slick-dots li.slick-active,
    html body .plan-container-card .slick-dots li.slick-active{
        margin-right: 10px!important;
    } */
    /* html body .plan-container-card .slick-dots li,
    html body .addOnsCard .slick-dots li,
    html body .select-plan__categories-selection__container__categories .slick-dots li{
        width: 16px !important;
    } */
    html body .plan-container-card .slick-dots li.slick-active button,
    html body .addOnsCard .slick-dots li.slick-active button,
    html body .select-plan__categories-selection__container__categories .slick-dots li.slick-active button{
        background-color: #333333 !important;
    }
    html body .plan-container-card .slick-dots li:not(.slick-active) button,
    html body .addOnsCard .slick-dots li:not(.slick-active) button,
    html body .select-plan__categories-selection__container__categories .slick-dots li:not(.slick-active) button{
        width: 18px !important;
    }
    html body .plan-card__promotion-label {
        width: 100% !important;
    }
    .plan-container-card .slick-dots {
        bottom: 37px;
    }
}
@media screen and (max-width: 380px) {
    .plan-container-card .cta-wrap a.btn-inverse, 
    .plan-container-card .cta-wrap a.btn.btn-primary.btn-block ,
    html body .plan-container-card .btn {
        font-size: 11px !important;
    }

}
  .plan-container-card.Shahry .plan-card__benfit-text {
    display: flex;
    flex-direction: column;
    }
    .plan-container-card.Shahry .plan-card__benfit-text > div:nth-child(1){
        order: -8;
    }
    .plan-container-card.Shahry .plan-card__benfit-text > div:nth-child(2){
        order: -7;
    }
    .plan-container-card.Shahry .plan-card__benfit-text > div:nth-child(4){
        order: -6;
    }
    .plan-container-card.Shahry .plan-card__benfit-text > div:nth-child(5){
        order: -5;
    }
   .plan-container-card.Shahry .plan-card__benfit-text {
    display: flex;
    flex-direction: column;
    }
</style>