自己做的超高仿Win10加载动画(应该是全网最像的 HTML 实现了),自己想用就拿去用吧

在线演示

HTML:

  1. <div class="loading">
  2. <i>
  3. <span></span>
  4. <span></span>
  5. <span></span>
  6. <span></span>
  7. <span></span>
  8. <span></span>
  9. </i>
  10. </div>

CSS:

  1. html,
  2. body,
  3. div{
  4. margin: 0;
  5. padding: 0;
  6. }
  7. html,
  8. body {
  9. width: 100%;
  10. height: 100%;
  11. }
  12. .loading {
  13. width: 100%;
  14. height: 100%;
  15. background: #1E1E1E;
  16. position: relative;
  17. }
  18. .loading i {
  19. margin: auto;
  20. position: absolute;
  21. top: calc(50% - 40px);
  22. left: calc(50% - 40px);
  23. width: 80px;
  24. height: 80px;
  25. display: block;
  26. }
  27. .loading span {
  28. position: absolute;
  29. width: 100%;
  30. height: 100%;
  31. opacity: 0;
  32. animation: i 5.5s infinite;
  33. }
  34. .loading span:after {
  35. content: '';
  36. display: block;
  37. position: absolute;
  38. left: 0px;
  39. top: 0px;
  40. width: 10px;
  41. height: 10px;
  42. background: #0078D7;
  43. border-radius: 10px;
  44. }
  45. .loading span:nth-child(1) {
  46. animation-delay: 0.18s;
  47. }
  48. .loading span:nth-child(2) {
  49. animation-delay: 0.36s;
  50. }
  51. .loading span:nth-child(3) {
  52. animation-delay: 0.54s;
  53. }
  54. .loading span:nth-child(4) {
  55. animation-delay: 0.72s;
  56. }
  57. .loading span:nth-child(5) {
  58. animation-delay: .90s;
  59. }
  60. .loading span:nth-child(6) {
  61. animation-delay: 1.08s;
  62. }
  63. @keyframes i {
  64. 0% {
  65. opacity: 1;
  66. transform: rotate(180deg);
  67. animation-timing-function: cubic-bezier(.29,.44,.32,.74);
  68. }
  69. 7% {
  70. opacity: 1;
  71. transform: rotate(300deg);
  72. animation-timing-function: linear;
  73. }
  74. 30% {
  75. opacity: 1;
  76. transform: rotate(450deg);
  77. animation-timing-function: cubic-bezier(.53,.27,.37,.81);
  78. }
  79. 39% {
  80. opacity: 1;
  81. transform: rotate(645deg);
  82. animation-timing-function: linear;
  83. }
  84. 63% {
  85. opacity: 1;
  86. transform: rotate(800deg);
  87. animation-timing-function: cubic-bezier(.5,.32,.82,.54);
  88. }
  89. 68% {
  90. opacity: 1;
  91. transform: rotate(920deg);
  92. animation-timing-function: ease-in;
  93. }
  94. 69% {
  95. opacity: 0;
  96. transform: rotate(920deg);
  97. }
  98. 100% {
  99. opacity: 0;
  100. transform: rotate(900deg);
  101. }
  102. }

在线演示

HTML:

  1. <div id="preload">
  2. <span></span>
  3. <span></span>
  4. <span></span>
  5. <span></span>
  6. <span></span>
  7. <span></span>
  8. </div>

CSS:

  1. @keyframes loader {
  2. 1% {
  3. left: -10%;
  4. opacity: 1;
  5. }
  6. 60% {
  7. left: 110%;
  8. opacity: 1;
  9. }
  10. 61% {
  11. opacity: 0;
  12. }
  13. }
  14. #preload {
  15. z-index: 1000;
  16. position: fixed;
  17. width: 100%;
  18. height: 100%;
  19. background: #1E1E1E;
  20. top: 0;
  21. left: 0;
  22. transition: opacity .3s;
  23. }
  24. #preload span {
  25. display: block;
  26. bottom: 45%;
  27. height: 10px;
  28. width: 10px;
  29. position: fixed;
  30. background: #0078D7;
  31. z-index: 1001;
  32. display: inline-block;
  33. margin: 0 2px;
  34. border-radius: 100%;
  35. animation: loader 5s infinite cubic-bezier(0.030, 0.615, 0.995, 0.415);
  36. transform: translate(-50%,-50%);
  37. opacity: 0;
  38. }
  39. #preload span:nth-child(1) {
  40. animation-delay: 0.5s;
  41. }
  42. #preload span:nth-child(2) {
  43. animation-delay: 0.4s;
  44. }
  45. #preload span:nth-child(3) {
  46. animation-delay: 0.3s;
  47. }
  48. #preload span:nth-child(4) {
  49. animation-delay: 0.2s;
  50. }
  51. #preload span:nth-child(5) {
  52. animation-delay: 0.1s;
  53. }
  54. #preload span:nth-child(6) {
  55. animation-delay: 0;
  56. }

版权声明:本文为henrylin原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://www.cnblogs.com/henrylin/p/13124866.html