Home.vue 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239
  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. const station = this.stations.find(
  587. station => station._id === res.data.stationId
  588. );
  589. if (station) {
  590. let newSong = res.data.song;
  591. if (!newSong)
  592. newSong = {
  593. thumbnail: "/assets/notes-transparent.png"
  594. };
  595. station.currentSong = newSong;
  596. }
  597. });
  598. this.socket.on("event:station.pause", res => {
  599. const station = this.stations.find(
  600. station => station._id === res.data.stationId
  601. );
  602. if (station) station.paused = true;
  603. });
  604. this.socket.on("event:station.resume", res => {
  605. const station = this.stations.find(
  606. station => station._id === res.data.stationId
  607. );
  608. if (station) station.paused = false;
  609. });
  610. this.socket.on("event:user.favoritedStation", res => {
  611. const { stationId } = res.data;
  612. const station = this.stations.find(
  613. station => station._id === stationId
  614. );
  615. if (station) {
  616. station.isFavorited = true;
  617. this.orderOfFavoriteStations.push(stationId);
  618. }
  619. });
  620. this.socket.on("event:user.unfavoritedStation", res => {
  621. const { stationId } = res.data;
  622. const station = this.stations.find(
  623. station => station._id === stationId
  624. );
  625. if (station) {
  626. station.isFavorited = false;
  627. this.orderOfFavoriteStations = this.orderOfFavoriteStations.filter(
  628. favoritedId => favoritedId !== stationId
  629. );
  630. }
  631. });
  632. this.socket.on("event:user.orderOfFavoriteStations.changed", res => {
  633. this.orderOfFavoriteStations = res.data.order;
  634. });
  635. },
  636. beforeDestroy() {
  637. this.socket.dispatch("apis.leaveRoom", "home", () => {});
  638. },
  639. methods: {
  640. init() {
  641. this.socket.dispatch("stations.index", res => {
  642. this.stations = [];
  643. if (res.status === "success") {
  644. res.data.stations.forEach(station => {
  645. const modifiableStation = station;
  646. if (!modifiableStation.currentSong)
  647. modifiableStation.currentSong = {
  648. thumbnail: "/assets/notes-transparent.png"
  649. };
  650. if (
  651. modifiableStation.currentSong &&
  652. !modifiableStation.currentSong.thumbnail
  653. )
  654. modifiableStation.currentSong.ytThumbnail = `https://img.youtube.com/vi/${station.currentSong.youtubeId}/mqdefault.jpg`;
  655. this.stations.push(modifiableStation);
  656. });
  657. this.orderOfFavoriteStations = res.data.favorited;
  658. }
  659. });
  660. this.socket.dispatch("apis.joinRoom", "home");
  661. },
  662. isOwner(station) {
  663. return station.owner === this.userId;
  664. },
  665. isPlaying(station) {
  666. return typeof station.currentSong.title !== "undefined";
  667. },
  668. favoriteStation(station) {
  669. this.socket.dispatch(
  670. "stations.favoriteStation",
  671. station._id,
  672. res => {
  673. if (res.status === "success") {
  674. new Toast("Successfully favorited station.");
  675. } else new Toast(res.message);
  676. }
  677. );
  678. },
  679. unfavoriteStation(station) {
  680. this.socket.dispatch(
  681. "stations.unfavoriteStation",
  682. station._id,
  683. res => {
  684. if (res.status === "success") {
  685. new Toast("Successfully unfavorited station.");
  686. } else new Toast(res.message);
  687. }
  688. );
  689. },
  690. calculateFavoriteStations() {
  691. this.favoriteStations = this.filteredStations
  692. .filter(station => station.isFavorited === true)
  693. .sort(
  694. (a, b) =>
  695. this.orderOfFavoriteStations.indexOf(a._id) -
  696. this.orderOfFavoriteStations.indexOf(b._id)
  697. );
  698. },
  699. changeFavoriteOrder() {
  700. const recalculatedOrder = [];
  701. this.favoriteStations.forEach(station =>
  702. recalculatedOrder.push(station._id)
  703. );
  704. this.socket.dispatch(
  705. "users.updateOrderOfFavoriteStations",
  706. recalculatedOrder,
  707. res => {
  708. return new Toast(res.message);
  709. }
  710. );
  711. },
  712. ...mapActions("modalVisibility", ["openModal"]),
  713. ...mapActions("station", ["updateIfStationIsFavorited"])
  714. }
  715. };
  716. </script>
  717. <style lang="scss">
  718. * {
  719. box-sizing: border-box;
  720. }
  721. html {
  722. width: 100%;
  723. height: 100%;
  724. color: rgba(0, 0, 0, 0.87);
  725. body {
  726. width: 100%;
  727. height: 100%;
  728. margin: 0;
  729. padding: 0;
  730. }
  731. }
  732. .night-mode {
  733. .header .overlay {
  734. background: linear-gradient(
  735. 180deg,
  736. rgba(34, 34, 34, 0.8) 0%,
  737. rgba(34, 34, 34, 0.95) 31.25%,
  738. rgba(34, 34, 34, 0.9) 54.17%,
  739. rgba(34, 34, 34, 0.8) 100%
  740. );
  741. }
  742. .card,
  743. .card-content,
  744. .card-content div {
  745. background-color: var(--dark-grey-3);
  746. }
  747. .card-content .icons i,
  748. .group-title i {
  749. color: var(--light-grey-2);
  750. }
  751. .card-image.thumbnail {
  752. background-color: var(--dark-grey-2);
  753. }
  754. .card-content .under-content .hostedBy {
  755. color: var(--light-grey-2);
  756. }
  757. }
  758. @media only screen and (min-width: 1200px) {
  759. html {
  760. font-size: 15px;
  761. }
  762. }
  763. @media only screen and (min-width: 992px) {
  764. html {
  765. font-size: 14.5px;
  766. }
  767. }
  768. @media only screen and (min-width: 0) {
  769. html {
  770. font-size: 14px;
  771. }
  772. }
  773. .header {
  774. display: flex;
  775. height: 35vh;
  776. margin-top: -64px;
  777. border-radius: 0% 0% 33% 33% / 0% 0% 7% 7%;
  778. img.background {
  779. height: 35vh;
  780. width: 100%;
  781. object-fit: cover;
  782. object-position: center;
  783. filter: blur(1px);
  784. border-radius: 0% 0% 33% 33% / 0% 0% 7% 7%;
  785. overflow: hidden;
  786. }
  787. .overlay {
  788. background: linear-gradient(
  789. 180deg,
  790. rgba(3, 169, 244, 0.8) 0%,
  791. rgba(3, 169, 244, 0.95) 31.25%,
  792. rgba(3, 169, 244, 0.9) 54.17%,
  793. rgba(3, 169, 244, 0.8) 100%
  794. );
  795. position: absolute;
  796. height: 35vh;
  797. width: 100%;
  798. border-radius: 0% 0% 33% 33% / 0% 0% 7% 7%;
  799. overflow: hidden;
  800. }
  801. .content-container {
  802. position: absolute;
  803. left: 0;
  804. right: 0;
  805. margin-left: auto;
  806. margin-right: auto;
  807. text-align: center;
  808. height: 100%;
  809. height: 35vh;
  810. .content {
  811. position: absolute;
  812. top: 50%;
  813. left: 0;
  814. right: 0;
  815. transform: translateY(-50%);
  816. background-color: transparent !important;
  817. img.logo {
  818. max-height: 90px;
  819. font-size: 40px;
  820. color: var(--white);
  821. font-family: Pacifico, cursive;
  822. }
  823. .buttons {
  824. display: flex;
  825. justify-content: center;
  826. margin-top: 20px;
  827. flex-wrap: wrap;
  828. .login,
  829. .register {
  830. margin: 5px 10px;
  831. padding: 10px 15px;
  832. border-radius: 5px;
  833. font-size: 18px;
  834. width: 100%;
  835. max-width: 250px;
  836. font-weight: 600;
  837. border: 0;
  838. height: inherit;
  839. }
  840. .login {
  841. background: var(--white);
  842. color: var(--primary-color);
  843. }
  844. .register {
  845. background: var(--purple);
  846. color: var(--white);
  847. }
  848. }
  849. }
  850. }
  851. &.loggedIn {
  852. height: 20vh;
  853. .overlay,
  854. .content-container,
  855. img.background {
  856. height: 20vh;
  857. }
  858. }
  859. }
  860. @media only screen and (max-width: 550px) {
  861. .header {
  862. height: 45vh;
  863. .overlay,
  864. .content-container,
  865. img.background {
  866. height: 45vh;
  867. }
  868. }
  869. }
  870. .under-content {
  871. height: 20px;
  872. position: relative;
  873. line-height: 1;
  874. font-size: 24px;
  875. display: flex;
  876. align-items: center;
  877. text-align: left;
  878. margin-top: 10px;
  879. p {
  880. font-size: 15px;
  881. line-height: 15px;
  882. display: inline;
  883. }
  884. i {
  885. font-size: 20px;
  886. }
  887. * {
  888. z-index: 10;
  889. position: relative;
  890. }
  891. .icons {
  892. position: absolute;
  893. right: 0;
  894. .material-icons {
  895. font-size: 22px;
  896. }
  897. .material-icons:first-child {
  898. margin-left: 5px;
  899. }
  900. .unlistedIcon {
  901. color: var(--orange);
  902. }
  903. .privateIcon {
  904. color: var(--dark-pink);
  905. }
  906. .homeIcon {
  907. color: var(--light-purple);
  908. }
  909. }
  910. .hostedBy {
  911. font-weight: 400;
  912. font-size: 12px;
  913. color: var(--black);
  914. .host,
  915. .host a {
  916. font-weight: 400;
  917. color: var(--primary-color);
  918. &:hover,
  919. &:focus {
  920. filter: brightness(90%);
  921. }
  922. }
  923. }
  924. }
  925. .app {
  926. display: flex;
  927. flex-direction: column;
  928. }
  929. .users-count {
  930. font-size: 20px;
  931. position: relative;
  932. top: -4px;
  933. }
  934. .group {
  935. min-height: 64px;
  936. flex: 1 0 auto;
  937. }
  938. .station-card {
  939. display: inline-flex;
  940. flex-direction: row;
  941. overflow: hidden;
  942. margin: 10px;
  943. cursor: pointer;
  944. height: 150px;
  945. width: calc(100% - 30px);
  946. max-width: 400px;
  947. flex-wrap: wrap;
  948. border-radius: 5px;
  949. box-shadow: 0 2px 3px rgba(10, 10, 10, 0.1), 0 0 0 1px rgba(10, 10, 10, 0.1);
  950. transition: all ease-in-out 0.2s;
  951. .card-content {
  952. padding: 10px 10px 10px 15px;
  953. display: flex;
  954. flex-direction: column;
  955. flex-grow: 1;
  956. -webkit-line-clamp: 2;
  957. .media {
  958. display: flex;
  959. align-items: center;
  960. margin-bottom: 0;
  961. .displayName {
  962. display: flex;
  963. align-items: center;
  964. width: 100%;
  965. overflow: hidden;
  966. text-overflow: ellipsis;
  967. display: flex;
  968. line-height: 30px;
  969. max-height: 30px;
  970. .favorite {
  971. position: absolute;
  972. color: var(--yellow);
  973. right: 10px;
  974. top: 10px;
  975. font-size: 28px;
  976. }
  977. h5 {
  978. font-size: 20px;
  979. font-weight: 400;
  980. margin: 0;
  981. display: inline;
  982. margin-right: 6px;
  983. line-height: 30px;
  984. text-overflow: ellipsis;
  985. overflow: hidden;
  986. white-space: nowrap;
  987. max-width: 200px;
  988. }
  989. i {
  990. font-size: 22px;
  991. }
  992. .verified-station {
  993. color: var(--primary-color);
  994. }
  995. }
  996. }
  997. .content {
  998. word-wrap: break-word;
  999. overflow: hidden;
  1000. text-overflow: ellipsis;
  1001. display: -webkit-box;
  1002. -webkit-box-orient: vertical;
  1003. -webkit-line-clamp: 3;
  1004. line-height: 20px;
  1005. flex-grow: 1;
  1006. text-align: left;
  1007. word-wrap: break-word;
  1008. margin-bottom: 0;
  1009. }
  1010. }
  1011. .card-image.thumbnail {
  1012. min-width: 120px;
  1013. width: 120px;
  1014. height: 120px;
  1015. margin: 0;
  1016. }
  1017. .bottomBar {
  1018. position: relative;
  1019. display: flex;
  1020. align-items: center;
  1021. background: var(--primary-color);
  1022. // box-shadow: inset 0px 2px 4px rgba(100, 100, 100, 0.3);
  1023. width: 100%;
  1024. height: 30px;
  1025. line-height: 30px;
  1026. color: var(--white);
  1027. font-weight: 400;
  1028. font-size: 12px;
  1029. padding: 0 5px;
  1030. flex-basis: 100%;
  1031. i.material-icons {
  1032. vertical-align: middle;
  1033. margin-left: 5px;
  1034. font-size: 22px;
  1035. }
  1036. .songTitle {
  1037. text-align: left;
  1038. vertical-align: middle;
  1039. margin-left: 5px;
  1040. line-height: 30px;
  1041. flex: 2 1 0;
  1042. overflow: hidden;
  1043. text-overflow: ellipsis;
  1044. white-space: nowrap;
  1045. }
  1046. }
  1047. &.createStation {
  1048. height: auto;
  1049. .card-image {
  1050. .image.is-square {
  1051. width: 120px;
  1052. @media screen and (max-width: 330px) {
  1053. width: 50px;
  1054. .material-icons {
  1055. font-size: 35px !important;
  1056. }
  1057. }
  1058. .material-icons {
  1059. position: absolute;
  1060. top: 25px;
  1061. bottom: 25px;
  1062. left: 0;
  1063. right: 0;
  1064. text-align: center;
  1065. font-size: 70px;
  1066. color: var(--primary-color);
  1067. }
  1068. }
  1069. }
  1070. .card-content {
  1071. width: min-content;
  1072. .media {
  1073. margin-top: auto;
  1074. .displayName h5 {
  1075. font-weight: 600;
  1076. }
  1077. }
  1078. .content {
  1079. flex-grow: unset;
  1080. margin-bottom: auto;
  1081. }
  1082. }
  1083. }
  1084. }
  1085. .station-card:hover {
  1086. box-shadow: 0 2px 3px rgba(10, 10, 10, 0.3), 0 0 10px rgba(10, 10, 10, 0.3);
  1087. transition: all ease-in-out 0.2s;
  1088. }
  1089. .community-button {
  1090. cursor: pointer;
  1091. transition: 0.25s ease color;
  1092. font-size: 30px;
  1093. color: var(--dark-grey);
  1094. }
  1095. .community-button:hover {
  1096. color: var(--primary-color);
  1097. }
  1098. .station-privacy {
  1099. text-transform: capitalize;
  1100. }
  1101. .label {
  1102. display: flex;
  1103. }
  1104. .g-recaptcha {
  1105. display: flex;
  1106. justify-content: center;
  1107. margin-top: 20px;
  1108. }
  1109. .group {
  1110. text-align: center;
  1111. width: 100%;
  1112. margin: 10px 0;
  1113. .group-title {
  1114. display: flex;
  1115. align-items: center;
  1116. justify-content: center;
  1117. margin: 25px 0;
  1118. h1 {
  1119. display: inline-block;
  1120. font-size: 45px;
  1121. margin: 0;
  1122. }
  1123. h2 {
  1124. font-size: 35px;
  1125. margin: 0;
  1126. }
  1127. a {
  1128. display: flex;
  1129. margin-left: 8px;
  1130. }
  1131. }
  1132. &.bottom {
  1133. margin-bottom: 40px;
  1134. }
  1135. }
  1136. </style>