index.html 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. <!doctype html>
  2. <html lang="en" id="htmlRoot">
  3. <head>
  4. <meta charset="UTF-8" />
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
  6. <meta name="renderer" content="webkit" />
  7. <meta name="viewport"
  8. content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=0" />
  9. <title>{{title}}</title>
  10. <link rel="icon" href="" id="favicon" />
  11. </head>
  12. <body>
  13. <div id="app">
  14. <style>
  15. html {
  16. /* same as ant-design-vue/dist/reset.css setting, avoid the title line-height changed */
  17. line-height: 1.15;
  18. }
  19. html[data-theme='dark'] .app-loading {
  20. background-color: #2c344a;
  21. }
  22. html[data-theme='dark'] .app-loading .app-loading-title {
  23. color: rgb(255 255 255 / 85%);
  24. }
  25. .app-loading {
  26. display: flex;
  27. flex-direction: column;
  28. align-items: center;
  29. justify-content: center;
  30. width: 100%;
  31. height: 100%;
  32. background-color: #f4f7f9;
  33. }
  34. .app-loading .app-loading-wrap {
  35. display: flex;
  36. position: absolute;
  37. top: 50%;
  38. left: 50%;
  39. flex-direction: column;
  40. align-items: center;
  41. justify-content: center;
  42. transform: translate3d(-50%, -50%, 0);
  43. }
  44. .app-loading .dots {
  45. display: flex;
  46. align-items: center;
  47. justify-content: center;
  48. padding: 98px;
  49. }
  50. .app-loading .app-loading-title {
  51. display: flex;
  52. align-items: center;
  53. justify-content: center;
  54. margin-top: 30px;
  55. color: rgb(0 0 0 / 85%);
  56. font-size: 30px;
  57. }
  58. .app-loading .app-loading-logo {
  59. display: block;
  60. width: 90px;
  61. margin: 0 auto;
  62. margin-bottom: 20px;
  63. }
  64. .dot {
  65. display: inline-block;
  66. position: relative;
  67. box-sizing: border-box;
  68. width: 48px;
  69. height: 48px;
  70. margin-top: 30px;
  71. transform: rotate(45deg);
  72. animation: ant-rotate 1.2s infinite linear;
  73. font-size: 32px;
  74. }
  75. .dot i {
  76. display: block;
  77. position: absolute;
  78. width: 20px;
  79. height: 20px;
  80. transform: scale(0.75);
  81. transform-origin: 50% 50%;
  82. animation: ant-spin-move 1s infinite linear alternate;
  83. border-radius: 100%;
  84. opacity: 0.3;
  85. background-color: #0065cc;
  86. }
  87. .dot i:nth-child(1) {
  88. top: 0;
  89. left: 0;
  90. }
  91. .dot i:nth-child(2) {
  92. top: 0;
  93. right: 0;
  94. animation-delay: 0.4s;
  95. }
  96. .dot i:nth-child(3) {
  97. right: 0;
  98. bottom: 0;
  99. animation-delay: 0.8s;
  100. }
  101. .dot i:nth-child(4) {
  102. bottom: 0;
  103. left: 0;
  104. animation-delay: 1.2s;
  105. }
  106. @keyframes ant-rotate {
  107. to {
  108. transform: rotate(405deg);
  109. }
  110. }
  111. @keyframes ant-spin-move {
  112. to {
  113. opacity: 1;
  114. }
  115. }
  116. </style>
  117. <div class="app-loading">
  118. <div class="app-loading-wrap">
  119. <!-- <img :src="avatarUrl || ''" id="loadingImage" class="app-loading-logo" alt="Logo" /> -->
  120. <img id="loadingImage" class="app-loading-logo" alt="Logo" />
  121. <div class="app-loading-dots">
  122. <span class="dot dot-spin"><i></i><i></i><i></i><i></i></span>
  123. </div>
  124. <div class="app-loading-title">
  125. <!-- <%= VITE_GLOB_APP_TITLE %> -->
  126. Loading...
  127. </div>
  128. </div>
  129. </div>
  130. </div>
  131. <script type="module" src="/src/main.ts"></script>
  132. <script>
  133. document.addEventListener('DOMContentLoaded', function () {
  134. // 从 localStorage 获取数据
  135. const title = localStorage.getItem('departmentName') || '';
  136. const avatarUrl = localStorage.getItem('avatar') || '';
  137. // 设置页面标题
  138. document.title = title;
  139. // 更新 favicon 图标
  140. function updateFavicon(url) {
  141. let link = document.querySelector("link[rel~='icon']");
  142. if (!link) {
  143. link = document.createElement('link');
  144. link.rel = 'icon';
  145. document.head.appendChild(link);
  146. }
  147. link.href = url ? `${url}?v=${new Date().getTime()}` : '';
  148. }
  149. updateFavicon(avatarUrl);
  150. // 设置加载页面中的图标和标题
  151. const loadingImage = document.getElementById('loadingImage');
  152. if (loadingImage) {
  153. if (avatarUrl) {
  154. loadingImage.src = avatarUrl; // 设置图标路径
  155. loadingImage.style.display = 'block'; // 显示图标
  156. } else {
  157. loadingImage.style.display = 'none'; // 隐藏图标
  158. }
  159. }
  160. const loadingTitle = document.querySelector('.app-loading-title');
  161. if (loadingTitle) {
  162. loadingTitle.textContent = title || 'Loading...'; // 设置标题
  163. }
  164. });
  165. </script>
  166. </body>
  167. </html>