hx-load.vue 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. <template>
  2. <view class="hx-load">
  3. <view class="style1" v-if="style == 1">
  4. <view class="">
  5. <view class="item bounce1" :style="color ? `background-color: ${color}` : '' "></view>
  6. <view class="item bounce2" :style="color ? `background-color: ${color}` : '' "></view>
  7. <view class="item bounce3" :style="color ? `background-color: ${color}` : '' "></view>
  8. </view>
  9. <text>{{txt}}</text>
  10. </view>
  11. </view>
  12. </template>
  13. <script>
  14. export default {
  15. name: 'hx-load',
  16. data() {
  17. return {
  18. };
  19. },
  20. props:{
  21. 'color': {
  22. type: String,
  23. default: '',
  24. },
  25. 'style': {
  26. type: Number,
  27. default: 1,
  28. },
  29. 'txt': {
  30. type: String,
  31. default: '正在载入',
  32. }
  33. }
  34. }
  35. </script>
  36. <style lang="scss">
  37. .hx-load{
  38. .style1 {
  39. margin: 20px auto;
  40. width: 150px;
  41. text-align: center;
  42. .item {
  43. width: 12px;
  44. height: 12px;
  45. background-color: #ffd11c;
  46. margin: 0 3px;
  47. border-radius: 100%;
  48. display: inline-block;
  49. -webkit-animation: bouncedelay 1.4s infinite ease-in-out;
  50. animation: bouncedelay 1.4s infinite ease-in-out;
  51. -webkit-animation-fill-mode: both;
  52. animation-fill-mode: both;
  53. }
  54. .bounce1 {
  55. -webkit-animation-delay: -0.32s;
  56. animation-delay: -0.32s;
  57. }
  58. .bounce2 {
  59. -webkit-animation-delay: -0.16s;
  60. animation-delay: -0.16s;
  61. }
  62. text{
  63. margin-top: 6px;
  64. font-size: 12px;
  65. color: #cccccc;
  66. }
  67. }
  68. @-webkit-keyframes bouncedelay {
  69. 0%, 80%, 100% { -webkit-transform: scale(0.0) }
  70. 40% { -webkit-transform: scale(1.0) }
  71. }
  72. @keyframes bouncedelay {
  73. 0%, 80%, 100% {
  74. transform: scale(0.0);
  75. -webkit-transform: scale(0.0);
  76. } 40% {
  77. transform: scale(1.0);
  78. -webkit-transform: scale(1.0);
  79. }
  80. }
  81. }
  82. </style>