123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344 |
- <script setup lang="ts">
- import { useRoute, useRouter } from "vue-router";
- import {
- defineAsyncComponent,
- ref,
- computed,
- onMounted,
- onBeforeUnmount
- } from "vue";
- import Toast from "toasters";
- import { storeToRefs } from "pinia";
- import { useWebsocketsStore } from "@/stores/websockets";
- import { useUserAuthStore } from "@/stores/userAuth";
- import { useModalsStore } from "@/stores/modals";
- import keyboardShortcuts from "@/keyboardShortcuts";
- import ws from "@/ws";
- const MainHeader = defineAsyncComponent(
- () => import("@/components/MainHeader.vue")
- );
- const MainFooter = defineAsyncComponent(
- () => import("@/components/MainFooter.vue")
- );
- const SongThumbnail = defineAsyncComponent(
- () => import("@/components/SongThumbnail.vue")
- );
- const UserLink = defineAsyncComponent(
- () => import("@/components/UserLink.vue")
- );
- const Draggable = defineAsyncComponent(
- () => import("@/components/Draggable.vue")
- );
- const userAuthStore = useUserAuthStore();
- const route = useRoute();
- const router = useRouter();
- const { loggedIn, userId, role } = storeToRefs(userAuthStore);
- const { socket } = useWebsocketsStore();
- const stations = ref([]);
- const searchQuery = ref("");
- const siteSettings = ref({
- logo_white: "",
- sitename: "Musare",
- registrationDisabled: false
- });
- const orderOfFavoriteStations = ref([]);
- const handledLoginRegisterRedirect = ref(false);
- const isOwner = station => loggedIn.value && station.owner === userId.value;
- const isAdmin = () => loggedIn.value && role.value === "admin";
- const isOwnerOrAdmin = station => isOwner(station) || isAdmin();
- const isPlaying = station => typeof station.currentSong.title !== "undefined";
- const filteredStations = computed(() => {
- const privacyOrder = ["public", "unlisted", "private"];
- return stations.value
- .filter(
- station =>
- JSON.stringify(Object.values(station)).indexOf(
- searchQuery.value
- ) !== -1
- )
- .sort(
- (a, b) =>
- Number(isOwner(b)) - Number(isOwner(a)) ||
- Number(isPlaying(b)) - Number(isPlaying(a)) ||
- a.paused - b.paused ||
- privacyOrder.indexOf(a.privacy) -
- privacyOrder.indexOf(b.privacy) ||
- b.userCount - a.userCount
- );
- });
- const favoriteStations = computed(() =>
- filteredStations.value
- .filter(station => station.isFavorited === true)
- .sort(
- (a, b) =>
- orderOfFavoriteStations.value.indexOf(a._id) -
- orderOfFavoriteStations.value.indexOf(b._id)
- )
- );
- const { openModal } = useModalsStore();
- const init = () => {
- socket.dispatch(
- "stations.index",
- route.query.adminFilter === undefined,
- res => {
- stations.value = [];
- if (res.status === "success") {
- res.data.stations.forEach(station => {
- const modifiableStation = station;
- if (!modifiableStation.currentSong)
- modifiableStation.currentSong = {
- thumbnail: "/assets/notes-transparent.png"
- };
- if (
- modifiableStation.currentSong &&
- !modifiableStation.currentSong.thumbnail
- )
- modifiableStation.currentSong.ytThumbnail = `https://img.youtube.com/vi/${station.currentSong.youtubeId}/mqdefault.jpg`;
- stations.value.push(modifiableStation);
- });
- orderOfFavoriteStations.value = res.data.favorited;
- }
- }
- );
- socket.dispatch("apis.joinRoom", "home");
- };
- const canRequest = (station, requireLogin = true) =>
- station &&
- (!requireLogin || loggedIn.value) &&
- station.requests &&
- station.requests.enabled &&
- (station.requests.access === "user" ||
- (station.requests.access === "owner" && isOwnerOrAdmin(station)));
- const favoriteStation = stationId => {
- socket.dispatch("stations.favoriteStation", stationId, res => {
- if (res.status === "success") {
- new Toast("Successfully favorited station.");
- } else new Toast(res.message);
- });
- };
- const unfavoriteStation = stationId => {
- socket.dispatch("stations.unfavoriteStation", stationId, res => {
- if (res.status === "success") {
- new Toast("Successfully unfavorited station.");
- } else new Toast(res.message);
- });
- };
- const changeFavoriteOrder = ({ moved }) => {
- const { updatedList } = moved;
- socket.dispatch(
- "users.updateOrderOfFavoriteStations",
- updatedList.map(station => station._id),
- res => new Toast(res.message)
- );
- };
- onMounted(async () => {
- siteSettings.value = await lofig.get("siteSettings");
- if (route.query.searchQuery)
- searchQuery.value = JSON.stringify(route.query.query);
- if (
- !loggedIn.value &&
- route.redirectedFrom &&
- (route.redirectedFrom.name === "login" ||
- route.redirectedFrom.name === "register") &&
- !handledLoginRegisterRedirect.value
- ) {
-
- handledLoginRegisterRedirect.value = true;
- openModal(route.redirectedFrom.name);
- }
- ws.onConnect(init);
- socket.on("event:station.created", res => {
- const { station } = res.data;
- if (stations.value.find(_station => _station._id === station._id)) {
- stations.value.forEach(s => {
- const _station = s;
- if (_station._id === station._id) {
- _station.privacy = station.privacy;
- }
- });
- } else {
- if (!station.currentSong)
- station.currentSong = {
- thumbnail: "/assets/notes-transparent.png"
- };
- if (station.currentSong && !station.currentSong.thumbnail)
- station.currentSong.ytThumbnail = `https://img.youtube.com/vi/${station.currentSong.youtubeId}/mqdefault.jpg`;
- stations.value.push(station);
- }
- });
- socket.on("event:station.deleted", res => {
- const { stationId } = res.data;
- const station = stations.value.find(
- station => station._id === stationId
- );
- if (station) {
- const stationIndex = stations.value.indexOf(station);
- stations.value.splice(stationIndex, 1);
- if (station.isFavorited)
- orderOfFavoriteStations.value =
- orderOfFavoriteStations.value.filter(
- favoritedId => favoritedId !== stationId
- );
- }
- });
- socket.on("event:station.userCount.updated", res => {
- const station = stations.value.find(
- station => station._id === res.data.stationId
- );
- if (station) station.userCount = res.data.userCount;
- });
- socket.on("event:station.updated", res => {
- const stationIndex = stations.value
- .map(station => station._id)
- .indexOf(res.data.station._id);
- if (stationIndex !== -1) {
- stations.value[stationIndex] = {
- ...stations.value[stationIndex],
- ...res.data.station
- };
- }
- });
- socket.on("event:station.nextSong", res => {
- const station = stations.value.find(
- station => station._id === res.data.stationId
- );
- if (station) {
- let newSong = res.data.currentSong;
- if (!newSong)
- newSong = {
- thumbnail: "/assets/notes-transparent.png"
- };
- station.currentSong = newSong;
- }
- });
- socket.on("event:station.pause", res => {
- const station = stations.value.find(
- station => station._id === res.data.stationId
- );
- if (station) station.paused = true;
- });
- socket.on("event:station.resume", res => {
- const station = stations.value.find(
- station => station._id === res.data.stationId
- );
- if (station) station.paused = false;
- });
- socket.on("event:user.station.favorited", res => {
- const { stationId } = res.data;
- const station = stations.value.find(
- station => station._id === stationId
- );
- if (station) {
- station.isFavorited = true;
- orderOfFavoriteStations.value.push(stationId);
- }
- });
- socket.on("event:user.station.unfavorited", res => {
- const { stationId } = res.data;
- const station = stations.value.find(
- station => station._id === stationId
- );
- if (station) {
- station.isFavorited = false;
- orderOfFavoriteStations.value =
- orderOfFavoriteStations.value.filter(
- favoritedId => favoritedId !== stationId
- );
- }
- });
- socket.on("event:user.orderOfFavoriteStations.updated", res => {
- orderOfFavoriteStations.value = res.data.order;
- });
-
- keyboardShortcuts.registerShortcut("home.toggleAdminFilter", {
- keyCode: 70,
- ctrl: true,
- alt: true,
- handler: () => {
- if (isAdmin())
- if (route.query.adminFilter === undefined)
- router.push({
- query: {
- ...route.query,
- adminFilter: null
- }
- });
- else
- router.push({
- query: {
- ...route.query,
- adminFilter: undefined
- }
- });
- }
- });
- });
- onBeforeUnmount(() => {
- socket.dispatch("apis.leaveRoom", "home", () => {});
- const shortcutNames = ["home.toggleAdminFilter"];
- shortcutNames.forEach(shortcutName => {
- keyboardShortcuts.unregisterShortcut(shortcutName);
- });
- });
- </script>
- <template>
- <div>
- <page-metadata title="Home" />
- <div class="app home-page">
- <main-header
- :hide-logo="true"
- :transparent="true"
- :hide-logged-out="true"
- />
- <div class="header" :class="{ loggedIn }">
- <img class="background" src="/assets/homebg.jpeg" />
- <div class="overlay"></div>
- <div class="content-container">
- <div class="content">
- <img
- v-if="siteSettings.sitename === 'Musare'"
- :src="siteSettings.logo_white"
- :alt="siteSettings.sitename || `Musare`"
- class="logo"
- />
- <span v-else class="logo">{{
- siteSettings.sitename
- }}</span>
- <div v-if="!loggedIn" class="buttons">
- <button
- class="button login"
- @click="openModal('login')"
- >
- Login
- </button>
- <button
- v-if="!siteSettings.registrationDisabled"
- class="button register"
- @click="openModal('register')"
- >
- Register
- </button>
- </div>
- </div>
- </div>
- </div>
- <div class="group" v-show="favoriteStations.length > 0">
- <div class="group-title">
- <div>
- <h2>My Favorites</h2>
- </div>
- </div>
- <draggable
- item-key="_id"
- name="home-favorite-stations"
- tag="span"
- :list="favoriteStations"
- @update="changeFavoriteOrder"
- >
- <template #item="{ element }">
- <router-link
- :to="{
- name: 'station',
- params: { id: element.name }
- }"
- :class="{
- 'station-card': true,
- isPrivate: element.privacy === 'private',
- isMine: isOwner(element)
- }"
- :style="
- '--primary-color: var(--' + element.theme + ')'
- "
- >
- <div class="card-content">
- <song-thumbnail :song="element.currentSong">
- <template #icon>
- <div class="icon-container">
- <div
- v-if="isOwnerOrAdmin(element)"
- class="material-icons manage-station"
- @click.prevent="
- openModal({
- modal: 'manageStation',
- data: {
- stationId:
- element._id,
- sector: 'home'
- }
- })
- "
- content="Manage Station"
- v-tippy
- >
- settings
- </div>
- <div
- v-else
- class="material-icons manage-station"
- @click.prevent="
- openModal({
- modal: 'manageStation',
- data: {
- stationId:
- element._id,
- sector: 'home'
- }
- })
- "
- content="View Queue"
- v-tippy
- >
- queue_music
- </div>
- </div>
- </template>
- </song-thumbnail>
- <div class="media">
- <div class="displayName">
- <i
- v-if="
- loggedIn && !element.isFavorited
- "
- @click.prevent="
- favoriteStation(element._id)
- "
- class="favorite material-icons"
- content="Favorite Station"
- v-tippy
- >star_border</i
- >
- <i
- v-if="
- loggedIn && element.isFavorited
- "
- @click.prevent="
- unfavoriteStation(element._id)
- "
- class="favorite material-icons"
- content="Unfavorite Station"
- v-tippy
- >star</i
- >
- <h5>{{ element.displayName }}</h5>
- <i
- v-if="element.type === 'official'"
- class="material-icons verified-station"
- content="Verified Station"
- v-tippy="{
- theme: 'info'
- }"
- >
- check_circle
- </i>
- </div>
- <div class="content">
- {{ element.description }}
- </div>
- <div class="under-content">
- <p class="hostedBy">
- Hosted by
- <span class="host">
- <span
- v-if="
- element.type ===
- 'official'
- "
- :title="
- siteSettings.sitename
- "
- >{{
- siteSettings.sitename
- }}</span
- >
- <user-link
- v-else
- :user-id="element.owner"
- />
- </span>
- </p>
- <div class="icons">
- <i
- v-if="
- element.type ===
- 'community' &&
- isOwner(element)
- "
- class="homeIcon material-icons"
- content="This is your station."
- v-tippy="{ theme: 'info' }"
- >home</i
- >
- <i
- v-if="
- element.privacy ===
- 'private'
- "
- class="privateIcon material-icons"
- content="This station is not visible to other users."
- v-tippy="{ theme: 'info' }"
- >lock</i
- >
- <i
- v-if="
- element.privacy ===
- 'unlisted'
- "
- class="unlistedIcon material-icons"
- content="Unlisted Station"
- v-tippy="{ theme: 'info' }"
- >link</i
- >
- </div>
- </div>
- </div>
- </div>
- <div class="bottomBar">
- <i
- v-if="
- element.paused &&
- element.currentSong.title
- "
- class="material-icons"
- content="Station Paused"
- v-tippy="{ theme: 'info' }"
- >pause</i
- >
- <i
- v-else-if="element.currentSong.title"
- class="material-icons"
- >music_note</i
- >
- <i v-else class="material-icons">music_off</i>
- <span
- v-if="element.currentSong.title"
- class="songTitle"
- :title="
- element.currentSong.artists.length > 0
- ? 'Now Playing: ' +
- element.currentSong.title +
- ' by ' +
- element.currentSong.artists.join(
- ', '
- )
- : 'Now Playing: ' +
- element.currentSong.title
- "
- >{{ element.currentSong.title }}
- {{
- element.currentSong.artists.length > 0
- ? " by " +
- element.currentSong.artists.join(
- ", "
- )
- : ""
- }}</span
- >
- <span v-else class="songTitle"
- >No Songs Playing</span
- >
- <i
- v-if="canRequest(element)"
- class="material-icons"
- content="You can request songs in this station"
- v-tippy="{ theme: 'info' }"
- >
- queue
- </i>
- </div>
- </router-link>
- </template>
- </draggable>
- </div>
- <div class="group bottom">
- <div class="group-title">
- <div>
- <h1>Stations</h1>
- </div>
- </div>
- <a
- v-if="loggedIn"
- @click="openModal('createStation')"
- class="station-card createStation"
- >
- <div class="card-content">
- <div class="thumbnail">
- <figure class="image">
- <i class="material-icons">radio</i>
- </figure>
- </div>
- <div class="media">
- <div class="displayName">
- <h5>Create Station</h5>
- </div>
- <div class="content">
- Click here to create your own station!
- </div>
- </div>
- </div>
- <div class="bottomBar"></div>
- </a>
- <a
- v-else
- @click="openModal('login')"
- class="station-card createStation"
- >
- <div class="card-content">
- <div class="thumbnail">
- <figure class="image">
- <i class="material-icons">radio</i>
- </figure>
- </div>
- <div class="media">
- <div class="displayName">
- <h5>Create Station</h5>
- </div>
- <div class="content">
- Login to create a station!
- </div>
- </div>
- </div>
- <div class="bottomBar"></div>
- </a>
- <router-link
- v-for="station in filteredStations"
- :key="station._id"
- :to="{
- name: 'station',
- params: { id: station.name }
- }"
- class="station-card"
- :class="{
- isPrivate: station.privacy === 'private',
- isMine: isOwner(station)
- }"
- :style="'--primary-color: var(--' + station.theme + ')'"
- >
- <div class="card-content">
- <song-thumbnail :song="station.currentSong">
- <template #icon>
- <div class="icon-container">
- <div
- v-if="isOwnerOrAdmin(station)"
- class="material-icons manage-station"
- @click.prevent="
- openModal({
- modal: 'manageStation',
- data: {
- stationId: station._id,
- sector: 'home'
- }
- })
- "
- content="Manage Station"
- v-tippy
- >
- settings
- </div>
- <div
- v-else
- class="material-icons manage-station"
- @click.prevent="
- openModal({
- modal: 'manageStation',
- data: {
- stationId: station._id,
- sector: 'home'
- }
- })
- "
- content="View Queue"
- v-tippy
- >
- queue_music
- </div>
- </div>
- </template>
- </song-thumbnail>
- <div class="media">
- <div class="displayName">
- <i
- v-if="loggedIn && !station.isFavorited"
- @click.prevent="
- favoriteStation(station._id)
- "
- class="favorite material-icons"
- content="Favorite Station"
- v-tippy
- >star_border</i
- >
- <i
- v-if="loggedIn && station.isFavorited"
- @click.prevent="
- unfavoriteStation(station._id)
- "
- class="favorite material-icons"
- content="Unfavorite Station"
- v-tippy
- >star</i
- >
- <h5>{{ station.displayName }}</h5>
- <i
- v-if="station.type === 'official'"
- class="material-icons verified-station"
- content="Verified Station"
- v-tippy="{ theme: 'info' }"
- >
- check_circle
- </i>
- </div>
- <div class="content">
- {{ station.description }}
- </div>
- <div class="under-content">
- <p class="hostedBy">
- Hosted by
- <span class="host">
- <span
- v-if="station.type === 'official'"
- :title="siteSettings.sitename"
- >{{ siteSettings.sitename }}</span
- >
- <user-link
- v-else
- :user-id="station.owner"
- />
- </span>
- </p>
- <div class="icons">
- <i
- v-if="
- station.type === 'community' &&
- isOwner(station)
- "
- class="homeIcon material-icons"
- content="This is your station."
- v-tippy="{ theme: 'info' }"
- >home</i
- >
- <i
- v-if="station.privacy === 'private'"
- class="privateIcon material-icons"
- content="This station is not visible to other users."
- v-tippy="{ theme: 'info' }"
- >lock</i
- >
- <i
- v-if="station.privacy === 'unlisted'"
- class="unlistedIcon material-icons"
- content="Unlisted Station"
- v-tippy="{ theme: 'info' }"
- >link</i
- >
- </div>
- </div>
- </div>
- </div>
- <div class="bottomBar">
- <i
- v-if="station.paused && station.currentSong.title"
- class="material-icons"
- content="Station Paused"
- v-tippy="{ theme: 'info' }"
- >pause</i
- >
- <i
- v-else-if="station.currentSong.title"
- class="material-icons"
- >music_note</i
- >
- <i v-else class="material-icons">music_off</i>
- <span
- v-if="station.currentSong.title"
- class="songTitle"
- :title="
- station.currentSong.artists.length > 0
- ? 'Now Playing: ' +
- station.currentSong.title +
- ' by ' +
- station.currentSong.artists.join(', ')
- : 'Now Playing: ' +
- station.currentSong.title
- "
- >{{ station.currentSong.title }}
- {{
- station.currentSong.artists.length > 0
- ? " by " +
- station.currentSong.artists.join(", ")
- : ""
- }}</span
- >
- <span v-else class="songTitle">No Songs Playing</span>
- <i
- v-if="canRequest(station)"
- class="material-icons"
- content="You can request songs in this station"
- v-tippy="{ theme: 'info' }"
- >
- queue
- </i>
- <i
- v-else-if="canRequest(station, false)"
- class="material-icons"
- content="Login to request songs in this station"
- v-tippy="{ theme: 'info' }"
- >
- queue
- </i>
- </div>
- </router-link>
- <h4 v-if="stations.length === 0">
- There are no stations to display
- </h4>
- </div>
- <main-footer />
- </div>
- </div>
- </template>
- <style lang="less">
- .christmas-mode .home-page {
- .header .overlay {
- background: linear-gradient(
- 180deg,
- rgba(231, 77, 60, 0.8) 0%,
- rgba(231, 77, 60, 0.95) 31.25%,
- rgba(231, 77, 60, 0.9) 54.17%,
- rgba(231, 77, 60, 0.8) 100%
- );
- }
- .christmas-lights {
- top: 300px !important;
- &.loggedIn {
- top: 200px !important;
- }
- }
- .header {
- &,
- .background,
- .overlay {
- border-radius: unset;
- }
- }
- }
- </style>
- <style lang="less" scoped>
- * {
- box-sizing: border-box;
- }
- html {
- width: 100%;
- height: 100%;
- color: rgba(0, 0, 0, 0.87);
- body {
- width: 100%;
- height: 100%;
- margin: 0;
- padding: 0;
- }
- @media only screen and (min-width: 1200px) {
- font-size: 15px;
- }
- @media only screen and (min-width: 992px) {
- font-size: 14.5px;
- }
- @media only screen and (min-width: 0) {
- font-size: 14px;
- }
- }
- .night-mode {
- .header .overlay {
- background: linear-gradient(
- 180deg,
- rgba(34, 34, 34, 0.8) 0%,
- rgba(34, 34, 34, 0.95) 31.25%,
- rgba(34, 34, 34, 0.9) 54.17%,
- rgba(34, 34, 34, 0.8) 100%
- );
- }
- .station-card {
- background-color: var(--dark-grey-3);
- .thumbnail {
- background-color: var(--dark-grey-2);
- i {
- user-select: none;
- -webkit-user-select: none;
- }
- }
- .card-content .media {
- .icons i,
- .under-content .hostedBy {
- color: var(--light-grey-2) !important;
- }
- }
- }
- .group-title i {
- color: var(--light-grey-2);
- }
- }
- .header {
- display: flex;
- height: 300px;
- margin-top: -64px;
- border-radius: 0% 0% 33% 33% / 0% 0% 7% 7%;
- img.background {
- height: 300px;
- width: 100%;
- object-fit: cover;
- object-position: center;
- filter: blur(1px);
- border-radius: 0% 0% 33% 33% / 0% 0% 7% 7%;
- overflow: hidden;
- user-select: none;
- }
- .overlay {
- background: linear-gradient(
- 180deg,
- rgba(3, 169, 244, 0.8) 0%,
- rgba(3, 169, 244, 0.95) 31.25%,
- rgba(3, 169, 244, 0.9) 54.17%,
- rgba(3, 169, 244, 0.8) 100%
- );
- position: absolute;
- height: 300px;
- width: 100%;
- border-radius: 0% 0% 33% 33% / 0% 0% 7% 7%;
- overflow: hidden;
- }
- .content-container {
- position: absolute;
- left: 0;
- right: 0;
- margin-left: auto;
- margin-right: auto;
- text-align: center;
- height: 300px;
- .content {
- position: absolute;
- top: 50%;
- left: 0;
- right: 0;
- transform: translateY(-50%);
- background-color: transparent !important;
- .logo {
- max-height: 90px;
- font-size: 50px;
- color: var(--white);
- font-family: Pacifico, cursive;
- user-select: none;
- white-space: nowrap;
- }
- .buttons {
- display: flex;
- justify-content: center;
- margin-top: 20px;
- flex-wrap: wrap;
- .login,
- .register {
- margin: 5px 10px;
- padding: 10px 15px;
- border-radius: @border-radius;
- font-size: 18px;
- width: 100%;
- max-width: 250px;
- font-weight: 600;
- border: 0;
- height: inherit;
- }
- .login {
- background: var(--white);
- color: var(--primary-color);
- }
- .register {
- background: var(--purple);
- color: var(--white);
- }
- }
- }
- }
- &.loggedIn {
- height: 200px;
- .overlay,
- .content-container,
- img.background {
- height: 200px;
- }
- }
- }
- .app {
- display: flex;
- flex-direction: column;
- }
- .station-card {
- display: inline-flex;
- position: relative;
- background-color: var(--white);
- color: var(--dark-grey);
- flex-direction: row;
- overflow: hidden;
- margin: 10px;
- cursor: pointer;
- filter: none;
- height: 150px;
- width: calc(100% - 30px);
- max-width: 400px;
- flex-wrap: wrap;
- border-radius: @border-radius;
- box-shadow: @box-shadow;
- .card-content {
- display: flex;
- flex-direction: row;
- flex-grow: 1;
- .thumbnail {
- display: flex;
- position: relative;
- min-width: 120px;
- width: 120px;
- height: 120px;
- margin: 0;
- .image {
- display: flex;
- position: relative;
- padding-top: 100%;
- }
- .icon-container {
- display: flex;
- position: absolute;
- z-index: 2;
- top: 0;
- bottom: 0;
- left: 0;
- right: 0;
- .material-icons.manage-station {
- display: inline-flex;
- opacity: 0;
- background: var(--primary-color);
- color: var(--white);
- margin: auto;
- font-size: 40px;
- border-radius: 100%;
- padding: 10px;
- transition: all 0.2s ease-in-out;
- }
- &:hover,
- &:focus {
- .material-icons.manage-station {
- opacity: 1;
- &:hover,
- &:focus {
- filter: brightness(90%);
- }
- }
- }
- }
- }
- .media {
- display: flex;
- position: relative;
- padding: 10px 10px 10px 15px;
- flex-direction: column;
- flex-grow: 1;
- -webkit-line-clamp: 2;
- .displayName {
- display: flex;
- align-items: center;
- width: 100%;
- overflow: hidden;
- text-overflow: ellipsis;
- display: flex;
- line-height: 30px;
- max-height: 30px;
- .favorite {
- position: absolute;
- color: var(--yellow);
- right: 10px;
- top: 10px;
- font-size: 28px;
- }
- h5 {
- font-size: 20px;
- font-weight: 400;
- margin: 0;
- display: inline;
- margin-right: 6px;
- line-height: 30px;
- text-overflow: ellipsis;
- overflow: hidden;
- white-space: nowrap;
- max-width: 200px;
- }
- i {
- font-size: 22px;
- }
- .verified-station {
- color: var(--primary-color);
- }
- }
- .content {
- word-wrap: break-word;
- overflow: hidden;
- text-overflow: ellipsis;
- display: -webkit-box;
- -webkit-box-orient: vertical;
- -webkit-line-clamp: 3;
- line-height: 20px;
- flex-grow: 1;
- text-align: left;
- word-wrap: break-word;
- margin-bottom: 0;
- }
- .under-content {
- height: 20px;
- position: relative;
- line-height: 1;
- font-size: 24px;
- display: flex;
- align-items: center;
- text-align: left;
- margin-top: 10px;
- p {
- font-size: 15px;
- line-height: 15px;
- display: inline;
- }
- i {
- font-size: 20px;
- }
- * {
- z-index: 10;
- position: relative;
- }
- .icons {
- position: absolute;
- right: 0;
- .material-icons {
- font-size: 22px;
- }
- .material-icons:first-child {
- margin-left: 5px;
- }
- .unlistedIcon {
- color: var(--orange);
- }
- .privateIcon {
- color: var(--dark-pink);
- }
- .homeIcon {
- color: var(--light-purple);
- }
- }
- .hostedBy {
- font-weight: 400;
- font-size: 12px;
- color: var(--black);
- .host,
- .host a {
- font-weight: 400;
- color: var(--primary-color);
- &:hover,
- &:focus {
- filter: brightness(90%);
- }
- }
- }
- }
- }
- }
- .bottomBar {
- position: relative;
- display: flex;
- align-items: center;
- background: var(--primary-color);
- width: 100%;
- height: 30px;
- line-height: 30px;
- color: var(--white);
- font-weight: 400;
- font-size: 12px;
- padding: 0 5px;
- flex-basis: 100%;
- i.material-icons {
- vertical-align: middle;
- margin-left: 5px;
- font-size: 22px;
- }
- .songTitle {
- text-align: left;
- vertical-align: middle;
- margin-left: 5px;
- line-height: 30px;
- flex: 2 1 0;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- }
- &.createStation {
- .card-content {
- .thumbnail {
- .image {
- width: 120px;
- .material-icons {
- position: absolute;
- top: 25px;
- bottom: 25px;
- left: 0;
- right: 0;
- text-align: center;
- font-size: 70px;
- color: var(--primary-color);
- }
- }
- }
- .media {
- margin: auto 0;
- .displayName h5 {
- font-weight: 600;
- }
- .content {
- flex-grow: unset;
- margin-bottom: auto;
- }
- }
- }
- }
- &:hover {
- box-shadow: @box-shadow-hover;
- transition: all ease-in-out 0.2s;
- }
- }
- .group {
- flex: 1 0 auto;
- text-align: center;
- width: 100%;
- margin: 10px 0;
- min-height: 64px;
- .group-title {
- display: flex;
- align-items: center;
- justify-content: center;
- margin: 25px 0;
- h1 {
- display: inline-block;
- font-size: 45px;
- margin: 0;
- }
- h2 {
- font-size: 35px;
- margin: 0;
- }
- a {
- display: flex;
- margin-left: 8px;
- }
- }
- &.bottom {
- margin-bottom: 40px;
- }
- }
- </style>
|