video-coloring-page.ejs 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <link rel="icon" href="/assets/icon/favicon.ico" type="image/x-icon">
  7. <title><%= title %></title>
  8. <meta name="description" content="<%= description %>">
  9. <meta property="og:title" content="<%= title %>">
  10. <meta property="og:description" content="<%= description %>">
  11. <meta property="og:image" content="<%= data.poster %>">
  12. <meta property="og:type" content="website">
  13. <!-- MARK: Universal Link / Android App Link 的核心配置 -->
  14. <!-- 这些 meta 标签的值应该是完整的 HTTPS 链接,Facebook 会识别并尝试拉起 App -->
  15. <meta property="og:url" content="<%= applink %>" />
  16. <!-- **Universal Link 路径** -->
  17. <meta property="al:ios:url" content="<%= applink %>" />
  18. <!-- **Universal Link 路径** -->
  19. <meta property="al:ios:app_store_id" content="1575480118" /> <!-- **iOS App Store ID** -->
  20. <meta property="al:ios:app_name" content="Art Number Coloring Book" /> <!-- **iOS 应用名称** -->
  21. <meta property="al:android:package" content="com.pcoloring.art.puzzle.color.by.number" /> <!-- **Android 包名** -->
  22. <meta property="al:android:url" content="<%= applink %>>" />
  23. <!-- ** Universal Link 路径** -->
  24. <meta property="al:android:app_name" content="Art Number Coloring Book" /> <!-- **Android 应用名称** -->
  25. <meta name="apple-itunes-app" content="app-id=1575480118">
  26. <link rel="stylesheet" href="/stylesheets/v2/styles.css">
  27. <style>
  28. h1 {
  29. text-align: start;
  30. }
  31. p {
  32. font-size: 1.1rem;
  33. }
  34. .breadcrumb {
  35. margin: 20px 0;
  36. font-size: 1.0rem;
  37. color: var(--light-text);
  38. }
  39. .breadcrumb a {
  40. color: var(--primary-color);
  41. text-decoration: none;
  42. }
  43. .breadcrumb a:hover {
  44. text-decoration: underline;
  45. }
  46. /* 视频播放器样式 */
  47. .video-player {
  48. position: relative;
  49. background-color: #000;
  50. border-radius: 8px;
  51. overflow: hidden;
  52. cursor: pointer;
  53. aspect-ratio: 1/1; /* 修改为1:1比例 */
  54. }
  55. .video-player video {
  56. width: 100%;
  57. height: 100%;
  58. object-fit: cover;
  59. display: block;
  60. }
  61. .play-button {
  62. position: absolute;
  63. top: 50%;
  64. left: 50%;
  65. transform: translate(-50%, -50%);
  66. width: 80px;
  67. height: 80px;
  68. background-color: rgba(255, 107, 107, 0.8);
  69. border-radius: 50%;
  70. display: flex;
  71. align-items: center;
  72. justify-content: center;
  73. transition: all 0.3s ease;
  74. }
  75. .play-button:hover {
  76. background-color: rgba(255, 107, 107, 1);
  77. transform: translate(-50%, -50%) scale(1.1);
  78. }
  79. .play-button::after {
  80. content: "";
  81. width: 0;
  82. height: 0;
  83. border-top: 15px solid transparent;
  84. border-bottom: 15px solid transparent;
  85. border-left: 25px solid white;
  86. margin-left: 5px;
  87. }
  88. /* 线稿图样式 */
  89. .lineart-container {
  90. position: relative;
  91. border-radius: 8px;
  92. overflow: hidden;
  93. aspect-ratio: 1/1;
  94. /* 修改为1:1比例 */
  95. background-color: #f5f5f5;
  96. }
  97. .lineart-container img {
  98. width: 100%;
  99. height: 100%;
  100. object-fit: contain;
  101. /* 使用contain保持图像比例 */
  102. padding: 15px;
  103. /* 添加内边距,使图像不贴边 */
  104. transition: all 0.3s ease;
  105. }
  106. /* 线稿图悬停效果 */
  107. .lineart-overlay {
  108. position: absolute;
  109. bottom: 0;
  110. left: 0;
  111. right: 0;
  112. background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
  113. padding: 15px;
  114. color: white;
  115. opacity: 0;
  116. transition: opacity 0.3s ease;
  117. }
  118. .lineart-container:hover .lineart-overlay {
  119. opacity: 1;
  120. }
  121. .lineart-container img:hover {
  122. transform: translateY(-5px);
  123. }
  124. .lineart-title {
  125. font-weight: 600;
  126. margin-bottom: 5px;
  127. }
  128. .lineart-desc {
  129. font-size: 0.9rem;
  130. opacity: 0.9;
  131. }
  132. .coloring-grid {
  133. grid-template-columns: 1fr 1fr;
  134. }
  135. .gallery-link {
  136. text-align: center;
  137. margin-top: 30px;
  138. font-size: 1.2rem;
  139. }
  140. .gallery-link a {
  141. color: var(--primary-color);
  142. text-decoration: none;
  143. font-weight: 600;
  144. display: inline-flex;
  145. align-items: center;
  146. }
  147. .gallery-link a:hover {
  148. text-decoration: underline;
  149. }
  150. .gallery-link svg {
  151. margin-left: 8px;
  152. width: 16px;
  153. height: 16px;
  154. }
  155. @media (max-width: 768px) {
  156. .gallery-link {
  157. font-size: 1rem;
  158. }
  159. .coloring-grid {
  160. grid-template-columns: 1fr;
  161. }
  162. }
  163. </style>
  164. <script type="application/ld+json">
  165. {
  166. "@context": "https://schema.org",
  167. "@type": "CollectionPage",
  168. "name": "<%= title %>",
  169. "description": "<%= description %>",
  170. "url": "https://art.pcoloring.com/<%= uri %>",
  171. "mainEntity": {
  172. "@type": "ItemList",
  173. "itemListElement": [
  174. <% data.contents.forEach((item, index)=> { %>
  175. {
  176. "@type": "ListItem",
  177. "position": <%= index+1 %>,
  178. "item": {
  179. "@type": "CreativeWork",
  180. "name": "<%= item.title %>",
  181. "url": "https://art.pcoloring.com<%= item.uri %>",
  182. "image": "https://d2mb6s2cy1zg97.cloudfront.net/thumbs/coloring-page/page/480/<%= item._id %>.webp",
  183. "author": {
  184. "@type": "Person",
  185. "name": "<%= item.user.username %>"
  186. }
  187. }
  188. }<% if(index < data.contents.length - 1){ %>, <%}%>
  189. <% }); %>
  190. ]
  191. }
  192. }
  193. </script>
  194. <script type='text/javascript'
  195. src='https://platform-api.sharethis.com/js/sharethis.js#property=685036ce6c1ae8001abaded7&product=sop'
  196. async='async'></script>
  197. </head>
  198. <!-- Google tag (gtag.js) -->
  199. <script async src="https://www.googletagmanager.com/gtag/js?id=G-JBGGVGLHTP"></script>
  200. <script>
  201. window.dataLayer = window.dataLayer || [];
  202. function gtag() { dataLayer.push(arguments); }
  203. gtag('js', new Date());
  204. gtag('config', 'G-JBGGVGLHTP');
  205. </script>
  206. <body>
  207. <%- include('header') %>
  208. <main class="container">
  209. <div class="breadcrumb">
  210. <a href="/">Home</a> &gt; <a href="/video-coloring-pages">Video Coloring Pages</a> &gt; <%= title%>
  211. </div>
  212. <section>
  213. <h1><%= title%></h1>
  214. <h4 style="margin-bottom: 40px;">By Art Number Coloring / <%=data.timeCreate%></h4>
  215. <div class="coloring-grid">
  216. <div class="video-player" id="storyVideo">
  217. <video poster="<%= data.poster %>" controls>
  218. <source src="<%= data.url %>" type="application/x-mpegURL">
  219. Your browser does not support the video tag.
  220. </video>
  221. <div class="play-button"></div>
  222. </div>
  223. <% data.contents.forEach(item=> { %>
  224. <div class="lineart-container">
  225. <a href="<%= item.uri %>"><img src="<%= item.thumb %>" alt="<%= item.title %>"></a>
  226. <div class="lineart-overlay">
  227. <div class="lineart-title"><%= item.title %></div>
  228. <div class="lineart-desc">Click to download or color online along with the video</div>
  229. </div>
  230. </div>
  231. <% }); %>
  232. </div>
  233. </section>
  234. <%- include('comment') %>
  235. </main>
  236. <%- include('footer') %>
  237. <script src="/scripts/script.js"></script>
  238. <script src="/scripts/progress2.js"></script>
  239. <script src="https://cdn.jsdelivr.net/npm/hls.js@latest"></script>
  240. <script>
  241. const storyVideo = document.getElementById('storyVideo');
  242. const video = storyVideo.querySelector('video');
  243. const playButton = storyVideo.querySelector('.play-button');
  244. // 视频播放控制
  245. if (Hls.isSupported()) {
  246. var hls = new Hls();
  247. var url = '<%= data.url %>';
  248. hls.loadSource(url);
  249. hls.attachMedia(video);
  250. } else if (video.canPlayType('application/vnd.apple.mpegurl')) {
  251. // Safari 不支持 hls.js 但原生支持 HLS
  252. video.src = '<%= data.url %>';
  253. } else {
  254. // 浏览器不支持 HLS
  255. console.error('Your browser does not support HLS.');
  256. }
  257. playButton.addEventListener('click', () => {
  258. video.play();
  259. playButton.style.display = 'none';
  260. });
  261. // 视频播放时隐藏play button
  262. video.addEventListener('play', () => {
  263. playButton.style.display = 'none';
  264. });
  265. // 视频暂停时显示播放按钮
  266. video.addEventListener('pause', () => {
  267. playButton.style.display = 'flex';
  268. });
  269. // 视频结束时显示播放按钮
  270. video.addEventListener('ended', () => {
  271. playButton.style.display = 'flex';
  272. });
  273. </script>
  274. </body>
  275. </html>