Station.vue 37 KB

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