

<?php $__env->startSection('container_content'); ?>

<section class="box">
    <div class="container-fluid">
        <div class="loops">
            <h3 class="title wow fadeInUp">Loops</h3>
            <div class="row">
                <div class="<?php echo e(($currentLoop && $currentLoop['month']) ? 'col-lg-7' : 'col-lg-12'); ?> ">
                    <div class="items">
                        <div class="content">
                            <div class="row">
                                <div class="col-6">
                                    <div class="cur-loops">
                                        <h6>Current loops</h6>
                                        <?php $__currentLoopData = $currentLoops; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $userLoop): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                            <a href="<?php echo e(route('loops.details', [ 'loop_id'=> $userLoop['id'] ])); ?>">
                                                <span><?php echo e($userLoop['month']); ?></span>
                                            </a>
                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                    </div>
                                </div>

                                <div class="col-6">
                                    <div class="prev-loops">
                                        <h6>previous loops</h6>
                                        <?php $__currentLoopData = $prevLoops; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $userLoop): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                            <a href="<?php echo e(route('loops.details', [ 'loop_id'=> $userLoop['id'] ])); ?>">
                                                <span><?php echo e($userLoop['month']); ?></span>
                                            </a>
                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <?php if($currentLoop && $currentLoop['month']): ?>
                <div class="col-lg-4 offset-lg-1">
                    <div class="items">
                        <h6><?php echo e(date('F Y')); ?></h6>
                        <div class="join-loops mb-2">
                            <!-- <span>feb</span> -->
                            <a href="<?php echo e(route('loops.available')); ?>">
                                <span><?php echo e($currentLoop['month']); ?></span>
                            </a>
                        </div>
                        <p>remaining to close</p>
                        <ul class="countdown-date">
                            <li><span id="days"></span>D : </li>
                            <li><span id="hours"></span>H : </li>
                            <li><span id="minutes"></span>M : </li>
                            <li><span id="seconds"></span>S</li>
                        </ul>
                    </div>
                </div>
                <?php endif; ?>
            </div>
        </div>
    </div>
</section>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('container_js'); ?>
<?php if($currentLoop && $currentLoop['end_date']): ?>
<script>
    // date countdown -----------------
    const second = 1000,
        minute = second * 60,
        hour = minute * 60,
        day = hour * 24,
        week = hour * 24 * 7;

    // let countDown = new Date('Nov 29, 2020 12:30:00').getTime(),
    let countDown = new Date('<?php echo e($currentLoop["end_date"]); ?>').getTime(),
        x = setInterval(function() {

            let now = new Date().getTime(),
                distance = countDown - now;

            document.getElementById('days').innerText = Math.floor(distance / (day)),
                document.getElementById('hours').innerText = Math.floor((distance % (day)) / (hour)),
                document.getElementById('minutes').innerText = Math.floor((distance % (hour)) / (minute)),
                document.getElementById('seconds').innerText = Math.floor((distance % (minute)) / second);
        }, second)
</script>
<?php endif; ?>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('web.layouts.layout', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH D:\wamp64\www\gam3iea\resources\views/web/loops/index.blade.php ENDPATH**/ ?>