index.html 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <!DOCTYPE html>
  2. <html lang="zh-CN">
  3. <head>
  4. <meta charset="UTF-8">
  5. <link rel="icon" href="favicon.png">
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7. <title>magic-api</title>
  8. <style>
  9. .magic-loading-wrapper {position: absolute;top: 0;bottom: 0;left: 0;right: 0;z-index: 10000000;text-align: center;background: #fff;}
  10. .magic-loading-container {position: absolute;top: 50%;left: 50%;width: 500px;height: 100px;margin-left: -250px;margin-top: -50px;text-align: center;}
  11. .magic-loading-container .magic-title {font-size: 0;color: #0075ff;letter-spacing: 0;}
  12. .magic-loading-container .magic-title label {font-size: 14px;display: inline-block;margin-top: 5px;vertical-align: top;}
  13. .magic-loading-container .magic-title span {font-size: 20px;display: inline-block;padding: 0 3px;animation: stretch 1s infinite;}
  14. .magic-loading-container .magic-title span:nth-child(1) {animation-delay: calc(1s / 8 * 0 / 2);}
  15. .magic-loading-container .magic-title span:nth-child(2) {animation-delay: calc(1s / 8 * 1 / 2);}
  16. .magic-loading-container .magic-title span:nth-child(3) {animation-delay: calc(1s / 8 * 2 / 2);}
  17. .magic-loading-container .magic-title span:nth-child(4) {animation-delay: calc(1s / 8 * 3 / 2);}
  18. .magic-loading-container .magic-title span:nth-child(5) {animation-delay: calc(1s / 8 * 4 / 2);}
  19. .magic-loading-container .magic-title span:nth-child(6) {animation-delay: calc(1s / 8 * 5 / 2);}
  20. .magic-loading-container .magic-title span:nth-child(7) {animation-delay: calc(1s / 8 * 6 / 2);}
  21. .magic-loading-container .magic-title span:nth-child(8) {animation-delay: calc(1s / 8 * 7 / 2);}
  22. .magic-loading-container .magic-loading-text {text-align: center;font-weight: bolder;font-style: italic;color: #889aa4;font-size: 14px;margin-top: 5px;animation: blink-loading 2s ease-in infinite;}
  23. @keyframes stretch {0% {transform: scale(1);}25% {transform: scale(1.2);}50% {transform: scale(1);}100% {transform: scale(1);}}
  24. @keyframes blink-loading {0% {opacity: 1;}50% {opacity: 0.5;}100% {opacity: 1;}}
  25. </style>
  26. </head>
  27. <body>
  28. <div class="magic-loading-wrapper" id="magic-loading-wrapper">
  29. <div class="magic-loading-container">
  30. <div class="magic-title">
  31. <span>L</span>
  32. <span>o</span>
  33. <span>a</span>
  34. <span>d</span>
  35. <span>i</span>
  36. <span>n</span>
  37. <span>g</span>
  38. </div>
  39. <div class="magic-loading-text" id="magic-loading-text"></div>
  40. </div>
  41. </div>
  42. <script>
  43. function showMaLoadingText(){
  44. let defaultConfig = {
  45. title: 'magic-api',
  46. version: '@VERSION@'
  47. }
  48. defaultConfig = { ...defaultConfig, ...window.MAGIC_EDITOR_CONFIG }
  49. let $dom = document.getElementById('magic-loading-text')
  50. $dom.innerText = 'By ' + defaultConfig.title + ' ' + defaultConfig.version
  51. document.title = defaultConfig.title + ' v' + defaultConfig.version
  52. }
  53. function hideMaLoading() {
  54. document.getElementById('magic-loading-wrapper').style.display = 'none'
  55. }
  56. </script>
  57. <script src="./config-js" onload="showMaLoadingText()" onerror="showMaLoadingText()"></script>
  58. <div id="app"></div>
  59. <script type="module" src="/src/main.js"></script>
  60. </body>
  61. </html>