<?php echo $__env->make('layout.header', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
<?php
    $website = website_header();
?>

<style>
    iframe {
        height: 240px !important;
    }
</style>
<!-- HEADER START -->
<div class="header_container">
    <div class="page_container w-100">
        <div class="d-flex align-items-center justify-content-between">
            <div class="logo_box d-flex align-items-center">
                <img src="<?php echo e(asset($website->logo)); ?>" alt="" />
                <p class="mb-0 f18">Open with an app</p>
            </div>
            <div class="download_box">
                <a href="<?php echo e(url('/download/apk')); ?>"><img src="<?php echo e(asset('assets/img/download-icon.png')); ?>" /></a>
            </div>
        </div>
    </div>
</div>
<!-- HEADER END -->

<!-- UNDER HEADER START -->
<div class="under_header_container">
    <div class="page_container">
        <div class="d-flex flex-column justify-content-center align-items-center">
            <h6 class="mb-0 fw-bold" style="font-size: 25px;"><?php echo e(env('APP_NAME')); ?></h6>
            <p class="mb-0">Quality Guarantee</p>
        </div>
    </div>
</div>
<!-- UNDER HEADER END -->

<!-- HERO START -->
<div class="hero_container">
    <div class="slider">
        <?php $__currentLoopData = $banners; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $banner): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
            <?php if($banner->type == 'image'): ?>
                <img style="object-fit: contain; height:350px !important;"
                    src="<?php echo e(asset('assets/img/' . $banner->path)); ?>" alt="<?php echo e($banner->banner_title); ?>" />
            <?php else: ?>
                <?php echo $banner->path; ?>

            <?php endif; ?>
        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
    </div>
</div>
<!-- HERO END -->

<!-- LISR START -->
<?php if(!env('NEW_HOME_PAGE', true)): ?>
    <!-- LISR START -->
    <div class="list_container mt-4">
        <div class="container-fluid">
            <div class="row gx-2 gy-2">
                <?php $__currentLoopData = $products; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $product): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <div class="col-6">
                        <div class="card_ py-2 px-3">
                            <a class="text-decoration-none text-dark" href="<?php echo e(url('/product/' . $product->id)); ?>">
                                <img class="w-100" style="object-fit: contain;"
                                    src="<?php echo e(asset('assets/img/' . $product->image)); ?>" alt="" />
                                <p class="mb-0 f14 mt-3">
                                    <?php echo e($product->title); ?>

                                </p>
                                <p class="mb-0 f14 gray my-1">
                                    <?php echo e($product->title); ?>

                                </p>
                                <p class="f14 fw500 mb-0">₹ <?php echo e($product->price); ?></p>
                            </a>
                        </div>
                    </div>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            </div>
        </div>
    </div>
    <!-- LISR END -->
<?php else: ?>
    <!-- LISR START -->
    <div class="list_container mt-4">
        <div class="container-fluid">
            <div class="row gx-2 gy-2">
                <div class="col-6">
                    <div class="card_ py-2 px-3">
                        <img class="w-100" style="object-fit: contain;"
                            src="<?php echo e(asset('assets/img/logos/aviator.png')); ?>" alt="" />
                        <?php if(env('ENABLE_AVIATOR', false)): ?>
                            <button id="play-now-btn" class="btn btn-primary mt-3 w-100"
                                style="font-size: 14px; background-color: #28a745; border-color: #28a745;">
                                Play Now
                            </button>
                        <?php else: ?>
                            <p class="mb-0 f14 mt-3">
                                Coming soon....
                            </p>
                        <?php endif; ?>
                        <script>
                            document.getElementById('play-now-btn').addEventListener('click', function() {
                                <?php if(Auth::check()): ?>
                                    let aviator_game_url = "<?php echo e(Auth::user()->aviator_game_url); ?>";

                                    if (!aviator_game_url) {
                                        toastShow("Loading Game...");
                                        // If token is null, make an AJAX request to get the token
                                        $.ajax({
                                            url: '<?php echo e(route('get.aviator.token')); ?>', // Route to get the aviator token
                                            method: 'GET',
                                            success: function(response) {
                                                if (response.success && response.gameUrl) {
                                                    gameUrl = response.gameUrl;
                                                    window.location.href = gameUrl;
                                                } else {
                                                    toastShow("Error From API: " + response.message);
                                                }
                                            },
                                            error: function() {
                                                toastShow("Error occurred while retrieving game token. Please try again.");
                                            }
                                        });
                                    } else {
                                        // If token exists, directly open the game URL
                                        window.location.href = aviator_game_url;
                                    }
                                <?php else: ?>
                                    toastShow("Please Login To Play The Game");
                                <?php endif; ?>
                            });
                        </script>
                    </div>
                </div>
                <div class="col-6">
                    <div class="card_ py-2 px-3">
                        <a href="<?php echo e(url('/user/gameDashboard')); ?>" class="text-decoration-none text-dark">
                            <img class="w-100" style="object-fit: contain;"
                                src="<?php echo e(asset('assets/img/logos/color.jpeg')); ?>" alt="" />
                            <button class="btn btn-primary mt-3 w-100"
                                style="font-size: 14px; background-color: #28a745; border-color: #28a745;">
                                Play Now
                            </button>
                        </a>
                    </div>
                </div>
                <div class="col-6">
                    <div class="card_ py-2 px-3">
                        <a target="_blank" href="<?php echo e($website->whatsapp); ?>" class="text-decoration-none text-dark">
                            <img class="w-100" style="object-fit: contain;"
                                src="https://upload.wikimedia.org/wikipedia/commons/thumb/6/6b/WhatsApp.svg/640px-WhatsApp.svg.png"
                                alt="" />
                            <button class="btn btn-primary mt-3 w-100"
                                style="font-size: 14px; background-color: #28a745; border-color: #28a745;">
                                Contact us
                            </button>
                        </a>
                    </div>
                </div>
                <div class="col-6">
                    <div class="card_ py-2 px-3">
                        <a class="text-decoration-none text-dark">
                            <img class="w-100" style="object-fit: contain;"
                                src="<?php echo e(asset('assets/img/logos/dragon.png')); ?>" alt="" />
                            <p class="mb-0 f14 mt-3">
                                Coming soon....
                            </p>
                        </a>
                    </div>
                </div>
                <div class="col-6">
                    <div class="card_ py-2 px-3">
                        <a class="text-decoration-none text-dark">
                            <img class="w-100" style="object-fit: contain;"
                                src="<?php echo e(asset('assets/img/logos/andar.png')); ?>" alt="" />
                            <p class="mb-0 f14 mt-3">
                                Coming soon....
                            </p>
                        </a>
                    </div>
                </div>
                <div class="col-6">
                    <div class="card_ py-2 px-3">
                        <a class="text-decoration-none text-dark">
                            <img class="w-100" style="object-fit: contain;"
                                src="<?php echo e(asset('assets/img/logos/jhanda.png')); ?>" alt="" />
                            <p class="mb-0 f14 mt-3">
                                Coming soon....
                            </p>
                        </a>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!-- LISR END -->
<?php endif; ?>
<!-- LISR END -->

<?php echo $__env->make('layout.footer', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
<?php /**PATH /home/shyambabamatka/public_html/zupitogames.com/resources/views/home.blade.php ENDPATH**/ ?>