Station.vue 38 KB

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