instrument.html 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8" />
  5. <meta name="viewport"
  6. content="user-scalable=no, width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, viewport-fit=cover" />
  7. <title>AI学练</title>
  8. <link rel="icon" href="/favicon.ico?v=1" />
  9. <script src="/flexible.js" charset="UTF-8"></script>
  10. <script src="https://unpkg.com/vconsole@latest/dist/vconsole.min.js"></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. </style>
  23. <script>
  24. // VConsole will be exported to `window.VConsole` by default.
  25. // var vConsole = new window.VConsole();
  26. </script>
  27. <script>
  28. function _postMessage(data, callback) {
  29. const instance = window.COLEXIU || (window.webkit && window.webkit.messageHandlers && window.webkit.messageHandlers.COLEXIU)
  30. if (instance) {
  31. instance.postMessage(JSON.stringify(data))
  32. }
  33. }
  34. // APP的全屏loading动画
  35. if (!location.href.includes('iscurseplay=play') && !location.href.includes('isPreView=true') && !location.href.includes("simple-detail")) {
  36. _postMessage({
  37. api: 'cloudLoading',
  38. content: {
  39. show: true,
  40. type: 'fullscreen',
  41. },
  42. })
  43. }
  44. </script>
  45. </head>
  46. <body>
  47. <div id="app"></div>
  48. <img id="loading" class="show" src="/loading.svg" alt="loading" />
  49. <script>
  50. // 处理课堂乐器老师端打开听音练习时去掉加载动画
  51. if (location.href.indexOf('view-figner') >= 0 && location.href.indexOf('platform=pc') >= 0 && location.href.indexOf('linkSource=class') < 0 && !location.href.includes("simple-detail")) {
  52. var _loading = document.getElementById("loading");
  53. _loading && document.body.removeChild(_loading);
  54. }
  55. </script>
  56. <script type="module" src="/src/page-instrument/main.ts"></script>
  57. </body>
  58. </html>