index.html 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. <!doctype html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8" />
  5. <link rel="icon" href="/favicon.ico" />
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  7. <title><%- title %></title>
  8. </head>
  9. <style>
  10. html,
  11. body,
  12. #app {
  13. width: 100%;
  14. height: 100%;
  15. padding: 0;
  16. margin: 0;
  17. }
  18. .loading-box {
  19. display: flex;
  20. flex-direction: column;
  21. align-items: center;
  22. justify-content: center;
  23. width: 100%;
  24. height: 100%;
  25. }
  26. .loading-box .loading-wrap {
  27. display: flex;
  28. align-items: center;
  29. justify-content: center;
  30. padding: 98px;
  31. }
  32. .dot {
  33. position: relative;
  34. box-sizing: border-box;
  35. display: inline-block;
  36. width: 32px;
  37. height: 32px;
  38. font-size: 32px;
  39. transform: rotate(45deg);
  40. animation: ant-rotate 1.2s infinite linear;
  41. }
  42. .dot i {
  43. position: absolute;
  44. display: block;
  45. width: 14px;
  46. height: 14px;
  47. background-color: #409eff;
  48. border-radius: 100%;
  49. opacity: 0.3;
  50. transform: scale(0.75);
  51. transform-origin: 50% 50%;
  52. animation: ant-spin-move 1s infinite linear alternate;
  53. }
  54. .dot i:nth-child(1) {
  55. top: 0;
  56. left: 0;
  57. }
  58. .dot i:nth-child(2) {
  59. top: 0;
  60. right: 0;
  61. animation-delay: 0.4s;
  62. }
  63. .dot i:nth-child(3) {
  64. right: 0;
  65. bottom: 0;
  66. animation-delay: 0.8s;
  67. }
  68. .dot i:nth-child(4) {
  69. bottom: 0;
  70. left: 0;
  71. animation-delay: 1.2s;
  72. }
  73. @keyframes ant-rotate {
  74. to {
  75. transform: rotate(405deg);
  76. }
  77. }
  78. @keyframes ant-spin-move {
  79. to {
  80. opacity: 1;
  81. }
  82. }
  83. </style>
  84. <body>
  85. <div id="app">
  86. <div class="loading-box">
  87. <div class="loading-wrap">
  88. <span class="dot dot-spin"></span>
  89. </div>
  90. </div>
  91. </div>
  92. <script>
  93. const globalState = JSON.parse(window.localStorage.getItem('global'))
  94. if (globalState) {
  95. const dot = document.querySelectorAll('.dot i')
  96. const html = document.querySelector('html')
  97. dot.forEach((item) => (item.style.background = globalState.primary))
  98. if (globalState.isDark) html.style.background = '#141414'
  99. }
  100. </script>
  101. <script type="module" src="/src/main.ts"></script>
  102. </body>
  103. </html>