index.html 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. <!DOCTYPE html>
  2. <html lang="zh">
  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.0" />
  7. <title>管乐迷</title>
  8. <style>
  9. .hide {
  10. display: none !important;
  11. }
  12. .el-notification {
  13. display: flex;
  14. width: 330px;
  15. padding: 14px 26px 14px 13px;
  16. border-radius: 8px;
  17. box-sizing: border-box;
  18. border: 1px solid #ebeef5;
  19. position: fixed;
  20. background-color: #fff;
  21. box-shadow:0 2px 12px 0 rgba(0, 0, 0, 0.1);
  22. transition: opacity 0.3s,transform 0.3s,left 0.3s,right 0.3s,top .4s,bottom 0.3s;
  23. overflow-wrap: anywhere;
  24. overflow: hidden;
  25. z-index: 9999;
  26. top: 16px;
  27. z-index: 2011;
  28. right: 16px;
  29. }
  30. .el-icon {
  31. --color: inherit;
  32. height: 1em;
  33. width: 1em;
  34. line-height: 1em;
  35. display: inline-flex;
  36. justify-content: center;
  37. align-items: center;
  38. position: relative;
  39. fill: currentColor;
  40. color: var(--color);
  41. font-size: inherit;
  42. }
  43. .el-notification .el-notification--info {
  44. color: #909399;
  45. }
  46. .el-notification .el-notification__icon {
  47. height: 24px;
  48. width: 24px;
  49. font-size: 24px;
  50. }
  51. .el-icon svg {
  52. height: 1em;
  53. width: 1em;
  54. }
  55. .el-notification__group {
  56. margin-left: 13px;
  57. margin-right: 8px;
  58. }
  59. .el-notification__title {
  60. font-weight: 700;
  61. font-size: 16px;
  62. line-height: 24px;
  63. color: #303133;
  64. margin: 0;
  65. }
  66. .el-notification__content {
  67. font-size: 14px;
  68. line-height: 24px;
  69. margin: 6px 0 0 0;
  70. color: #606266;
  71. text-align: justify;
  72. }
  73. .el-notification__content p {
  74. margin: 0;
  75. }
  76. .el-notification .el-notification__closeBtn {
  77. position: absolute;
  78. top: 18px;
  79. right: 15px;
  80. cursor: pointer;
  81. color: #909399;
  82. font-size: 16px;
  83. }
  84. </style>
  85. </head>
  86. <body>
  87. <div id="app"></div>
  88. <script type="module" src="/src/main.ts"></script>
  89. <div id="notification_1" class="el-notification right hide" role="alert" style="top: 16px; z-index: 2011;"><i class="el-icon el-notification__icon el-notification--info"><svg class="icon" width="200" height="200" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg"><path fill="currentColor" d="M512 64a448 448 0 110 896.064A448 448 0 01512 64zm67.2 275.072c33.28 0 60.288-23.104 60.288-57.344s-27.072-57.344-60.288-57.344c-33.28 0-60.16 23.104-60.16 57.344s26.88 57.344 60.16 57.344zM590.912 699.2c0-6.848 2.368-24.64 1.024-34.752l-52.608 60.544c-10.88 11.456-24.512 19.392-30.912 17.28a12.992 12.992 0 01-8.256-14.72l87.68-276.992c7.168-35.136-12.544-67.2-54.336-71.296-44.096 0-108.992 44.736-148.48 101.504 0 6.784-1.28 23.68.064 33.792l52.544-60.608c10.88-11.328 23.552-19.328 29.952-17.152a12.8 12.8 0 017.808 16.128L388.48 728.576c-10.048 32.256 8.96 63.872 55.04 71.04 67.84 0 107.904-43.648 147.456-100.416z"></path></svg></i><div class="el-notification__group"><h2 class="el-notification__title">提示</h2><div class="el-notification__content"><p>为了保障更好的直播体验,建议使用chrome浏览器</p></div><i id="noClose" class="el-icon el-notification__closeBtn"><svg class="icon" width="200" height="200" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg"><path fill="currentColor" d="M764.288 214.592L512 466.88 259.712 214.592a31.936 31.936 0 00-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1045.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0045.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 10-45.12-45.184z"></path></svg></i></div></div>
  90. <script>
  91. var is360ByUserActivationProperty = () => {
  92. var navigator = window.navigator;
  93. if(navigator.userActivation){
  94. return false;//chrome
  95. }else{
  96. return true;//360极速
  97. }
  98. }
  99. function _mime(option, value) {
  100. var mimeTypes = navigator.mimeTypes;
  101. for (var mt in mimeTypes) {
  102. if (mimeTypes[mt][option] == value) {
  103. return true;
  104. }
  105. }
  106. return false;
  107. }
  108. var isChrome = navigator.userAgent.indexOf("Chrome") !== -1
  109. var is360 = is360ByUserActivationProperty() || _mime("type", "application/vnd.chromium.remoting-viewer")
  110. var isCloseBrowser = sessionStorage.getItem('isCloseBrowser')
  111. console.log(isChrome, is360, isCloseBrowser)
  112. // 如果不是360浏览器会提示
  113. if((!isChrome || is360) && !isCloseBrowser) {
  114. document.querySelector('#notification_1').classList.remove('hide')
  115. sessionStorage.removeItem('isCloseBrowser')
  116. }
  117. document.querySelector('#noClose').onclick = function() {
  118. document.querySelector('#notification_1').classList.add('hide')
  119. sessionStorage.setItem('isCloseBrowser', 1)
  120. }
  121. </script>
  122. </body>
  123. </html>