Station.vue 38 KB

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