SearchQueryItem.vue 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. <template>
  2. <div class="universal-item search-query-item">
  3. <div class="thumbnail-and-info">
  4. <img class="item-thumbnail" :src="result.thumbnail" />
  5. <div class="song-info">
  6. <h4 class="item-title" :title="result.title">
  7. {{ result.title }}
  8. </h4>
  9. <a
  10. v-if="result.channelTitle && result.channelId"
  11. class="item-description"
  12. :title="result.channelTitle"
  13. :href="'https://youtube.com/channel/' + result.channelId"
  14. target="_blank"
  15. >
  16. {{ result.channelTitle }}
  17. </a>
  18. </div>
  19. </div>
  20. <div class="universal-item-actions">
  21. <div class="icons-group">
  22. <a
  23. target="_blank"
  24. :href="`https://www.youtube.com/watch?v=${result.id}`"
  25. content="View on Youtube"
  26. v-tippy
  27. >
  28. <div class="youtube-icon"></div>
  29. </a>
  30. <slot name="actions" />
  31. </div>
  32. </div>
  33. </div>
  34. </template>
  35. <script>
  36. export default {
  37. props: {
  38. result: {
  39. type: Object,
  40. default: () => {}
  41. }
  42. }
  43. };
  44. </script>
  45. <style lang="scss">
  46. .search-query-actions-enter-active {
  47. transition: all 0.2s ease;
  48. }
  49. .search-query-actions-leave-active {
  50. transition: all 0.2s cubic-bezier(1, 0.5, 0.8, 1);
  51. }
  52. .search-query-actions-enter {
  53. transform: translateX(-20px);
  54. opacity: 0;
  55. }
  56. .search-query-actions-leave-to {
  57. transform: translateX(20px);
  58. opacity: 0;
  59. }
  60. </style>
  61. <style lang="scss" scoped>
  62. .night-mode {
  63. .search-query-item {
  64. background-color: var(--dark-grey-2) !important;
  65. border: 0 !important;
  66. }
  67. }
  68. .search-query-item {
  69. .thumbnail-and-info,
  70. .universal-item-actions {
  71. display: flex;
  72. align-items: center;
  73. }
  74. .universal-item-actions {
  75. margin-left: 5px;
  76. }
  77. .item-thumbnail {
  78. width: 55px;
  79. height: 55px;
  80. }
  81. .thumbnail-and-info {
  82. width: calc(100% - 160px);
  83. }
  84. .song-info {
  85. display: flex;
  86. flex-direction: column;
  87. justify-content: center;
  88. margin-left: 20px;
  89. width: calc(100% - 65px);
  90. .item-title {
  91. font-size: 20px;
  92. }
  93. .item-description {
  94. margin: 0;
  95. font-size: 14px;
  96. }
  97. *:not(i) {
  98. margin: 0;
  99. font-family: Karla, Arial, sans-serif;
  100. }
  101. }
  102. }
  103. </style>