Home.vue 26 KB

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