Home.vue 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263
  1. <template>
  2. <div>
  3. <page-metadata title="Home" />
  4. <div class="app">
  5. <main-header
  6. :hide-logo="true"
  7. :transparent="true"
  8. :hide-logged-out="true"
  9. />
  10. <div class="header" :class="{ loggedIn }">
  11. <img class="background" src="/assets/homebg.jpeg" />
  12. <div class="overlay"></div>
  13. <div class="content-container">
  14. <div class="content">
  15. <img
  16. class="logo"
  17. src="/assets/white_wordmark.png"
  18. :alt="`${this.sitename}` || `Musare`"
  19. />
  20. <div v-if="!loggedIn" class="buttons">
  21. <button
  22. class="button login"
  23. @click="openModal('login')"
  24. >
  25. Login
  26. </button>
  27. <button
  28. class="button register"
  29. @click="openModal('register')"
  30. >
  31. Register
  32. </button>
  33. </div>
  34. </div>
  35. </div>
  36. </div>
  37. <div class="group" v-show="favoriteStations.length > 0">
  38. <div class="group-title">
  39. <div>
  40. <h2>My Favorites</h2>
  41. </div>
  42. </div>
  43. <draggable
  44. item-key="_id"
  45. v-model="favoriteStations"
  46. v-bind="dragOptions"
  47. @change="changeFavoriteOrder"
  48. >
  49. <template #item="{ element }">
  50. <router-link
  51. :to="{
  52. name: 'station',
  53. params: { id: element.name }
  54. }"
  55. :class="{
  56. 'station-card': true,
  57. 'item-draggable': true,
  58. isPrivate: element.privacy === 'private',
  59. isMine: isOwner(element)
  60. }"
  61. :style="
  62. '--primary-color: var(--' + element.theme + ')'
  63. "
  64. >
  65. <song-thumbnail :song="element.currentSong" />
  66. <div class="card-content">
  67. <div class="media">
  68. <div class="media-left displayName">
  69. <i
  70. v-if="
  71. loggedIn && !element.isFavorited
  72. "
  73. @click.prevent="
  74. favoriteStation(element._id)
  75. "
  76. class="favorite material-icons"
  77. content="Favorite Station"
  78. v-tippy
  79. >star_border</i
  80. >
  81. <i
  82. v-if="
  83. loggedIn && element.isFavorited
  84. "
  85. @click.prevent="
  86. unfavoriteStation(element._id)
  87. "
  88. class="favorite material-icons"
  89. content="Unfavorite Station"
  90. v-tippy
  91. >star</i
  92. >
  93. <h5>{{ element.displayName }}</h5>
  94. <i
  95. v-if="element.type === 'official'"
  96. class="
  97. material-icons
  98. verified-station
  99. "
  100. content="Verified Station"
  101. v-tippy="{
  102. theme: 'info'
  103. }"
  104. >
  105. check_circle
  106. </i>
  107. </div>
  108. </div>
  109. <div class="content">
  110. {{ element.description }}
  111. </div>
  112. <div class="under-content">
  113. <p class="hostedBy">
  114. Hosted by
  115. <span class="host">
  116. <span
  117. v-if="
  118. element.type === 'official'
  119. "
  120. title="Musare"
  121. >Musare</span
  122. >
  123. <user-id-to-username
  124. v-else
  125. :user-id="element.owner"
  126. :link="true"
  127. />
  128. </span>
  129. </p>
  130. <div class="icons">
  131. <i
  132. v-if="
  133. element.type === 'community' &&
  134. isOwner(element)
  135. "
  136. class="homeIcon material-icons"
  137. content="This is your station."
  138. v-tippy="{ theme: 'info' }"
  139. >home</i
  140. >
  141. <i
  142. v-if="element.privacy === 'private'"
  143. class="privateIcon material-icons"
  144. content="This station is not visible to other users."
  145. v-tippy="{ theme: 'info' }"
  146. >lock</i
  147. >
  148. <i
  149. v-if="
  150. element.privacy === 'unlisted'
  151. "
  152. class="unlistedIcon material-icons"
  153. content="Unlisted Station"
  154. v-tippy="{ theme: 'info' }"
  155. >link</i
  156. >
  157. </div>
  158. </div>
  159. </div>
  160. <div class="bottomBar">
  161. <i
  162. v-if="
  163. element.paused &&
  164. element.currentSong.title
  165. "
  166. class="material-icons"
  167. content="Station Paused"
  168. v-tippy="{ theme: 'info' }"
  169. >pause</i
  170. >
  171. <i
  172. v-else-if="element.currentSong.title"
  173. class="material-icons"
  174. >music_note</i
  175. >
  176. <i v-else class="material-icons">music_off</i>
  177. <span
  178. v-if="element.currentSong.title"
  179. class="songTitle"
  180. :title="
  181. element.currentSong.artists.length > 0
  182. ? 'Now Playing: ' +
  183. element.currentSong.title +
  184. ' by ' +
  185. element.currentSong.artists.join(
  186. ', '
  187. )
  188. : 'Now Playing: ' +
  189. element.currentSong.title
  190. "
  191. >{{ element.currentSong.title }}
  192. {{
  193. element.currentSong.artists.length > 0
  194. ? " by " +
  195. element.currentSong.artists.join(
  196. ", "
  197. )
  198. : ""
  199. }}</span
  200. >
  201. <span v-else class="songTitle"
  202. >No Songs Playing</span
  203. >
  204. <i
  205. class="material-icons stationMode"
  206. :content="
  207. element.partyMode
  208. ? 'Station in Party mode'
  209. : 'Station in Playlist mode'
  210. "
  211. v-tippy="{ theme: 'info' }"
  212. >{{
  213. element.partyMode
  214. ? "emoji_people"
  215. : "playlist_play"
  216. }}</i
  217. >
  218. </div>
  219. </router-link>
  220. </template>
  221. </draggable>
  222. </div>
  223. <div class="group bottom">
  224. <div class="group-title">
  225. <div>
  226. <h1>Stations</h1>
  227. </div>
  228. </div>
  229. <a
  230. v-if="loggedIn"
  231. @click="openModal('createStation')"
  232. class="station-card createStation"
  233. >
  234. <div class="thumbnail">
  235. <figure class="image">
  236. <i class="material-icons">radio</i>
  237. </figure>
  238. </div>
  239. <div class="card-content">
  240. <div class="media">
  241. <div class="media-left displayName">
  242. <h5>Create Station</h5>
  243. </div>
  244. </div>
  245. <div class="content">
  246. Click here to create your own station!
  247. </div>
  248. </div>
  249. <div class="bottomBar"></div>
  250. </a>
  251. <a
  252. v-else
  253. @click="openModal('login')"
  254. class="station-card createStation"
  255. >
  256. <div class="thumbnail">
  257. <figure class="image">
  258. <i class="material-icons">radio</i>
  259. </figure>
  260. </div>
  261. <div class="card-content">
  262. <div class="media">
  263. <div class="media-left displayName">
  264. <h5>Create Station</h5>
  265. </div>
  266. </div>
  267. <div class="content">Login to create a station!</div>
  268. </div>
  269. <div class="bottomBar"></div>
  270. </a>
  271. <router-link
  272. v-for="station in filteredStations"
  273. :key="station._id"
  274. :to="{
  275. name: 'station',
  276. params: { id: station.name }
  277. }"
  278. class="station-card"
  279. :class="{
  280. isPrivate: station.privacy === 'private',
  281. isMine: isOwner(station)
  282. }"
  283. :style="'--primary-color: var(--' + station.theme + ')'"
  284. >
  285. <song-thumbnail :song="station.currentSong" />
  286. <div class="card-content">
  287. <div class="media">
  288. <div class="media-left displayName">
  289. <i
  290. v-if="loggedIn && !station.isFavorited"
  291. @click.prevent="
  292. favoriteStation(station._id)
  293. "
  294. class="favorite material-icons"
  295. content="Favorite Station"
  296. v-tippy
  297. >star_border</i
  298. >
  299. <i
  300. v-if="loggedIn && station.isFavorited"
  301. @click.prevent="
  302. unfavoriteStation(station._id)
  303. "
  304. class="favorite material-icons"
  305. content="Unfavorite Station"
  306. v-tippy
  307. >star</i
  308. >
  309. <h5>{{ station.displayName }}</h5>
  310. <i
  311. v-if="station.type === 'official'"
  312. class="material-icons verified-station"
  313. content="Verified Station"
  314. v-tippy="{ theme: 'info' }"
  315. >
  316. check_circle
  317. </i>
  318. </div>
  319. </div>
  320. <div class="content">
  321. {{ station.description }}
  322. </div>
  323. <div class="under-content">
  324. <p class="hostedBy">
  325. Hosted by
  326. <span class="host">
  327. <span
  328. v-if="station.type === 'official'"
  329. title="Musare"
  330. >Musare</span
  331. >
  332. <user-id-to-username
  333. v-else
  334. :user-id="station.owner"
  335. :link="true"
  336. />
  337. </span>
  338. </p>
  339. <div class="icons">
  340. <i
  341. v-if="
  342. station.type === 'community' &&
  343. isOwner(station)
  344. "
  345. class="homeIcon material-icons"
  346. content="This is your station."
  347. v-tippy="{ theme: 'info' }"
  348. >home</i
  349. >
  350. <i
  351. v-if="station.privacy === 'private'"
  352. class="privateIcon material-icons"
  353. content="This station is not visible to other users."
  354. v-tippy="{ theme: 'info' }"
  355. >lock</i
  356. >
  357. <i
  358. v-if="station.privacy === 'unlisted'"
  359. class="unlistedIcon material-icons"
  360. content="Unlisted Station"
  361. v-tippy="{ theme: 'info' }"
  362. >link</i
  363. >
  364. </div>
  365. </div>
  366. </div>
  367. <div class="bottomBar">
  368. <i
  369. v-if="station.paused && station.currentSong.title"
  370. class="material-icons"
  371. content="Station Paused"
  372. v-tippy="{ theme: 'info' }"
  373. >pause</i
  374. >
  375. <i
  376. v-else-if="station.currentSong.title"
  377. class="material-icons"
  378. >music_note</i
  379. >
  380. <i v-else class="material-icons">music_off</i>
  381. <span
  382. v-if="station.currentSong.title"
  383. class="songTitle"
  384. :title="
  385. station.currentSong.artists.length > 0
  386. ? 'Now Playing: ' +
  387. station.currentSong.title +
  388. ' by ' +
  389. station.currentSong.artists.join(', ')
  390. : 'Now Playing: ' +
  391. station.currentSong.title
  392. "
  393. >{{ station.currentSong.title }}
  394. {{
  395. station.currentSong.artists.length > 0
  396. ? " by " +
  397. station.currentSong.artists.join(", ")
  398. : ""
  399. }}</span
  400. >
  401. <span v-else class="songTitle">No Songs Playing</span>
  402. <i
  403. class="material-icons stationMode"
  404. :content="
  405. station.partyMode
  406. ? 'Station in Party mode'
  407. : 'Station in Playlist mode'
  408. "
  409. v-tippy="{ theme: 'info' }"
  410. >{{
  411. station.partyMode
  412. ? "emoji_people"
  413. : "playlist_play"
  414. }}</i
  415. >
  416. </div>
  417. </router-link>
  418. <h4 v-if="stations.length === 0">
  419. There are no stations to display
  420. </h4>
  421. </div>
  422. <main-footer />
  423. </div>
  424. <create-station v-if="modals.createStation" />
  425. </div>
  426. </template>
  427. <script>
  428. import { mapState, mapGetters, mapActions } from "vuex";
  429. import { defineAsyncComponent } from "vue";
  430. import draggable from "vuedraggable";
  431. import Toast from "toasters";
  432. import MainHeader from "@/components/layout/MainHeader.vue";
  433. import MainFooter from "@/components/layout/MainFooter.vue";
  434. import SongThumbnail from "@/components/SongThumbnail.vue";
  435. import UserIdToUsername from "@/components/UserIdToUsername.vue";
  436. import ws from "@/ws";
  437. export default {
  438. components: {
  439. MainHeader,
  440. MainFooter,
  441. SongThumbnail,
  442. CreateStation: defineAsyncComponent(() =>
  443. import("@/components/modals/CreateStation.vue")
  444. ),
  445. UserIdToUsername,
  446. draggable
  447. },
  448. data() {
  449. return {
  450. recaptcha: { key: "" },
  451. stations: [],
  452. favoriteStations: [],
  453. searchQuery: "",
  454. sitename: "Musare",
  455. orderOfFavoriteStations: [],
  456. handledLoginRegisterRedirect: false
  457. };
  458. },
  459. computed: {
  460. ...mapState({
  461. loggedIn: state => state.user.auth.loggedIn,
  462. userId: state => state.user.auth.userId,
  463. modals: state => state.modalVisibility.modals
  464. }),
  465. ...mapGetters({
  466. socket: "websockets/getSocket"
  467. }),
  468. filteredStations() {
  469. const privacyOrder = ["public", "unlisted", "private"];
  470. return this.stations
  471. .filter(
  472. station =>
  473. JSON.stringify(Object.values(station)).indexOf(
  474. this.searchQuery
  475. ) !== -1
  476. )
  477. .sort(
  478. (a, b) =>
  479. this.isOwner(b) - this.isOwner(a) ||
  480. this.isPlaying(b) - this.isPlaying(a) ||
  481. a.paused - b.paused ||
  482. privacyOrder.indexOf(a.privacy) -
  483. privacyOrder.indexOf(b.privacy) ||
  484. b.userCount - a.userCount
  485. );
  486. },
  487. dragOptions() {
  488. return {
  489. animation: 200,
  490. group: "favoriteStations",
  491. disabled: false,
  492. ghostClass: "draggable-list-ghost",
  493. filter: ".ignore-elements",
  494. fallbackTolerance: 50
  495. };
  496. }
  497. },
  498. watch: {
  499. orderOfFavoriteStations: {
  500. deep: true,
  501. handler() {
  502. this.calculateFavoriteStations();
  503. }
  504. }
  505. },
  506. async mounted() {
  507. this.sitename = await lofig.get("siteSettings.sitename");
  508. if (
  509. !this.loggedIn &&
  510. this.$route.redirectedFrom &&
  511. (this.$route.redirectedFrom.name === "login" ||
  512. this.$route.redirectedFrom.name === "register") &&
  513. !this.handledLoginRegisterRedirect
  514. ) {
  515. // Makes sure the login/register modal isn't opened whenever the home page gets remounted due to a code change
  516. this.handledLoginRegisterRedirect = true;
  517. this.openModal(this.$route.redirectedFrom.name);
  518. }
  519. ws.onConnect(this.init);
  520. this.socket.on("event:station.created", res => {
  521. const { station } = res.data;
  522. if (this.stations.find(_station => _station._id === station._id)) {
  523. this.stations.forEach(s => {
  524. const _station = s;
  525. if (_station._id === station._id) {
  526. _station.privacy = station.privacy;
  527. }
  528. });
  529. } else {
  530. if (!station.currentSong)
  531. station.currentSong = {
  532. thumbnail: "/assets/notes-transparent.png"
  533. };
  534. if (station.currentSong && !station.currentSong.thumbnail)
  535. station.currentSong.ytThumbnail = `https://img.youtube.com/vi/${station.currentSong.youtubeId}/mqdefault.jpg`;
  536. this.stations.push(station);
  537. }
  538. });
  539. this.socket.on("event:station.deleted", res => {
  540. const { stationId } = res.data;
  541. const station = this.stations.find(
  542. station => station._id === stationId
  543. );
  544. if (station) {
  545. const stationIndex = this.stations.indexOf(station);
  546. this.stations.splice(stationIndex, 1);
  547. if (station.isFavorited)
  548. this.orderOfFavoriteStations.filter(
  549. favoritedId => favoritedId !== stationId
  550. );
  551. }
  552. });
  553. this.socket.on("event:station.userCount.updated", res => {
  554. const station = this.stations.find(
  555. station => station._id === res.data.stationId
  556. );
  557. if (station) station.userCount = res.data.userCount;
  558. });
  559. this.socket.on("event:station.privacy.updated", res => {
  560. const station = this.stations.find(
  561. station => station._id === res.data.stationId
  562. );
  563. if (station) station.privacy = res.data.privacy;
  564. });
  565. this.socket.on("event:station.name.updated", res => {
  566. const station = this.stations.find(
  567. station => station._id === res.data.stationId
  568. );
  569. if (station) station.name = res.data.name;
  570. });
  571. this.socket.on("event:station.displayName.updated", res => {
  572. const station = this.stations.find(
  573. station => station._id === res.data.stationId
  574. );
  575. if (station) station.displayName = res.data.displayName;
  576. });
  577. this.socket.on("event:station.description.updated", res => {
  578. const station = this.stations.find(
  579. station => station._id === res.data.stationId
  580. );
  581. if (station) station.description = res.data.description;
  582. });
  583. this.socket.on("event:station.theme.updated", res => {
  584. const { stationId, theme } = res.data;
  585. const station = this.stations.find(
  586. station => station._id === stationId
  587. );
  588. if (station) station.theme = theme;
  589. });
  590. this.socket.on("event:station.partyMode.updated", res => {
  591. const { stationId, partyMode } = res.data;
  592. const station = this.stations.find(
  593. station => station._id === stationId
  594. );
  595. if (station) station.partyMode = partyMode;
  596. });
  597. this.socket.on("event:station.nextSong", res => {
  598. const station = this.stations.find(
  599. station => station._id === res.data.stationId
  600. );
  601. if (station) {
  602. let newSong = res.data.currentSong;
  603. if (!newSong)
  604. newSong = {
  605. thumbnail: "/assets/notes-transparent.png"
  606. };
  607. station.currentSong = newSong;
  608. }
  609. });
  610. this.socket.on("event:station.pause", res => {
  611. const station = this.stations.find(
  612. station => station._id === res.data.stationId
  613. );
  614. if (station) station.paused = true;
  615. });
  616. this.socket.on("event:station.resume", res => {
  617. const station = this.stations.find(
  618. station => station._id === res.data.stationId
  619. );
  620. if (station) station.paused = false;
  621. });
  622. this.socket.on("event:user.station.favorited", res => {
  623. const { stationId } = res.data;
  624. const station = this.stations.find(
  625. station => station._id === stationId
  626. );
  627. if (station) {
  628. station.isFavorited = true;
  629. this.orderOfFavoriteStations.push(stationId);
  630. }
  631. });
  632. this.socket.on("event:user.station.unfavorited", res => {
  633. const { stationId } = res.data;
  634. const station = this.stations.find(
  635. station => station._id === stationId
  636. );
  637. if (station) {
  638. station.isFavorited = false;
  639. this.orderOfFavoriteStations =
  640. this.orderOfFavoriteStations.filter(
  641. favoritedId => favoritedId !== stationId
  642. );
  643. }
  644. });
  645. this.socket.on("event:user.orderOfFavoriteStations.updated", res => {
  646. this.orderOfFavoriteStations = res.data.order;
  647. });
  648. },
  649. beforeUnmount() {
  650. this.socket.dispatch("apis.leaveRoom", "home", () => {});
  651. },
  652. methods: {
  653. init() {
  654. this.socket.dispatch("stations.index", res => {
  655. this.stations = [];
  656. if (res.status === "success") {
  657. res.data.stations.forEach(station => {
  658. const modifiableStation = station;
  659. if (!modifiableStation.currentSong)
  660. modifiableStation.currentSong = {
  661. thumbnail: "/assets/notes-transparent.png"
  662. };
  663. if (
  664. modifiableStation.currentSong &&
  665. !modifiableStation.currentSong.thumbnail
  666. )
  667. modifiableStation.currentSong.ytThumbnail = `https://img.youtube.com/vi/${station.currentSong.youtubeId}/mqdefault.jpg`;
  668. this.stations.push(modifiableStation);
  669. });
  670. this.orderOfFavoriteStations = res.data.favorited;
  671. }
  672. });
  673. this.socket.dispatch("apis.joinRoom", "home");
  674. },
  675. isOwner(station) {
  676. return station.owner === this.userId;
  677. },
  678. isPlaying(station) {
  679. return typeof station.currentSong.title !== "undefined";
  680. },
  681. favoriteStation(stationId) {
  682. this.socket.dispatch("stations.favoriteStation", stationId, res => {
  683. if (res.status === "success") {
  684. new Toast("Successfully favorited station.");
  685. } else new Toast(res.message);
  686. });
  687. },
  688. unfavoriteStation(stationId) {
  689. this.socket.dispatch(
  690. "stations.unfavoriteStation",
  691. stationId,
  692. res => {
  693. if (res.status === "success") {
  694. new Toast("Successfully unfavorited station.");
  695. } else new Toast(res.message);
  696. }
  697. );
  698. },
  699. calculateFavoriteStations() {
  700. this.favoriteStations = this.filteredStations
  701. .filter(station => station.isFavorited === true)
  702. .sort(
  703. (a, b) =>
  704. this.orderOfFavoriteStations.indexOf(a._id) -
  705. this.orderOfFavoriteStations.indexOf(b._id)
  706. );
  707. },
  708. changeFavoriteOrder() {
  709. const recalculatedOrder = [];
  710. this.favoriteStations.forEach(station =>
  711. recalculatedOrder.push(station._id)
  712. );
  713. this.socket.dispatch(
  714. "users.updateOrderOfFavoriteStations",
  715. recalculatedOrder,
  716. res => new Toast(res.message)
  717. );
  718. },
  719. ...mapActions("modalVisibility", ["openModal"]),
  720. ...mapActions("station", ["updateIfStationIsFavorited"])
  721. }
  722. };
  723. </script>
  724. <style lang="scss" scoped>
  725. * {
  726. box-sizing: border-box;
  727. }
  728. html {
  729. width: 100%;
  730. height: 100%;
  731. color: rgba(0, 0, 0, 0.87);
  732. body {
  733. width: 100%;
  734. height: 100%;
  735. margin: 0;
  736. padding: 0;
  737. }
  738. }
  739. .night-mode {
  740. .header .overlay {
  741. background: linear-gradient(
  742. 180deg,
  743. rgba(34, 34, 34, 0.8) 0%,
  744. rgba(34, 34, 34, 0.95) 31.25%,
  745. rgba(34, 34, 34, 0.9) 54.17%,
  746. rgba(34, 34, 34, 0.8) 100%
  747. );
  748. }
  749. .station-card,
  750. .card-content,
  751. .card-content div {
  752. background-color: var(--dark-grey-3);
  753. }
  754. .card-content .icons i,
  755. .group-title i {
  756. color: var(--light-grey-2);
  757. }
  758. .thumbnail i {
  759. user-select: none;
  760. -webkit-user-select: none;
  761. }
  762. .thumbnail {
  763. background-color: var(--dark-grey-2);
  764. }
  765. .card-content .under-content .hostedBy {
  766. color: var(--light-grey-2);
  767. }
  768. }
  769. @media only screen and (min-width: 1200px) {
  770. html {
  771. font-size: 15px;
  772. }
  773. }
  774. @media only screen and (min-width: 992px) {
  775. html {
  776. font-size: 14.5px;
  777. }
  778. }
  779. @media only screen and (min-width: 0) {
  780. html {
  781. font-size: 14px;
  782. }
  783. }
  784. .header {
  785. display: flex;
  786. height: 35vh;
  787. margin-top: -64px;
  788. border-radius: 0% 0% 33% 33% / 0% 0% 7% 7%;
  789. img.background {
  790. height: 35vh;
  791. width: 100%;
  792. object-fit: cover;
  793. object-position: center;
  794. filter: blur(1px);
  795. border-radius: 0% 0% 33% 33% / 0% 0% 7% 7%;
  796. overflow: hidden;
  797. user-select: none;
  798. }
  799. .overlay {
  800. background: linear-gradient(
  801. 180deg,
  802. rgba(3, 169, 244, 0.8) 0%,
  803. rgba(3, 169, 244, 0.95) 31.25%,
  804. rgba(3, 169, 244, 0.9) 54.17%,
  805. rgba(3, 169, 244, 0.8) 100%
  806. );
  807. position: absolute;
  808. height: 35vh;
  809. width: 100%;
  810. border-radius: 0% 0% 33% 33% / 0% 0% 7% 7%;
  811. overflow: hidden;
  812. }
  813. .content-container {
  814. position: absolute;
  815. left: 0;
  816. right: 0;
  817. margin-left: auto;
  818. margin-right: auto;
  819. text-align: center;
  820. height: 100%;
  821. height: 35vh;
  822. .content {
  823. position: absolute;
  824. top: 50%;
  825. left: 0;
  826. right: 0;
  827. transform: translateY(-50%);
  828. background-color: transparent !important;
  829. img.logo {
  830. max-height: 90px;
  831. font-size: 40px;
  832. color: var(--white);
  833. font-family: Pacifico, cursive;
  834. user-select: none;
  835. }
  836. .buttons {
  837. display: flex;
  838. justify-content: center;
  839. margin-top: 20px;
  840. flex-wrap: wrap;
  841. .login,
  842. .register {
  843. margin: 5px 10px;
  844. padding: 10px 15px;
  845. border-radius: 5px;
  846. font-size: 18px;
  847. width: 100%;
  848. max-width: 250px;
  849. font-weight: 600;
  850. border: 0;
  851. height: inherit;
  852. }
  853. .login {
  854. background: var(--white);
  855. color: var(--primary-color);
  856. }
  857. .register {
  858. background: var(--purple);
  859. color: var(--white);
  860. }
  861. }
  862. }
  863. }
  864. &.loggedIn {
  865. height: 20vh;
  866. .overlay,
  867. .content-container,
  868. img.background {
  869. height: 20vh;
  870. }
  871. }
  872. }
  873. @media only screen and (max-width: 550px) {
  874. .header {
  875. height: 45vh;
  876. .overlay,
  877. .content-container,
  878. img.background {
  879. height: 45vh;
  880. }
  881. }
  882. }
  883. .under-content {
  884. height: 20px;
  885. position: relative;
  886. line-height: 1;
  887. font-size: 24px;
  888. display: flex;
  889. align-items: center;
  890. text-align: left;
  891. margin-top: 10px;
  892. p {
  893. font-size: 15px;
  894. line-height: 15px;
  895. display: inline;
  896. }
  897. i {
  898. font-size: 20px;
  899. }
  900. * {
  901. z-index: 10;
  902. position: relative;
  903. }
  904. .icons {
  905. position: absolute;
  906. right: 0;
  907. .material-icons {
  908. font-size: 22px;
  909. }
  910. .material-icons:first-child {
  911. margin-left: 5px;
  912. }
  913. .unlistedIcon {
  914. color: var(--orange);
  915. }
  916. .privateIcon {
  917. color: var(--dark-pink);
  918. }
  919. .homeIcon {
  920. color: var(--light-purple);
  921. }
  922. }
  923. .hostedBy {
  924. font-weight: 400;
  925. font-size: 12px;
  926. color: var(--black);
  927. .host,
  928. .host a {
  929. font-weight: 400;
  930. color: var(--primary-color);
  931. &:hover,
  932. &:focus {
  933. filter: brightness(90%);
  934. }
  935. }
  936. }
  937. }
  938. .app {
  939. display: flex;
  940. flex-direction: column;
  941. }
  942. .users-count {
  943. font-size: 20px;
  944. position: relative;
  945. top: -4px;
  946. }
  947. .group {
  948. min-height: 64px;
  949. flex: 1 0 auto;
  950. }
  951. .station-card {
  952. display: inline-flex;
  953. position: relative;
  954. background-color: var(--white);
  955. color: var(--dark-grey);
  956. flex-direction: row;
  957. overflow: hidden;
  958. margin: 10px;
  959. cursor: pointer;
  960. height: 150px;
  961. width: calc(100% - 30px);
  962. max-width: 400px;
  963. flex-wrap: wrap;
  964. border-radius: 5px;
  965. box-shadow: 0 2px 3px rgba(10, 10, 10, 0.1), 0 0 0 1px rgba(10, 10, 10, 0.1);
  966. .card-content {
  967. display: flex;
  968. position: relative;
  969. padding: 10px 10px 10px 15px;
  970. display: flex;
  971. flex-direction: column;
  972. flex-grow: 1;
  973. -webkit-line-clamp: 2;
  974. .media {
  975. display: flex;
  976. align-items: center;
  977. margin-bottom: 0;
  978. .displayName {
  979. display: flex;
  980. align-items: center;
  981. width: 100%;
  982. overflow: hidden;
  983. text-overflow: ellipsis;
  984. display: flex;
  985. line-height: 30px;
  986. max-height: 30px;
  987. .favorite {
  988. position: absolute;
  989. color: var(--yellow);
  990. right: 10px;
  991. top: 10px;
  992. font-size: 28px;
  993. }
  994. h5 {
  995. font-size: 20px;
  996. font-weight: 400;
  997. margin: 0;
  998. display: inline;
  999. margin-right: 6px;
  1000. line-height: 30px;
  1001. text-overflow: ellipsis;
  1002. overflow: hidden;
  1003. white-space: nowrap;
  1004. max-width: 200px;
  1005. }
  1006. i {
  1007. font-size: 22px;
  1008. }
  1009. .verified-station {
  1010. color: var(--primary-color);
  1011. }
  1012. }
  1013. }
  1014. .content {
  1015. word-wrap: break-word;
  1016. overflow: hidden;
  1017. text-overflow: ellipsis;
  1018. display: -webkit-box;
  1019. -webkit-box-orient: vertical;
  1020. -webkit-line-clamp: 3;
  1021. line-height: 20px;
  1022. flex-grow: 1;
  1023. text-align: left;
  1024. word-wrap: break-word;
  1025. margin-bottom: 0;
  1026. }
  1027. }
  1028. .thumbnail {
  1029. display: flex;
  1030. position: relative;
  1031. min-width: 120px;
  1032. width: 120px;
  1033. height: 120px;
  1034. margin: 0;
  1035. .image {
  1036. display: flex;
  1037. position: relative;
  1038. padding-top: 100%;
  1039. }
  1040. }
  1041. .bottomBar {
  1042. position: relative;
  1043. display: flex;
  1044. align-items: center;
  1045. background: var(--primary-color);
  1046. width: 100%;
  1047. height: 30px;
  1048. line-height: 30px;
  1049. color: var(--white);
  1050. font-weight: 400;
  1051. font-size: 12px;
  1052. padding: 0 5px;
  1053. flex-basis: 100%;
  1054. i.material-icons {
  1055. vertical-align: middle;
  1056. margin-left: 5px;
  1057. font-size: 22px;
  1058. }
  1059. .songTitle {
  1060. text-align: left;
  1061. vertical-align: middle;
  1062. margin-left: 5px;
  1063. line-height: 30px;
  1064. flex: 2 1 0;
  1065. overflow: hidden;
  1066. text-overflow: ellipsis;
  1067. white-space: nowrap;
  1068. }
  1069. }
  1070. &.createStation {
  1071. .thumbnail {
  1072. .image {
  1073. width: 120px;
  1074. @media screen and (max-width: 330px) {
  1075. width: 50px;
  1076. .material-icons {
  1077. font-size: 35px !important;
  1078. }
  1079. }
  1080. .material-icons {
  1081. position: absolute;
  1082. top: 25px;
  1083. bottom: 25px;
  1084. left: 0;
  1085. right: 0;
  1086. text-align: center;
  1087. font-size: 70px;
  1088. color: var(--primary-color);
  1089. }
  1090. }
  1091. }
  1092. .card-content {
  1093. width: min-content;
  1094. .media {
  1095. margin-top: auto;
  1096. .displayName h5 {
  1097. font-weight: 600;
  1098. }
  1099. }
  1100. .content {
  1101. flex-grow: unset;
  1102. margin-bottom: auto;
  1103. }
  1104. }
  1105. }
  1106. }
  1107. .station-card:hover {
  1108. box-shadow: 0 2px 3px rgba(10, 10, 10, 0.3), 0 0 10px rgba(10, 10, 10, 0.3);
  1109. transition: all ease-in-out 0.2s;
  1110. }
  1111. .community-button {
  1112. cursor: pointer;
  1113. transition: 0.25s ease color;
  1114. font-size: 30px;
  1115. color: var(--dark-grey);
  1116. }
  1117. .community-button:hover {
  1118. color: var(--primary-color);
  1119. }
  1120. .station-privacy {
  1121. text-transform: capitalize;
  1122. }
  1123. .label {
  1124. display: flex;
  1125. }
  1126. .g-recaptcha {
  1127. display: flex;
  1128. justify-content: center;
  1129. margin-top: 20px;
  1130. }
  1131. .group {
  1132. text-align: center;
  1133. width: 100%;
  1134. margin: 10px 0;
  1135. .group-title {
  1136. display: flex;
  1137. align-items: center;
  1138. justify-content: center;
  1139. margin: 25px 0;
  1140. h1 {
  1141. display: inline-block;
  1142. font-size: 45px;
  1143. margin: 0;
  1144. }
  1145. h2 {
  1146. font-size: 35px;
  1147. margin: 0;
  1148. }
  1149. a {
  1150. display: flex;
  1151. margin-left: 8px;
  1152. }
  1153. }
  1154. &.bottom {
  1155. margin-bottom: 40px;
  1156. }
  1157. }
  1158. </style>