orchestra.html 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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>
  10. this.globalThis || (this.globalThis = this)
  11. </script>
  12. <script src="/helpers/lottie.min.js"></script>
  13. <link href="/vant.css" rel="stylesheet">
  14. <script>
  15. if (window.navigator && navigator.serviceWorker) {
  16. navigator.serviceWorker.getRegistrations().then(function (registrations) {
  17. for (let registration of registrations) {
  18. registration.unregister()
  19. }
  20. })
  21. }
  22. function _postMessage(data, callback) {
  23. const instance = window.ORCHESTRA || (window.webkit && window.webkit.messageHandlers && window.webkit.messageHandlers.ORCHESTRA)
  24. if (instance) {
  25. const uuid = '' + Date.now() + Math.floor(Math.random() * 1000000)
  26. data.content = data.content ? { ...data.content, uuid } : { uuid }
  27. console.log('h5发送:', JSON.stringify(data))
  28. instance.postMessage(JSON.stringify(data))
  29. }
  30. }
  31. _postMessage({
  32. api: 'cloudLoading',
  33. content: {
  34. show: true,
  35. type: 'fullscreen',
  36. },
  37. })
  38. </script>
  39. <style>
  40. #lottieWeb {
  41. position: fixed;
  42. z-index: 100;
  43. top: 50%;
  44. left: 50%;
  45. width: 100Px;
  46. height: 100Px;
  47. transform: translate(-50%, -50%);
  48. pointer-events: none;
  49. transition: opacity .3s;
  50. }
  51. </style>
  52. </head>
  53. <body>
  54. <div id="app"></div>
  55. <div id="lottieWeb"></div>
  56. <script>
  57. lottie.loadAnimation({
  58. container: document.getElementById('lottieWeb'),
  59. renderer: 'svg',
  60. width: '30px',
  61. height: '30px',
  62. loop: true,
  63. autoplay: true,
  64. path: '/orchestra-music-score/loading.json'
  65. });
  66. window.addEventListener('load', function () {
  67. const loadingEle = document.getElementById('lottieWeb')
  68. loadingEle.style.opacity = '0'
  69. setTimeout(() => {
  70. loadingEle.style.display = 'none'
  71. }, 1000)
  72. })
  73. </script>
  74. <script type="module" src="/src/subpages/colexiu/main.ts"></script>
  75. </body>
  76. </html>