video.blade.php 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. @extends('layouts.frontend')
  2. @section('content')
  3. <div class="container" style="min-height: 450px;">
  4. <div class="row archivio-news">
  5. <br>
  6. <div class="title-section col-sm-12">
  7. <h1 style="width: 90%"><span>Archivio video</span></h1>
  8. </div>
  9. @foreach($videos as $video)
  10. <div class="col-sm-3">
  11. <div class="news-post image-post">
  12. <a href="{{$video->id}}" class="view-video"><img src="/files/videos/{{$video->image}}" alt="" class="img-responsive"></a>
  13. <div class="post-content">
  14. <h2><a href="{{$video->id}}">{{$video->title}}</a></h2>
  15. <ul class="post-tags">
  16. <li><i class="fa fa-clock-o"></i>{{date("d/m/Y", strtotime($video->date))}}</li>
  17. </ul>
  18. </div>
  19. </div>
  20. </div>
  21. @endforeach
  22. </div>
  23. </div>
  24. @stop
  25. @section('extra_js')
  26. <script>
  27. $( document ).ready(function() {
  28. var $overlay = $('<div id="overlay" class="overlay" style="position: fixed;background: $black;width: 100%;height: 100%;top: 0;left: 0;text-align: center;z-index: 999999 !important;display: none;"></div>');
  29. var $iframe = $('<iframe width="595" height="485" frameborder="0" marginwidth="0" margin="0" height="0" scrolling="no" style="margin-top:10%" allowfullscreen></iframe>');
  30. $overlay.append($iframe);
  31. // append overlay to body
  32. $('body').append($overlay);
  33. $('a.view-video').click(function(event) {
  34. event.preventDefault();
  35. var id = $(this).attr('href');
  36. var src = '/video/' + id;
  37. console.log(src);
  38. // update overlay with iframe
  39. $iframe.attr('src', src);
  40. // show overlay
  41. $overlay.show();
  42. });
  43. // when overlay is clicked
  44. $overlay.click(function() {
  45. // hide overlay
  46. $overlay.hide();
  47. $iframe.attr('src', '');
  48. });
  49. });
  50. </script>
  51. @stop