share.ejs 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307
  1. <!DOCTYPE html>
  2. <html lang="<%= lang %>">
  3. <head>
  4. <meta http-equiv="x-ua-compatible" content="ie=edge">
  5. <title>Art Color</title>
  6. <link rel="alternate" href="https://art.pcoloring.com/share/<%= id %>?lang=en" hrefLang="en" />
  7. <link rel="alternate" href="https://art.pcoloring.com/share/<%= id %>?lang=zh" hrefLang="zh" />
  8. <link rel="alternate" href="https://art.pcoloring.com/share/<%= id %>?lang=es" hrefLang="es" />
  9. <link rel="alternate" href="https://art.pcoloring.com/share/<%= id %>?lang=pt" hrefLang="pt" />
  10. <link rel="alternate" href="https://art.pcoloring.com/share/<%= id %>?lang=ja" hrefLang="ja" />
  11. <link rel="alternate" href="https://art.pcoloring.com/share/<%= id %>" hrefLang="x-default" />
  12. <meta name="viewport" content="width=device-width, initial-scale=1">
  13. <meta name="description" content="<%= translate.colorRelex[lang] %>">
  14. <meta name="keywords" content="color, paint, app, ios, android, game">
  15. <meta property="og:site_name" content="art.pcoloring.com">
  16. <meta property="og:title" content="Art Color">
  17. <meta property="og:description" content="<%= translate.colorRelex[lang] %>">
  18. <meta property="og:image" content="<%= imageUrl %>">
  19. <meta property="og:type" content="website">
  20. <!-- <meta property="fb:page_id" content="565152927316964"> -->
  21. <!-- MARK: Universal Link / Android App Link 的核心配置 -->
  22. <!-- 这些 meta 标签的值应该是完整的 HTTPS 链接,Facebook 会识别并尝试拉起 App -->
  23. <meta property="og:url" content="<%= applink %>" /> <!-- **Universal Link 路径** -->
  24. <meta property="al:ios:url" content="<%= applink %>" /> <!-- **Universal Link 路径** -->
  25. <meta property="al:ios:app_store_id" content="1575480118" /> <!-- **iOS App Store ID** -->
  26. <meta property="al:ios:app_name" content="Art Color" /> <!-- **iOS 应用名称** -->
  27. <meta property="al:android:package" content="com.pcoloring.art.puzzle.color.by.number" /> <!-- **Android 包名** -->
  28. <meta property="al:android:url" content="<%= applink %>" /> <!-- ** Universal Link 路径** -->
  29. <meta property="al:android:app_name" content="Art Color" /> <!-- **Android 应用名称** -->
  30. <meta name="apple-itunes-app" content="app-id=1575480118">
  31. <link rel="icon" href="/assets/icon/favicon.ico" type="image/x-icon">
  32. <link rel="apple-touch-icon" sizes="180x180" href="/assets/icon/icon.png">
  33. <script type="module" crossorigin src="/assets/share-DDyw1eeR.js"></script>
  34. <link rel="modulepreload" crossorigin href="/assets/modulepreload-polyfill-B5Qt9EMX.js">
  35. <link rel="modulepreload" crossorigin href="/assets/WorkLayer-RuTV64WF.js">
  36. <style>
  37. :root {
  38. --primary-color: #ff6b6b;
  39. --secondary-color: #4ecdc4;
  40. --accent-color: #ffd166;
  41. --background-color: #f9f9f9;
  42. --text-color: #333;
  43. --light-text: #666;
  44. --border-color: #e0e0e0;
  45. }
  46. body {
  47. font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  48. display: flex;
  49. flex-direction: column;
  50. /* 垂直方向排列子元素 */
  51. justify-content: center;
  52. /* 垂直居中 */
  53. align-items: center;
  54. /* 水平居中 */
  55. min-height: 100vh;
  56. /* 最小高度为视口高度,确保垂直居中 */
  57. margin: 0;
  58. padding: 20px;
  59. box-sizing: border-box;
  60. /* 盒模型为边框盒 */
  61. background-color: var(--background-color);
  62. color: var(--text-color);
  63. line-height: 1.6;
  64. }
  65. /* 父容器,用于包裹图片和 Canvas,并使其相对定位 */
  66. .image-canvas-container {
  67. position: relative;
  68. max-width: 90%;
  69. /* 限制容器最大宽度 */
  70. height: auto;
  71. display: inline-block;
  72. /* 确保容器根据图片尺寸收缩 */
  73. box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  74. /* 添加阴影效果 */
  75. border-radius: 12px;
  76. /* 圆角 */
  77. overflow: hidden;
  78. /* 隐藏超出容器的内容 */
  79. }
  80. /* 图片样式:使其响应式并填充容器 */
  81. .image-canvas-container img {
  82. position: relative;
  83. display: block;
  84. /* 移除图片底部空白 */
  85. max-width: 100%;
  86. /* 最大宽度为父容器的100% */
  87. height: auto;
  88. /* 高度自动调整,保持图片比例 */
  89. border-radius: 12px;
  90. /* 与容器相同的圆角 */
  91. z-index: 100;
  92. }
  93. /* Canvas 样式:绝对定位,与图片完全重叠 */
  94. .image-canvas-container canvas {
  95. position: absolute;
  96. top: 0;
  97. left: 0;
  98. width: 100%;
  99. height: 100%;
  100. border-radius: 12px;
  101. /* 与容器相同的圆角 */
  102. z-index: 50;
  103. }
  104. .btn {
  105. display: inline-block;
  106. background-color: var(--primary-color);
  107. color: white;
  108. border: none;
  109. padding: 10px 20px;
  110. border-radius: 5px;
  111. font-size: 1.1rem;
  112. font-weight: 500;
  113. cursor: pointer;
  114. transition: background-color 0.3s ease;
  115. text-decoration: none;
  116. text-align: center;
  117. margin-right: 10px;
  118. margin-bottom: 10px;
  119. }
  120. .btn:hover {
  121. background-color: #ff4d4d;
  122. }
  123. .btn-secondary {
  124. background-color: var(--secondary-color);
  125. }
  126. .btn-secondary:hover {
  127. background-color: #37b0a8;
  128. }
  129. .play-button {
  130. position: absolute;
  131. display: block;
  132. top: 50%;
  133. left: 50%;
  134. transform: translate(-50%, -50%);
  135. width: 80px;
  136. height: 80px;
  137. background-color: rgba(255, 107, 107, 0.8);
  138. border-radius: 50%;
  139. display: flex;
  140. align-items: center;
  141. justify-content: center;
  142. transition: all 0.3s ease;
  143. z-index: 0;
  144. }
  145. .play-button:hover {
  146. background-color: rgba(255, 107, 107, 1);
  147. transform: translate(-50%, -50%) scale(1.1);
  148. }
  149. .play-button::after {
  150. content: "";
  151. width: 0;
  152. height: 0;
  153. border-top: 15px solid transparent;
  154. border-bottom: 15px solid transparent;
  155. border-left: 25px solid white;
  156. margin-left: 5px;
  157. }
  158. .buttons {
  159. width: 100%;
  160. max-width: 550px;
  161. display: flex;
  162. flex-wrap: wrap;
  163. justify-content: space-between;
  164. align-items: center;
  165. margin-top: 40px;
  166. }
  167. /* MARK: 微信引导层样式 */
  168. .wechat-guide-overlay {
  169. position: fixed;
  170. top: 0;
  171. left: 0;
  172. width: 100%;
  173. height: 100%;
  174. background-color: rgba(0, 0, 0, 0.75);
  175. /* 半透明黑色背景 */
  176. z-index: 9999;
  177. /* 确保在最上层 */
  178. display: none;
  179. /* 默认隐藏 */
  180. justify-content: center;
  181. align-items: center;
  182. color: white;
  183. font-size: 1.5rem;
  184. text-align: center;
  185. padding: 20px;
  186. box-sizing: border-box;
  187. flex-direction: column;
  188. }
  189. .wechat-guide-overlay.active {
  190. display: flex;
  191. /* 显示引导层 */
  192. }
  193. .wechat-guide-arrow {
  194. position: absolute;
  195. top: 10px;
  196. /* 箭头位置靠近右上角 */
  197. right: 20px;
  198. width: 80px;
  199. height: 80px;
  200. background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z" transform="rotate(90 12 12)"/></svg>') no-repeat center center;
  201. background-size: contain;
  202. transform: rotate(90deg);
  203. /* 旋转箭头指向右下 */
  204. }
  205. .wechat-guide-text {
  206. margin-top: 100px;
  207. /* 留出箭头空间 */
  208. line-height: 1.8;
  209. }
  210. .wechat-guide-text strong {
  211. color: var(--accent-color);
  212. /* 突出显示关键文字 */
  213. }
  214. </style>
  215. </head>
  216. <!-- Google tag (gtag.js) -->
  217. <script async src="https://www.googletagmanager.com/gtag/js?id=G-JBGGVGLHTP"></script>
  218. <script>
  219. window.dataLayer = window.dataLayer || [];
  220. function gtag() { dataLayer.push(arguments); }
  221. gtag('js', new Date());
  222. gtag('config', 'G-JBGGVGLHTP');
  223. </script>
  224. <body>
  225. <div class="image-canvas-container">
  226. <img id="poster-img" src="<%= imageUrl %>" alt="Art Color" />
  227. <canvas id="canvas"></canvas>
  228. <div id="play-button" class="play-button"></div>
  229. </div>
  230. <div class="buttons">
  231. <a href="/">
  232. <%= translate.home[lang] %>
  233. </a>
  234. <a href="<%= downlink %>" class="btn btn-secondary">
  235. <%= translate.downloadApp[lang] %>
  236. </a>
  237. <a href="/coloring-page/<%= id %>">
  238. <%= translate.detail[lang] %>>>
  239. </a>
  240. </div>
  241. <!-- MARK: 微信引导层 -->
  242. <div id="wechat-guide-overlay" class="wechat-guide-overlay">
  243. <div class="wechat-guide-arrow" onclick="closeOverlay()"></div>
  244. <p class="wechat-guide-text">
  245. 请点击右上角 <strong>"..."</strong> 菜单<br>
  246. 选择 <strong>"在浏览器中打开"</strong><br>
  247. 即可跳转到 App 或下载页面
  248. </p>
  249. </div>
  250. <script>
  251. const wechatGuideOverlay = document.getElementById('wechat-guide-overlay');
  252. // MARK: 微信环境检测
  253. function isWeChatBrowser() {
  254. const ua = window.navigator.userAgent.toLowerCase();
  255. return ua.includes('micromessenger');
  256. }
  257. function closeOverlay() {
  258. wechatGuideOverlay.classList.remove('active');
  259. }
  260. if (isWeChatBrowser()) {
  261. wechatGuideOverlay.classList.add('active');
  262. console.log("检测到微信浏览器,显示引导层。");
  263. } else {
  264. wechatGuideOverlay.classList.remove('active'); // 确保隐藏
  265. }
  266. </script>
  267. </body>
  268. </html>