browser.html 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  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"/>
  6. <title><%= title %></title>
  7. <link rel="icon" href="/favicon.ico" />
  8. <style>
  9. /* 基础重置与布局 */
  10. * {
  11. margin: 0;
  12. padding: 0;
  13. box-sizing: border-box;
  14. }
  15. body {
  16. font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  17. background-color: #fff;
  18. display: flex;
  19. flex-direction: column;
  20. justify-content: center;
  21. align-items: center;
  22. min-height: 100vh;
  23. color: #999;
  24. }
  25. /* 容器与文本样式 */
  26. .container {
  27. text-align: center;
  28. }
  29. .tips {
  30. margin: 8px 0;
  31. line-height: 1.6;
  32. }
  33. /* 浏览器图标区域布局 */
  34. .browser-icons {
  35. display: flex;
  36. justify-content: center;
  37. gap: 40px;
  38. margin-top: 20px;
  39. flex-wrap: wrap; /* 适配小屏幕换行 */
  40. }
  41. .browser-item {
  42. display: flex;
  43. flex-direction: column;
  44. align-items: center;
  45. cursor: pointer;
  46. transition: transform 0.2s ease;
  47. }
  48. .browser-item:hover {
  49. transform: scale(1.05);
  50. }
  51. .browser-item img {
  52. width: 60px;
  53. height: 60px;
  54. margin-bottom: 8px;
  55. }
  56. .browser-item span {
  57. font-size: 14px;
  58. }
  59. /* 国产系统专属提示(可选样式) */
  60. .domestic-os-tip {
  61. color: #ff6600;
  62. font-weight: bold;
  63. margin-top: 20px;
  64. }
  65. .icon-area {
  66. display: flex;
  67. justify-content: center;
  68. gap: 40px;
  69. margin-top: 20px;
  70. }
  71. /* 单个图标及文字的样式 */
  72. .browser-icon {
  73. display: flex;
  74. flex-direction: column;
  75. align-items: center;
  76. cursor: pointer;
  77. }
  78. .browser-icon img {
  79. width: 60px;
  80. height: 60px;
  81. margin-bottom: 8px;
  82. }
  83. .browser-icon span {
  84. font-size: 14px;
  85. }
  86. /* 顶部提示文字样式 */
  87. .tips {
  88. margin-bottom: 10px;
  89. }
  90. </style>
  91. </head>
  92. <body>
  93. <div class="container">
  94. <!-- 通用提示文案 -->
  95. <p class="tips">无法打开页面,请升级或更换浏览器后重新打开</p>
  96. <p class="tips">建议使用以下浏览器</p>
  97. <!-- 浏览器图标区 -->
  98. <div class="browser-icons" id="noDomestic">
  99. <div class="browser-item">
  100. <!-- 可替换为 Firefox 官方图标地址或本地资源 -->
  101. <span style="font-size: 60px; color: #FF7B00;">🦊</span>
  102. <span>Firefox</span>
  103. </div>
  104. <div class="browser-item">
  105. <!-- Edge 图标 -->
  106. <span style="font-size: 60px; color: #0078D7;">🌊</span>
  107. <span>Microsoft Edge</span>
  108. </div>
  109. <div class="browser-item">
  110. <!-- Chrome 图标 -->
  111. <span style="font-size: 60px; color: #000;">🍎</span>
  112. <span>Chrome</span>
  113. </div>
  114. </div>
  115. <!-- 国产系统检测结果展示区 -->
  116. <div class="icon-area" id="domestic">
  117. <div class="browser-icon">
  118. <!-- 这里用文字简单模拟图标,实际可替换为 Firefox 浏览器图标的路径 -->
  119. <span style="font-size: 60px; color: #FF7B00;">🦊</span>
  120. <span>火狐</span>
  121. </div>
  122. <div class="browser-icon">
  123. <!-- 同理,替换为 Edge 浏览器图标的路径 -->
  124. <span style="font-size: 60px; color: #0078D7;">🌊</span>
  125. <span>奇安信可浏览器</span>
  126. </div>
  127. <div class="browser-icon">
  128. <!-- 替换为 Safari 浏览器图标的路径 -->
  129. <span style="font-size: 60px; color: #000;">🍎</span>
  130. <span>360安全浏览器</span>
  131. </div>
  132. <div class="browser-icon">
  133. <!-- 替换为 Chrome 浏览器图标的路径 -->
  134. <span style="font-size: 60px; color: #4285F4;">🔴</span>
  135. <span>Chromeium</span>
  136. </div>
  137. </div>
  138. </div>
  139. <script>
  140. // 识别国产操作系统逻辑(示例覆盖常见标识,可根据需要补充)
  141. function isDomesticOS() {
  142. const userAgent = navigator.userAgent.toLowerCase();
  143. const platform = navigator.platform.toLowerCase();
  144. // 统信 UOS、银河麒麟、深度 Deepin、中标麒麟等标识
  145. return /uos|kylin|deepin|neokylin/.test(userAgent)
  146. || /linux/.test(platform) && /国产|中国/.test(userAgent);
  147. }
  148. // 执行检测
  149. const isDomestic = isDomesticOS();
  150. const domestic = document.getElementById('domestic');
  151. const noDomestic = document.getElementById('noDomestic');
  152. if (isDomestic) {
  153. domestic.style.display = 'flex';
  154. noDomestic.style.display = 'none';
  155. } else {
  156. // 非国产系统可隐藏或自定义提示
  157. domestic.style.display = 'none';
  158. noDomestic.style.display = 'flex';
  159. }
  160. </script>
  161. </body>
  162. </html>