download.html 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <!DOCTYPE html>
  2. <html lang="zh-CN">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
  6. <title>正在进入游戏...</title>
  7. <style>
  8. body {
  9. margin: 0;
  10. padding: 0;
  11. background-color: #000;
  12. }
  13. #weixin-tip {
  14. position: fixed;
  15. left: 0;
  16. top: 0;
  17. background: rgba(0, 0, 0, 0.8);
  18. width: 100%;
  19. height: 100%;
  20. z-index: 2000;
  21. display: none;
  22. }
  23. #weixin-tip p {
  24. text-align: center;
  25. margin-top: 10%;
  26. padding: 0 5%;
  27. }
  28. .wechat-img {
  29. max-width: 100%;
  30. height: auto;
  31. }
  32. .loading-text {
  33. color: #fff;
  34. text-align: center;
  35. margin-top: 50%;
  36. font-family: sans-serif;
  37. }
  38. </style>
  39. </head>
  40. <body>
  41. <div id="weixin-tip">
  42. <p><img src="./assets/live_weixin.png" alt="微信打开" class="wechat-img"/></p>
  43. </div>
  44. <div class="loading-text" id="status">正在检测环境...</div>
  45. <script>
  46. const DOWNLOAD_LINKS = {
  47. ios: 'https://apps.apple.com/cn/app/id6746466555',
  48. android: 'https://apps.apple.com/cn/app/id6746466555',
  49. default: 'https://apps.apple.com/cn/app/id6746466555'
  50. };
  51. function is_weixin() {
  52. var ua = navigator.userAgent.toLowerCase();
  53. return ua.indexOf('micromessenger') !== -1;
  54. }
  55. function getOS() {
  56. const ua = navigator.userAgent;
  57. if (/iPad|iPhone|iPod/.test(ua)) return 'ios';
  58. if (/Android/.test(ua)) return 'android';
  59. return 'pc';
  60. }
  61. function handleDownload() {
  62. const os = getOS();
  63. const downloadUrl = DOWNLOAD_LINKS[os] || DOWNLOAD_LINKS.default;
  64. if (is_weixin()) {
  65. document.getElementById('weixin-tip').style.display = 'block';
  66. document.getElementById('status').style.display = 'none';
  67. } else {
  68. document.getElementById('status').innerText = '正在跳转下载...';
  69. window.location.href = downloadUrl;
  70. }
  71. }
  72. // Handle click to close (optional but good for UX)
  73. document.getElementById('weixin-tip').addEventListener('click', function() {
  74. // No easy way to Force open in browser via JS alone beyond the tip
  75. });
  76. // Run detection on load
  77. window.onload = handleDownload;
  78. </script>
  79. </body>
  80. </html>