Station.vue 37 KB

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