• html, css写一个loading


    效果图:

     

    1. <template>
    2. <div>
    3. <div class="loading3">
    4. <div class="loader">
    5. <span v-for="i in 13">span>
    6. div>
    7. div>
    8. div>
    9. template>
    10. <script>
    11. script>
    12. <style lang="less" scoped>
    13. .loading3 {
    14. width: 100%;
    15. height: 500px;
    16. background: linear-gradient(#000 70%, pink);
    17. .loader {
    18. width: 15rem;
    19. height: 15rem;
    20. border: 8px solid rgb(21, 93, 228);
    21. border-radius: 50%;
    22. margin: 0 auto;
    23. display: flex;
    24. align-items: center;
    25. justify-content: center;
    26. background: pink;
    27. span {
    28. width: 5px;
    29. height: 50px;
    30. background: rgb(21, 93, 228);
    31. margin: 0 2px;
    32. animation: span-animation 1.5s ease-in-out infinite;
    33. animation-delay: calc(var(--n) * 0.05s);
    34. }
    35. }
    36. }
    37. // 关键帧
    38. @keyframes span-animation{
    39. 0%, 100% {
    40. transform:scaleY(0.05) translateX(-0.5em);
    41. }
    42. 40%{
    43. transform:scaleY(2) translatex(1em);
    44. }
    45. }
    46. .loading3 .loader span:nth-of-type(1){ --n: 1; }
    47. .loading3 .loader span:nth-of-type(2){ --n: 2;}
    48. .loading3 .loader span:nth-of-type(3){ --n: 3;}
    49. .loading3 .loader span:nth-of-type(4){ --n: 4;}
    50. .loading3 .loader span:nth-of-type(5){ --n: 5;}
    51. .loading3 .loader span:nth-of-type(6){ --n: 6;}
    52. .loading3 .loader span:nth-of-type(7){ --n: 7;}
    53. .loading3 .loader span:nth-of-type(8){ --n: 8;}
    54. .loading3 .loader span:nth-of-type(9){ --n: 9;}
    55. .loading3 .loader span:nth-of-type(10){ --n: 10;}
    56. .loading3 .loader span:nth-of-type(11){ --n: 11;}
    57. .loading3 .loader span:nth-of-type(12){ --n: 12;}
    58. .loading3 .loader span:nth-of-type(13){ --n: 13;}
    59. .title {
    60. text-align: left;
    61. }
    62. style>

  • 相关阅读:
    涨粉超100万,这些博主的内容密码是什么?
    C++ 三大特性之-多态
    Java错题归纳day19
    LINUX中命令
    尚硅谷Vue系列教程学习笔记(8)
    发布Python包到pypi
    【面试题精讲】为什么重写equals时必须重写hashCode方法?
    手机备忘录怎么设置每月5号提醒事件
    PLC和工控机的网络特性
    常见web信息泄露
  • 原文地址:https://blog.csdn.net/yinge0508/article/details/126545158