Station.vue 38 KB

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