video-coloring-page.ejs 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356
  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": "VideoObject",
  168. "name": "Dog Riding an Electric Scooter - Video Story Coloring Page",
  169. "description": "Watch the real-life story of a dog riding an electric scooter that inspired our coloring page. Then, color it yourself!",
  170. "thumbnailUrl": "<%= data.poster %>",
  171. "uploadDate": "<%=data.timeCreate%>",
  172. "contentUrl": "<%= data.url %>",
  173. "duration": "PT11S",
  174. "potentialAction": {
  175. "@type": "WatchAction",
  176. "target": {
  177. "@type": "EntryPoint",
  178. "url": "https://art.pcoloring.com<%= uri %>"
  179. }
  180. },
  181. "interactionStatistic": {
  182. "@type": "InteractionCounter",
  183. "interactionType": "https://schema.org/WatchAction",
  184. "userInteractionCount": 2353
  185. }
  186. }
  187. </script>
  188. <script type="application/ld+json">
  189. {
  190. "@context": "https://schema.org",
  191. "@type": "CollectionPage",
  192. "name": "<%= title %>",
  193. "description": "<%= description %>",
  194. "url": "https://art.pcoloring.com<%= uri %>",
  195. "mainEntity": {
  196. "@type": "ItemList",
  197. "itemListElement": [
  198. <% data.contents.forEach((item, index)=> { %>
  199. {
  200. "@type": "ListItem",
  201. "position": <%= index+1 %>,
  202. "item": {
  203. "@type": "CreativeWork",
  204. "name": "<%= item.title %>",
  205. "url": "https://art.pcoloring.com<%= item.uri %>",
  206. "image": "https://d2mb6s2cy1zg97.cloudfront.net/thumbs/coloring-page/page/480/<%= item._id %>.webp",
  207. "author": {
  208. "@type": "Person",
  209. "name": "<%= item.user.username %>"
  210. }
  211. }
  212. }<% if(index < data.contents.length - 1){ %>, <%}%>
  213. <% }); %>
  214. ]
  215. }
  216. }
  217. </script>
  218. <script type='text/javascript'
  219. src='https://platform-api.sharethis.com/js/sharethis.js#property=685036ce6c1ae8001abaded7&product=sop'
  220. async='async'></script>
  221. </head>
  222. <!-- Google tag (gtag.js) -->
  223. <script async src="https://www.googletagmanager.com/gtag/js?id=G-JBGGVGLHTP"></script>
  224. <script>
  225. window.dataLayer = window.dataLayer || [];
  226. function gtag() { dataLayer.push(arguments); }
  227. gtag('js', new Date());
  228. gtag('config', 'G-JBGGVGLHTP');
  229. </script>
  230. <body>
  231. <%- include('header') %>
  232. <main class="container">
  233. <div class="breadcrumb">
  234. <a href="/">Home</a> &gt; <a href="/video-coloring-pages">Video Coloring Pages</a> &gt; <%= title%>
  235. </div>
  236. <section>
  237. <h1><%= title%></h1>
  238. <h4 style="margin-bottom: 40px;">By Art Number Coloring / <%=data.timeCreate%></h4>
  239. <div class="coloring-grid">
  240. <div class="video-player" id="storyVideo">
  241. <video poster="<%= data.poster %>" controls>
  242. <source src="<%= data.url %>" type="application/x-mpegURL">
  243. Your browser does not support the video tag.
  244. </video>
  245. <div class="play-button"></div>
  246. </div>
  247. <% data.contents.forEach(item=> { %>
  248. <div class="lineart-container">
  249. <a href="<%= item.uri %>"><img src="<%= item.thumb %>" alt="<%= item.title %>"></a>
  250. <div class="lineart-overlay">
  251. <div class="lineart-title"><%= item.title %></div>
  252. <div class="lineart-desc">Click to download or color online along with the video</div>
  253. </div>
  254. </div>
  255. <% }); %>
  256. </div>
  257. </section>
  258. <%- include('comment') %>
  259. </main>
  260. <%- include('footer') %>
  261. <script src="/scripts/script.js"></script>
  262. <script src="/scripts/progress2.js"></script>
  263. <script src="https://cdn.jsdelivr.net/npm/hls.js@latest"></script>
  264. <script>
  265. const storyVideo = document.getElementById('storyVideo');
  266. const video = storyVideo.querySelector('video');
  267. const playButton = storyVideo.querySelector('.play-button');
  268. // 视频播放控制
  269. if (Hls.isSupported()) {
  270. var hls = new Hls();
  271. var url = '<%= data.url %>';
  272. hls.loadSource(url);
  273. hls.attachMedia(video);
  274. } else if (video.canPlayType('application/vnd.apple.mpegurl')) {
  275. // Safari 不支持 hls.js 但原生支持 HLS
  276. video.src = '<%= data.url %>';
  277. } else {
  278. // 浏览器不支持 HLS
  279. console.error('Your browser does not support HLS.');
  280. }
  281. playButton.addEventListener('click', () => {
  282. video.play();
  283. playButton.style.display = 'none';
  284. });
  285. // 视频播放时隐藏play button
  286. video.addEventListener('play', () => {
  287. playButton.style.display = 'none';
  288. });
  289. // 视频暂停时显示播放按钮
  290. video.addEventListener('pause', () => {
  291. playButton.style.display = 'flex';
  292. });
  293. // 视频结束时显示播放按钮
  294. video.addEventListener('ended', () => {
  295. playButton.style.display = 'flex';
  296. });
  297. </script>
  298. </body>
  299. </html>