index.html 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. <!doctype html>
  2. <html lang="zh-cmn-Hans" id="htmlRoot">
  3. <head>
  4. <meta charset="UTF-8" />
  5. <link rel="icon" type="image/svg+xml" href="/logo.svg" />
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  7. <title><%= title %></title>
  8. </head>
  9. <body>
  10. <div id="app">
  11. <script>
  12. ;(() => {
  13. const { darkMode = 'dark', appTheme = '#5d9dfe' } =
  14. JSON.parse(window.localStorage.getItem('DESIGN-SETTING')) || {}
  15. let htmlRoot = document.getElementById('htmlRoot')
  16. if (htmlRoot) {
  17. htmlRoot.classList.add(darkMode)
  18. }
  19. // 设置主题色变量
  20. document.documentElement.style.setProperty(
  21. '--app-theme-color',
  22. appTheme,
  23. )
  24. })()
  25. </script>
  26. <style>
  27. body {
  28. margin: 0;
  29. }
  30. html.dark .first-loading-wrap {
  31. background-color: #101014;
  32. }
  33. .first-loading-wrap {
  34. display: flex;
  35. width: 100%;
  36. height: 100vh;
  37. justify-content: center;
  38. align-items: center;
  39. flex-direction: column;
  40. }
  41. .first-loading-wrap > h1 {
  42. font-size: 28px;
  43. }
  44. .first-loading-wrap .loading-wrap {
  45. padding: 98px;
  46. display: flex;
  47. justify-content: center;
  48. align-items: center;
  49. }
  50. .dot {
  51. animation: antRotate 1.2s infinite linear;
  52. transform: rotate(45deg);
  53. position: relative;
  54. display: inline-block;
  55. font-size: 12px;
  56. width: 30px;
  57. height: 30px;
  58. box-sizing: border-box;
  59. }
  60. .dot i {
  61. width: 14px;
  62. height: 14px;
  63. position: absolute;
  64. display: block;
  65. background: var(--app-theme-color);
  66. border-radius: 100%;
  67. transform: scale(0.75);
  68. transform-origin: 50% 50%;
  69. opacity: 0.3;
  70. animation: antSpinMove 1s infinite linear alternate;
  71. }
  72. .dot i:nth-child(1) {
  73. top: 0;
  74. left: 0;
  75. }
  76. .dot i:nth-child(2) {
  77. top: 0;
  78. right: 0;
  79. -webkit-animation-delay: 0.4s;
  80. animation-delay: 0.4s;
  81. }
  82. .dot i:nth-child(3) {
  83. right: 0;
  84. bottom: 0;
  85. -webkit-animation-delay: 0.8s;
  86. animation-delay: 0.8s;
  87. }
  88. .dot i:nth-child(4) {
  89. bottom: 0;
  90. left: 0;
  91. -webkit-animation-delay: 1.2s;
  92. animation-delay: 1.2s;
  93. }
  94. @keyframes antRotate {
  95. to {
  96. -webkit-transform: rotate(405deg);
  97. transform: rotate(405deg);
  98. }
  99. }
  100. @-webkit-keyframes antRotate {
  101. to {
  102. -webkit-transform: rotate(405deg);
  103. transform: rotate(405deg);
  104. }
  105. }
  106. @keyframes antSpinMove {
  107. to {
  108. opacity: 1;
  109. }
  110. }
  111. @-webkit-keyframes antSpinMove {
  112. to {
  113. opacity: 1;
  114. }
  115. }
  116. </style>
  117. <div class="first-loading-wrap">
  118. <div class="loading-wrap">
  119. <span class="dot dot-spin"><i></i><i></i><i></i><i></i></span>
  120. </div>
  121. </div>
  122. </div>
  123. <script type="module" src="/src/main.ts"></script>
  124. </body>
  125. </html>