Station.vue 38 KB

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