<?php $__env->startSection('content'); ?>
    <section class="gallery-sec gallery-pg">
        <div class="container">
            <!--<div class="row">-->
                <?php if(count($galleries)): ?>
                <div class="row galleries_container">
                    <?php $__currentLoopData = $galleries; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $gallery): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <div class="col-lg-4 col-md-6">
                            <a href="<?php echo e(asset($gallery->image)); ?>" data-fancybox="images">
                                <div class="gallery_card">
                                    <img src="<?php echo e(asset($gallery->image)); ?>" alt="" class="main-img"/>
                                    <span class="plus"></span>
                                    <h6 class="title"><?php echo e($gallery->title); ?></h6>
                                </div>
                            </a>
                        </div>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </div>
                <div class="col-md-12">
                    <a href="#" class="more-butn mt-4 show_more_link"> <i class="fas fa-spinner"></i><?php echo e(__('main.show_more')); ?></a>
                </div>
                <?php endif; ?>
            <!--</div>-->
        </div>
    </section>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('inner_js'); ?>
    <script>
        let showMoreGalleryRoute = "<?php echo e(route('showMoreGallery')); ?>",
            noMoreGalleriesAlert = "<?php echo e(__('photoGalleries.no_more_galleries')); ?>",
            skip = 0;

        $('.show_more_link').click(async function (e) {
            e.preventDefault();
            skip = skip + 6;

            if(!$(this).hasClass('show_more_link')){
                return false;
            }
            let url = showMoreGalleryRoute,
                data = {skip: skip},
                method = 'get';

            const response=await ajax({
                url,
                data,
                dataType: 'html',
                method
            });

            if(!response){
               $(this).toggleClass('w-25 show_more_link').html(noMoreGalleriesAlert);
            }
            if (response){
                $('.galleries_container').append(response);
            }

        });
    </script>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('web.layouts.container', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/balyomhost/public_html/fulath/resources/views/web/media_center/gallery/index.blade.php ENDPATH**/ ?>