index.html 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263
  1. <!DOCTYPE html>
  2. <html lang="zh-CN">
  3. <head>
  4. <meta charset="UTF-8" />
  5. <link rel="icon" href="/favicon.ico" />
  6. <meta name="viewport"
  7. content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, viewport-fit=cover">
  8. <meta http-equiv="Cache-control" content="no-cache">
  9. <meta http-equiv="Cache" content="no-cache">
  10. <meta name="apple-mobile-web-app-capable" content="yes" />
  11. <!-- 设置苹果工具栏颜色 -->
  12. <meta name="apple-mobile-web-app-status-bar-style" content="black" />
  13. <!-- 忽略页面中的数字识别为电话,忽略email识别 -->
  14. <meta name="format-detection" content="telphone=no, email=no" />
  15. <!-- 启用360浏览器的极速模式(webkit) -->
  16. <meta name="renderer" content="webkit" />
  17. <!-- 避免IE使用兼容模式 -->
  18. <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  19. <meta name="HandheldFriendly" content="true" />
  20. <!-- 设置在apple上以应用模式启动时,是否全屏 -->
  21. <meta name="apple-touch-fullscreen" content="yes" />
  22. <!-- windows phone 点击无高光 -->
  23. <meta name="msapplication-tap-highlight" content="no" />
  24. <meta name="referrer" content="no-referrer" />
  25. <title>音乐数字课堂</title>
  26. <style>
  27. body {
  28. background: #f1f5ff;
  29. width: 100%;
  30. }
  31. .bgImg {
  32. width: 456px;
  33. height: 522px;
  34. }
  35. .btnImg {
  36. width: 288px;
  37. position: absolute;
  38. left: 50%;
  39. margin-left: -144px;
  40. bottom: 31px;
  41. cursor: pointer;
  42. z-index: 100;
  43. }
  44. .imgWrap {
  45. width: 456px;
  46. height: 522px;
  47. margin: 140px auto 0;
  48. position: relative;
  49. z-index: 100;
  50. }
  51. /* margin-top: 300px; */
  52. .textWrap {
  53. margin-top: 140px;
  54. text-align: center;
  55. width: 500px;
  56. position: absolute;
  57. top: 141px;
  58. left: 50%;
  59. margin-left: -288px;
  60. }
  61. .subMsg {
  62. margin-top: 32px;
  63. font-size: 22px;
  64. line-height: 30px;
  65. color: #777;
  66. }
  67. .subBtn {
  68. width: 231px;
  69. height: 62px;
  70. background: #198CFE;
  71. border-radius: 18px;
  72. border: none;
  73. font-size: 22px;
  74. font-weight: 600;
  75. color: #FFFFFF;
  76. line-height: 30px;
  77. cursor: pointer;
  78. margin-top: 32px;
  79. list-style: none outside none;
  80. text-decoration: none;
  81. }
  82. </style>
  83. <script type="text/javascript">
  84. function gotoLinlk() {
  85. console.log('点击')
  86. var agent = navigator.userAgent.toLowerCase();
  87. var isMac = function () { return /macintosh|mac os x/i.test(navigator.userAgent); }();
  88. if (agent.indexOf("win32") >= 0 || agent.indexOf("wow32") >= 0) {
  89. window.open('https://appstore.ks3-cn-beijing.ksyuncs.com/ChromeStandaloneSetup32.exe');
  90. }
  91. if (agent.indexOf("win64") >= 0 || agent.indexOf("wow64") >= 0) {
  92. window.open('https://appstore.ks3-cn-beijing.ksyuncs.com/ChromeStandaloneSetup64.exe');
  93. }
  94. if (isMac) {
  95. window.open('https://appstore.ks3-cn-beijing.ksyuncs.com/googlechrome-mac.dmg');
  96. }
  97. }
  98. const check360 = () => {
  99. console.log(navigator)
  100. const result = false;
  101. for (const key in navigator.plugins) {
  102. // np-mswmp.dll只在360浏览器下存在
  103. // if (navigator.plugins[key].filename == 'internal-nacl-plugin') {
  104. // console.log('来到插件')
  105. // return !result;
  106. // }
  107. if (navigator.plugins[key].filename == 'np-mswmp.dll') {
  108. console.log('来到插件')
  109. return !result;
  110. }
  111. }
  112. return result;
  113. };
  114. function getChromeVersion() {
  115. var arr = navigator.userAgent.split(' ');
  116. var chromeVersion = '';
  117. for (var i = 0; i < arr.length; i++) {
  118. if (/chrome/i.test(arr[i])) chromeVersion = arr[i];
  119. }
  120. if (chromeVersion) {
  121. return Number(chromeVersion.split('/')[1].split('.')[0]);
  122. } else {
  123. return false;
  124. }
  125. };
  126. function IsFF() {
  127. var sAgent = window.navigator.userAgent.toLowerCase();
  128. if (sAgent.indexOf("firefox") != -1) {
  129. return true;
  130. }
  131. return false;
  132. }
  133. const isChrome = () => {
  134. const isChromium = window.chrome,
  135. winNav = window.navigator,
  136. vendorName = winNav.vendor,
  137. isOpera = winNav.userAgent.indexOf('OPR') > -1,
  138. isIEedge = winNav.userAgent.indexOf('Edge') > -1,
  139. isIOSChrome = winNav.userAgent.match('CriOS');
  140. // // QQ
  141. // isQQBriwser =
  142. // winNav.userAgent.indexOf('QQBrowser') > -1 ||
  143. // winNav.userAgent.indexOf('QQ') > -1,
  144. // // 搜狗
  145. // isSouggou =
  146. // winNav.userAgent.indexOf('se 2.x') > -1 ||
  147. // winNav.userAgent.indexOf('MetaSr') > -1,
  148. // // 360
  149. // is360 = check360(),
  150. // // 遨游
  151. // isMaxthon = winNav.userAgent.indexOf('Maxthon') > -1,
  152. // // 是否为2345浏览器
  153. // is2345Explorer = winNav.userAgent.includes('2345Explorer'),
  154. // // 世界之窗
  155. // isTheWorld = winNav.userAgent.indexOf('TheWorld') > -1,
  156. // // 猎豹
  157. // isLiebao = winNav.userAgent.indexOf('LBBROWSER') > -1;
  158. // console.log(winNav.userAgent)
  159. /*
  160. isQQBriwser === false &&
  161. isSouggou === false &&
  162. is360 === false &&
  163. isMaxthon === false &&
  164. is2345Explorer === false &&
  165. isTheWorld === false &&
  166. isLiebao === false
  167. */
  168. if (isIOSChrome) {
  169. return true;
  170. } else if (
  171. isChromium !== null &&
  172. typeof isChromium !== 'undefined' &&
  173. vendorName === 'Google Inc.' &&
  174. isOpera === false &&
  175. isIEedge === false &&
  176. ) {
  177. return true;
  178. } else {
  179. return false;
  180. }
  181. };
  182. function IEVersion() {
  183. var userAgent = navigator.userAgent; //取得浏览器的userAgent字符串
  184. var isIE = userAgent.indexOf("compatible") > -1 && userAgent.indexOf("MSIE") > -1; //判断是否IE<11浏览器
  185. var isEdge = userAgent.indexOf("Edge") > -1 && !isIE; //判断是否IE的Edge浏览器
  186. var isIE11 = userAgent.indexOf('Trident') > -1 && userAgent.indexOf("rv:11.0") > -1;
  187. if (isIE) {
  188. var reIE = new RegExp("MSIE (\\d+\\.\\d+);");
  189. reIE.test(userAgent);
  190. var fIEVersion = parseFloat(RegExp["$1"]);
  191. if (fIEVersion == 7) {
  192. return 7;
  193. } else if (fIEVersion == 8) {
  194. return 8;
  195. } else if (fIEVersion == 9) {
  196. return 9;
  197. } else if (fIEVersion == 10) {
  198. return 10;
  199. } else {
  200. return 6;//IE版本<=7
  201. }
  202. } else if (isEdge) {
  203. return 'edge';//edge
  204. } else if (isIE11) {
  205. return 11; //IE11
  206. } else {
  207. return -1;//不是ie浏览器
  208. }
  209. }
  210. (function (window) {
  211. if (!isChrome()) {
  212. // document.writeln("<div class='imgWrap'><img src='https://gyt.ks3-cn-beijing.ksyuncs.com/basic/1688699993534.png' class='bgImg' alt=''><img src='https://gyt.ks3-cn-beijing.ksyuncs.com/basic/1688699779209.png' class='btnImg' alt=''></div>");
  213. if (IEVersion() < 9 && IEVersion() != -1) {
  214. document.writeln(" <div class='textWrap'><h1>当前浏览器版本过低</h1><p class='subMsg'>为了保证良好的上课体验,推荐您使用谷歌浏览器</p> <button class='subBtn' onclick='gotoLinlk()'>下载谷歌浏览器</button>");
  215. document.execCommand("Stop");
  216. } else {
  217. document.writeln(" <div class='imgWrap'><img onabort='this.src=this.src' src='https://gyt.ks3-cn-beijing.ksyuncs.com/basic/1688699993534.png' class='bgImg' alt=''><img src='https://gyt.ks3-cn-beijing.ksyuncs.com/basic/1688699779209.png' onabort='this.src=this.src' onclick='gotoLinlk()' class='btnImg' alt=''></div>");
  218. document.execCommand("Stop");
  219. window.stop()
  220. }
  221. } else {
  222. if (getChromeVersion() < 90) {
  223. document.writeln(" <div class='imgWrap'><img src='https://gyt.ks3-cn-beijing.ksyuncs.com/basic/1688699993534.png' class='bgImg' alt=''><img src='https://gyt.ks3-cn-beijing.ksyuncs.com/basic/1688699779209.png' onclick='gotoLinlk()' class='btnImg' alt=''></div>");
  224. document.execCommand("Stop");
  225. window.stop()
  226. console.log('Stop')
  227. }
  228. // if (IsFF()) {
  229. }
  230. })(window);
  231. </script>
  232. </head>
  233. <!-- 按钮 https://gyt.ks3-cn-beijing.ksyuncs.com/basic/1688699779209.png -->
  234. <!-- 背景 https://gyt.ks3-cn-beijing.ksyuncs.com/basic/1688699993534.png -->
  235. <body class="myBody">
  236. <div id="app"></div>
  237. <script type="module" src="/src/main.ts"></script>
  238. </body>
  239. </html>