/
home
/
obinna
/
html
/
app
/
storage
/
framework
/
views
/
Upload File
HOME
<?php echo $__env->make('layout.header', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?> <link rel="stylesheet" href="/css/post.css" /> <div class="posts-header"> <div class="left"> <div class="posts-wrap sample-post-wrap"> <div class="posts"> <div class="post"> <p class="top-meta"><b><?php echo e($category); ?></b> <?php echo e(date('F m, Y', strtotime($special->post_date))); ?></p> <a href="<?php echo e($special->url); ?>" style="color: #fff;"> <h2><?php echo e($special->post_title); ?></h2> </a> <p class="bottom-meta"><i>By</i> <a href="/author/<?php echo e($special->author_url); ?>" class="aa"><?php echo e($special->author); ?></a></p> </div> </div> <img src="<?php echo e($special->thumbnail); ?>"> <div class="inner"></div> </div> </div> <div class="right"> <h1><?php echo e($category); ?></h1> </div> </div> <div class="inline-post-wrap"> <div class="wrap"> <div class="row"> <?php $__currentLoopData = $posts; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $post): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <div class="col-md-3"> <a href="<?php echo e($post->url); ?>"> <div class="inline-post"> <div class="img-wrap"> <img src="<?php echo e($post->thumbnail); ?>"> </div> <p><b><?php echo e(date('d.m.y', strtotime($post->post_date))); ?></b> <a style="color:#575756;padding-left:10px;"><?php echo e($category); ?></a></p> <a href="<?php echo e($post->url); ?>"> <h2><?php echo e($post->post_title); ?></h2> <h4><?php echo e($post->post_excerpt); ?></h4> </a> </div> </a> </div> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> </div> <div id="morePost" class="row"> </div> <div style="text-align: center"> <!-- <button class="paginate">$posts</button> --> <?php if($posts->total() > $posts->perPage()): ?> <?php if($posts->currentPage() != $posts->lastPage()): ?> <button class="btn-more" id="loadMore">More Post</button> <div class="loading"><span></span></div> <?php endif; ?> <?php endif; ?> </div> </div> </div> <style> .loading{ height: 2px; width: 230px; margin: 0 auto; position: relative; display: none; } .loading::after{ background: red; height: 2px; width: 20px; content: ''; position: absolute; left: 0; animation: move 5s infinite; } @keyframes move{ from{width:20px;} to{width: 230px;} } </style> <?php echo $__env->make('layout.footer', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?> <script> const category = "<?php echo $category;?>"; var page = 1; $('#loadMore').on('click',function(e){ e.preventDefault(); page = page + 1; console.log(page) $('.loading').css('display','block'); $.get("/getPostsByCategoryJson/"+category+"?page="+page) .success(function(response){ if(response.last_page == response.current_page){ $('#loadMore').css('display','none'); } var obj = []; obj.push(response.data); $.each(obj, function() { $.each(this, function(key, value) { var result = ` <div class="col-md-3"> <a href="${value.url}"> <div class="inline-post"> <div class="img-wrap"> <img src="${value.thumbnail}"> </div> <p><b>${value.post_date}</b> <a style="color:#575756;padding-left:10px;"><?php echo e($category); ?></a></p> <a href="${value.url}"> <h2>${value.post_title}</h2> <h4>${value.post_excerpt}</h4> </a> </div> </a> </div> `; $('#morePost').append(result) }); }); $('.loading').css('display','none'); }) .error(function(error){ $('.loading').css('display','none'); console.log(error); }) }) </script> <style> .aa{ color: #ff0b3a !important; } .aa:hover{ text-decoration: underline !important; color:#ff0b3a !important; } .posts-wrap{ width: 100%; overflow: hidden; padding: 60px 0px; } .posts-wrap .wrap{ width: 80%; } .posts h2{ width: auto; }.inline-post { padding-bottom: 40px; } @media(max-width:768px){ .posts-wrap{ padding: 30px 0px; } } </style><?php /**PATH C:\xampp\htdocs\fij\resources\views/posts.blade.php ENDPATH**/ ?>