double-dot.vue 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <template>
  2. <view>
  3. <view class="spinner-inside" :style="{
  4. width: size+40+'px',
  5. height: size+40+'px'
  6. }">
  7. <view :style="{ backgroundColor:color }" class="dot1"></view>
  8. <view :style="{ backgroundColor:color }" class="dot2"></view>
  9. </view>
  10. </view>
  11. </template>
  12. <script>
  13. export default {
  14. name: 'doubleDot',
  15. props: {
  16. color: String,
  17. size: Number
  18. }
  19. }
  20. </script>
  21. <style scoped>
  22. .spinner-inside {
  23. margin: 25px auto;
  24. position: relative;
  25. text-align: center;
  26. -webkit-animation: rotate 2.0s infinite linear;
  27. animation: rotate 2.0s infinite linear;
  28. }
  29. .dot1, .dot2 {
  30. width: 60%;
  31. height: 60%;
  32. display: inline-block;
  33. position: absolute;
  34. top: 0;
  35. background-color: #67CF22;
  36. border-radius: 100%;
  37. -webkit-animation: bounce 2.0s infinite ease-in-out;
  38. animation: bounce 2.0s infinite ease-in-out;
  39. }
  40. .dot2 {
  41. top: auto;
  42. bottom: 0px;
  43. -webkit-animation-delay: -1.0s;
  44. animation-delay: -1.0s;
  45. }
  46. @-webkit-keyframes rotate { 100% { -webkit-transform: rotate(360deg) }}
  47. @keyframes rotate { 100% { transform: rotate(360deg); -webkit-transform: rotate(360deg) }}
  48. @-webkit-keyframes bounce {
  49. 0%, 100% { -webkit-transform: scale(0.0) }
  50. 50% { -webkit-transform: scale(1.0) }
  51. }
  52. @keyframes bounce {
  53. 0%, 100% {
  54. transform: scale(0.0);
  55. -webkit-transform: scale(0.0);
  56. } 50% {
  57. transform: scale(1.0);
  58. -webkit-transform: scale(1.0);
  59. }
  60. }
  61. </style>