Station.vue 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898
  1. <template>
  2. <official-header v-if='type == "official"'></official-header>
  3. <community-header v-if='type == "community"'></community-header>
  4. <song-queue v-if='modals.addSongToQueue'></song-queue>
  5. <edit-playlist v-if='modals.editPlaylist'></edit-playlist>
  6. <create-playlist v-if='modals.createPlaylist'></create-playlist>
  7. <edit-station v-if='modals.editStation'></edit-station>
  8. <report v-if='modals.report'></report>
  9. <songs-list-sidebar v-if='sidebars.songslist'></songs-list-sidebar>
  10. <playlist-sidebar v-if='sidebars.playlist'></playlist-sidebar>
  11. <users-sidebar v-if='sidebars.users'></users-sidebar>
  12. <div class="station">
  13. <div v-show="noSong" class="no-song">
  14. <h1>No song is currently playing</h1>
  15. <h4 v-if='type === "community" && station.partyMode'>
  16. <a href='#' class='no-song' @click='modals.addSongToQueue = true'>Add a Song to the Queue</a>
  17. </h4>
  18. <h4 v-if='type === "community" && !station.partyMode && $parent.userId === station.owner && !station.privatePlaylist'>
  19. <a href='#' class='no-song' @click='sidebars.playlist = true'>Play a private playlist</a>
  20. </h4>
  21. <h1 v-if='type === "community" && !station.partyMode && $parent.userId === station.owner && station.privatePlaylist'>Maybe you can add some songs to your selected private playlist and then press the skip button</h1>
  22. </div>
  23. <div class="columns is-mobile" v-show="!noSong">
  24. <div class="column is-8-desktop is-offset-2-desktop is-12-mobile">
  25. <div class="video-container">
  26. <div id="player"></div>
  27. <div class="seeker-bar-container white" id="preview-progress">
  28. <div class="seeker-bar light-blue" style="width: 0%;"></div>
  29. </div>
  30. </div>
  31. </div>
  32. </div>
  33. <div class="columns is-mobile" v-show="!noSong">
  34. <div class="column is-8-desktop is-offset-2-desktop is-12-mobile">
  35. <div class="columns is-mobile">
  36. <div class="column is-12-mobile" v-bind:class="{'is-8-desktop': !simpleSong}">
  37. <h4 id="time-display">{{timeElapsed}} / {{formatTime(currentSong.duration)}}</h4>
  38. <h3>{{currentSong.title}}</h3>
  39. <h4 class="thin" style="margin-left: 0">{{currentSong.artists}}</h4>
  40. <div class="columns is-mobile">
  41. <form style="margin-top: 12px; margin-bottom: 0;" action="#" class="column is-7-desktop is-4-mobile">
  42. <p class='volume-slider-wrapper'>
  43. <i class="material-icons" @click='toggleMute()' v-if='muted'>volume_mute</i>
  44. <i class="material-icons" @click='toggleMute()' v-else>volume_down</i>
  45. <input type="range" id="volumeSlider" min="0" max="100" class="active" v-on:change="changeVolume()" v-on:input="changeVolume()">
  46. <i class="material-icons" @click='toggleMaxVolume()'>volume_up</i>
  47. </p>
  48. </form>
  49. <div class="column is-8-mobile is-5-desktop" style="float: right;">
  50. <ul id="ratings" v-if="currentSong.likes !== -1 && currentSong.dislikes !== -1">
  51. <li id="like" class="right" @click="toggleLike()">
  52. <span class="flow-text">{{currentSong.likes}} </span>
  53. <i id="thumbs_up" class="material-icons grey-text" v-bind:class="{ liked: liked }">thumb_up</i>
  54. <a class='absolute-a behind' @click="toggleLike()" href='#'></a>
  55. </li>
  56. <li style="margin-right: 10px;" id="dislike" class="right" @click="toggleDislike()">
  57. <span class="flow-text">{{currentSong.dislikes}} </span>
  58. <i id="thumbs_down" class="material-icons grey-text" v-bind:class="{ disliked: disliked }">thumb_down</i>
  59. <a class='absolute-a behind' @click="toggleDislike()" href='#'></a>
  60. </li>
  61. </ul>
  62. </div>
  63. </div>
  64. </div>
  65. <div class="column is-4-desktop" v-if="!simpleSong">
  66. <img class="image" id="song-thumbnail" style="margin-top: 10px !important" :src="currentSong.thumbnail" alt="Song Thumbnail" onerror="this.src='/assets/notes-transparent.png'" />
  67. </div>
  68. </div>
  69. </div>
  70. </div>
  71. </div>
  72. </template>
  73. <script>
  74. import { Toast } from 'vue-roaster';
  75. import SongQueue from '../Modals/AddSongToQueue.vue';
  76. import EditPlaylist from '../Modals/Playlists/Edit.vue';
  77. import CreatePlaylist from '../Modals/Playlists/Create.vue';
  78. import EditStation from '../Modals/EditStation.vue';
  79. import Report from '../Modals/Report.vue';
  80. import SongsListSidebar from '../Sidebars/SongsList.vue';
  81. import PlaylistSidebar from '../Sidebars/Playlist.vue';
  82. import UsersSidebar from '../Sidebars/UsersList.vue';
  83. import OfficialHeader from './OfficialHeader.vue';
  84. import CommunityHeader from './CommunityHeader.vue';
  85. import io from '../../io';
  86. export default {
  87. data() {
  88. return {
  89. type: '',
  90. playerReady: false,
  91. previousSong: null,
  92. currentSong: {},
  93. player: undefined,
  94. timePaused: 0,
  95. paused: false,
  96. muted: false,
  97. timeElapsed: '0:00',
  98. liked: false,
  99. disliked: false,
  100. modals: {
  101. addSongToQueue: false,
  102. editPlaylist: false,
  103. createPlaylist: false,
  104. editStation: false,
  105. report: false
  106. },
  107. sidebars: {
  108. songslist: false,
  109. users: false,
  110. playlist: false
  111. },
  112. noSong: false,
  113. simpleSong: false,
  114. songsList: [],
  115. timeBeforePause: 0,
  116. station: {},
  117. skipVotes: 0,
  118. privatePlaylistQueueSelected: null,
  119. automaticallyRequestedSongId: null,
  120. systemDifference: 0
  121. }
  122. },
  123. methods: {
  124. editPlaylist: function (id) {
  125. this.playlistBeingEdited = id;
  126. this.modals.editPlaylist = !this.modals.editPlaylist;
  127. },
  128. toggleSidebar: function (type) {
  129. Object.keys(this.sidebars).forEach(sidebar => {
  130. if (sidebar !== type) this.sidebars[sidebar] = false;
  131. else this.sidebars[type] = !this.sidebars[type];
  132. });
  133. },
  134. youtubeReady: function() {
  135. let local = this;
  136. if (!local.player) {
  137. local.player = new YT.Player("player", {
  138. height: 270,
  139. width: 480,
  140. videoId: local.currentSong._id,
  141. startSeconds: local.getTimeElapsed() / 1000 + local.currentSong.skipDuration,
  142. playerVars: {controls: 0, iv_load_policy: 3, rel: 0, showinfo: 0},
  143. events: {
  144. 'onReady': function (event) {
  145. local.playerReady = true;
  146. let volume = parseInt(localStorage.getItem("volume"));
  147. volume = (typeof volume === "number") ? volume : 20;
  148. local.player.setVolume(volume);
  149. if (volume > 0) local.player.unMute();
  150. local.playVideo();
  151. },
  152. 'onError': function(err) {
  153. console.log("iframe error", err);
  154. local.voteSkipStation();
  155. },
  156. 'onStateChange': function (event) {
  157. if (event.data === 1 && local.videoLoading === true) {
  158. local.videoLoading = false;
  159. local.player.seekTo(local.getTimeElapsed() / 1000 + local.currentSong.skipDuration, true);
  160. if (local.paused) local.player.pauseVideo();
  161. } else if (event.data === 1 && local.paused) {
  162. local.player.seekTo(local.timeBeforePause / 1000, true);
  163. local.player.pauseVideo();
  164. }
  165. if (event.data === 2 && !local.paused && !local.noSong && (local.player.getDuration() / 1000) < local.currentSong.duration) {
  166. local.player.seekTo(local.getTimeElapsed() / 1000 + local.currentSong.skipDuration, true);
  167. local.player.playVideo();
  168. }
  169. }
  170. }
  171. });
  172. }
  173. },
  174. getTimeElapsed: function() {
  175. let local = this;
  176. if (local.currentSong) return Date.currently() - local.startedAt - local.timePaused;
  177. else return 0;
  178. },
  179. playVideo: function() {
  180. let local = this;
  181. if (local.playerReady) {
  182. local.videoLoading = true;
  183. local.player.loadVideoById(local.currentSong._id, local.getTimeElapsed() / 1000 + local.currentSong.skipDuration);
  184. if (local.currentSong.artists) local.currentSong.artists = local.currentSong.artists.join(", ");
  185. if (window.stationInterval !== 0) clearInterval(window.stationInterval);
  186. window.stationInterval = setInterval(function () {
  187. local.resizeSeekerbar();
  188. local.calculateTimeElapsed();
  189. }, 250);
  190. }
  191. },
  192. resizeSeekerbar: function() {
  193. let local = this;
  194. if (!local.paused) {
  195. $(".seeker-bar").width(parseInt(((local.getTimeElapsed() / 1000) / local.currentSong.duration * 100)) + "%");
  196. }
  197. },
  198. formatTime: function(duration) {
  199. let d = moment.duration(duration, 'seconds');
  200. if (duration < 0) return "0:00";
  201. return ((d.hours() > 0) ? (d.hours() < 10 ? ("0" + d.hours() + ":") : (d.hours() + ":")) : "") + (d.minutes() + ":") + (d.seconds() < 10 ? ("0" + d.seconds()) : d.seconds());
  202. },
  203. calculateTimeElapsed: function() {
  204. let local = this;
  205. let currentTime = Date.currently();
  206. if (local.currentTime !== undefined && local.paused) {
  207. local.timePaused += (Date.currently() - local.currentTime);
  208. local.currentTime = undefined;
  209. }
  210. let duration = (Date.currently() - local.startedAt - local.timePaused) / 1000;
  211. let songDuration = local.currentSong.duration;
  212. if (songDuration <= duration) local.player.pauseVideo();
  213. if ((!local.paused) && duration <= songDuration) local.timeElapsed = local.formatTime(duration);
  214. },
  215. changeVolume: function() {
  216. let local = this;
  217. let volume = $("#volumeSlider").val();
  218. localStorage.setItem("volume", volume);
  219. if (local.playerReady) {
  220. local.player.setVolume(volume);
  221. if (volume > 0) local.player.unMute();
  222. }
  223. },
  224. resumeLocalStation: function() {
  225. this.paused = false;
  226. if (!this.noSong) {
  227. if (this.playerReady) {
  228. this.player.seekTo(this.getTimeElapsed() / 1000 + this.currentSong.skipDuration);
  229. this.player.playVideo();
  230. }
  231. }
  232. },
  233. pauseLocalStation: function() {
  234. this.paused = true;
  235. if (!this.noSong) {
  236. this.timeBeforePause = this.getTimeElapsed();
  237. if (this.playerReady) this.player.pauseVideo();
  238. }
  239. },
  240. skipStation: function () {
  241. let _this = this;
  242. _this.socket.emit('stations.forceSkip', _this.stationId, data => {
  243. if (data.status !== 'success') Toast.methods.addToast(`Error: ${data.message}`, 8000);
  244. else Toast.methods.addToast('Successfully skipped the station\'s current song.', 4000);
  245. });
  246. },
  247. voteSkipStation: function () {
  248. let _this = this;
  249. _this.socket.emit('stations.voteSkip', _this.stationId, data => {
  250. if (data.status !== 'success') Toast.methods.addToast(`Error: ${data.message}`, 8000);
  251. else Toast.methods.addToast('Successfully voted to skip the current song.', 4000);
  252. });
  253. },
  254. resumeStation: function () {
  255. let _this = this;
  256. _this.socket.emit('stations.resume', _this.stationId, data => {
  257. if (data.status !== 'success') Toast.methods.addToast(`Error: ${data.message}`, 8000);
  258. else Toast.methods.addToast('Successfully resumed the station.', 4000);
  259. });
  260. },
  261. pauseStation: function () {
  262. let _this = this;
  263. _this.socket.emit('stations.pause', _this.stationId, data => {
  264. if (data.status !== 'success') Toast.methods.addToast(`Error: ${data.message}`, 8000);
  265. else Toast.methods.addToast('Successfully paused the station.', 4000);
  266. });
  267. },
  268. toggleMute: function () {
  269. if (this.playerReady) {
  270. let previousVolume = parseInt(localStorage.getItem("volume"));
  271. let volume = this.player.getVolume() <= 0 ? previousVolume : 0;
  272. this.muted = !this.muted;
  273. $("#volumeSlider").val(volume);
  274. this.player.setVolume(volume);
  275. }
  276. },
  277. toggleMaxVolume: function () {
  278. if (this.playerReady) {
  279. let previousVolume = parseInt(localStorage.getItem("volume"));
  280. let volume = this.player.getVolume() <= previousVolume ? 100 : previousVolume;
  281. $("#volumeSlider").val(volume);
  282. this.player.setVolume(volume);
  283. }
  284. },
  285. toggleLike: function() {
  286. let _this = this;
  287. if (_this.liked) _this.socket.emit('songs.unlike', _this.currentSong._id, data => {
  288. if (data.status !== 'success') Toast.methods.addToast(`Error: ${data.message}`, 8000);
  289. }); else _this.socket.emit('songs.like', _this.currentSong._id, data => {
  290. if (data.status !== 'success') Toast.methods.addToast(`Error: ${data.message}`, 8000);
  291. });
  292. },
  293. toggleDislike: function() {
  294. let _this = this;
  295. if (_this.disliked) return _this.socket.emit('songs.undislike', _this.currentSong._id, data => {
  296. if (data.status !== 'success') Toast.methods.addToast(`Error: ${data.message}`, 8000);
  297. });
  298. _this.socket.emit('songs.dislike', _this.currentSong._id, data => {
  299. if (data.status !== 'success') Toast.methods.addToast(`Error: ${data.message}`, 8000);
  300. });
  301. },
  302. addFirstPrivatePlaylistSongToQueue: function() {
  303. let _this = this;
  304. let isInQueue = false;
  305. let userId = _this.$parent.userId;
  306. if (_this.type === 'community') {
  307. _this.songsList.forEach((queueSong) => {
  308. if (queueSong.requestedBy === userId) isInQueue = true;
  309. });
  310. if (!isInQueue && _this.privatePlaylistQueueSelected) {
  311. _this.socket.emit('playlists.getFirstSong', _this.privatePlaylistQueueSelected, data => {
  312. if (data.status === 'success') {
  313. let songId = data.song._id;
  314. _this.automaticallyRequestedSongId = songId;
  315. _this.socket.emit('stations.addToQueue', _this.stationId, songId, data => {
  316. if (data.status === 'success') {
  317. _this.socket.emit('playlists.moveSongToBottom', _this.privatePlaylistQueueSelected, songId, data => {
  318. if (data.status === 'success') {}
  319. });
  320. }
  321. });
  322. }
  323. });
  324. }
  325. }
  326. },
  327. joinStation: function () {
  328. let _this = this;
  329. _this.socket.emit('stations.join', _this.stationId, res => {
  330. if (res.status === 'success') {
  331. _this.station = {
  332. displayName: res.data.displayName,
  333. description: res.data.description,
  334. privacy: res.data.privacy,
  335. partyMode: res.data.partyMode,
  336. owner: res.data.owner,
  337. privatePlaylist: res.data.privatePlaylist
  338. };
  339. _this.currentSong = (res.data.currentSong) ? res.data.currentSong : {};
  340. _this.type = res.data.type;
  341. _this.startedAt = res.data.startedAt;
  342. _this.paused = res.data.paused;
  343. _this.timePaused = res.data.timePaused;
  344. if (res.data.currentSong) {
  345. _this.noSong = false;
  346. _this.simpleSong = (res.data.currentSong.likes === -1 && res.data.currentSong.dislikes === -1);
  347. if (_this.simpleSong) {
  348. _this.currentSong.skipDuration = 0;
  349. }
  350. _this.youtubeReady();
  351. _this.playVideo();
  352. _this.socket.emit('songs.getOwnSongRatings', res.data.currentSong._id, data => {
  353. if (_this.currentSong._id === data.songId) {
  354. _this.liked = data.liked;
  355. _this.disliked = data.disliked;
  356. }
  357. });
  358. } else {
  359. if (_this.playerReady) _this.player.pauseVideo();
  360. _this.noSong = true;
  361. }
  362. if (_this.type === 'community') {
  363. _this.socket.emit('stations.getQueue', _this.stationId, data => {
  364. if (data.status === 'success') _this.songsList = data.queue;
  365. });
  366. }
  367. }
  368. _this.socket.emit('stations.getPlaylist', _this.stationId, res => {
  369. if (res.status == 'success') _this.songsList = res.data;
  370. });
  371. // UNIX client time before ping
  372. let beforePing = Date.now();
  373. _this.socket.emit('apis.ping', res => {
  374. // UNIX client time after ping
  375. let afterPing = Date.now();
  376. // Average time in MS it took between the server responding and the client receiving
  377. let connectionLatency = (afterPing - beforePing) / 2;
  378. console.log(connectionLatency, beforePing - afterPing);
  379. // UNIX server time
  380. let serverDate = res.date;
  381. // Difference between the server UNIX time and the client UNIX time after ping, with the connectionLatency added to the server UNIX time
  382. let difference = (serverDate + connectionLatency) - afterPing;
  383. console.log("Difference: ", difference);
  384. if (difference > 3000 || difference < -3000) {
  385. console.log("System time difference is bigger than 3 seconds.");
  386. }
  387. _this.systemDifference = difference;
  388. });
  389. });
  390. }
  391. },
  392. ready: function() {
  393. let _this = this;
  394. Date.currently = () => {
  395. return new Date().getTime() + _this.systemDifference;
  396. };
  397. _this.stationId = _this.$route.params.id;
  398. window.stationInterval = 0;
  399. io.getSocket((socket) => {
  400. _this.socket = socket;
  401. io.removeAllListeners();
  402. if (_this.socket.connected) _this.joinStation();
  403. io.onConnect(() => {
  404. _this.joinStation();
  405. });
  406. _this.socket.emit('stations.find', _this.stationId, res => {
  407. if (res.status === 'error') {
  408. _this.$router.go('/404');
  409. Toast.methods.addToast(res.message, 3000);
  410. }
  411. });
  412. _this.socket.on('event:songs.next', data => {
  413. _this.previousSong = (_this.currentSong._id) ? _this.currentSong : null;
  414. _this.currentSong = (data.currentSong) ? data.currentSong : {};
  415. _this.startedAt = data.startedAt;
  416. _this.paused = data.paused;
  417. _this.timePaused = data.timePaused;
  418. if (data.currentSong) {
  419. _this.noSong = false;
  420. _this.simpleSong = (data.currentSong.likes === -1 && data.currentSong.dislikes === -1);
  421. if (_this.simpleSong) _this.currentSong.skipDuration = 0;
  422. if (!_this.playerReady) _this.youtubeReady();
  423. else _this.playVideo();
  424. _this.socket.emit('songs.getOwnSongRatings', data.currentSong._id, (data) => {
  425. if (_this.currentSong._id === data.songId) {
  426. _this.liked = data.liked;
  427. _this.disliked = data.disliked;
  428. }
  429. });
  430. } else {
  431. if (_this.playerReady) _this.player.pauseVideo();
  432. _this.noSong = true;
  433. }
  434. let isInQueue = false;
  435. let userId = _this.$parent.userId;
  436. _this.songsList.forEach((queueSong) => {
  437. if (queueSong.requestedBy === userId) isInQueue = true;
  438. });
  439. if (!isInQueue && _this.privatePlaylistQueueSelected && (_this.automaticallyRequestedSongId !== _this.currentSong._id || !_this.currentSong._id)) {
  440. _this.addFirstPrivatePlaylistSongToQueue();
  441. }
  442. });
  443. _this.socket.on('event:stations.pause', data => {
  444. _this.pauseLocalStation();
  445. });
  446. _this.socket.on('event:stations.resume', data => {
  447. _this.timePaused = data.timePaused;
  448. _this.resumeLocalStation();
  449. });
  450. _this.socket.on('event:song.like', data => {
  451. if (!this.noSong) {
  452. if (data.songId === _this.currentSong._id) {
  453. _this.currentSong.dislikes = data.dislikes;
  454. _this.currentSong.likes = data.likes;
  455. }
  456. }
  457. });
  458. _this.socket.on('event:song.dislike', data => {
  459. if (!this.noSong) {
  460. if (data.songId === _this.currentSong._id) {
  461. _this.currentSong.dislikes = data.dislikes;
  462. _this.currentSong.likes = data.likes;
  463. }
  464. }
  465. });
  466. _this.socket.on('event:song.unlike', data => {
  467. if (!this.noSong) {
  468. if (data.songId === _this.currentSong._id) {
  469. _this.currentSong.dislikes = data.dislikes;
  470. _this.currentSong.likes = data.likes;
  471. }
  472. }
  473. });
  474. _this.socket.on('event:song.undislike', data => {
  475. if (!this.noSong) {
  476. if (data.songId === _this.currentSong._id) {
  477. _this.currentSong.dislikes = data.dislikes;
  478. _this.currentSong.likes = data.likes;
  479. }
  480. }
  481. });
  482. _this.socket.on('event:song.newRatings', data => {
  483. if (!this.noSong) {
  484. if (data.songId === _this.currentSong._id) {
  485. _this.liked = data.liked;
  486. _this.disliked = data.disliked;
  487. }
  488. }
  489. });
  490. _this.socket.on('event:queue.update', queue => {
  491. if (this.type === 'community') this.songsList = queue;
  492. });
  493. _this.socket.on('event:song.voteSkipSong', () => {
  494. if (this.currentSong) this.currentSong.skipVotes++;
  495. });
  496. _this.socket.on('event:privatePlaylist.selected', (playlistId) => {
  497. if (this.type === 'community') {
  498. this.station.privatePlaylist = playlistId;
  499. }
  500. });
  501. _this.socket.on('event:partyMode.updated', (partyMode) => {
  502. if (this.type === 'community') {
  503. this.station.partyMode = partyMode;
  504. }
  505. });
  506. _this.socket.on('event:newOfficialPlaylist', (playlist) => {
  507. console.log(playlist);
  508. if (this.type === 'official') {
  509. this.songsList = playlist;
  510. }
  511. });
  512. });
  513. let volume = parseInt(localStorage.getItem("volume"));
  514. volume = (typeof volume === "number" && !isNaN(volume)) ? volume : 20;
  515. localStorage.setItem("volume", volume);
  516. $("#volumeSlider").val(volume);
  517. },
  518. components: {
  519. OfficialHeader,
  520. CommunityHeader,
  521. SongQueue,
  522. EditPlaylist,
  523. CreatePlaylist,
  524. EditStation,
  525. Report,
  526. SongsListSidebar,
  527. PlaylistSidebar,
  528. UsersSidebar
  529. }
  530. }
  531. </script>
  532. <style lang="scss">
  533. .no-song {
  534. color: #03A9F4;
  535. text-align: center;
  536. }
  537. #volumeSlider {
  538. padding: 0 15px;
  539. background: transparent;
  540. }
  541. .volume-slider-wrapper {
  542. margin-top: 0;
  543. position: relative;
  544. display: flex;
  545. align-items: center;
  546. }
  547. .material-icons { cursor: pointer; }
  548. .stationDisplayName {
  549. color: white !important;
  550. }
  551. .slideout {
  552. top: 50px;
  553. height: 100%;
  554. position: fixed;
  555. right: 0;
  556. width: 350px;
  557. background-color: white;
  558. box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12);
  559. .slideout-header {
  560. text-align: center;
  561. background-color: rgb(3, 169, 244) !important;
  562. margin: 0;
  563. padding-top: 5px;
  564. padding-bottom: 7px;
  565. color: white;
  566. }
  567. .slideout-content {
  568. height: 100%;
  569. }
  570. }
  571. .modal-large {
  572. width: 75%;
  573. }
  574. .station {
  575. flex: 1 0 auto;
  576. padding-top: 0.5vw;
  577. transition: all 0.1s;
  578. margin: 0 auto;
  579. max-width: 1280px;
  580. width: 90%;
  581. @media only screen and (min-width: 993px) {
  582. width: 70%;
  583. }
  584. @media only screen and (min-width: 601px) {
  585. width: 85%;
  586. }
  587. input[type=range] {
  588. -webkit-appearance: none;
  589. width: 100%;
  590. margin: 7.3px 0;
  591. }
  592. input[type=range]:focus {
  593. outline: none;
  594. }
  595. input[type=range]::-webkit-slider-runnable-track {
  596. width: 100%;
  597. height: 5.2px;
  598. cursor: pointer;
  599. box-shadow: 0;
  600. background: #c2c0c2;
  601. border-radius: 0;
  602. border: 0;
  603. }
  604. input[type=range]::-webkit-slider-thumb {
  605. box-shadow: 0;
  606. border: 0;
  607. height: 19px;
  608. width: 19px;
  609. border-radius: 15px;
  610. background: #03a9f4;
  611. cursor: pointer;
  612. -webkit-appearance: none;
  613. margin-top: -6.5px;
  614. }
  615. input[type=range]::-moz-range-track {
  616. width: 100%;
  617. height: 5.2px;
  618. cursor: pointer;
  619. box-shadow: 0;
  620. background: #c2c0c2;
  621. border-radius: 0;
  622. border: 0;
  623. }
  624. input[type=range]::-moz-range-thumb {
  625. box-shadow: 0;
  626. border: 0;
  627. height: 19px;
  628. width: 19px;
  629. border-radius: 15px;
  630. background: #03a9f4;
  631. cursor: pointer;
  632. -webkit-appearance: none;
  633. margin-top: -6.5px;
  634. }
  635. input[type=range]::-ms-track {
  636. width: 100%;
  637. height: 5.2px;
  638. cursor: pointer;
  639. box-shadow: 0;
  640. background: #c2c0c2;
  641. border-radius: 1.3px;
  642. }
  643. input[type=range]::-ms-fill-lower {
  644. background: #c2c0c2;
  645. border: 0;
  646. border-radius: 0;
  647. box-shadow: 0;
  648. }
  649. input[type=range]::-ms-fill-upper {
  650. background: #c2c0c2;
  651. border: 0;
  652. border-radius: 0;
  653. box-shadow: 0;
  654. }
  655. input[type=range]::-ms-thumb {
  656. box-shadow: 0;
  657. border: 0;
  658. height: 15px;
  659. width: 15px;
  660. border-radius: 15px;
  661. background: #03a9f4;
  662. cursor: pointer;
  663. -webkit-appearance: none;
  664. margin-top: 1.5px;
  665. }
  666. .video-container {
  667. position: relative;
  668. padding-bottom: 56.25%;
  669. height: 0;
  670. overflow: hidden;
  671. iframe {
  672. position: absolute;
  673. top: 0;
  674. left: 0;
  675. width: 100%;
  676. height: 100%;
  677. }
  678. }
  679. .video-col {
  680. padding-right: 0.75rem;
  681. padding-left: 0.75rem;
  682. }
  683. }
  684. .room-title {
  685. left: 50%;
  686. -webkit-transform: translateX(-50%);
  687. transform: translateX(-50%);
  688. font-size: 2.1em;
  689. }
  690. #ratings {
  691. span {
  692. font-size: 1.68rem;
  693. }
  694. i {
  695. color: #9e9e9e !important;
  696. cursor: pointer;
  697. transition: 0.1s color;
  698. }
  699. }
  700. #time-display {
  701. margin-top: 30px;
  702. float: right;
  703. }
  704. #thumbs_up:hover, #thumbs_up.liked {
  705. color: #87D37C !important;
  706. }
  707. #thumbs_down:hover, #thumbs_down.disliked {
  708. color: #EC644B !important;
  709. }
  710. #song-thumbnail {
  711. max-width: 100%;
  712. width: 85%;
  713. }
  714. .seeker-bar-container {
  715. position: relative;
  716. height: 5px;
  717. display: block;
  718. width: 100%;
  719. overflow: hidden;
  720. }
  721. .seeker-bar {
  722. top: 0;
  723. left: 0;
  724. bottom: 0;
  725. position: absolute;
  726. }
  727. ul {
  728. list-style: none;
  729. margin: 0;
  730. display: block;
  731. }
  732. h1, h2, h3, h4, h5, h6 {
  733. font-weight: 400;
  734. line-height: 1.1;
  735. }
  736. h1 a, h2 a, h3 a, h4 a, h5 a, h6 a {
  737. font-weight: inherit;
  738. }
  739. h1 {
  740. font-size: 4.2rem;
  741. line-height: 110%;
  742. margin: 2.1rem 0 1.68rem 0;
  743. }
  744. h2 {
  745. font-size: 3.56rem;
  746. line-height: 110%;
  747. margin: 1.78rem 0 1.424rem 0;
  748. }
  749. h3 {
  750. font-size: 2.92rem;
  751. line-height: 110%;
  752. margin: 1.46rem 0 1.168rem 0;
  753. }
  754. h4 {
  755. font-size: 2.28rem;
  756. line-height: 110%;
  757. margin: 1.14rem 0 0.912rem 0;
  758. }
  759. h5 {
  760. font-size: 1.64rem;
  761. line-height: 110%;
  762. margin: 0.82rem 0 0.656rem 0;
  763. }
  764. h6 {
  765. font-size: 1rem;
  766. line-height: 110%;
  767. margin: 0.5rem 0 0.4rem 0;
  768. }
  769. .thin {
  770. font-weight: 200;
  771. }
  772. .left {
  773. float: left !important;
  774. }
  775. .right {
  776. float: right !important;
  777. }
  778. .light-blue {
  779. background-color: #03a9f4 !important;
  780. }
  781. .white {
  782. background-color: #FFFFFF !important;
  783. }
  784. .btn-search {
  785. font-size: 14px;
  786. }
  787. .menu { padding: 0 10px; }
  788. .menu-list li a:hover { color: #000 !important; }
  789. .menu-list li {
  790. display: flex;
  791. justify-content: space-between;
  792. }
  793. .menu-list a {
  794. /*padding: 0 10px !important;*/
  795. }
  796. .menu-list a:hover {
  797. background-color : transparent;
  798. }
  799. .icons-group { display: flex; }
  800. #like, #dislike {
  801. position: relative;
  802. }
  803. .behind {
  804. z-index: -1;
  805. }
  806. .behind:focus {
  807. z-index: 0;
  808. }
  809. </style>