video-coloring-page.ejs 9.5 KB

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