<?php $__env->startSection('isMobile'); ?>
<div class="content my01">

  <?php echo $__env->make('nav_saldo', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>

  
  <div class="container pt-1 sub-games">
    <h3 class="title">SLOTS PROVIDERS</h3>

    <div class="scroll-wrapper row" style="height:72px;">
      <div class="left">
        <button class="prev-btn btn" id="left-button">
          <i class="icon-keyboard_arrow_left"></i>
        </button>
      </div>

      <div class="scroller" style="overflow:hidden;width:100%;">
        <div class="row no-gutters text-center slider-content">
          <div class="col" style="height:72px;">
            <a class="btn-box active" href="/slots/pragmatic-play">
              <img src="https://files.sitestatic.net/images/ppslot.gif?v=1"
                   style="width:70px;height:50px;">
              <h5 class="game-title">PRAGMATIC</h5>
            </a>
          </div>

          <div class="col" style="height:72px;">
            <a class="btn-box" href="/slots/pgsoft">
              <img src="https://files.sitestatic.net/images/pgsoft.gif?v=0.2"
                   style="width:70px;height:50px;">
              <h5 class="game-title">PGSOFT</h5>
            </a>
          </div>

          <div class="col" style="height:72px;">
            <a class="btn-box" href="/slots/joker-gaming">
              <img src="https://files.sitestatic.net/assets/imgs/game_logos/100x70/jk_slot.png?v=0.1"
                   style="width:70px;height:50px;">
              <h5 class="game-title">JOKER</h5>
            </a>
          </div>
          
        </div>
      </div>

      <div class="right">
        <button class="next-btn btn" id="right-button">
          <i class="icon-keyboard_arrow_right"></i>
        </button>
      </div>
    </div>

    
    <div class="row no-gutters filter mt-2">
      <div class="col-xs-10 text-center">
        <div class="row">
          <div class="col-xs-3">
            <button class="btn btn-clear f" data-filter="NEW">BARU</button>
          </div>
          <div class="col-xs-3">
            <button class="btn btn-clear f" data-filter="TOP">TOP</button>
          </div>
          <div class="col-xs-3">
            <button class="btn btn-clear f active" data-filter="ALL">SEMUA</button>
          </div>
        </div>
      </div>
      <div class="col-xs-1 text-right">
        <button class="btn btn-clear" data-trigger="nifty" data-target="#searchModal">
          <i class="icon-magnifier"></i>
        </button>
      </div>
      <div class="col-xs-1 text-right">
        <button class="btn btn-clear" data-trigger="nifty" data-target="#filterModal">
          <i class="icon-equalizer2"></i>
        </button>
      </div>
    </div>

    <div class="mobile-border"></div>
    <div class="mobile-border"></div>

    

<input type="hidden" id="hiddenGameCode">

<div class="row games no-gutters">
    <?php if(isset($gamelist) && $gamelist->count()): ?>
        <?php $__currentLoopData = $gamelist; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $game): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
            <a class="col-xs-4 col-md-3 game-box text-center"
               data-title="<?php echo e($game->game_name); ?>"
               data-filter="ALL,slot,TOP,NEW"
               onclick="showGameLinks(
                   event,
                   '<?php echo e($game->game_name); ?>',
                   '<?php echo e(asset($game->game_image)); ?>',
                   '<?php echo e($game->game_code); ?>'
               )">

                <div class="content-wrapper">
                    <img class="lazy"
                         data-src="<?php echo e(asset($game->game_image)); ?>"
                         alt="<?php echo e($game->game_name); ?>">
                </div>

                <h5><?php echo e($game->game_name); ?></h5>
            </a>
        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
    <?php else: ?>
        <p class="text-center">No games available.</p>
    <?php endif; ?>
</div>
  </div>

  
  <div class="nifty-modal slide-in-bottom" id="gamelinksModal-1">
    <div class="md-content">
      <div class="md-body">
        <div class="row mb-4 no-gutters">
          <div class="col-xs-5">
            <img src="" class="img-fluid" id="gamePreviewImg">
          </div>
          <div class="col-xs-7">
            <div class="g-title"></div>
          </div>
        </div>

        <button class="btn btn-primary btn-block" onclick="launchGame(event)">
          MAIN SEKARANG
        </button>
      </div>
    </div>
  </div>
  <div class="md-overlay"></div>

  
  <div class="nifty-modal slide-in-bottom" id="searchModal">
    <div class="md-content">
      <div class="md-body">
        <div class="search_filter">
          <input type="text" placeholder="Search" class="search" id="searchInput">
          <button class="btn srch_button" id="clearSearch">
            <i class="icon-x-square"></i>
          </button>
        </div>
      </div>
    </div>
  </div>
  <div class="md-overlay"></div>

</div>


<?php if(Auth::check()): ?>
<script>
function showGameLinks(e, name, imgSrc, gameCode) {
  e.preventDefault();
  $('#gamelinksModal-1 .g-title').text(name);
  $('#gamePreviewImg').attr('src', imgSrc);
  $('#hiddenGameCode').val(gameCode);
  $('#gamelinksModal-1').nifty('show');
}

function launchGame(e) {
  e.preventDefault();

  let gameCode = $('#hiddenGameCode').val();

  $.ajax({
    type: 'POST',
    url: "<?php echo e(route('game.launch')); ?>",
    data: {
      _token: "<?php echo e(csrf_token()); ?>",
      game_code: gameCode
    },
    beforeSend() {
      $('#loader').show();
    },
    success(res) {
      $('#loader').hide();
      if (res.status === true && res.url) {
        window.open(res.url, '_blank');
      } else {
        Swal.fire('Gagal', res.message ?? 'Game gagal dibuka', 'error');
      }
    },
    error() {
      $('#loader').hide();
      Swal.fire('Error', 'Terjadi kesalahan sistem', 'error');
    }
  });
}
</script>
<?php else: ?>
<script>
function launchGame() {
  Swal.fire('Warning', 'Silakan login terlebih dahulu', 'warning');
}
</script>
<?php endif; ?>

<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.main', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/ybjqutnd/jp.royalkingz.top/resources/views/games/slots/fastspin.blade.php ENDPATH**/ ?>