Home.vue 26 KB

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