Home.vue 26 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246
  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. .card-content {
  959. padding: 10px 10px 10px 15px;
  960. display: flex;
  961. flex-direction: column;
  962. flex-grow: 1;
  963. -webkit-line-clamp: 2;
  964. .media {
  965. display: flex;
  966. align-items: center;
  967. margin-bottom: 0;
  968. .displayName {
  969. display: flex;
  970. align-items: center;
  971. width: 100%;
  972. overflow: hidden;
  973. text-overflow: ellipsis;
  974. display: flex;
  975. line-height: 30px;
  976. max-height: 30px;
  977. .favorite {
  978. position: absolute;
  979. color: var(--yellow);
  980. right: 10px;
  981. top: 10px;
  982. font-size: 28px;
  983. }
  984. h5 {
  985. font-size: 20px;
  986. font-weight: 400;
  987. margin: 0;
  988. display: inline;
  989. margin-right: 6px;
  990. line-height: 30px;
  991. text-overflow: ellipsis;
  992. overflow: hidden;
  993. white-space: nowrap;
  994. max-width: 200px;
  995. }
  996. i {
  997. font-size: 22px;
  998. }
  999. .verified-station {
  1000. color: var(--primary-color);
  1001. }
  1002. }
  1003. }
  1004. .content {
  1005. word-wrap: break-word;
  1006. overflow: hidden;
  1007. text-overflow: ellipsis;
  1008. display: -webkit-box;
  1009. -webkit-box-orient: vertical;
  1010. -webkit-line-clamp: 3;
  1011. line-height: 20px;
  1012. flex-grow: 1;
  1013. text-align: left;
  1014. word-wrap: break-word;
  1015. margin-bottom: 0;
  1016. }
  1017. }
  1018. .card-image.thumbnail {
  1019. min-width: 120px;
  1020. width: 120px;
  1021. height: 120px;
  1022. margin: 0;
  1023. }
  1024. .bottomBar {
  1025. position: relative;
  1026. display: flex;
  1027. align-items: center;
  1028. background: var(--primary-color);
  1029. width: 100%;
  1030. height: 30px;
  1031. line-height: 30px;
  1032. color: var(--white);
  1033. font-weight: 400;
  1034. font-size: 12px;
  1035. padding: 0 5px;
  1036. flex-basis: 100%;
  1037. i.material-icons {
  1038. vertical-align: middle;
  1039. margin-left: 5px;
  1040. font-size: 22px;
  1041. }
  1042. .songTitle {
  1043. text-align: left;
  1044. vertical-align: middle;
  1045. margin-left: 5px;
  1046. line-height: 30px;
  1047. flex: 2 1 0;
  1048. overflow: hidden;
  1049. text-overflow: ellipsis;
  1050. white-space: nowrap;
  1051. }
  1052. }
  1053. &.createStation {
  1054. height: auto;
  1055. .card-image {
  1056. .image.is-square {
  1057. width: 120px;
  1058. @media screen and (max-width: 330px) {
  1059. width: 50px;
  1060. .material-icons {
  1061. font-size: 35px !important;
  1062. }
  1063. }
  1064. .material-icons {
  1065. position: absolute;
  1066. top: 25px;
  1067. bottom: 25px;
  1068. left: 0;
  1069. right: 0;
  1070. text-align: center;
  1071. font-size: 70px;
  1072. color: var(--primary-color);
  1073. }
  1074. }
  1075. }
  1076. .card-content {
  1077. width: min-content;
  1078. .media {
  1079. margin-top: auto;
  1080. .displayName h5 {
  1081. font-weight: 600;
  1082. }
  1083. }
  1084. .content {
  1085. flex-grow: unset;
  1086. margin-bottom: auto;
  1087. }
  1088. }
  1089. }
  1090. }
  1091. .station-card:hover {
  1092. box-shadow: 0 2px 3px rgba(10, 10, 10, 0.3), 0 0 10px rgba(10, 10, 10, 0.3);
  1093. transition: all ease-in-out 0.2s;
  1094. }
  1095. .community-button {
  1096. cursor: pointer;
  1097. transition: 0.25s ease color;
  1098. font-size: 30px;
  1099. color: var(--dark-grey);
  1100. }
  1101. .community-button:hover {
  1102. color: var(--primary-color);
  1103. }
  1104. .station-privacy {
  1105. text-transform: capitalize;
  1106. }
  1107. .label {
  1108. display: flex;
  1109. }
  1110. .g-recaptcha {
  1111. display: flex;
  1112. justify-content: center;
  1113. margin-top: 20px;
  1114. }
  1115. .group {
  1116. text-align: center;
  1117. width: 100%;
  1118. margin: 10px 0;
  1119. .group-title {
  1120. display: flex;
  1121. align-items: center;
  1122. justify-content: center;
  1123. margin: 25px 0;
  1124. h1 {
  1125. display: inline-block;
  1126. font-size: 45px;
  1127. margin: 0;
  1128. }
  1129. h2 {
  1130. font-size: 35px;
  1131. margin: 0;
  1132. }
  1133. a {
  1134. display: flex;
  1135. margin-left: 8px;
  1136. }
  1137. }
  1138. &.bottom {
  1139. margin-bottom: 40px;
  1140. }
  1141. }
  1142. </style>