Home.vue 26 KB

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