Station.vue 38 KB

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