index.html 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <!DOCTYPE html>
  2. <html lang="ZH-cn">
  3. <head>
  4. <meta charset="UTF-8" />
  5. <link rel="icon" href="/favicon.ico" />
  6. <title>管乐团云教练</title>
  7. <meta name="description" content="管乐团APP,器乐学习的不二选择" />
  8. <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no" />
  9. <script src="/helpers/lottie.min.js"></script>
  10. <link href="/vant.css" rel="stylesheet">
  11. <script>
  12. if (window.navigator && navigator.serviceWorker) {
  13. navigator.serviceWorker.getRegistrations().then(function (registrations) {
  14. for (let registration of registrations) {
  15. registration.unregister()
  16. }
  17. })
  18. }
  19. function _postMessage(data, callback) {
  20. const instance = window.ORCHESTRA || (window.webkit && window.webkit.messageHandlers && window.webkit.messageHandlers.ORCHESTRA)
  21. if (instance) {
  22. const uuid = '' + Date.now() + Math.floor(Math.random() * 1000000)
  23. data.content = data.content ? { ...data.content, uuid } : { uuid }
  24. console.log('h5发送:', JSON.stringify(data))
  25. instance.postMessage(JSON.stringify(data))
  26. }
  27. }
  28. _postMessage({
  29. api: 'cloudLoading',
  30. content: {
  31. show: true,
  32. type: 'fullscreen',
  33. },
  34. })
  35. </script>
  36. <style>
  37. #lottieWeb {
  38. position: fixed;
  39. z-index: 100;
  40. top: 50%;
  41. left: 50%;
  42. width: 100Px;
  43. height: 100Px;
  44. transform: translate(-50%, -50%);
  45. pointer-events: none;
  46. transition: opacity .3s;
  47. }
  48. </style>
  49. </head>
  50. <body>
  51. <div id="app"></div>
  52. <div id="lottieWeb"></div>
  53. <script>
  54. lottie.loadAnimation({
  55. container: document.getElementById('lottieWeb'),
  56. renderer: 'svg',
  57. width: '30px',
  58. height: '30px',
  59. loop: true,
  60. autoplay: true,
  61. path: '/orchestra-music-score/loading.json'
  62. });
  63. window.addEventListener('load', function () {
  64. const loadingEle = document.getElementById('lottieWeb')
  65. loadingEle.style.opacity = '0'
  66. setTimeout(() => {
  67. loadingEle.style.display = 'none'
  68. }, 1000)
  69. })
  70. </script>
  71. <script type="module" src="/src/subpages/colexiu/main.ts"></script>
  72. </body>
  73. </html>