OfficialQueue.vue 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. <template>
  2. <div class='sidebar' transition='slide' v-if='$parent.sidebars.officialqueue'>
  3. <div class='inner-wrapper'>
  4. <div class='title'>Official Queue</div>
  5. <article class="media">
  6. <figure class="media-left">
  7. <p class="image is-64x64">
  8. <img :src="$parent.currentSong.thumbnail" onerror="this.src='/assets/notes-transparent.png'">
  9. </p>
  10. </figure>
  11. <div class="media-content">
  12. <div class="content">
  13. <p>
  14. Current Song: <strong>{{ $parent.currentSong.title }}</strong>
  15. <br>
  16. <small>{{ $parent.currentSong.artists }}</small>
  17. </p>
  18. </div>
  19. </div>
  20. <div class="media-right">
  21. {{ $parent.formatTime($parent.currentSong.duration) }}
  22. </div>
  23. </article>
  24. <article class="media" v-for='song in $parent.queue'>
  25. <div class="media-content">
  26. <div class="content">
  27. <p>
  28. <strong>{{ song.title }}</strong>
  29. <br>
  30. <small>{{ song.artists }}</small>
  31. </p>
  32. </div>
  33. </div>
  34. </article>
  35. </div>
  36. </div>
  37. </template>
  38. <script>
  39. import io from '../../io';
  40. export default {
  41. ready: function () {
  42. let _this = this;
  43. io.getSocket((socket) => {
  44. _this.socket = socket;
  45. // get official station playlist
  46. });
  47. }
  48. }
  49. </script>
  50. <style type='scss' scoped>
  51. .sidebar {
  52. position: fixed;
  53. z-index: 1;
  54. top: 0;
  55. right: 0;
  56. width: 300px;
  57. height: 100vh;
  58. background-color: #fff;
  59. box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12);
  60. }
  61. .inner-wrapper {
  62. top: 64px;
  63. position: relative;
  64. }
  65. .slide-transition {
  66. transition: transform 0.6s ease-in-out;
  67. transform: translateX(0);
  68. }
  69. .slide-enter, .slide-leave { transform: translateX(100%); }
  70. .title {
  71. background-color: rgb(3, 169, 244);
  72. text-align: center;
  73. padding: 10px;
  74. color: white;
  75. font-weight: 600;
  76. }
  77. .media { padding: 0px 25px;}
  78. .media-content .content {
  79. height: 64px;
  80. display: flex;
  81. align-items: center;
  82. strong { word-break: break-word; }
  83. }
  84. .media-right { line-height: 64px; }
  85. </style>