<?php 
/**
 * Ahead WebSoft Technologies Pvt Ltd.
 * @copyright  Copyright 2006-2026 Ahead WebSoft Technologies Pvt Ltd.
 * @license    https://www.socialengine.com/policies
*/
?>
<?php $allParams = $this->allParams; ?>
<div class="pulse_lp_banner">
  <div class="container">
    <div class="pulse_lp_banner_section">
      <?php if($allParams['title']) { ?> 
        <h3 class="pulse_title"><?php echo $this->translate($allParams['title']); ?></h3>
      <?php } ?>
      <div class="pulse_lp_banner_section_row">
        <div class="pulse_lp_banner_section_row_left">
          <?php if($allParams['description']) { ?> 
            <p class="pulse_description"><?php echo $this->translate($allParams['description']); ?></p>
          <?php } ?>
          <ul class="pulse_lp_banner_counter">
            <?php for($i=1;$i<=4;$i++) { ?>
              <?php if( !empty($allParams['count' .$i]) || !empty($allParams['headinglink' .$i]) || !empty($allParams['text' .$i]) ) { ?>
                <li>
                  <?php if(!empty($allParams['count'.$i])) { ?>
                    <h4>
                      <span class="count" data-count="<?php echo $this->translate($allParams['count'.$i]); ?>">
                      0
                      </span> 
                      +
                    </h4>
                  <?php } ?> 
                  <?php if(!empty($allParams['text'.$i])) { ?>
                    <p>
                      <?php echo $this->translate($allParams['text'.$i]); ?> 
                    </p>
                  <?php } ?> 
                </li>
              <?php } ?>
            <?php } ?>
          </ul>
          <div class="pulse_lp_banner_counter_btn">
            <?php if($allParams['btntextlink']) { ?> 
              <a href="<?php echo $this->translate($allParams['btntextlink']); ?>" class="btn btn-primary">
                <?php echo $this->translate($allParams['btntext']); ?>
              </a>
            <?php } ?>
          </div>
        </div>
        <figure>
          <?php if(!empty($allParams['photo' . $i])) { ?>
            <?php $path = Engine_Api::_()->core()->getFileUrl($allParams['photo' . $i], true); ?>
            <img src="<?php echo $path['image']; ?>" height="" width="" alt="<?php echo $path['alt_text'] ? $path['alt_text'] : 'Features Icon'; ?>" />
          <?php } else { ?>
            <img src="application/modules/Pulse/externals/images/bannerimg.png" height="" width="" alt="Features Icon" />
          <?php } ?>
        </figure>
      </div>
    </div>
  </div>  
</div>  
<script type="text/javascript">
   var counted = 0;
  scriptJquery(window).ready(function() {
   var oTop = scriptJquery('.pulse_lp_banner_counter').offset().top - window.innerHeight;
    if (counted == 0 && scriptJquery(window).scrollTop() > oTop) {
     scriptJquery('.count').each(function() {
       var $this = scriptJquery(this),
         countTo = $this.attr('data-count');
       scriptJquery({
         countNum: $this.text()
       }).animate({
           countNum: countTo
         },
         {
           duration: 5000,
           easing: 'swing',
           step: function() {
             $this.text(Math.floor(this.countNum));
           },
           complete: function() {
             $this.text(this.countNum);
             //alert('finished');
           }
         });
     });
     counted = 1;
    }
  });
</script>
