Introduce tabs to right sidebar

- new icons
- rename upnext.vue to queue.vue
- other tiny changes
This commit is contained in:
geoffrey45
2022-01-31 09:38:14 +03:00
parent 3eef90dc8a
commit bdfbb59d76
19 changed files with 363 additions and 255 deletions
+11 -21
View File
@@ -1,21 +1,14 @@
.right-search .v0 {
max-height: 0em;
transition: max-height 0.5s ease;
}
.right-search .v1 {
max-height: 25rem;
transition: max-height 0.5s ease;
}
.right-search { .right-search {
position: relative; position: relative;
border-radius: $small; border-radius: $small;
margin: 0.5rem 0 0 0;
padding: 1rem $small 0 0;
background-color: #03000eab; background-color: #03000eab;
display: grid;
grid-template-rows: min-content 1fr;
overflow: hidden; overflow: hidden;
width: auto; width: auto;
height: 100%;
padding: $small $small 0 $small;
// margin: $small 0 $small 0;
.no-res { .no-res {
text-align: center; text-align: center;
@@ -79,12 +72,11 @@
} }
.right-search .scrollable { .right-search .scrollable {
width: 100%;
height: 26rem;
overflow-y: auto; overflow-y: auto;
scroll-behavior: smooth;
padding: 0 $small 0 0; &::-webkit-scrollbar {
margin-bottom: 0.5rem; display: none;
}
} }
.right-search { .right-search {
@@ -94,7 +86,7 @@
position: relative; position: relative;
input { input {
width: calc(100% - 6rem); width: calc(100% - 2.5rem);
border: none; border: none;
line-height: 2.5rem; line-height: 2.5rem;
background-color: transparent; background-color: transparent;
@@ -102,7 +94,7 @@
font-size: 1rem; font-size: 1rem;
outline: none; outline: none;
transition: all 0.5s ease; transition: all 0.5s ease;
padding-left: $small; padding-left: 0.4rem;
&:focus { &:focus {
transition: all 0.5s ease; transition: all 0.5s ease;
@@ -116,5 +108,3 @@
} }
} }
} }
+1
View File
@@ -0,0 +1 @@
<svg fill="#ffffff" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48" width="48px" height="48px"><path d="M 20.5 6 C 12.509634 6 6 12.50964 6 20.5 C 6 28.49036 12.509634 35 20.5 35 C 23.956359 35 27.133709 33.779044 29.628906 31.75 L 39.439453 41.560547 A 1.50015 1.50015 0 1 0 41.560547 39.439453 L 31.75 29.628906 C 33.779044 27.133709 35 23.956357 35 20.5 C 35 12.50964 28.490366 6 20.5 6 z M 20.5 9 C 26.869047 9 32 14.130957 32 20.5 C 32 23.602612 30.776198 26.405717 28.791016 28.470703 A 1.50015 1.50015 0 0 0 28.470703 28.791016 C 26.405717 30.776199 23.602614 32 20.5 32 C 14.130953 32 9 26.869043 9 20.5 C 9 14.130957 14.130953 9 20.5 9 z"/></svg>

After

Width:  |  Height:  |  Size: 663 B

+6
View File
@@ -0,0 +1,6 @@
<svg width="300" height="300" viewBox="0 0 300 300" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect x="28" y="25" width="104.69" height="104.69" rx="40" fill="#055096"/>
<rect x="167.028" y="170.31" width="104.69" height="104.69" rx="40" fill="#C43A3A"/>
<rect x="28" y="170.31" width="104.69" height="104.69" rx="40" fill="#C4C4C4"/>
<rect x="167.028" y="25" width="104.69" height="104.69" rx="40" fill="white"/>
</svg>

After

Width:  |  Height:  |  Size: 427 B

+6
View File
@@ -0,0 +1,6 @@
<svg width="300" height="300" viewBox="0 0 300 300" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect x="25" y="65" width="250" height="44.8439" rx="22.4219" fill="white"/>
<rect x="25" y="190.999" width="168.664" height="44.8439" rx="22.4219" fill="white"/>
<rect x="230.156" y="190.999" width="44.8439" height="44.8439" rx="22.4219" fill="#055096"/>
<rect x="25" y="127.999" width="211.511" height="44.8439" rx="22.4219" fill="#C43A3A"/>
</svg>

After

Width:  |  Height:  |  Size: 451 B

+5 -1
View File
@@ -1 +1,5 @@
<svg fill="#ffffff" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48" width="48px" height="48px"><path d="M 20.5 6 C 12.509634 6 6 12.50964 6 20.5 C 6 28.49036 12.509634 35 20.5 35 C 23.956359 35 27.133709 33.779044 29.628906 31.75 L 39.439453 41.560547 A 1.50015 1.50015 0 1 0 41.560547 39.439453 L 31.75 29.628906 C 33.779044 27.133709 35 23.956357 35 20.5 C 35 12.50964 28.490366 6 20.5 6 z M 20.5 9 C 26.869047 9 32 14.130957 32 20.5 C 32 23.602612 30.776198 26.405717 28.791016 28.470703 A 1.50015 1.50015 0 0 0 28.470703 28.791016 C 26.405717 30.776199 23.602614 32 20.5 32 C 14.130953 32 9 26.869043 9 20.5 C 9 14.130957 14.130953 9 20.5 9 z"/></svg> <svg width="300" height="300" viewBox="0 0 300 300" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="113.788" cy="121.788" r="88.7875" fill="#C4C4C4"/>
<path d="M130.102 159.761L152.799 133.981L262.11 230.216C269.229 236.483 269.919 247.335 263.652 254.454V254.454C257.385 261.573 246.533 262.263 239.414 255.996L130.102 159.761Z" fill="#C4C4C4"/>
<circle cx="113.959" cy="121.616" r="68.6944" fill="#055096"/>
</svg>

Before

Width:  |  Height:  |  Size: 663 B

After

Width:  |  Height:  |  Size: 429 B

+14
View File
@@ -0,0 +1,14 @@
<template>
<div class="r-home image">
</div>
</template>
<style lang="scss">
.r-home {
height: 100%;
width: 31rem;
background-image: url("https://pro2-bar-s3-cdn-cf2.myportfolio.com/a534e2586a621751e93466e77f5228be/d686c78b-9cd7-4eeb-a660-69cfaf7e4cac_rw_600.gif");
color: transparent;
}
</style>
+70 -25
View File
@@ -1,20 +1,25 @@
<template> <template>
<div class="r-sidebar"> <div class="r-sidebar">
<!-- <div class="m-np"> --> <div class="grid">
<!-- <NowPlaying class="hidden"/> --> <div class="r-content border rounded">
<!-- </div> --> <div class="r-dash" v-if="current_tab == tabs.home">
<div class="s"> <DashBoard/>
<Search </div>
v-model:search="search" <div class="r-search" v-if="current_tab == tabs.search">
@expandSearch="expandSearch" <Search
@collapseSearch="collapseSearch" v-model:search="search"
/> @expandSearch="expandSearch"
</div> @collapseSearch="collapseSearch"
<div class="q"> />
<UpNext v-model:up_next="up_next" @expandQueue="expandQueue" /> </div>
</div>
<div class="r"> <div class="r-queue" v-if="current_tab == tabs.queue">
<RecommendedArtist /> <UpNext v-model:up_next="up_next" @expandQueue="expandQueue" />
</div>
</div>
<div class="tab-keys card-dark border">
<Tabs :current_tab="current_tab" :tabs="tabs" @changeTab="changeTab" />
</div>
</div> </div>
</div> </div>
</template> </template>
@@ -22,8 +27,11 @@
<script setup> <script setup>
import { ref } from "vue"; import { ref } from "vue";
import Search from "../Search.vue"; import Search from "../Search.vue";
import UpNext from "./UpNext.vue"; import UpNext from "./Queue.vue";
import RecommendedArtist from "@/components/RightSideBar/Recommendation.vue"; import Tabs from "./Tabs.vue";
import Main from "./Home/Main.vue";
const DashBoard = Main;
let up_next = ref(true); let up_next = ref(true);
let search = ref(false); let search = ref(false);
@@ -39,17 +47,54 @@ const expandSearch = () => {
const collapseSearch = () => { const collapseSearch = () => {
search.value = false; search.value = false;
}; };
const tabs = {
home: "home",
search: "search",
queue: "queue",
};
const current_tab = ref(tabs.search);
function changeTab(tab) {
current_tab.value = tab;
}
</script> </script>
<style lang="scss"> <style lang="scss">
.r-sidebar { .r-sidebar {
border-radius: 5px; width: 34em;
margin-right: 0.5rem;
margin-bottom: $small; .grid {
overflow-y: auto; height: 100%;
width: 30em; display: grid;
display: grid; grid-template-areas: "content tabs";
grid-auto-flow: row;
grid-template-rows: min-content min-content auto; .r-content {
grid-area: content;
width: 100%;
overflow: hidden;
margin: $small $small $small 0;
.r-search {
height: 100%;
}
.r-dash {
height: 100%;
}
.r-queue {
height: 100%;
}
}
.tab-keys {
grid-area: tabs;
width: 3rem;
padding: $small;
margin-left: $small;
}
}
} }
</style> </style>
+144
View File
@@ -0,0 +1,144 @@
<template>
<div class="up-next border">
<p class="heading">COMING UP NEXT</p>
<div class="r-grid">
<div class="main-item h-1 border" @click="playNext">
<div
class="album-art image"
:style="{
backgroundImage: `url(&quot;${next.image}&quot;)`,
}"
></div>
<div class="tags">
<p class="title ellip">{{ next.title }}</p>
<hr />
<p class="artist ellip">
<span v-for="artist in putCommas(next.artists)" :key="artist">{{
artist
}}</span>
</p>
</div>
</div>
<div class="scrollable-r border">
<TrackItem v-for="song in queue" :key="song" :track="song" />
</div>
</div>
</div>
</template>
<script>
import { ref, toRefs } from "@vue/reactivity";
import perks from "@/composables/perks.js";
import audio from "@/composables/playAudio.js";
import { watch } from "@vue/runtime-core";
import TrackItem from "../shared/TrackItem.vue";
export default {
props: ["up_next"],
setup(props, { emit }) {
const is_expanded = toRefs(props).up_next;
const queue = ref(perks.queue);
const next = ref(perks.next);
let collapse = () => {
emit("expandQueue");
};
watch(is_expanded, (newVal) => {
if (newVal) {
setTimeout(() => {
perks.focusCurrent();
}, 1000);
}
});
const { playNext } = audio;
const putCommas = perks.putCommas;
return {
collapse,
is_expanded,
playNext,
putCommas,
queue,
next,
};
},
components: { TrackItem },
};
</script>
<style lang="scss">
.up-next {
background-color: $card-dark;
border-radius: 0.5rem;
padding: $small;
overflow: hidden;
height: 100%;
.heading {
position: relative;
margin: 0.5rem 0 1rem 0;
}
.main-item {
display: flex;
align-items: center;
padding: 0.5rem;
border-radius: 0.5rem;
cursor: pointer;
margin-bottom: 0.5rem;
.album-art {
width: 4.5rem;
height: 4.5rem;
background-image: url(../../assets/images/null.webp);
margin: 0 0.5rem 0 0;
border-radius: 0.5rem;
}
.tags {
hr {
border: none;
margin: 0.3rem;
}
.title {
width: 20rem;
margin: 0;
}
.artist {
width: 20rem;
margin: 0;
font-size: small;
}
}
&:hover {
background-color: $blue;
}
}
.r-grid {
position: relative;
height: calc(100% - 2rem);
overflow: hidden;
width: 100%;
display: grid;
grid-template-rows: min-content 1fr;
.scrollable-r {
margin-bottom: $small;
padding: $small;
overflow: auto;
background-color: $card-dark;
border-radius: 0.5rem;
&::-webkit-scrollbar-track {
background-color: transparent;
}
}
}
}
</style>
+63
View File
@@ -0,0 +1,63 @@
<template>
<div class="r-tabs">
<button v-for="tab in props.tabs"
@click="changeTab(tab)"
:key="tab"
class="image t-item rounded"
:class="{ active_tab: props.current_tab == tab }, `${tab}`"
></button>
<div>
</div>
</div>
</template>
<script setup>import { onMounted } from 'vue';
const props = defineProps({
current_tab: String,
tabs: Object,
});
const emit = defineEmits(['changeTab'])
function changeTab(tab) {
if (tab == props.current_tab) return;
emit('changeTab', tab)
}
</script>
<style lang="scss">
.r-tabs {
display: flex;
flex-direction: column;
gap: $small;
.t-item {
width: 2rem;
height: 2rem;
background-size: 1.5rem;
}
.active_tab {
border-right: solid;
border-radius: $small 0 0 $small;
}
.search {
background-image: url("../../assets/icons/search.svg");
background-color: rgba(35, 35, 66, 0.247);
}
.queue {
background-image: url("../../assets/icons/queue.svg");
background-color: rgba(46, 25, 33, 0.445);
}
.home {
background-image: url("../../assets/icons/dashboard.svg");
background-color: rgba(148, 102, 50, 0.445);
}
}
</style>
-169
View File
@@ -1,169 +0,0 @@
<template>
<div class="up-next border">
<p class="heading">
COMING UP NEXT <span class="more" @click="collapse">SEE ALL</span>
</p>
<div class="main-item h-1 border" @click="playNext">
<div
class="album-art image"
:style="{
backgroundImage: `url(&quot;${next.image}&quot;)`,
}"
></div>
<div class="tags">
<p class="title ellip">{{ next.title }}</p>
<hr />
<p class="artist ellip">
<span v-for="artist in putCommas(next.artists)" :key="artist">{{
artist
}}</span>
</p>
</div>
</div>
<div>
<div
:class="{ v0: !is_expanded, v1: is_expanded }"
class="scrollable border"
>
<TrackItem v-for="song in queue" :key="song" :track="song" />
</div>
</div>
</div>
</template>
<script>
import { ref, toRefs } from "@vue/reactivity";
import perks from "@/composables/perks.js";
import audio from "@/composables/playAudio.js";
import { watch } from "@vue/runtime-core";
import TrackItem from "../shared/TrackItem.vue";
export default {
props: ["up_next"],
setup(props, { emit }) {
const is_expanded = toRefs(props).up_next;
const queue = ref(perks.queue);
const next = ref(perks.next);
let collapse = () => {
emit("expandQueue");
};
watch(is_expanded, (newVal) => {
if (newVal) {
setTimeout(() => {
perks.focusCurrent();
}, 1000);
}
});
const { playNext } = audio;
const putCommas = perks.putCommas;
return {
collapse,
is_expanded,
playNext,
putCommas,
queue,
next,
};
},
components: { TrackItem },
};
</script>
<style lang="scss">
.up-next .v0 {
max-height: 0;
transition: max-height 0.5s ease;
visibility: hidden;
padding: 0;
}
.up-next .v1 {
max-height: 21em;
transition: max-height 0.5s ease;
padding: $small;
.currentInQueue {
border: 2px solid $pink;
&:hover {
color: #fff;
}
}
}
.up-next {
padding: 0.5rem;
margin-top: $small;
background-color: $card-dark;
border-radius: 0.5rem;
}
.up-next .heading {
position: relative;
margin: 0.5rem 0 1rem 0;
span {
position: absolute;
right: 0.5rem;
padding: 0.5rem;
border-radius: 0.5rem;
user-select: none;
&:hover {
background: $blue;
cursor: pointer;
}
}
}
.up-next .main-item {
display: flex;
align-items: center;
padding: 0.5rem;
border-radius: 0.5rem;
cursor: pointer;
margin-bottom: 0.5rem;
.album-art {
width: 4.5rem;
height: 4.5rem;
background-image: url(../../assets/images/null.webp);
margin: 0 0.5rem 0 0;
border-radius: 0.5rem;
}
.tags {
hr {
border: none;
margin: 0.3rem;
}
.title {
width: 20rem;
margin: 0;
}
.artist {
width: 20rem;
margin: 0;
font-size: small;
}
}
&:hover {
background-color: $blue;
}
}
.up-next .scrollable {
overflow-y: auto;
background-color: $card-dark;
border-radius: 0.5rem;
&::-webkit-scrollbar-track {
background-color: transparent;
}
}
</style>
+29 -27
View File
@@ -1,33 +1,35 @@
<template> <template>
<div class="right-search border" ref="searchComponent"> <div class="right-search" ref="searchComponent">
<div class="input"> <div>
<Loader /> <div class="input">
<Filters :filters="filters" @removeFilter="removeFilter" /> <Loader />
<div class="input-loader border"> <Filters :filters="filters" @removeFilter="removeFilter" />
<input <div class="input-loader border">
type="search" <input
id="search" type="text"
@focus="activateMagicFlag" id="search"
@blur="removeMagicFlag" @focus="activateMagicFlag"
@keyup.backspace="removeLastFilter" @blur="removeMagicFlag"
placeholder="find your music" @keyup.backspace="removeLastFilter"
v-model="query" placeholder="find your music"
/> v-model="query"
<div class="search-icon image"></div> />
<!-- --> <div class="search-icon image"></div>
</div> <!-- -->
<div </div>
class="suggestions v00" <div
:class="{ class="suggestions v00"
v00: !filters.length && !query, :class="{
v11: filters.length || query, v00: !filters.length && !query,
}" v11: filters.length || query,
> }"
<div class="item">Kenny Rogers</div> >
<div class="item">Kenny Rogers</div>
</div>
</div> </div>
<div class="separator no-border"></div>
<Options :magic_flag="magic_flag" @addFilter="addFilter" />
</div> </div>
<div class="separator no-border"></div>
<Options :magic_flag="magic_flag" @addFilter="addFilter" />
<div class="scrollable" :class="{ v0: !is_hidden, v1: is_hidden }"> <div class="scrollable" :class="{ v0: !is_hidden, v1: is_hidden }">
<TracksGrid <TracksGrid
:tracks="tracks.tracks" :tracks="tracks.tracks"
-1
View File
@@ -35,7 +35,6 @@ export default {
border-radius: 0.5rem; border-radius: 0.5rem;
background: #0f131b44; background: #0f131b44;
margin-left: $small;
margin-top: $small; margin-top: $small;
padding: $small 0; padding: $small 0;
overflow-x: hidden; overflow-x: hidden;
+1 -1
View File
@@ -38,8 +38,8 @@ export default {
.right-search .artists-results { .right-search .artists-results {
border-radius: 0.5rem; border-radius: 0.5rem;
background: #1214178c; background: #1214178c;
margin: 0 0 0 $small;
padding: $small 0; padding: $small 0;
margin-bottom: $small;
.grid { .grid {
padding: 0 0 0 $small; padding: 0 0 0 $small;
+2 -1
View File
@@ -29,9 +29,10 @@ export default {
<style lang="scss"> <style lang="scss">
.right-search .filter { .right-search .filter {
display: flex; display: flex;
margin-left: 3rem; margin-left: 2rem;
height: 2rem; height: 2rem;
.item { .item {
&:hover { &:hover {
width: 4rem; width: 4rem;
+1 -1
View File
@@ -1,7 +1,7 @@
<template> <template>
<div class="morexx"> <div class="morexx">
<button @click="loadMore"> <button @click="loadMore">
<div class="text">Load All</div> <div class="text">Load More</div>
</button> </button>
</div> </div>
</template> </template>
+4 -6
View File
@@ -1,6 +1,6 @@
<template> <template>
<div class="loaderx" :class="{ loader: loading, not_loader: !loading }"> <div class="loaderx" :class="{ loader: loading, not_loader: !loading }">
<div class="content" v-if="!loading">/</div> <div v-if="!loading">😹</div>
</div> </div>
</template> </template>
@@ -18,15 +18,14 @@ export default {
<style lang="scss"> <style lang="scss">
.loaderx { .loaderx {
position: absolute; position: absolute;
left: 0.65rem;
top: 0.65rem; top: 0.65rem;
width: 1.5rem; width: 1.5rem;
height: 1.5rem; height: 1.5rem;
border-radius: 50%;
} }
.loader { .loader {
border: dotted $blue; border: dotted $blue;
border-radius: 50%;
animation: spin 0.25s linear infinite; animation: spin 0.25s linear infinite;
@keyframes spin { @keyframes spin {
@@ -40,8 +39,7 @@ export default {
} }
.not_loader { .not_loader {
border: solid 1px; display: grid;
border-radius: 50%; place-items: center;
background-image: url("");
} }
</style> </style>
+2 -1
View File
@@ -1,5 +1,5 @@
<template> <template>
<div class="options" v-if="magic_flag"> <div class="options border rounded">
<div class="item info">Filter by:</div> <div class="item info">Filter by:</div>
<div <div
class="item" class="item"
@@ -54,6 +54,7 @@ export default {
<style lang="scss"> <style lang="scss">
.right-search .options { .right-search .options {
display: flex; display: flex;
margin-bottom: $small;
.item { .item {
margin: $small; margin: $small;
-1
View File
@@ -41,7 +41,6 @@ function loadMore() {
<style lang="scss"> <style lang="scss">
.right-search .tracks-results { .right-search .tracks-results {
border-radius: 0.5rem; border-radius: 0.5rem;
margin-left: $small;
padding: $small; padding: $small;
} }
</style> </style>
+4
View File
@@ -51,6 +51,10 @@ const playThis = (song) => {
</script> </script>
<style lang="scss"> <style lang="scss">
.currentInQueue {
border: solid 2px $pink;
}
.track-item { .track-item {
display: flex; display: flex;
align-items: center; align-items: center;