index.html 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no">
  7. <meta http-equiv="Cache-control" content="no-cache">
  8. <meta http-equiv="Cache" content="no-cache">
  9. <title>云练习</title>
  10. <script src="/flexible.js" charset="UTF-8"></script>
  11. <style>
  12. #loading {
  13. position: fixed;
  14. left: 50%;
  15. top: 50%;
  16. transform: translate(-50%, -50%);
  17. display: none;
  18. }
  19. #loading.show {
  20. display: block;
  21. }
  22. #update {
  23. position: fixed;
  24. left: 50%;
  25. top: 50%;
  26. transform: translate(-50%, -50%);
  27. display: none;
  28. }
  29. #update.show {
  30. display: block;
  31. }
  32. #update img {
  33. display: block;
  34. width: 2rem;
  35. height: 2rem;
  36. margin: auto;
  37. }
  38. #update span {
  39. display: block;
  40. margin: auto;
  41. margin-top: 30px;
  42. color: rgba(0, 0, 0, .65);
  43. line-height: 1.8;
  44. }
  45. </style>
  46. <script>
  47. window.postMessageInstance = window.ORCHESTRA || (window.webkit && window.webkit.messageHandlers && window.webkit.messageHandlers.ORCHESTRA);
  48. if (window.navigator && navigator.serviceWorker) {
  49. navigator.serviceWorker.getRegistrations()
  50. .then(function (registrations) {
  51. for (let registration of registrations) {
  52. registration.unregister();
  53. }
  54. });
  55. }
  56. function getBroswer() {
  57. var Sys = {};
  58. var ua = navigator.userAgent.toLowerCase();
  59. var s = (s = ua.match(/chrome\/([\d.]+)/)) ? (s[1] && (Sys.chrome = s[1].split('.')[0])) : 0
  60. if (Sys.chrome) return { broswer: "Chrome", version: Sys.chrome };
  61. return { broswer: "", version: "0" };
  62. }
  63. var broswer = getBroswer();
  64. window.addEventListener('DOMContentLoaded', function () {
  65. if (broswer.broswer === 'Chrome' && parseFloat(broswer.version) <= 50) {
  66. document.getElementById('update').className = 'show'
  67. }
  68. })
  69. </script>
  70. </head>
  71. <body>
  72. <div id="app"></div>
  73. <div id="update">
  74. <img src="/update.png" />
  75. <span>您的系统当前版本过低,请及时前往系统设置进行升级。</span>
  76. </div>
  77. <img id="loading" class="show" src="/loading.svg" alt="loading" />
  78. <script type="module" src="/src/page-gym/main.ts"></script>
  79. </body>
  80. </html>