Playlist.vue 1.6 KB

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