Home.vue 26 KB

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