Home.vue 27 KB

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