Box2LinePlayRightArrow.vue 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <template>
  2. <view
  3. class="d-flex w-100 flex-row align-center bg-light-light-primary radius-base mt-2 p-2"
  4. @click="$emit('click')"
  5. >
  6. <image class="width-100 height-100 radius-base"
  7. :src="'https://mncdn.wenlvti.net/app_static/minnan/images/discover/' + (isPlaying && isCurrent ? 'PauseButtonLarge.png' : 'PlayButtonLarge.png')"
  8. mode="aspectFill"
  9. />
  10. <view class="d-flex flex-col ml-3 flex-one">
  11. <text class="color-primary">{{ title }}</text>
  12. <text v-if="desc" class="color-primary-second-text">{{ desc }}</text>
  13. </view>
  14. <view v-if="isCurrent" class="playing-anim">
  15. <view class="line line1"></view>
  16. <view class="line line2"></view>
  17. <view class="line line3"></view>
  18. </view>
  19. <text v-else class="iconfont icon-arrow-right color-primary" />
  20. </view>
  21. </template>
  22. <script setup lang="ts">
  23. defineProps({
  24. title: {
  25. type: String,
  26. default: ''
  27. },
  28. desc: {
  29. type: String,
  30. default: ''
  31. },
  32. isCurrent: {
  33. type: Boolean,
  34. default: false
  35. },
  36. isPlaying: {
  37. type: Boolean,
  38. default: false
  39. },
  40. })
  41. </script>
  42. <style lang="scss">
  43. .playing-anim {
  44. display: flex;
  45. justify-content: center;
  46. align-items: center;
  47. width: 50rpx;
  48. height: 50rpx;
  49. .line {
  50. width: 4rpx;
  51. border-radius: 2rpx;
  52. margin-right: 4rpx;
  53. background-color: #d94a2f;
  54. animation: playing-anim-loading 1.2s infinite ease-in-out;
  55. }
  56. .line1 {
  57. animation-delay: -0.4s;
  58. }
  59. .line2 {
  60. animation-delay: -0.2s;
  61. }
  62. .line3 {
  63. animation-delay: 0;
  64. margin-right: 0;
  65. }
  66. }
  67. @keyframes playing-anim-loading {
  68. 0%, 100% {
  69. height: 25rpx;
  70. }
  71. 50% {
  72. height: 40rpx;
  73. }
  74. }
  75. </style>