Station.vue 38 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751
  1. <template>
  2. <div>
  3. <official-header v-if="type == 'official'" />
  4. <community-header v-if="type == 'community'" />
  5. <song-queue v-if="modals.addSongToQueue" />
  6. <add-to-playlist v-if="modals.addSongToPlaylist" />
  7. <edit-playlist v-if="modals.editPlaylist" />
  8. <create-playlist v-if="modals.createPlaylist" />
  9. <edit-station v-show="modals.editStation" />
  10. <report v-if="modals.report" />
  11. <transition name="slide">
  12. <songs-list-sidebar v-if="sidebars.songslist" />
  13. </transition>
  14. <transition name="slide">
  15. <playlist-sidebar v-if="sidebars.playlist" />
  16. </transition>
  17. <transition name="slide">
  18. <users-sidebar v-if="sidebars.users" />
  19. </transition>
  20. <div v-show="loading" class="progress" />
  21. <div v-show="!loading && exists" class="station">
  22. <div v-show="noSong" class="no-song">
  23. <h1>No song is currently playing</h1>
  24. <h4
  25. v-if="
  26. type === 'community' &&
  27. station.partyMode &&
  28. (!station.locked ||
  29. (station.locked &&
  30. $parent.loggedIn &&
  31. $parent.userId === station.owner))
  32. "
  33. >
  34. <a
  35. href="#"
  36. class="no-song"
  37. @click="
  38. openModal({
  39. sector: 'station',
  40. modal: 'addSongToQueue'
  41. })
  42. "
  43. >Add a song to the queue</a
  44. >
  45. </h4>
  46. <h4
  47. v-if="
  48. type === 'community' &&
  49. !station.partyMode &&
  50. $parent.userId === station.owner &&
  51. !station.privatePlaylist
  52. "
  53. >
  54. <a
  55. href="#"
  56. class="no-song"
  57. @click="sidebars.playlist = true"
  58. >Play a private playlist</a
  59. >
  60. </h4>
  61. <h1
  62. v-if="
  63. type === 'community' &&
  64. !station.partyMode &&
  65. $parent.userId === station.owner &&
  66. station.privatePlaylist
  67. "
  68. >
  69. Maybe you can add some songs to your selected private
  70. playlist and then press the skip button
  71. </h1>
  72. </div>
  73. <div v-show="!noSong" class="columns">
  74. <div
  75. class="column is-8-desktop is-offset-2-desktop is-12-mobile"
  76. >
  77. <div class="video-container">
  78. <div id="player" />
  79. <div
  80. class="player-can-not-autoplay"
  81. v-if="!canAutoplay"
  82. >
  83. <p>
  84. Please click anywhere on the screen for the
  85. video to start
  86. </p>
  87. </div>
  88. </div>
  89. <div
  90. id="preview-progress"
  91. class="seeker-bar-container white"
  92. >
  93. <div class="seeker-bar light-blue" style="width: 0%;" />
  94. </div>
  95. </div>
  96. <div
  97. class="desktop-only column is-3-desktop card playlistCard experimental"
  98. >
  99. <div v-if="type === 'community'" class="title">
  100. Queue
  101. </div>
  102. <div v-else class="title">
  103. Playlist
  104. </div>
  105. <article v-if="!noSong" class="media">
  106. <figure class="media-left">
  107. <p class="image is-64x64">
  108. <img
  109. :src="currentSong.thumbnail"
  110. onerror="this.src='/assets/notes-transparent.png'"
  111. />
  112. </p>
  113. </figure>
  114. <div class="media-content">
  115. <div class="content">
  116. <p>
  117. Current Song:
  118. <br />
  119. <strong>{{ currentSong.title }}</strong>
  120. <br />
  121. <small>{{ currentSong.artists }}</small>
  122. </p>
  123. </div>
  124. </div>
  125. <div class="media-right">
  126. {{ formatTime(currentSong.duration) }}
  127. </div>
  128. </article>
  129. <p v-if="noSong" class="center">
  130. There is currently no song playing.
  131. </p>
  132. <article
  133. v-for="(song, index) in songsList"
  134. :key="index"
  135. class="media"
  136. >
  137. <div class="media-content">
  138. <div class="content">
  139. <strong class="songTitle">{{
  140. song.title
  141. }}</strong>
  142. <br />
  143. <small>{{ song.artists.join(", ") }}</small>
  144. <br />
  145. <div v-if="station.partyMode">
  146. <br />
  147. <small>
  148. Requested by
  149. <b>
  150. <user-id-to-username
  151. :userId="song.requestedBy"
  152. :link="true"
  153. />
  154. </b>
  155. </small>
  156. <button
  157. v-if="isOwnerOnly() || isAdminOnly()"
  158. class="button"
  159. @click="removeFromQueue(song.songId)"
  160. >
  161. REMOVE
  162. </button>
  163. </div>
  164. </div>
  165. </div>
  166. <div class="media-right">
  167. {{ formatTime(song.duration) }}
  168. </div>
  169. </article>
  170. <a
  171. v-if="type === 'community' && $parent.loggedIn"
  172. class="button add-to-queue"
  173. href="#"
  174. @click="
  175. openModal({
  176. sector: 'station',
  177. modal: 'addSongToQueue'
  178. })
  179. "
  180. >Add Song to Queue</a
  181. >
  182. </div>
  183. </div>
  184. <div v-show="!noSong" class="desktop-only columns is-mobile">
  185. <div
  186. class="column is-8-desktop is-offset-2-desktop is-12-mobile"
  187. >
  188. <div class="columns is-mobile">
  189. <div class="column is-12-desktop">
  190. <h4 id="time-display">
  191. {{ timeElapsed }} /
  192. {{ formatTime(currentSong.duration) }}
  193. </h4>
  194. <h3>{{ currentSong.title }}</h3>
  195. <h4 class="thin" style="margin-left: 0">
  196. {{ currentSong.artists }}
  197. </h4>
  198. <div class="columns is-mobile">
  199. <form
  200. style="margin-top: 12px; margin-bottom: 0;"
  201. action="#"
  202. class="column is-7-desktop is-4-mobile"
  203. >
  204. <p class="volume-slider-wrapper">
  205. <i
  206. v-if="muted"
  207. class="material-icons"
  208. @click="toggleMute()"
  209. >volume_mute</i
  210. >
  211. <i
  212. v-else
  213. class="material-icons"
  214. @click="toggleMute()"
  215. >volume_down</i
  216. >
  217. <input
  218. id="volumeSlider"
  219. type="range"
  220. min="0"
  221. max="10000"
  222. class="active"
  223. @change="changeVolume()"
  224. @input="changeVolume()"
  225. />
  226. <i
  227. class="material-icons"
  228. @click="increaseVolume()"
  229. >volume_up</i
  230. >
  231. </p>
  232. </form>
  233. <div
  234. class="column is-8-mobile is-5-desktop"
  235. style="float: right;"
  236. >
  237. <ul
  238. v-if="
  239. currentSong.likes !== -1 &&
  240. currentSong.dislikes !== -1
  241. "
  242. id="ratings"
  243. >
  244. <li
  245. id="like"
  246. class="right"
  247. @click="toggleLike()"
  248. >
  249. <span class="flow-text">{{
  250. currentSong.likes
  251. }}</span>
  252. <i
  253. id="thumbs_up"
  254. class="material-icons grey-text"
  255. :class="{ liked: liked }"
  256. >thumb_up</i
  257. >
  258. <a
  259. class="absolute-a behind"
  260. href="#"
  261. @click="toggleLike()"
  262. />
  263. </li>
  264. <li
  265. id="dislike"
  266. style="margin-right: 10px;"
  267. class="right"
  268. @click="toggleDislike()"
  269. >
  270. <span class="flow-text">{{
  271. currentSong.dislikes
  272. }}</span>
  273. <i
  274. id="thumbs_down"
  275. class="material-icons grey-text"
  276. :class="{
  277. disliked: disliked
  278. }"
  279. >thumb_down</i
  280. >
  281. <a
  282. class="absolute-a behind"
  283. href="#"
  284. @click="toggleDislike()"
  285. />
  286. </li>
  287. </ul>
  288. </div>
  289. </div>
  290. </div>
  291. <div
  292. v-if="!simpleSong"
  293. class="column is-3-desktop experimental"
  294. >
  295. <img
  296. class="image"
  297. :src="currentSong.thumbnail"
  298. alt="Song Thumbnail"
  299. onerror="this.src='/assets/notes-transparent.png'"
  300. />
  301. </div>
  302. </div>
  303. </div>
  304. </div>
  305. <div v-show="!noSong" class="mobile-only">
  306. <div>
  307. <div>
  308. <div>
  309. <h3>{{ currentSong.title }}</h3>
  310. <h4 class="thin">
  311. {{ currentSong.artists }}
  312. </h4>
  313. <h5>
  314. {{ timeElapsed }} /
  315. {{ formatTime(currentSong.duration) }}
  316. </h5>
  317. <div>
  318. <form class="columns" action="#">
  319. <p
  320. class="column is-11-mobile volume-slider-wrapper"
  321. >
  322. <i
  323. v-if="muted"
  324. class="material-icons"
  325. @click="toggleMute()"
  326. >volume_mute</i
  327. >
  328. <i
  329. v-else
  330. class="material-icons"
  331. @click="toggleMute()"
  332. >volume_down</i
  333. >
  334. <input
  335. id="volumeSlider"
  336. type="range"
  337. min="0"
  338. max="10000"
  339. class="active"
  340. @change="changeVolume()"
  341. @input="changeVolume()"
  342. />
  343. <i
  344. class="material-icons"
  345. @click="increaseVolume()"
  346. >volume_up</i
  347. >
  348. </p>
  349. </form>
  350. <div>
  351. <ul
  352. v-if="
  353. currentSong.likes !== -1 &&
  354. currentSong.dislikes !== -1
  355. "
  356. id="ratings"
  357. style="display: inline-block;"
  358. >
  359. <li
  360. id="dislike"
  361. style="display: inline-block;margin-right: 10px;"
  362. @click="toggleDislike()"
  363. >
  364. <span class="flow-text">{{
  365. currentSong.dislikes
  366. }}</span>
  367. <i
  368. id="thumbs_down"
  369. class="material-icons grey-text"
  370. :class="{
  371. disliked: disliked
  372. }"
  373. >thumb_down</i
  374. >
  375. <a
  376. class="absolute-a behind"
  377. href="#"
  378. @click="toggleDislike()"
  379. />
  380. </li>
  381. <li
  382. id="like"
  383. style="display: inline-block;"
  384. @click="toggleLike()"
  385. >
  386. <span class="flow-text">{{
  387. currentSong.likes
  388. }}</span>
  389. <i
  390. id="thumbs_up"
  391. class="material-icons grey-text"
  392. :class="{ liked: liked }"
  393. >thumb_up</i
  394. >
  395. <a
  396. class="absolute-a behind"
  397. href="#"
  398. @click="toggleLike()"
  399. />
  400. </li>
  401. </ul>
  402. </div>
  403. </div>
  404. </div>
  405. </div>
  406. </div>
  407. </div>
  408. </div>
  409. <Z404 v-if="!exists"></Z404>
  410. </div>
  411. </template>
  412. <script>
  413. import { mapState, mapActions } from "vuex";
  414. import { Toast } from "vue-roaster";
  415. import SongQueue from "../Modals/AddSongToQueue.vue";
  416. import AddToPlaylist from "../Modals/AddSongToPlaylist.vue";
  417. import EditPlaylist from "../Modals/Playlists/Edit.vue";
  418. import CreatePlaylist from "../Modals/Playlists/Create.vue";
  419. import EditStation from "../Modals/EditStation.vue";
  420. import Report from "../Modals/Report.vue";
  421. import SongsListSidebar from "../Sidebars/SongsList.vue";
  422. import PlaylistSidebar from "../Sidebars/Playlist.vue";
  423. import UsersSidebar from "../Sidebars/UsersList.vue";
  424. import OfficialHeader from "./OfficialHeader.vue";
  425. import CommunityHeader from "./CommunityHeader.vue";
  426. import UserIdToUsername from "../UserIdToUsername.vue";
  427. import Z404 from "../404.vue";
  428. import io from "../../io";
  429. export default {
  430. data() {
  431. return {
  432. loading: true,
  433. ready: false,
  434. exists: true,
  435. type: "",
  436. playerReady: false,
  437. previousSong: null,
  438. currentSong: {},
  439. player: undefined,
  440. timePaused: 0,
  441. paused: false,
  442. muted: false,
  443. timeElapsed: "0:00",
  444. liked: false,
  445. disliked: false,
  446. sidebars: {
  447. songslist: false,
  448. users: false,
  449. playlist: false
  450. },
  451. noSong: false,
  452. simpleSong: false,
  453. songsList: [],
  454. timeBeforePause: 0,
  455. skipVotes: 0,
  456. privatePlaylistQueueSelected: null,
  457. automaticallyRequestedSongId: null,
  458. systemDifference: 0,
  459. users: [],
  460. userCount: 0,
  461. attemptsToPlayVideo: 0,
  462. canAutoplay: true,
  463. lastTimeRequestedIfCanAutoplay: 0
  464. };
  465. },
  466. computed: {
  467. ...mapState("modals", {
  468. modals: state => state.modals.station
  469. }),
  470. ...mapState("station", {
  471. station: state => state.station
  472. })
  473. },
  474. methods: {
  475. isOwnerOnly: function() {
  476. return (
  477. this.$parent.loggedIn &&
  478. this.$parent.userId === this.station.owner
  479. );
  480. },
  481. isAdminOnly: function() {
  482. return this.$parent.loggedIn && this.$parent.role === "admin";
  483. },
  484. removeFromQueue: function(songId) {
  485. window.socket.emit(
  486. "stations.removeFromQueue",
  487. this.station._id,
  488. songId,
  489. res => {
  490. if (res.status === "success") {
  491. Toast.methods.addToast(
  492. "Successfully removed song from the queue.",
  493. 4000
  494. );
  495. } else Toast.methods.addToast(res.message, 8000);
  496. }
  497. );
  498. },
  499. toggleSidebar: function(type) {
  500. Object.keys(this.sidebars).forEach(sidebar => {
  501. if (sidebar !== type) this.sidebars[sidebar] = false;
  502. else this.sidebars[type] = !this.sidebars[type];
  503. });
  504. },
  505. youtubeReady: function() {
  506. let local = this;
  507. if (!local.player) {
  508. local.player = new window.YT.Player("player", {
  509. height: 270,
  510. width: 480,
  511. videoId: local.currentSong.songId,
  512. startSeconds:
  513. local.getTimeElapsed() / 1000 +
  514. local.currentSong.skipDuration,
  515. playerVars: {
  516. controls: 0,
  517. iv_load_policy: 3,
  518. rel: 0,
  519. showinfo: 0
  520. },
  521. events: {
  522. onReady: function() {
  523. local.playerReady = true;
  524. let volume = parseInt(
  525. localStorage.getItem("volume")
  526. );
  527. volume = typeof volume === "number" ? volume : 20;
  528. local.player.setVolume(volume);
  529. if (volume > 0) {
  530. local.player.unMute();
  531. }
  532. if (local.muted) local.player.mute();
  533. local.playVideo();
  534. },
  535. onError: function(err) {
  536. console.log("iframe error", err);
  537. local.voteSkipStation();
  538. },
  539. onStateChange: function(event) {
  540. if (
  541. event.data === 1 &&
  542. local.videoLoading === true
  543. ) {
  544. local.videoLoading = false;
  545. local.player.seekTo(
  546. local.getTimeElapsed() / 1000 +
  547. local.currentSong.skipDuration,
  548. true
  549. );
  550. if (local.paused) local.player.pauseVideo();
  551. } else if (event.data === 1 && local.paused) {
  552. local.player.seekTo(
  553. local.timeBeforePause / 1000,
  554. true
  555. );
  556. local.player.pauseVideo();
  557. }
  558. if (
  559. event.data === 2 &&
  560. !local.paused &&
  561. !local.noSong &&
  562. local.player.getDuration() / 1000 <
  563. local.currentSong.duration
  564. ) {
  565. local.player.seekTo(
  566. local.getTimeElapsed() / 1000 +
  567. local.currentSong.skipDuration,
  568. true
  569. );
  570. local.player.playVideo();
  571. }
  572. }
  573. }
  574. });
  575. }
  576. },
  577. getTimeElapsed: function() {
  578. let local = this;
  579. if (local.currentSong) {
  580. let timePaused = local.timePaused;
  581. if (local.paused)
  582. timePaused += Date.currently() - local.pausedAt;
  583. return Date.currently() - local.startedAt - timePaused;
  584. } else return 0;
  585. },
  586. playVideo: function() {
  587. let local = this;
  588. if (local.playerReady) {
  589. local.videoLoading = true;
  590. local.player.loadVideoById(
  591. local.currentSong.songId,
  592. local.getTimeElapsed() / 1000 +
  593. local.currentSong.skipDuration
  594. );
  595. if (window.stationInterval !== 0)
  596. clearInterval(window.stationInterval);
  597. window.stationInterval = setInterval(function() {
  598. local.resizeSeekerbar();
  599. local.calculateTimeElapsed();
  600. }, 150);
  601. }
  602. },
  603. resizeSeekerbar: function() {
  604. let local = this;
  605. if (!local.paused) {
  606. document.getElementsByClassName("seeker-bar")[0].style.width =
  607. parseFloat(
  608. (local.getTimeElapsed() /
  609. 1000 /
  610. local.currentSong.duration) *
  611. 100
  612. ) + "%";
  613. }
  614. },
  615. formatTime: function(duration) {
  616. let d = moment.duration(duration, "seconds");
  617. if (duration < 0) return "0:00";
  618. return (
  619. (d.hours() > 0
  620. ? d.hours() < 10
  621. ? "0" + d.hours() + ":"
  622. : d.hours() + ":"
  623. : "") +
  624. (d.minutes() + ":") +
  625. (d.seconds() < 10 ? "0" + d.seconds() : d.seconds())
  626. );
  627. },
  628. calculateTimeElapsed: function() {
  629. let local = this;
  630. if (
  631. local.playerReady &&
  632. local.currentSong &&
  633. local.player.getPlayerState() === -1
  634. ) {
  635. if (local.attemptsToPlayVideo >= 5) {
  636. if (
  637. Date.now() - local.lastTimeRequestedIfCanAutoplay >
  638. 2000
  639. ) {
  640. local.lastTimeRequestedIfCanAutoplay = Date.now();
  641. window.canAutoplay.video().then(({ result }) => {
  642. if (result) {
  643. local.attemptsToPlayVideo = 0;
  644. local.canAutoplay = true;
  645. } else {
  646. local.canAutoplay = false;
  647. }
  648. });
  649. }
  650. } else {
  651. local.player.playVideo();
  652. local.attemptsToPlayVideo++;
  653. }
  654. }
  655. if (!local.paused) {
  656. let timeElapsed = local.getTimeElapsed();
  657. let currentPlayerTime = local.player.getCurrentTime() * 1000;
  658. let difference = timeElapsed - currentPlayerTime;
  659. //console.log(difference123);
  660. if (difference < -200) {
  661. //console.log("Difference0.8");
  662. local.player.setPlaybackRate(0.8);
  663. } else if (difference < -50) {
  664. //console.log("Difference0.9");
  665. local.player.setPlaybackRate(0.9);
  666. } else if (difference < -25) {
  667. //console.log("Difference0.99");
  668. local.player.setPlaybackRate(0.99);
  669. } else if (difference > 200) {
  670. //console.log("Difference1.2");
  671. local.player.setPlaybackRate(1.2);
  672. } else if (difference > 50) {
  673. //console.log("Difference1.1");
  674. local.player.setPlaybackRate(1.1);
  675. } else if (difference > 25) {
  676. //console.log("Difference1.01");
  677. local.player.setPlaybackRate(1.01);
  678. } else if (local.player.getPlaybackRate !== 1.0) {
  679. //console.log("NDifference1.0");
  680. local.player.setPlaybackRate(1.0);
  681. }
  682. }
  683. /*if (local.currentTime !== undefined && local.paused) {
  684. local.timePaused += Date.currently() - local.currentTime;
  685. local.currentTime = undefined;
  686. }*/
  687. let timePaused = local.timePaused;
  688. if (local.paused) timePaused += Date.currently() - local.pausedAt;
  689. let duration =
  690. (Date.currently() - local.startedAt - timePaused) / 1000;
  691. let songDuration = local.currentSong.duration;
  692. if (songDuration <= duration) local.player.pauseVideo();
  693. if (!local.paused && duration <= songDuration)
  694. local.timeElapsed = local.formatTime(duration);
  695. },
  696. toggleLock: function() {
  697. window.socket.emit("stations.toggleLock", this.station._id, res => {
  698. if (res.status === "success") {
  699. Toast.methods.addToast(
  700. "Successfully toggled the queue lock.",
  701. 4000
  702. );
  703. } else Toast.methods.addToast(res.message, 8000);
  704. });
  705. },
  706. changeVolume: function() {
  707. let local = this;
  708. let volume = document.getElementById("volumeSlider").value;
  709. localStorage.setItem("volume", volume / 100);
  710. if (local.playerReady) {
  711. local.player.setVolume(volume / 100);
  712. if (volume > 0) {
  713. local.player.unMute();
  714. localStorage.setItem("muted", false);
  715. local.muted = false;
  716. }
  717. }
  718. },
  719. resumeLocalStation: function() {
  720. this.paused = false;
  721. if (!this.noSong) {
  722. if (this.playerReady) {
  723. this.player.seekTo(
  724. this.getTimeElapsed() / 1000 +
  725. this.currentSong.skipDuration
  726. );
  727. this.player.playVideo();
  728. }
  729. }
  730. },
  731. pauseLocalStation: function() {
  732. this.paused = true;
  733. if (!this.noSong) {
  734. this.timeBeforePause = this.getTimeElapsed();
  735. if (this.playerReady) this.player.pauseVideo();
  736. }
  737. },
  738. skipStation: function() {
  739. let _this = this;
  740. _this.socket.emit("stations.forceSkip", _this.station._id, data => {
  741. if (data.status !== "success")
  742. Toast.methods.addToast(`Error: ${data.message}`, 8000);
  743. else
  744. Toast.methods.addToast(
  745. "Successfully skipped the station's current song.",
  746. 4000
  747. );
  748. });
  749. },
  750. voteSkipStation: function() {
  751. let _this = this;
  752. _this.socket.emit("stations.voteSkip", _this.station._id, data => {
  753. if (data.status !== "success")
  754. Toast.methods.addToast(`Error: ${data.message}`, 8000);
  755. else
  756. Toast.methods.addToast(
  757. "Successfully voted to skip the current song.",
  758. 4000
  759. );
  760. });
  761. },
  762. resumeStation: function() {
  763. let _this = this;
  764. _this.socket.emit("stations.resume", _this.station._id, data => {
  765. if (data.status !== "success")
  766. Toast.methods.addToast(`Error: ${data.message}`, 8000);
  767. else
  768. Toast.methods.addToast(
  769. "Successfully resumed the station.",
  770. 4000
  771. );
  772. });
  773. },
  774. pauseStation: function() {
  775. let _this = this;
  776. _this.socket.emit("stations.pause", _this.station._id, data => {
  777. if (data.status !== "success")
  778. Toast.methods.addToast(`Error: ${data.message}`, 8000);
  779. else
  780. Toast.methods.addToast(
  781. "Successfully paused the station.",
  782. 4000
  783. );
  784. });
  785. },
  786. toggleMute: function() {
  787. if (this.playerReady) {
  788. let previousVolume = parseFloat(localStorage.getItem("volume"));
  789. let volume =
  790. this.player.getVolume() * 100 <= 0 ? previousVolume : 0;
  791. this.muted = !this.muted;
  792. localStorage.setItem("muted", this.muted);
  793. document.getElementById("volumeSlider").value = volume * 100;
  794. this.player.setVolume(volume);
  795. if (!this.muted) localStorage.setItem("volume", volume);
  796. }
  797. },
  798. increaseVolume: function() {
  799. if (this.playerReady) {
  800. let previousVolume = parseInt(localStorage.getItem("volume"));
  801. let volume = previousVolume + 5;
  802. if (previousVolume === 0) {
  803. this.muted = false;
  804. localStorage.setItem("muted", false);
  805. }
  806. if (volume > 100) volume = 100;
  807. document.getElementById("volumeSlider").value = volume * 100;
  808. this.player.setVolume(volume);
  809. localStorage.setItem("volume", volume);
  810. }
  811. },
  812. toggleLike: function() {
  813. let _this = this;
  814. if (_this.liked)
  815. _this.socket.emit(
  816. "songs.unlike",
  817. _this.currentSong.songId,
  818. data => {
  819. if (data.status !== "success")
  820. Toast.methods.addToast(
  821. `Error: ${data.message}`,
  822. 8000
  823. );
  824. }
  825. );
  826. else
  827. _this.socket.emit(
  828. "songs.like",
  829. _this.currentSong.songId,
  830. data => {
  831. if (data.status !== "success")
  832. Toast.methods.addToast(
  833. `Error: ${data.message}`,
  834. 8000
  835. );
  836. }
  837. );
  838. },
  839. toggleDislike: function() {
  840. let _this = this;
  841. if (_this.disliked)
  842. return _this.socket.emit(
  843. "songs.undislike",
  844. _this.currentSong.songId,
  845. data => {
  846. if (data.status !== "success")
  847. Toast.methods.addToast(
  848. `Error: ${data.message}`,
  849. 8000
  850. );
  851. }
  852. );
  853. _this.socket.emit(
  854. "songs.dislike",
  855. _this.currentSong.songId,
  856. data => {
  857. if (data.status !== "success")
  858. Toast.methods.addToast(`Error: ${data.message}`, 8000);
  859. }
  860. );
  861. },
  862. addFirstPrivatePlaylistSongToQueue: function() {
  863. let _this = this;
  864. let isInQueue = false;
  865. let userId = _this.$parent.userId;
  866. if (_this.type === "community") {
  867. _this.songsList.forEach(queueSong => {
  868. if (queueSong.requestedBy === userId) isInQueue = true;
  869. });
  870. if (!isInQueue && _this.privatePlaylistQueueSelected) {
  871. _this.socket.emit(
  872. "playlists.getFirstSong",
  873. _this.privatePlaylistQueueSelected,
  874. data => {
  875. if (data.status === "success") {
  876. if (data.song.duration < 15 * 60) {
  877. _this.automaticallyRequestedSongId =
  878. data.song.songId;
  879. _this.socket.emit(
  880. "stations.addToQueue",
  881. _this.station._id,
  882. data.song.songId,
  883. data2 => {
  884. if (data2.status === "success") {
  885. _this.socket.emit(
  886. "playlists.moveSongToBottom",
  887. _this.privatePlaylistQueueSelected,
  888. data.song.songId,
  889. data3 => {
  890. if (
  891. data3.status ===
  892. "success"
  893. ) {} // eslint-disable-line
  894. }
  895. );
  896. }
  897. }
  898. );
  899. } else {
  900. Toast.methods.addToast(
  901. `Top song in playlist was too long to be added.`,
  902. 3000
  903. );
  904. _this.socket.emit(
  905. "playlists.moveSongToBottom",
  906. _this.privatePlaylistQueueSelected,
  907. data.song.songId,
  908. data3 => {
  909. if (data3.status === "success") {
  910. setTimeout(() => {
  911. this.addFirstPrivatePlaylistSongToQueue();
  912. }, 3000);
  913. }
  914. }
  915. );
  916. }
  917. }
  918. }
  919. );
  920. }
  921. }
  922. },
  923. join: function() {
  924. let _this = this;
  925. _this.socket.emit("stations.join", _this.stationName, res => {
  926. if (res.status === "success") {
  927. _this.loading = false;
  928. const {
  929. _id,
  930. displayName,
  931. description,
  932. privacy,
  933. locked,
  934. partyMode,
  935. owner,
  936. privatePlaylist
  937. } = res.data;
  938. document.title = `Musare - ${displayName}`;
  939. _this.joinStation({
  940. _id,
  941. name: _this.stationName,
  942. displayName,
  943. description,
  944. privacy,
  945. locked,
  946. partyMode,
  947. owner,
  948. privatePlaylist
  949. });
  950. _this.currentSong = res.data.currentSong
  951. ? res.data.currentSong
  952. : {};
  953. if (_this.currentSong.artists)
  954. _this.currentSong.artists = _this.currentSong.artists.join(
  955. ", "
  956. );
  957. _this.type = res.data.type;
  958. _this.startedAt = res.data.startedAt;
  959. _this.paused = res.data.paused;
  960. _this.timePaused = res.data.timePaused;
  961. _this.userCount = res.data.userCount;
  962. _this.users = res.data.users;
  963. _this.pausedAt = res.data.pausedAt;
  964. if (res.data.currentSong) {
  965. _this.noSong = false;
  966. _this.simpleSong =
  967. res.data.currentSong.likes === -1 &&
  968. res.data.currentSong.dislikes === -1;
  969. if (_this.simpleSong) {
  970. _this.currentSong.skipDuration = 0;
  971. }
  972. _this.youtubeReady();
  973. _this.playVideo();
  974. _this.socket.emit(
  975. "songs.getOwnSongRatings",
  976. res.data.currentSong.songId,
  977. data => {
  978. if (_this.currentSong.songId === data.songId) {
  979. _this.liked = data.liked;
  980. _this.disliked = data.disliked;
  981. }
  982. }
  983. );
  984. } else {
  985. if (_this.playerReady) _this.player.pauseVideo();
  986. _this.noSong = true;
  987. }
  988. // UNIX client time before ping
  989. let beforePing = Date.now();
  990. _this.socket.emit("apis.ping", res => {
  991. // UNIX client time after ping
  992. let afterPing = Date.now();
  993. // Average time in MS it took between the server responding and the client receiving
  994. let connectionLatency = (afterPing - beforePing) / 2;
  995. console.log(connectionLatency, beforePing - afterPing);
  996. // UNIX server time
  997. let serverDate = res.date;
  998. // Difference between the server UNIX time and the client UNIX time after ping, with the connectionLatency added to the server UNIX time
  999. let difference =
  1000. serverDate + connectionLatency - afterPing;
  1001. console.log("Difference: ", difference);
  1002. if (difference > 3000 || difference < -3000) {
  1003. console.log(
  1004. "System time difference is bigger than 3 seconds."
  1005. );
  1006. }
  1007. _this.systemDifference = difference;
  1008. });
  1009. }
  1010. });
  1011. },
  1012. ...mapActions("modals", ["openModal"]),
  1013. ...mapActions("station", ["joinStation"])
  1014. },
  1015. mounted: function() {
  1016. let _this = this;
  1017. Date.currently = () => {
  1018. return new Date().getTime() + _this.systemDifference;
  1019. };
  1020. _this.stationName = _this.$route.params.id;
  1021. window.stationInterval = 0;
  1022. io.getSocket(socket => {
  1023. _this.socket = socket;
  1024. io.removeAllListeners();
  1025. if (_this.socket.connected) _this.join();
  1026. io.onConnect(_this.join);
  1027. _this.socket.emit("stations.findByName", _this.stationName, res => {
  1028. if (res.status === "failure") {
  1029. _this.loading = false;
  1030. _this.exists = false;
  1031. } else {
  1032. _this.exists = true;
  1033. }
  1034. });
  1035. _this.socket.on("event:songs.next", data => {
  1036. _this.previousSong = _this.currentSong.songId
  1037. ? _this.currentSong
  1038. : null;
  1039. _this.currentSong = data.currentSong ? data.currentSong : {};
  1040. _this.startedAt = data.startedAt;
  1041. _this.paused = data.paused;
  1042. _this.timePaused = data.timePaused;
  1043. if (data.currentSong) {
  1044. _this.noSong = false;
  1045. if (_this.currentSong.artists)
  1046. _this.currentSong.artists = _this.currentSong.artists.join(
  1047. ", "
  1048. );
  1049. _this.simpleSong =
  1050. data.currentSong.likes === -1 &&
  1051. data.currentSong.dislikes === -1;
  1052. if (_this.simpleSong) _this.currentSong.skipDuration = 0;
  1053. if (!_this.playerReady) _this.youtubeReady();
  1054. else _this.playVideo();
  1055. _this.socket.emit(
  1056. "songs.getOwnSongRatings",
  1057. data.currentSong.songId,
  1058. data => {
  1059. if (_this.currentSong.songId === data.songId) {
  1060. _this.liked = data.liked;
  1061. _this.disliked = data.disliked;
  1062. }
  1063. }
  1064. );
  1065. } else {
  1066. if (_this.playerReady) _this.player.pauseVideo();
  1067. _this.noSong = true;
  1068. }
  1069. let isInQueue = false;
  1070. let userId = _this.$parent.userId;
  1071. _this.songsList.forEach(queueSong => {
  1072. if (queueSong.requestedBy === userId) isInQueue = true;
  1073. });
  1074. if (
  1075. !isInQueue &&
  1076. _this.privatePlaylistQueueSelected &&
  1077. (_this.automaticallyRequestedSongId !==
  1078. _this.currentSong.songId ||
  1079. !_this.currentSong.songId)
  1080. ) {
  1081. _this.addFirstPrivatePlaylistSongToQueue();
  1082. }
  1083. });
  1084. _this.socket.on("event:stations.pause", data => {
  1085. _this.pausedAt = data.pausedAt;
  1086. _this.pauseLocalStation();
  1087. });
  1088. _this.socket.on("event:stations.resume", data => {
  1089. _this.timePaused = data.timePaused;
  1090. _this.resumeLocalStation();
  1091. });
  1092. _this.socket.on(
  1093. "event:stations.remove",
  1094. () => (location.href = "/")
  1095. );
  1096. _this.socket.on("event:song.like", data => {
  1097. if (!this.noSong) {
  1098. if (data.songId === _this.currentSong.songId) {
  1099. _this.currentSong.dislikes = data.dislikes;
  1100. _this.currentSong.likes = data.likes;
  1101. }
  1102. }
  1103. });
  1104. _this.socket.on("event:song.dislike", data => {
  1105. if (!this.noSong) {
  1106. if (data.songId === _this.currentSong.songId) {
  1107. _this.currentSong.dislikes = data.dislikes;
  1108. _this.currentSong.likes = data.likes;
  1109. }
  1110. }
  1111. });
  1112. _this.socket.on("event:song.unlike", data => {
  1113. if (!this.noSong) {
  1114. if (data.songId === _this.currentSong.songId) {
  1115. _this.currentSong.dislikes = data.dislikes;
  1116. _this.currentSong.likes = data.likes;
  1117. }
  1118. }
  1119. });
  1120. _this.socket.on("event:song.undislike", data => {
  1121. if (!this.noSong) {
  1122. if (data.songId === _this.currentSong.songId) {
  1123. _this.currentSong.dislikes = data.dislikes;
  1124. _this.currentSong.likes = data.likes;
  1125. }
  1126. }
  1127. });
  1128. _this.socket.on("event:song.newRatings", data => {
  1129. if (!this.noSong) {
  1130. if (data.songId === _this.currentSong.songId) {
  1131. _this.liked = data.liked;
  1132. _this.disliked = data.disliked;
  1133. }
  1134. }
  1135. });
  1136. _this.socket.on("event:queue.update", queue => {
  1137. if (this.type === "community") this.songsList = queue;
  1138. });
  1139. _this.socket.on("event:song.voteSkipSong", () => {
  1140. if (this.currentSong) this.currentSong.skipVotes++;
  1141. });
  1142. _this.socket.on("event:privatePlaylist.selected", playlistId => {
  1143. if (this.type === "community") {
  1144. this.station.privatePlaylist = playlistId;
  1145. }
  1146. });
  1147. _this.socket.on("event:partyMode.updated", partyMode => {
  1148. if (this.type === "community") {
  1149. this.station.partyMode = partyMode;
  1150. }
  1151. });
  1152. _this.socket.on("event:newOfficialPlaylist", playlist => {
  1153. if (this.type === "official") {
  1154. this.songsList = playlist;
  1155. }
  1156. });
  1157. _this.socket.on("event:users.updated", users => {
  1158. _this.users = users;
  1159. });
  1160. _this.socket.on("event:userCount.updated", userCount => {
  1161. _this.userCount = userCount;
  1162. });
  1163. _this.socket.on("event:queueLockToggled", locked => {
  1164. _this.station.locked = locked;
  1165. });
  1166. });
  1167. if (JSON.parse(localStorage.getItem("muted"))) {
  1168. this.muted = true;
  1169. this.player.setVolume(0);
  1170. document.getElementById("volumeSlider").value = 0 * 100;
  1171. } else {
  1172. let volume = parseFloat(localStorage.getItem("volume"));
  1173. volume = typeof volume === "number" && !isNaN(volume) ? volume : 20;
  1174. localStorage.setItem("volume", volume);
  1175. document.getElementById("volumeSlider").value = volume * 100;
  1176. }
  1177. },
  1178. components: {
  1179. OfficialHeader,
  1180. CommunityHeader,
  1181. SongQueue,
  1182. AddToPlaylist,
  1183. EditPlaylist,
  1184. CreatePlaylist,
  1185. EditStation,
  1186. Report,
  1187. SongsListSidebar,
  1188. PlaylistSidebar,
  1189. UsersSidebar,
  1190. UserIdToUsername,
  1191. Z404
  1192. }
  1193. };
  1194. </script>
  1195. <style lang="scss">
  1196. .player-can-not-autoplay {
  1197. position: absolute;
  1198. width: 100%;
  1199. height: 100%;
  1200. background: rgba(3, 169, 244, 0.95);
  1201. display: flex;
  1202. align-items: center;
  1203. justify-content: center;
  1204. p {
  1205. color: white;
  1206. font-size: 26px;
  1207. text-align: center;
  1208. }
  1209. }
  1210. .slide-enter-active,
  1211. .slide-leave-active {
  1212. transition: all 0.3s ease;
  1213. }
  1214. .slide-enter,
  1215. .slide-leave-to {
  1216. transform: translateX(300px);
  1217. }
  1218. .no-song {
  1219. color: #03a9f4;
  1220. text-align: center;
  1221. }
  1222. #volumeSlider {
  1223. padding: 0 15px;
  1224. background: transparent;
  1225. }
  1226. .volume-slider-wrapper {
  1227. margin-top: 0;
  1228. position: relative;
  1229. display: flex;
  1230. align-items: center;
  1231. .material-icons {
  1232. user-select: none;
  1233. }
  1234. }
  1235. .material-icons {
  1236. cursor: pointer;
  1237. }
  1238. .stationDisplayName {
  1239. color: white !important;
  1240. }
  1241. .add-to-playlist {
  1242. display: flex;
  1243. align-items: center;
  1244. justify-content: center;
  1245. }
  1246. .slideout {
  1247. top: 50px;
  1248. height: 100%;
  1249. position: fixed;
  1250. right: 0;
  1251. width: 350px;
  1252. background-color: white;
  1253. box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.16),
  1254. 0 2px 10px 0 rgba(0, 0, 0, 0.12);
  1255. .slideout-header {
  1256. text-align: center;
  1257. background-color: rgb(3, 169, 244) !important;
  1258. margin: 0;
  1259. padding-top: 5px;
  1260. padding-bottom: 7px;
  1261. color: white;
  1262. }
  1263. .slideout-content {
  1264. height: 100%;
  1265. }
  1266. }
  1267. .modal-large {
  1268. width: 75%;
  1269. }
  1270. .station {
  1271. flex: 1 0 auto;
  1272. padding-top: 0.5vw;
  1273. transition: all 0.1s;
  1274. margin: 0 auto;
  1275. max-width: 100%;
  1276. width: 90%;
  1277. @media only screen and (min-width: 993px) {
  1278. width: 70%;
  1279. }
  1280. @media only screen and (min-width: 601px) {
  1281. width: 85%;
  1282. }
  1283. @media (min-width: 999px) {
  1284. .mobile-only {
  1285. display: none;
  1286. }
  1287. .desktop-only {
  1288. display: block;
  1289. }
  1290. }
  1291. @media (max-width: 998px) {
  1292. .mobile-only {
  1293. display: block;
  1294. }
  1295. .desktop-only {
  1296. display: none;
  1297. visibility: hidden;
  1298. }
  1299. }
  1300. .mobile-only {
  1301. text-align: center;
  1302. }
  1303. .playlistCard {
  1304. margin: 10px;
  1305. position: relative;
  1306. padding-bottom: calc(31.25% + 7px);
  1307. height: 0;
  1308. overflow-y: scroll;
  1309. .title {
  1310. background-color: rgb(3, 169, 244);
  1311. text-align: center;
  1312. padding: 10px;
  1313. color: white;
  1314. font-weight: 600;
  1315. }
  1316. .media {
  1317. padding: 0 25px;
  1318. }
  1319. .media-content .content {
  1320. min-height: 64px;
  1321. max-height: 64px;
  1322. display: flex;
  1323. align-items: center;
  1324. }
  1325. .content p strong {
  1326. word-break: break-word;
  1327. }
  1328. .content p small {
  1329. word-break: break-word;
  1330. }
  1331. .add-to-queue {
  1332. width: 100%;
  1333. margin-top: 25px;
  1334. height: 40px;
  1335. border-radius: 0;
  1336. background: rgb(3, 169, 244);
  1337. color: #fff !important;
  1338. border: 0;
  1339. &:active,
  1340. &:focus {
  1341. border: 0;
  1342. }
  1343. }
  1344. .add-to-queue:focus {
  1345. background: #029ce3;
  1346. }
  1347. .media-right {
  1348. line-height: 64px;
  1349. }
  1350. .songTitle {
  1351. word-wrap: break-word;
  1352. overflow: hidden;
  1353. text-overflow: ellipsis;
  1354. display: -webkit-box;
  1355. -webkit-box-orient: vertical;
  1356. -webkit-line-clamp: 2;
  1357. line-height: 20px;
  1358. max-height: 40px;
  1359. width: 100%;
  1360. }
  1361. }
  1362. input[type="range"] {
  1363. -webkit-appearance: none;
  1364. width: 100%;
  1365. margin: 7.3px 0;
  1366. }
  1367. input[type="range"]:focus {
  1368. outline: none;
  1369. }
  1370. input[type="range"]::-webkit-slider-runnable-track {
  1371. width: 100%;
  1372. height: 5.2px;
  1373. cursor: pointer;
  1374. box-shadow: 0;
  1375. background: #c2c0c2;
  1376. border-radius: 0;
  1377. border: 0;
  1378. }
  1379. input[type="range"]::-webkit-slider-thumb {
  1380. box-shadow: 0;
  1381. border: 0;
  1382. height: 19px;
  1383. width: 19px;
  1384. border-radius: 15px;
  1385. background: #03a9f4;
  1386. cursor: pointer;
  1387. -webkit-appearance: none;
  1388. margin-top: -6.5px;
  1389. }
  1390. input[type="range"]::-moz-range-track {
  1391. width: 100%;
  1392. height: 5.2px;
  1393. cursor: pointer;
  1394. box-shadow: 0;
  1395. background: #c2c0c2;
  1396. border-radius: 0;
  1397. border: 0;
  1398. }
  1399. input[type="range"]::-moz-range-thumb {
  1400. box-shadow: 0;
  1401. border: 0;
  1402. height: 19px;
  1403. width: 19px;
  1404. border-radius: 15px;
  1405. background: #03a9f4;
  1406. cursor: pointer;
  1407. -webkit-appearance: none;
  1408. margin-top: -6.5px;
  1409. }
  1410. input[type="range"]::-ms-track {
  1411. width: 100%;
  1412. height: 5.2px;
  1413. cursor: pointer;
  1414. box-shadow: 0;
  1415. background: #c2c0c2;
  1416. border-radius: 1.3px;
  1417. }
  1418. input[type="range"]::-ms-fill-lower {
  1419. background: #c2c0c2;
  1420. border: 0;
  1421. border-radius: 0;
  1422. box-shadow: 0;
  1423. }
  1424. input[type="range"]::-ms-fill-upper {
  1425. background: #c2c0c2;
  1426. border: 0;
  1427. border-radius: 0;
  1428. box-shadow: 0;
  1429. }
  1430. input[type="range"]::-ms-thumb {
  1431. box-shadow: 0;
  1432. border: 0;
  1433. height: 15px;
  1434. width: 15px;
  1435. border-radius: 15px;
  1436. background: #03a9f4;
  1437. cursor: pointer;
  1438. -webkit-appearance: none;
  1439. margin-top: 1.5px;
  1440. }
  1441. .video-container {
  1442. position: relative;
  1443. padding-bottom: 56.25%;
  1444. height: 0;
  1445. overflow: hidden;
  1446. iframe {
  1447. position: absolute;
  1448. top: 0;
  1449. left: 0;
  1450. width: 100%;
  1451. height: 100%;
  1452. }
  1453. }
  1454. .video-col {
  1455. padding-right: 0.75rem;
  1456. padding-left: 0.75rem;
  1457. }
  1458. }
  1459. .room-title {
  1460. left: 50%;
  1461. -webkit-transform: translateX(-50%);
  1462. transform: translateX(-50%);
  1463. font-size: 2.1em;
  1464. }
  1465. #ratings {
  1466. span {
  1467. font-size: 1.68rem;
  1468. }
  1469. i {
  1470. color: #9e9e9e !important;
  1471. cursor: pointer;
  1472. transition: 0.1s color;
  1473. }
  1474. }
  1475. #time-display {
  1476. margin-top: 30px;
  1477. float: right;
  1478. }
  1479. #thumbs_up:hover,
  1480. #thumbs_up.liked {
  1481. color: #87d37c !important;
  1482. }
  1483. #thumbs_down:hover,
  1484. #thumbs_down.disliked {
  1485. color: #ec644b !important;
  1486. }
  1487. #song-thumbnail {
  1488. max-width: 100%;
  1489. width: 85%;
  1490. }
  1491. .seeker-bar-container {
  1492. position: relative;
  1493. height: 7px;
  1494. display: block;
  1495. width: 100%;
  1496. overflow: hidden;
  1497. }
  1498. .seeker-bar {
  1499. top: 0;
  1500. left: 0;
  1501. bottom: 0;
  1502. position: absolute;
  1503. }
  1504. ul {
  1505. list-style: none;
  1506. margin: 0;
  1507. display: block;
  1508. }
  1509. h1,
  1510. h2,
  1511. h3,
  1512. h4,
  1513. h5,
  1514. h6 {
  1515. font-weight: 400;
  1516. line-height: 1.1;
  1517. }
  1518. h1 a,
  1519. h2 a,
  1520. h3 a,
  1521. h4 a,
  1522. h5 a,
  1523. h6 a {
  1524. font-weight: inherit;
  1525. }
  1526. h1 {
  1527. font-size: 4.2rem;
  1528. line-height: 110%;
  1529. margin: 2.1rem 0 1.68rem 0;
  1530. }
  1531. h2 {
  1532. font-size: 3.56rem;
  1533. line-height: 110%;
  1534. margin: 1.78rem 0 1.424rem 0;
  1535. }
  1536. h3 {
  1537. font-size: 2.92rem;
  1538. line-height: 110%;
  1539. margin: 1.46rem 0 1.168rem 0;
  1540. }
  1541. h4 {
  1542. font-size: 2.28rem;
  1543. line-height: 110%;
  1544. margin: 1.14rem 0 0.912rem 0;
  1545. }
  1546. h5 {
  1547. font-size: 1.64rem;
  1548. line-height: 110%;
  1549. margin: 0.82rem 0 0.656rem 0;
  1550. }
  1551. h6 {
  1552. font-size: 1rem;
  1553. line-height: 110%;
  1554. margin: 0.5rem 0 0.4rem 0;
  1555. }
  1556. .thin {
  1557. font-weight: 200;
  1558. }
  1559. .left {
  1560. float: left !important;
  1561. }
  1562. .right {
  1563. float: right !important;
  1564. }
  1565. .light-blue {
  1566. background-color: #03a9f4 !important;
  1567. }
  1568. .white {
  1569. background-color: #ffffff !important;
  1570. }
  1571. .btn-search {
  1572. font-size: 14px;
  1573. }
  1574. .menu {
  1575. padding: 0 10px;
  1576. }
  1577. .menu-list li a:hover {
  1578. color: #000 !important;
  1579. }
  1580. .menu-list li {
  1581. display: flex;
  1582. justify-content: space-between;
  1583. }
  1584. .menu-list a {
  1585. /*padding: 0 10px !important;*/
  1586. }
  1587. .menu-list a:hover {
  1588. background-color: transparent;
  1589. }
  1590. .icons-group {
  1591. display: flex;
  1592. }
  1593. #like,
  1594. #dislike {
  1595. position: relative;
  1596. }
  1597. .behind {
  1598. z-index: -1;
  1599. }
  1600. .behind:focus {
  1601. z-index: 0;
  1602. }
  1603. .progress {
  1604. width: 50px;
  1605. animation: rotate 0.8s infinite linear;
  1606. border: 8px solid #03a9f4;
  1607. border-right-color: transparent;
  1608. height: 50px;
  1609. position: absolute;
  1610. top: 50%;
  1611. left: 50%;
  1612. }
  1613. @keyframes rotate {
  1614. 0% {
  1615. transform: rotate(0deg);
  1616. }
  1617. 100% {
  1618. transform: rotate(360deg);
  1619. }
  1620. }
  1621. .experimental {
  1622. display: none !important;
  1623. }
  1624. </style>