Home.vue 27 KB

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