Station.vue 38 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731
  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. toggleModal({
  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. toggleModal({
  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) local.player.unMute();
  530. local.playVideo();
  531. },
  532. onError: function(err) {
  533. console.log("iframe error", err);
  534. local.voteSkipStation();
  535. },
  536. onStateChange: function(event) {
  537. if (
  538. event.data === 1 &&
  539. local.videoLoading === true
  540. ) {
  541. local.videoLoading = false;
  542. local.player.seekTo(
  543. local.getTimeElapsed() / 1000 +
  544. local.currentSong.skipDuration,
  545. true
  546. );
  547. if (local.paused) local.player.pauseVideo();
  548. } else if (event.data === 1 && local.paused) {
  549. local.player.seekTo(
  550. local.timeBeforePause / 1000,
  551. true
  552. );
  553. local.player.pauseVideo();
  554. }
  555. if (
  556. event.data === 2 &&
  557. !local.paused &&
  558. !local.noSong &&
  559. local.player.getDuration() / 1000 <
  560. local.currentSong.duration
  561. ) {
  562. local.player.seekTo(
  563. local.getTimeElapsed() / 1000 +
  564. local.currentSong.skipDuration,
  565. true
  566. );
  567. local.player.playVideo();
  568. }
  569. }
  570. }
  571. });
  572. }
  573. },
  574. getTimeElapsed: function() {
  575. let local = this;
  576. if (local.currentSong) {
  577. let timePaused = local.timePaused;
  578. if (local.paused)
  579. timePaused += Date.currently() - local.pausedAt;
  580. return Date.currently() - local.startedAt - timePaused;
  581. } else return 0;
  582. },
  583. playVideo: function() {
  584. let local = this;
  585. if (local.playerReady) {
  586. local.videoLoading = true;
  587. local.player.loadVideoById(
  588. local.currentSong.songId,
  589. local.getTimeElapsed() / 1000 +
  590. local.currentSong.skipDuration
  591. );
  592. if (window.stationInterval !== 0)
  593. clearInterval(window.stationInterval);
  594. window.stationInterval = setInterval(function() {
  595. local.resizeSeekerbar();
  596. local.calculateTimeElapsed();
  597. }, 150);
  598. }
  599. },
  600. resizeSeekerbar: function() {
  601. let local = this;
  602. if (!local.paused) {
  603. document.getElementsByClassName("seeker-bar")[0].style.width =
  604. parseFloat(
  605. (local.getTimeElapsed() /
  606. 1000 /
  607. local.currentSong.duration) *
  608. 100
  609. ) + "%";
  610. }
  611. },
  612. formatTime: function(duration) {
  613. let d = moment.duration(duration, "seconds");
  614. if (duration < 0) return "0:00";
  615. return (
  616. (d.hours() > 0
  617. ? d.hours() < 10
  618. ? "0" + d.hours() + ":"
  619. : d.hours() + ":"
  620. : "") +
  621. (d.minutes() + ":") +
  622. (d.seconds() < 10 ? "0" + d.seconds() : d.seconds())
  623. );
  624. },
  625. calculateTimeElapsed: function() {
  626. let local = this;
  627. if (
  628. local.playerReady &&
  629. local.currentSong &&
  630. local.player.getPlayerState() === -1
  631. ) {
  632. if (local.attemptsToPlayVideo >= 5) {
  633. if (
  634. Date.now() - local.lastTimeRequestedIfCanAutoplay >
  635. 2000
  636. ) {
  637. local.lastTimeRequestedIfCanAutoplay = Date.now();
  638. window.canAutoplay.video().then(({ result }) => {
  639. if (result) {
  640. local.attemptsToPlayVideo = 0;
  641. local.canAutoplay = true;
  642. } else {
  643. local.canAutoplay = false;
  644. }
  645. });
  646. }
  647. } else {
  648. local.player.playVideo();
  649. local.attemptsToPlayVideo++;
  650. }
  651. }
  652. if (!local.paused) {
  653. let timeElapsed = local.getTimeElapsed();
  654. let currentPlayerTime = local.player.getCurrentTime() * 1000;
  655. let difference = timeElapsed - currentPlayerTime;
  656. //console.log(difference123);
  657. if (difference < -200) {
  658. //console.log("Difference0.8");
  659. local.player.setPlaybackRate(0.8);
  660. } else if (difference < -50) {
  661. //console.log("Difference0.9");
  662. local.player.setPlaybackRate(0.9);
  663. } else if (difference < -25) {
  664. //console.log("Difference0.99");
  665. local.player.setPlaybackRate(0.99);
  666. } else if (difference > 200) {
  667. //console.log("Difference1.2");
  668. local.player.setPlaybackRate(1.2);
  669. } else if (difference > 50) {
  670. //console.log("Difference1.1");
  671. local.player.setPlaybackRate(1.1);
  672. } else if (difference > 25) {
  673. //console.log("Difference1.01");
  674. local.player.setPlaybackRate(1.01);
  675. } else if (local.player.getPlaybackRate !== 1.0) {
  676. //console.log("NDifference1.0");
  677. local.player.setPlaybackRate(1.0);
  678. }
  679. }
  680. /*if (local.currentTime !== undefined && local.paused) {
  681. local.timePaused += Date.currently() - local.currentTime;
  682. local.currentTime = undefined;
  683. }*/
  684. let timePaused = local.timePaused;
  685. if (local.paused) timePaused += Date.currently() - local.pausedAt;
  686. let duration =
  687. (Date.currently() - local.startedAt - timePaused) / 1000;
  688. let songDuration = local.currentSong.duration;
  689. if (songDuration <= duration) local.player.pauseVideo();
  690. if (!local.paused && duration <= songDuration)
  691. local.timeElapsed = local.formatTime(duration);
  692. },
  693. toggleLock: function() {
  694. window.socket.emit("stations.toggleLock", this.station._id, res => {
  695. if (res.status === "success") {
  696. Toast.methods.addToast(
  697. "Successfully toggled the queue lock.",
  698. 4000
  699. );
  700. } else Toast.methods.addToast(res.message, 8000);
  701. });
  702. },
  703. changeVolume: function() {
  704. let local = this;
  705. let volume = document.getElementById("volumeSlider").value;
  706. localStorage.setItem("volume", volume / 100);
  707. if (local.playerReady) {
  708. local.player.setVolume(volume / 100);
  709. if (volume > 0) local.player.unMute();
  710. }
  711. },
  712. resumeLocalStation: function() {
  713. this.paused = false;
  714. if (!this.noSong) {
  715. if (this.playerReady) {
  716. this.player.seekTo(
  717. this.getTimeElapsed() / 1000 +
  718. this.currentSong.skipDuration
  719. );
  720. this.player.playVideo();
  721. }
  722. }
  723. },
  724. pauseLocalStation: function() {
  725. console.log("pause locally");
  726. this.paused = true;
  727. if (!this.noSong) {
  728. this.timeBeforePause = this.getTimeElapsed();
  729. if (this.playerReady) this.player.pauseVideo();
  730. }
  731. },
  732. skipStation: function() {
  733. let _this = this;
  734. _this.socket.emit("stations.forceSkip", _this.station._id, data => {
  735. if (data.status !== "success")
  736. Toast.methods.addToast(`Error: ${data.message}`, 8000);
  737. else
  738. Toast.methods.addToast(
  739. "Successfully skipped the station's current song.",
  740. 4000
  741. );
  742. });
  743. },
  744. voteSkipStation: function() {
  745. let _this = this;
  746. _this.socket.emit("stations.voteSkip", _this.station._id, data => {
  747. if (data.status !== "success")
  748. Toast.methods.addToast(`Error: ${data.message}`, 8000);
  749. else
  750. Toast.methods.addToast(
  751. "Successfully voted to skip the current song.",
  752. 4000
  753. );
  754. });
  755. },
  756. resumeStation: function() {
  757. let _this = this;
  758. _this.socket.emit("stations.resume", _this.station._id, data => {
  759. if (data.status !== "success")
  760. Toast.methods.addToast(`Error: ${data.message}`, 8000);
  761. else
  762. Toast.methods.addToast(
  763. "Successfully resumed the station.",
  764. 4000
  765. );
  766. });
  767. },
  768. pauseStation: function() {
  769. let _this = this;
  770. _this.socket.emit("stations.pause", _this.station._id, data => {
  771. if (data.status !== "success")
  772. Toast.methods.addToast(`Error: ${data.message}`, 8000);
  773. else
  774. Toast.methods.addToast(
  775. "Successfully paused the station.",
  776. 4000
  777. );
  778. });
  779. },
  780. toggleMute: function() {
  781. if (this.playerReady) {
  782. let previousVolume = parseFloat(localStorage.getItem("volume"));
  783. let volume =
  784. this.player.getVolume() * 100 <= 0 ? previousVolume : 0;
  785. this.muted = !this.muted;
  786. document.getElementById("volumeSlider").value = volume * 100;
  787. this.player.setVolume(volume);
  788. if (!this.muted) localStorage.setItem("volume", volume);
  789. }
  790. },
  791. increaseVolume: function() {
  792. if (this.playerReady) {
  793. let previousVolume = parseInt(localStorage.getItem("volume"));
  794. let volume = previousVolume + 5;
  795. if (previousVolume === 0) this.muted = false;
  796. if (volume > 100) volume = 100;
  797. document.getElementById("volumeSlider").value = volume * 100;
  798. this.player.setVolume(volume);
  799. localStorage.setItem("volume", volume);
  800. }
  801. },
  802. toggleLike: function() {
  803. let _this = this;
  804. if (_this.liked)
  805. _this.socket.emit(
  806. "songs.unlike",
  807. _this.currentSong.songId,
  808. data => {
  809. if (data.status !== "success")
  810. Toast.methods.addToast(
  811. `Error: ${data.message}`,
  812. 8000
  813. );
  814. }
  815. );
  816. else
  817. _this.socket.emit(
  818. "songs.like",
  819. _this.currentSong.songId,
  820. data => {
  821. if (data.status !== "success")
  822. Toast.methods.addToast(
  823. `Error: ${data.message}`,
  824. 8000
  825. );
  826. }
  827. );
  828. },
  829. toggleDislike: function() {
  830. let _this = this;
  831. if (_this.disliked)
  832. return _this.socket.emit(
  833. "songs.undislike",
  834. _this.currentSong.songId,
  835. data => {
  836. if (data.status !== "success")
  837. Toast.methods.addToast(
  838. `Error: ${data.message}`,
  839. 8000
  840. );
  841. }
  842. );
  843. _this.socket.emit(
  844. "songs.dislike",
  845. _this.currentSong.songId,
  846. data => {
  847. if (data.status !== "success")
  848. Toast.methods.addToast(`Error: ${data.message}`, 8000);
  849. }
  850. );
  851. },
  852. addFirstPrivatePlaylistSongToQueue: function() {
  853. let _this = this;
  854. let isInQueue = false;
  855. let userId = _this.$parent.userId;
  856. if (_this.type === "community") {
  857. _this.songsList.forEach(queueSong => {
  858. if (queueSong.requestedBy === userId) isInQueue = true;
  859. });
  860. if (!isInQueue && _this.privatePlaylistQueueSelected) {
  861. _this.socket.emit(
  862. "playlists.getFirstSong",
  863. _this.privatePlaylistQueueSelected,
  864. data => {
  865. if (data.status === "success") {
  866. if (data.song.duration < 15 * 60) {
  867. _this.automaticallyRequestedSongId =
  868. data.song.songId;
  869. _this.socket.emit(
  870. "stations.addToQueue",
  871. _this.station._id,
  872. data.song.songId,
  873. data2 => {
  874. if (data2.status === "success") {
  875. _this.socket.emit(
  876. "playlists.moveSongToBottom",
  877. _this.privatePlaylistQueueSelected,
  878. data.song.songId,
  879. data3 => {
  880. if (
  881. data3.status ===
  882. "success"
  883. ) {} // eslint-disable-line
  884. }
  885. );
  886. }
  887. }
  888. );
  889. } else {
  890. Toast.methods.addToast(
  891. `Top song in playlist was too long to be added.`,
  892. 3000
  893. );
  894. _this.socket.emit(
  895. "playlists.moveSongToBottom",
  896. _this.privatePlaylistQueueSelected,
  897. data.song.songId,
  898. data3 => {
  899. if (data3.status === "success") {
  900. setTimeout(() => {
  901. this.addFirstPrivatePlaylistSongToQueue();
  902. }, 3000);
  903. }
  904. }
  905. );
  906. }
  907. }
  908. }
  909. );
  910. }
  911. }
  912. },
  913. join: function() {
  914. let _this = this;
  915. _this.socket.emit("stations.join", _this.stationName, res => {
  916. if (res.status === "success") {
  917. _this.loading = false;
  918. const {
  919. _id,
  920. displayName,
  921. description,
  922. privacy,
  923. locked,
  924. partyMode,
  925. owner,
  926. privatePlaylist
  927. } = res.data;
  928. document.title = `Musare - ${displayName}`;
  929. _this.joinStation({
  930. _id,
  931. name: _this.stationName,
  932. displayName,
  933. description,
  934. privacy,
  935. locked,
  936. partyMode,
  937. owner,
  938. privatePlaylist
  939. });
  940. _this.currentSong = res.data.currentSong
  941. ? res.data.currentSong
  942. : {};
  943. if (_this.currentSong.artists)
  944. _this.currentSong.artists = _this.currentSong.artists.join(
  945. ", "
  946. );
  947. _this.type = res.data.type;
  948. _this.startedAt = res.data.startedAt;
  949. _this.paused = res.data.paused;
  950. _this.timePaused = res.data.timePaused;
  951. _this.userCount = res.data.userCount;
  952. _this.users = res.data.users;
  953. _this.pausedAt = res.data.pausedAt;
  954. if (res.data.currentSong) {
  955. _this.noSong = false;
  956. _this.simpleSong =
  957. res.data.currentSong.likes === -1 &&
  958. res.data.currentSong.dislikes === -1;
  959. if (_this.simpleSong) {
  960. _this.currentSong.skipDuration = 0;
  961. }
  962. _this.youtubeReady();
  963. _this.playVideo();
  964. _this.socket.emit(
  965. "songs.getOwnSongRatings",
  966. res.data.currentSong.songId,
  967. data => {
  968. if (_this.currentSong.songId === data.songId) {
  969. _this.liked = data.liked;
  970. _this.disliked = data.disliked;
  971. }
  972. }
  973. );
  974. } else {
  975. if (_this.playerReady) _this.player.pauseVideo();
  976. _this.noSong = true;
  977. }
  978. // UNIX client time before ping
  979. let beforePing = Date.now();
  980. _this.socket.emit("apis.ping", res => {
  981. // UNIX client time after ping
  982. let afterPing = Date.now();
  983. // Average time in MS it took between the server responding and the client receiving
  984. let connectionLatency = (afterPing - beforePing) / 2;
  985. console.log(connectionLatency, beforePing - afterPing);
  986. // UNIX server time
  987. let serverDate = res.date;
  988. // Difference between the server UNIX time and the client UNIX time after ping, with the connectionLatency added to the server UNIX time
  989. let difference =
  990. serverDate + connectionLatency - afterPing;
  991. console.log("Difference: ", difference);
  992. if (difference > 3000 || difference < -3000) {
  993. console.log(
  994. "System time difference is bigger than 3 seconds."
  995. );
  996. }
  997. _this.systemDifference = difference;
  998. });
  999. }
  1000. });
  1001. },
  1002. ...mapActions("modals", ["toggleModal"]),
  1003. ...mapActions("station", ["joinStation"])
  1004. },
  1005. mounted: function() {
  1006. let _this = this;
  1007. Date.currently = () => {
  1008. return new Date().getTime() + _this.systemDifference;
  1009. };
  1010. _this.stationName = _this.$route.params.id;
  1011. window.stationInterval = 0;
  1012. io.getSocket(socket => {
  1013. _this.socket = socket;
  1014. io.removeAllListeners();
  1015. if (_this.socket.connected) _this.join();
  1016. io.onConnect(_this.join);
  1017. _this.socket.emit("stations.findByName", _this.stationName, res => {
  1018. if (res.status === "failure") {
  1019. _this.loading = false;
  1020. _this.exists = false;
  1021. } else {
  1022. _this.exists = true;
  1023. }
  1024. });
  1025. _this.socket.on("event:songs.next", data => {
  1026. _this.previousSong = _this.currentSong.songId
  1027. ? _this.currentSong
  1028. : null;
  1029. _this.currentSong = data.currentSong ? data.currentSong : {};
  1030. _this.startedAt = data.startedAt;
  1031. _this.paused = data.paused;
  1032. _this.timePaused = data.timePaused;
  1033. if (data.currentSong) {
  1034. _this.noSong = false;
  1035. if (_this.currentSong.artists)
  1036. _this.currentSong.artists = _this.currentSong.artists.join(
  1037. ", "
  1038. );
  1039. _this.simpleSong =
  1040. data.currentSong.likes === -1 &&
  1041. data.currentSong.dislikes === -1;
  1042. if (_this.simpleSong) _this.currentSong.skipDuration = 0;
  1043. if (!_this.playerReady) _this.youtubeReady();
  1044. else _this.playVideo();
  1045. _this.socket.emit(
  1046. "songs.getOwnSongRatings",
  1047. data.currentSong.songId,
  1048. data => {
  1049. if (_this.currentSong.songId === data.songId) {
  1050. _this.liked = data.liked;
  1051. _this.disliked = data.disliked;
  1052. }
  1053. }
  1054. );
  1055. } else {
  1056. if (_this.playerReady) _this.player.pauseVideo();
  1057. _this.noSong = true;
  1058. }
  1059. let isInQueue = false;
  1060. let userId = _this.$parent.userId;
  1061. _this.songsList.forEach(queueSong => {
  1062. if (queueSong.requestedBy === userId) isInQueue = true;
  1063. });
  1064. if (
  1065. !isInQueue &&
  1066. _this.privatePlaylistQueueSelected &&
  1067. (_this.automaticallyRequestedSongId !==
  1068. _this.currentSong.songId ||
  1069. !_this.currentSong.songId)
  1070. ) {
  1071. _this.addFirstPrivatePlaylistSongToQueue();
  1072. }
  1073. });
  1074. _this.socket.on("event:stations.pause", data => {
  1075. _this.pausedAt = data.pausedAt;
  1076. _this.pauseLocalStation();
  1077. console.log("local pause");
  1078. });
  1079. _this.socket.on("event:stations.resume", data => {
  1080. _this.timePaused = data.timePaused;
  1081. _this.resumeLocalStation();
  1082. });
  1083. _this.socket.on(
  1084. "event:stations.remove",
  1085. () => (location.href = "/")
  1086. );
  1087. _this.socket.on("event:song.like", data => {
  1088. if (!this.noSong) {
  1089. if (data.songId === _this.currentSong.songId) {
  1090. _this.currentSong.dislikes = data.dislikes;
  1091. _this.currentSong.likes = data.likes;
  1092. }
  1093. }
  1094. });
  1095. _this.socket.on("event:song.dislike", data => {
  1096. if (!this.noSong) {
  1097. if (data.songId === _this.currentSong.songId) {
  1098. _this.currentSong.dislikes = data.dislikes;
  1099. _this.currentSong.likes = data.likes;
  1100. }
  1101. }
  1102. });
  1103. _this.socket.on("event:song.unlike", data => {
  1104. if (!this.noSong) {
  1105. if (data.songId === _this.currentSong.songId) {
  1106. _this.currentSong.dislikes = data.dislikes;
  1107. _this.currentSong.likes = data.likes;
  1108. }
  1109. }
  1110. });
  1111. _this.socket.on("event:song.undislike", data => {
  1112. if (!this.noSong) {
  1113. if (data.songId === _this.currentSong.songId) {
  1114. _this.currentSong.dislikes = data.dislikes;
  1115. _this.currentSong.likes = data.likes;
  1116. }
  1117. }
  1118. });
  1119. _this.socket.on("event:song.newRatings", data => {
  1120. if (!this.noSong) {
  1121. if (data.songId === _this.currentSong.songId) {
  1122. _this.liked = data.liked;
  1123. _this.disliked = data.disliked;
  1124. }
  1125. }
  1126. });
  1127. _this.socket.on("event:queue.update", queue => {
  1128. if (this.type === "community") this.songsList = queue;
  1129. });
  1130. _this.socket.on("event:song.voteSkipSong", () => {
  1131. if (this.currentSong) this.currentSong.skipVotes++;
  1132. });
  1133. _this.socket.on("event:privatePlaylist.selected", playlistId => {
  1134. if (this.type === "community") {
  1135. this.station.privatePlaylist = playlistId;
  1136. }
  1137. });
  1138. _this.socket.on("event:partyMode.updated", partyMode => {
  1139. if (this.type === "community") {
  1140. this.station.partyMode = partyMode;
  1141. }
  1142. });
  1143. _this.socket.on("event:newOfficialPlaylist", playlist => {
  1144. if (this.type === "official") {
  1145. this.songsList = playlist;
  1146. }
  1147. });
  1148. _this.socket.on("event:users.updated", users => {
  1149. _this.users = users;
  1150. });
  1151. _this.socket.on("event:userCount.updated", userCount => {
  1152. _this.userCount = userCount;
  1153. });
  1154. _this.socket.on("event:queueLockToggled", locked => {
  1155. _this.station.locked = locked;
  1156. });
  1157. });
  1158. let volume = parseFloat(localStorage.getItem("volume"));
  1159. volume = typeof volume === "number" && !isNaN(volume) ? volume : 20;
  1160. localStorage.setItem("volume", volume);
  1161. document.getElementById("volumeSlider").value = volume * 100;
  1162. },
  1163. components: {
  1164. OfficialHeader,
  1165. CommunityHeader,
  1166. SongQueue,
  1167. AddToPlaylist,
  1168. EditPlaylist,
  1169. CreatePlaylist,
  1170. EditStation,
  1171. Report,
  1172. SongsListSidebar,
  1173. PlaylistSidebar,
  1174. UsersSidebar,
  1175. UserIdToUsername,
  1176. Z404
  1177. }
  1178. };
  1179. </script>
  1180. <style lang="scss">
  1181. .player-can-not-autoplay {
  1182. position: absolute;
  1183. width: 100%;
  1184. height: 100%;
  1185. background: rgba(3, 169, 244, 0.95);
  1186. display: flex;
  1187. align-items: center;
  1188. justify-content: center;
  1189. p {
  1190. color: white;
  1191. font-size: 26px;
  1192. text-align: center;
  1193. }
  1194. }
  1195. .slide-enter-active,
  1196. .slide-leave-active {
  1197. transition: all 0.3s ease;
  1198. }
  1199. .slide-enter,
  1200. .slide-leave-to {
  1201. transform: translateX(300px);
  1202. }
  1203. .no-song {
  1204. color: #03a9f4;
  1205. text-align: center;
  1206. }
  1207. #volumeSlider {
  1208. padding: 0 15px;
  1209. background: transparent;
  1210. }
  1211. .volume-slider-wrapper {
  1212. margin-top: 0;
  1213. position: relative;
  1214. display: flex;
  1215. align-items: center;
  1216. .material-icons {
  1217. user-select: none;
  1218. }
  1219. }
  1220. .material-icons {
  1221. cursor: pointer;
  1222. }
  1223. .stationDisplayName {
  1224. color: white !important;
  1225. }
  1226. .add-to-playlist {
  1227. display: flex;
  1228. align-items: center;
  1229. justify-content: center;
  1230. }
  1231. .slideout {
  1232. top: 50px;
  1233. height: 100%;
  1234. position: fixed;
  1235. right: 0;
  1236. width: 350px;
  1237. background-color: white;
  1238. box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.16),
  1239. 0 2px 10px 0 rgba(0, 0, 0, 0.12);
  1240. .slideout-header {
  1241. text-align: center;
  1242. background-color: rgb(3, 169, 244) !important;
  1243. margin: 0;
  1244. padding-top: 5px;
  1245. padding-bottom: 7px;
  1246. color: white;
  1247. }
  1248. .slideout-content {
  1249. height: 100%;
  1250. }
  1251. }
  1252. .modal-large {
  1253. width: 75%;
  1254. }
  1255. .station {
  1256. flex: 1 0 auto;
  1257. padding-top: 0.5vw;
  1258. transition: all 0.1s;
  1259. margin: 0 auto;
  1260. max-width: 100%;
  1261. width: 90%;
  1262. @media only screen and (min-width: 993px) {
  1263. width: 70%;
  1264. }
  1265. @media only screen and (min-width: 601px) {
  1266. width: 85%;
  1267. }
  1268. @media (min-width: 999px) {
  1269. .mobile-only {
  1270. display: none;
  1271. }
  1272. .desktop-only {
  1273. display: block;
  1274. }
  1275. }
  1276. @media (max-width: 998px) {
  1277. .mobile-only {
  1278. display: block;
  1279. }
  1280. .desktop-only {
  1281. display: none;
  1282. visibility: hidden;
  1283. }
  1284. }
  1285. .mobile-only {
  1286. text-align: center;
  1287. }
  1288. .playlistCard {
  1289. margin: 10px;
  1290. position: relative;
  1291. padding-bottom: calc(31.25% + 7px);
  1292. height: 0;
  1293. overflow-y: scroll;
  1294. .title {
  1295. background-color: rgb(3, 169, 244);
  1296. text-align: center;
  1297. padding: 10px;
  1298. color: white;
  1299. font-weight: 600;
  1300. }
  1301. .media {
  1302. padding: 0 25px;
  1303. }
  1304. .media-content .content {
  1305. min-height: 64px;
  1306. max-height: 64px;
  1307. display: flex;
  1308. align-items: center;
  1309. }
  1310. .content p strong {
  1311. word-break: break-word;
  1312. }
  1313. .content p small {
  1314. word-break: break-word;
  1315. }
  1316. .add-to-queue {
  1317. width: 100%;
  1318. margin-top: 25px;
  1319. height: 40px;
  1320. border-radius: 0;
  1321. background: rgb(3, 169, 244);
  1322. color: #fff !important;
  1323. border: 0;
  1324. &:active,
  1325. &:focus {
  1326. border: 0;
  1327. }
  1328. }
  1329. .add-to-queue:focus {
  1330. background: #029ce3;
  1331. }
  1332. .media-right {
  1333. line-height: 64px;
  1334. }
  1335. .songTitle {
  1336. word-wrap: break-word;
  1337. overflow: hidden;
  1338. text-overflow: ellipsis;
  1339. display: -webkit-box;
  1340. -webkit-box-orient: vertical;
  1341. -webkit-line-clamp: 2;
  1342. line-height: 20px;
  1343. max-height: 40px;
  1344. width: 100%;
  1345. }
  1346. }
  1347. input[type="range"] {
  1348. -webkit-appearance: none;
  1349. width: 100%;
  1350. margin: 7.3px 0;
  1351. }
  1352. input[type="range"]:focus {
  1353. outline: none;
  1354. }
  1355. input[type="range"]::-webkit-slider-runnable-track {
  1356. width: 100%;
  1357. height: 5.2px;
  1358. cursor: pointer;
  1359. box-shadow: 0;
  1360. background: #c2c0c2;
  1361. border-radius: 0;
  1362. border: 0;
  1363. }
  1364. input[type="range"]::-webkit-slider-thumb {
  1365. box-shadow: 0;
  1366. border: 0;
  1367. height: 19px;
  1368. width: 19px;
  1369. border-radius: 15px;
  1370. background: #03a9f4;
  1371. cursor: pointer;
  1372. -webkit-appearance: none;
  1373. margin-top: -6.5px;
  1374. }
  1375. input[type="range"]::-moz-range-track {
  1376. width: 100%;
  1377. height: 5.2px;
  1378. cursor: pointer;
  1379. box-shadow: 0;
  1380. background: #c2c0c2;
  1381. border-radius: 0;
  1382. border: 0;
  1383. }
  1384. input[type="range"]::-moz-range-thumb {
  1385. box-shadow: 0;
  1386. border: 0;
  1387. height: 19px;
  1388. width: 19px;
  1389. border-radius: 15px;
  1390. background: #03a9f4;
  1391. cursor: pointer;
  1392. -webkit-appearance: none;
  1393. margin-top: -6.5px;
  1394. }
  1395. input[type="range"]::-ms-track {
  1396. width: 100%;
  1397. height: 5.2px;
  1398. cursor: pointer;
  1399. box-shadow: 0;
  1400. background: #c2c0c2;
  1401. border-radius: 1.3px;
  1402. }
  1403. input[type="range"]::-ms-fill-lower {
  1404. background: #c2c0c2;
  1405. border: 0;
  1406. border-radius: 0;
  1407. box-shadow: 0;
  1408. }
  1409. input[type="range"]::-ms-fill-upper {
  1410. background: #c2c0c2;
  1411. border: 0;
  1412. border-radius: 0;
  1413. box-shadow: 0;
  1414. }
  1415. input[type="range"]::-ms-thumb {
  1416. box-shadow: 0;
  1417. border: 0;
  1418. height: 15px;
  1419. width: 15px;
  1420. border-radius: 15px;
  1421. background: #03a9f4;
  1422. cursor: pointer;
  1423. -webkit-appearance: none;
  1424. margin-top: 1.5px;
  1425. }
  1426. .video-container {
  1427. position: relative;
  1428. padding-bottom: 56.25%;
  1429. height: 0;
  1430. overflow: hidden;
  1431. iframe {
  1432. position: absolute;
  1433. top: 0;
  1434. left: 0;
  1435. width: 100%;
  1436. height: 100%;
  1437. }
  1438. }
  1439. .video-col {
  1440. padding-right: 0.75rem;
  1441. padding-left: 0.75rem;
  1442. }
  1443. }
  1444. .room-title {
  1445. left: 50%;
  1446. -webkit-transform: translateX(-50%);
  1447. transform: translateX(-50%);
  1448. font-size: 2.1em;
  1449. }
  1450. #ratings {
  1451. span {
  1452. font-size: 1.68rem;
  1453. }
  1454. i {
  1455. color: #9e9e9e !important;
  1456. cursor: pointer;
  1457. transition: 0.1s color;
  1458. }
  1459. }
  1460. #time-display {
  1461. margin-top: 30px;
  1462. float: right;
  1463. }
  1464. #thumbs_up:hover,
  1465. #thumbs_up.liked {
  1466. color: #87d37c !important;
  1467. }
  1468. #thumbs_down:hover,
  1469. #thumbs_down.disliked {
  1470. color: #ec644b !important;
  1471. }
  1472. #song-thumbnail {
  1473. max-width: 100%;
  1474. width: 85%;
  1475. }
  1476. .seeker-bar-container {
  1477. position: relative;
  1478. height: 7px;
  1479. display: block;
  1480. width: 100%;
  1481. overflow: hidden;
  1482. }
  1483. .seeker-bar {
  1484. top: 0;
  1485. left: 0;
  1486. bottom: 0;
  1487. position: absolute;
  1488. }
  1489. ul {
  1490. list-style: none;
  1491. margin: 0;
  1492. display: block;
  1493. }
  1494. h1,
  1495. h2,
  1496. h3,
  1497. h4,
  1498. h5,
  1499. h6 {
  1500. font-weight: 400;
  1501. line-height: 1.1;
  1502. }
  1503. h1 a,
  1504. h2 a,
  1505. h3 a,
  1506. h4 a,
  1507. h5 a,
  1508. h6 a {
  1509. font-weight: inherit;
  1510. }
  1511. h1 {
  1512. font-size: 4.2rem;
  1513. line-height: 110%;
  1514. margin: 2.1rem 0 1.68rem 0;
  1515. }
  1516. h2 {
  1517. font-size: 3.56rem;
  1518. line-height: 110%;
  1519. margin: 1.78rem 0 1.424rem 0;
  1520. }
  1521. h3 {
  1522. font-size: 2.92rem;
  1523. line-height: 110%;
  1524. margin: 1.46rem 0 1.168rem 0;
  1525. }
  1526. h4 {
  1527. font-size: 2.28rem;
  1528. line-height: 110%;
  1529. margin: 1.14rem 0 0.912rem 0;
  1530. }
  1531. h5 {
  1532. font-size: 1.64rem;
  1533. line-height: 110%;
  1534. margin: 0.82rem 0 0.656rem 0;
  1535. }
  1536. h6 {
  1537. font-size: 1rem;
  1538. line-height: 110%;
  1539. margin: 0.5rem 0 0.4rem 0;
  1540. }
  1541. .thin {
  1542. font-weight: 200;
  1543. }
  1544. .left {
  1545. float: left !important;
  1546. }
  1547. .right {
  1548. float: right !important;
  1549. }
  1550. .light-blue {
  1551. background-color: #03a9f4 !important;
  1552. }
  1553. .white {
  1554. background-color: #ffffff !important;
  1555. }
  1556. .btn-search {
  1557. font-size: 14px;
  1558. }
  1559. .menu {
  1560. padding: 0 10px;
  1561. }
  1562. .menu-list li a:hover {
  1563. color: #000 !important;
  1564. }
  1565. .menu-list li {
  1566. display: flex;
  1567. justify-content: space-between;
  1568. }
  1569. .menu-list a {
  1570. /*padding: 0 10px !important;*/
  1571. }
  1572. .menu-list a:hover {
  1573. background-color: transparent;
  1574. }
  1575. .icons-group {
  1576. display: flex;
  1577. }
  1578. #like,
  1579. #dislike {
  1580. position: relative;
  1581. }
  1582. .behind {
  1583. z-index: -1;
  1584. }
  1585. .behind:focus {
  1586. z-index: 0;
  1587. }
  1588. .progress {
  1589. width: 50px;
  1590. animation: rotate 0.8s infinite linear;
  1591. border: 8px solid #03a9f4;
  1592. border-right-color: transparent;
  1593. height: 50px;
  1594. position: absolute;
  1595. top: 50%;
  1596. left: 50%;
  1597. }
  1598. @keyframes rotate {
  1599. 0% {
  1600. transform: rotate(0deg);
  1601. }
  1602. 100% {
  1603. transform: rotate(360deg);
  1604. }
  1605. }
  1606. .experimental {
  1607. display: none !important;
  1608. }
  1609. </style>