Station.vue 37 KB

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