Playlist.vue 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. <template>
  2. <div class='sidebar' transition='slide' v-if='$parent.sidebars.playlist'>
  3. <div class='inner-wrapper'>
  4. <div class='title'>Playlists</div>
  5. <aside class='menu'>
  6. <ul class='menu-list'>
  7. <li>
  8. <a href='#'>Top 40</a>
  9. <a href='#' @click='$parent.editPlaylist(56);'>
  10. <i class='material-icons'>edit</i>
  11. </a>
  12. </li>
  13. </ul>
  14. </aside>
  15. <a class='button create-playlist' @click='$parent.toggleModal("createPlaylist")'>Create Playlist</a>
  16. </div>
  17. </div>
  18. </template>
  19. <script>
  20. export default {
  21. ready: function () {
  22. let _this = this;
  23. let socketInterval = setInterval(() => {
  24. if (!!_this.$parent.$parent.socket) {
  25. _this.socket = _this.$parent.$parent.socket;
  26. // get users playlists
  27. clearInterval(socketInterval);
  28. }
  29. }, 100);
  30. }
  31. }
  32. </script>
  33. <style type='scss' scoped>
  34. .sidebar {
  35. position: fixed;
  36. top: 0;
  37. right: 0;
  38. width: 300px;
  39. height: 100vh;
  40. background-color: #fff;
  41. box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12);
  42. }
  43. .inner-wrapper {
  44. top: 50px;
  45. position: relative;
  46. }
  47. .slide-transition {
  48. transition: transform 0.6s ease-in-out;
  49. transform: translateX(0);
  50. }
  51. .slide-enter, .slide-leave { transform: translateX(100%); }
  52. .title {
  53. background-color: rgb(3, 169, 244);
  54. text-align: center;
  55. padding: 10px;
  56. color: white;
  57. font-weight: 600;
  58. }
  59. .create-playlist {
  60. width: 100%;
  61. margin-top: 25px;
  62. height: 40px;
  63. border-radius: 0;
  64. background: rgb(3, 169, 244);
  65. color: #fff !important;
  66. border: 0;
  67. &:active, &:focus { border: 0; }
  68. }
  69. .menu { padding: 0 20px; }
  70. .menu-list li a:hover { color: #000 !important; }
  71. .menu-list li {
  72. display: flex;
  73. justify-content: space-between;
  74. }
  75. li a {
  76. display: flex;
  77. align-items: center;
  78. }
  79. </style>