gallery-detail.blade.php 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6. <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  7. <title>相册</title>
  8. <link rel="shortcut icon" href="/static//static/images/favicon.ico" type="image/x-icon">
  9. <link rel="icon" href="/static//static/images/favicon.ico" type="image/x-icon">
  10. <link rel="stylesheet" href="/static/css/swiper-bundle.min.css">
  11. <link rel="stylesheet" href="/static/css/font-awesome.min.css">
  12. <link rel="stylesheet" href="/static/css/magnific-popup.min.css">
  13. <link rel="stylesheet" href="/static/css/animate.min.css">
  14. <link rel="stylesheet" href="/static/js/layui/css/layui.css">
  15. <link rel="stylesheet" href="/static/css/main.css">
  16. </head>
  17. <style>
  18. .video-hover-container {
  19. position: relative;
  20. display: inline-block;
  21. }
  22. .video-hover-container img,
  23. .video-hover-container video {
  24. display: block;
  25. object-fit: cover;
  26. }
  27. .video-hover-container a {
  28. display: block;
  29. position: relative;
  30. }
  31. /* Spinner styles */
  32. .spinner {
  33. width: 40px;
  34. height: 40px;
  35. border: 4px solid #fff;
  36. border-top: 4px solid transparent;
  37. border-radius: 50%;
  38. animation: spin 1s linear infinite;
  39. }
  40. @keyframes spin {
  41. 0% { transform: rotate(0deg); }
  42. 100% { transform: rotate(360deg); }
  43. }
  44. </style>
  45. <body class="main-body">
  46. <div class="menu-overlay"></div>
  47. <main class="main">
  48. <section class="gallery">
  49. {{-- @include('__sidebar', ['foldersTree'=> $foldersTree,'active'=>true])--}}
  50. <div class="update-content">
  51. <div class="update-log" >
  52. <a href="/update-log" class="update-log-link">
  53. <div class="timestamp"><i class="fa fa-volume-up"></i> <span class="update-time">&nbsp;</span> <span class="user_name">&nbsp;</span> <span class="action">&nbsp;</span> <span class="model">&nbsp;</span> <span class="highlight log-content">&nbsp;</span></div>
  54. </a>
  55. {{-- <a href="javascript:void(0)" onclick="logout()" class="login-out-link">--}}
  56. {{-- 退出登录--}}
  57. {{-- </a>--}}
  58. <div class="clear"></div>
  59. </div>
  60. </div>
  61. <div class="content-page gallery-content gallery-wrap">
  62. <div class="content-inner">
  63. <div class="title-wrapper" style="margin-left: 0">
  64. <h2 class="title">{{$album['model']}}</h2>
  65. <div class="subtitle">
  66. <p></p>
  67. </div>
  68. </div>
  69. <div class="album-tab">
  70. @foreach($showTabs as $tab)
  71. <a href="#album-{{$tab['column']}}" @if($loop->first)class="is-active"@endif column={{$tab['column']}}>{{$tab['title']}}</a>
  72. @endforeach
  73. </div>
  74. <!-- Album Animals START -->
  75. <div class="gallery-album-line">
  76. <a href="javascript:history.back();" class="gallery-album-prev"><i class="fa fa-angle-double-left"></i> 返回 </a>
  77. <a href="javascript:void(0);" class="download-all">下载全部 <i class="fa fa-download"></i></a>
  78. </div>
  79. @foreach($showTabs as $tab)
  80. <div class="grid-album @if($loop->first)gallery-album is-active @endif" id="album-{{$tab['column']}}">
  81. @php
  82. $content = json_decode($album[$tab['column']], true);
  83. @endphp
  84. @if (empty($content))
  85. 数据为空
  86. @endif
  87. @if ($tab['column'] == 'video' || $tab['column'] == 'pdf')
  88. @if ($tab['column'] == 'video' && empty($content) == false)
  89. <?php
  90. //$content倒序
  91. $content = array_reverse($content);
  92. ?>
  93. <table class="album_table">
  94. <thead>
  95. <tr>
  96. <th>图片</th>
  97. <th>中文标题</th>
  98. <th>英文标题</th>
  99. <th>操作</th>
  100. </tr>
  101. </thead>
  102. <tbody>
  103. @foreach($content as $item)
  104. <tr>
  105. <td class="video-hover-container">
  106. <a href="{{ossUrl($item['cover'])}}" target="_blank">
  107. <img src="{{ossUrl($item['cover'])}}?x-oss-process=image/resize,w_260" class="void-img" data-index="{{$loop->index}}" data-preview="{{ossUrl($item['preview_url'])}}" data-poster="{{ossUrl($item['cover'])}}?x-oss-process=image/resize,w_260">
  108. </a>
  109. </td>
  110. <td>
  111. {{@$item['video_title']}}
  112. </td>
  113. <td>
  114. {{@$item['video_en_title']}}
  115. </td>
  116. <td>
  117. <button data-src="{{ossUrl($item['video_src'])}}" class="video-btn">播放</button>
  118. <a href="/download?url={{urlencode(ossUrl($item['video_src']))}}" download class="download-btn" target="_blank"><button>下载</button></a>
  119. </td>
  120. </tr>
  121. @endforeach
  122. </tbody>
  123. </table>
  124. <br/>
  125. @endif
  126. @if ($tab['column'] == 'pdf' && empty($content) == false)
  127. <table class="album_table">
  128. <thead>
  129. <tr>
  130. <th>PDF标题</th>
  131. <th>PDF标题(英文)</th>
  132. <th width="15%">操作</th>
  133. </tr>
  134. </thead>
  135. <tbody>
  136. @foreach($content as $item)
  137. <tr>
  138. <td>{{$item['pdf_title']}}</td>
  139. <td>{{@$item['pdf_title_en']}}</td>
  140. <td>
  141. <a href="/download?url={{urlencode(ossUrl($item['pdf_src']))}}" download class="download-btn" target="_blank"><button>下载</button></a>
  142. </td>
  143. </tr>
  144. @endforeach
  145. </tbody>
  146. </table>
  147. <br/>
  148. @endif
  149. @elseif ($tab['column'] == 'parameters' && empty($content) == false)
  150. <table class="album_table">
  151. <thead>
  152. <tr>
  153. <th>属性名</th>
  154. <th>属性值</th>
  155. </tr>
  156. </thead>
  157. <tbody>
  158. @foreach($content as $item)
  159. <tr>
  160. <td>{{$item['key']}}</td>
  161. <td>
  162. {{$item['value']}}
  163. </td>
  164. </tr>
  165. @endforeach
  166. </tbody>
  167. </table>
  168. @else
  169. <div class="grid-sizer"></div>
  170. @foreach($content as $item)
  171. <div class="grid-item album-item">
  172. <div class="album-thumb album-thumb-detail">
  173. <img data-src="{{ossUrl($item)}}" src="{{ossUrl($item)}}?x-oss-process=image/resize,w_380" loading="lazy" alt="1">
  174. <div class="album-mask">
  175. <!-- 下载图标 -->
  176. <a href="javascript:void(0)" data-src="{{ossUrl($item)}}" download class="download-icon">
  177. <i class="fa fa-cloud-download"></i>
  178. </a>
  179. </div>
  180. </div>
  181. </div>
  182. @endforeach
  183. @endif
  184. </div>
  185. @endforeach
  186. <!-- Album Animals END -->
  187. </div><!-- end container-inner -->
  188. </div>
  189. <!-- 视频遮罩层 -->
  190. <div id="overlay" class="overlay">
  191. <div class="video-container">
  192. <video id="videoPlayer" controls>
  193. Your browser does not support the video tag.
  194. </video>
  195. </div>
  196. </div>
  197. </section> <!-- end gallery -->
  198. </main>
  199. {{--<footer class="site-footer">--}}
  200. {{-- <div class="footer-copyright">--}}
  201. {{-- © 2025 <strong>mietub</strong>. All rights reserved.--}}
  202. {{-- </div>--}}
  203. {{--</footer>--}}
  204. <script src="/static/js/jquery-3.7.0.min.js"></script>
  205. <script src="/static/js/swiper-bundle.min.js"></script>
  206. <script src="/static/js/wow.min.js"></script>
  207. <script src="/static/js/masonry.pkgd.min.js"></script>
  208. <script src="/static/js/imagesloaded.pkgd.min.js"></script>
  209. <script src="/static/js/magnific-popup.min.js"></script>
  210. <script src="/static/js/blazy.min.js"></script>
  211. <script src="/static/js/parazoom.min.js"></script>
  212. <script src="/static/js/layui/layui.js"></script>
  213. <script src="/static/js/script.js"></script>
  214. <script>
  215. $(document).ready(function() {
  216. $('.grid-album:first').addClass('');
  217. });
  218. // 视频预览播放
  219. $(document).ready(function() {
  220. $('.video-hover-container').each(function() {
  221. var $container = $(this);
  222. var $img = $container.find('img');
  223. $img.data('original-src', $img.attr('src'));
  224. });
  225. // Object to track load status using data-index as key
  226. var loadIndexes = {};
  227. var loadingVar = {};
  228. $('.video-hover-container').on('mouseenter', function(e) {
  229. e.preventDefault(); // Prevent link default behavior during hover
  230. var $container = $(this);
  231. var $img = $container.find('img');
  232. var $link = $container.find('a');
  233. var videoUrl = $img.data('preview');
  234. var posterUrl = $img.data('poster');
  235. var index = $img.data('index'); // Get the data-index value
  236. // Initialize loadIndexes[index] if not set
  237. if (!loadIndexes.hasOwnProperty(index)) {
  238. loadIndexes[index] = 0;
  239. }
  240. // Create loading overlay
  241. loadingVar[index] = $('<div>', {
  242. class: 'loading-overlay',
  243. css: {
  244. position: 'absolute',
  245. top: 0,
  246. left: 0,
  247. width: '100%',
  248. height: '100%',
  249. background: 'rgba(0,0,0,0.5)',
  250. display: 'flex',
  251. alignItems: 'center',
  252. justifyContent: 'center',
  253. zIndex: 10
  254. }
  255. }).append('<div class="spinner"></div>');
  256. // Create video element
  257. var $video = $('<video>', {
  258. src: videoUrl,
  259. poster: posterUrl,
  260. autoplay: true,
  261. muted: true,
  262. loop: true,
  263. css: {
  264. width: $img.width(),
  265. height: $img.height(),
  266. display: 'none' // Initially hidden until loaded
  267. }
  268. });
  269. if (loadIndexes[index] === 0 && videoUrl != "") {
  270. loadIndexes[index] = 1;
  271. $container.css('position', 'relative');
  272. $link.append(loadingVar[index]);
  273. }
  274. // When video can play
  275. $video.on('canplay', function() {
  276. if (loadIndexes[index] === 1) {
  277. loadIndexes[index] = 2;
  278. loadingVar[index].remove();
  279. $img.hide();
  280. $video.show();
  281. $link.append($video);
  282. }
  283. });
  284. // Maintain link functionality
  285. $link.on('click', function(e) {
  286. if ($video.is(':visible')) {
  287. e.preventDefault(); // Prevent click when video is showing
  288. }
  289. });
  290. });
  291. $('.video-hover-container').on('mouseleave', function() {
  292. var $container = $(this);
  293. var $img = $container.find('img');
  294. var index = $img.data('index'); // Get the data-index value
  295. if (loadIndexes[index] === 2 || loadIndexes[index] === 1) {
  296. loadIndexes[index] = 0;
  297. var $video = $container.find('video');
  298. var $loading = $container.find('.loading-overlay');
  299. $video.remove();
  300. $loading.remove();
  301. $img.show();
  302. }
  303. });
  304. });
  305. </script>
  306. </body>
  307. </html>