Home.vue 27 KB

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