gallery.blade.php 4.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <div class="row">
  2. @forelse($postPage['Page'] ?? [] as $post)
  3. @php
  4. if($post){
  5. if(strpos($postType['C3'], 'youtube') !== false){
  6. $url = $post['T1'];
  7. $parts = explode('embed/', $url);
  8. if(count($parts) == 2) {
  9. $href = $parts[0].'watch?v='.$parts[1];
  10. }
  11. }else{
  12. $href = $post['T1'];
  13. }
  14. }
  15. @endphp
  16. <div class="{{ $post['PcGalleryClass'] }} {{ $post['MoGalleryClass'] }}">
  17. <div class="blog-card">
  18. <div class="blog-media">
  19. @if ($postType['C5'] === 'gallery')
  20. <a class="blog-img" href="{{ route('dbrbbs.details', [$postCode, $post['C10']]) }}" onclick="openInNewWindow(event, '{{ $href }}')">
  21. {{-- <div class="mask"><i class="fa-solid fa-caret-right"></i></div>--}}
  22. <img :width="this.galleryWidth" :height="this.galleryHeight" src="{{ msset($post['C1']) }}" alt="blog">
  23. </a>
  24. @else
  25. <a class="video-img" href="{{ route('dbrbbs.details', [$postCode, $post['C10']]) }}" onclick="openInNewWindow(event, '{{ $href }}')">
  26. <iframe class="w-100" :width="this.galleryWidth" :height="this.galleryHeight" src="{{ $post['T1'] }}" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>
  27. </a>
  28. @endif
  29. </div>
  30. <div class="blog-content">
  31. <ul class="blog-meta">
  32. <li>
  33. <i class="fas fa-user"></i>
  34. <span>{{ $post['C9'] }}</span>
  35. </li>
  36. <li>
  37. <i class="fas fa-calendar-alt"></i>
  38. <span>{{ $post['C4'] }}</span>
  39. </li>
  40. </ul>
  41. <h4 class="blog-title">
  42. <a href="{{ route('dbrbbs.details', [$postCode, $post['C10']]) }}" onclick="openInNewWindow(event, '{{ $href }}')">{!! $post['Title'] !!}</a>
  43. </h4>
  44. @if ($postType['C5'] === 'gallery')
  45. <p class="blog-desc">
  46. {{ $post['C7'] }}
  47. </p>
  48. @else
  49. @php
  50. if (isset($post['T1']) && strpos($post['T1'], 'embed') !== false) {
  51. $parts = explode('embed/', $post['T1']);
  52. if(count($parts) == 2) {
  53. $post['T1'] = $parts[0].'watch?v='.$parts[1];
  54. }
  55. }
  56. @endphp
  57. <div class="d-flex align-items-center">
  58. <button class="btn-primary w-100"
  59. onclick="window.location.href = '{{ route('dbrbbs.details', [$postCode, $post['C10']]) }}'"
  60. style="margin-right: 10px;">
  61. 동영상 보기
  62. </button>
  63. <button class="btn-danger w-100"
  64. onclick="window.open('{{ $post['T1'] }}', '_blank')">
  65. 유튜브 보기
  66. </button>
  67. </div>
  68. @endif
  69. </div>
  70. </div>
  71. </div>
  72. @empty
  73. <div class="pricing_box1 full_width">
  74. 데이터가 존재하지 않습니다
  75. </div>
  76. @endforelse
  77. </div>
  78. <script>
  79. function openInNewWindow(event, href) {
  80. event.preventDefault();
  81. window.open(href, '_blank');
  82. }
  83. </script>