Station.vue 38 KB

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