implement wheel scroll on featured artists.

add next-prev buttons too
This commit is contained in:
geoffrey45
2021-12-10 16:10:06 +03:00
parent a96b76748f
commit 43c1f70380
7 changed files with 129 additions and 81 deletions
+1 -47
View File
@@ -10,12 +10,6 @@
</div> </div>
<Navigation :collapsed="collapsed" /> <Navigation :collapsed="collapsed" />
<PinnedStuff :collapsed="collapsed" /> <PinnedStuff :collapsed="collapsed" />
<div id="settings-button">
<div class="in">
<div class="nav-icon image" id="settings-icon"></div>
<span id="text">Settings</span>
</div>
</div>
</div> </div>
<div class="content"> <div class="content">
<router-view /> <router-view />
@@ -114,15 +108,6 @@ export default {
animation-iteration-count: 1; animation-iteration-count: 1;
} }
.nav-container .in {
display: flex;
align-items: center;
}
.collapsed .in {
flex-direction: column;
}
.l-sidebar { .l-sidebar {
position: relative; position: relative;
} }
@@ -139,40 +124,9 @@ export default {
cursor: pointer; cursor: pointer;
} }
.l-container #settings-button {
position: absolute;
bottom: 0;
display: flex;
height: 50px;
width: 100%;
cursor: pointer;
border-radius: 0 0 $small $small;
border-top: solid .1rem $seperator
}
#settings-button .in {
display: flex;
align-items: center;
justify-content: center;
}
.l-container #settings-button #settings-icon {
margin-left: 1.5rem;
margin-right: 0.25rem;
width: 1.5rem;
height: 1.5rem;
background-image: url(./assets/icons/settings.svg);
}
.collapsed #settings-button #settings-icon {
margin-right: 0;
}
.collapsed #settings-button #text {
display: none;
}
.m-np { .m-np {
position: absolute; position: absolute;
bottom: 0; bottom: 0;
} }
</style> </style>
+1 -1
View File
@@ -79,7 +79,7 @@ a {
} }
.l-sidebar { .l-sidebar {
width: 250px; width: 15em;
grid-area: l-sidebar; grid-area: l-sidebar;
padding-top: 0.5rem; padding-top: 0.5rem;
margin: 0.5rem 0 0.5rem 0.5rem; margin: 0.5rem 0 0.5rem 0.5rem;
+3
View File
@@ -0,0 +1,3 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M10.0201 6L8.61011 7.41L13.1901 12L8.61011 16.59L10.0201 18L16.0201 12L10.0201 6Z" fill="white"/>
</svg>

After

Width:  |  Height:  |  Size: 210 B

+17 -4
View File
@@ -53,6 +53,15 @@
</div> </div>
</div> </div>
</router-link> </router-link>
<hr />
<router-link :to="{ name: 'FolderView' }">
<div class="nav-button" id="folders-button">
<div class="in">
<div class="nav-icon image" id="settings-icon"></div>
<span id="text">Settings</span>
</div>
</div>
</router-link>
</div> </div>
</template> </template>
@@ -65,7 +74,7 @@ export default {
<style> <style lang="scss">
.side-nav-container .in { .side-nav-container .in {
display: flex; display: flex;
align-items: center; align-items: center;
@@ -89,12 +98,13 @@ export default {
background-color: transparent; background-color: transparent;
height: 100%; height: 100%;
padding: 10px; padding: 10px;
transition: all 0.3s ease-in-out;
} }
.collapsed .nav-button {
.collapsed .nav-button span { font-size: smaller;
font-size: small;
margin-top: 5px; margin-top: 5px;
transition: all .2s ease-in-out;
} }
.side-nav-container .nav-button:hover { .side-nav-container .nav-button:hover {
@@ -135,6 +145,9 @@ export default {
.side-nav-container #folders-button #folders-icon { .side-nav-container #folders-button #folders-icon {
background-image: url(../../assets/icons/folder.svg); background-image: url(../../assets/icons/folder.svg);
} }
.side-nav-container #folders-button #settings-icon {
background-image: url(../../assets/icons/settings.svg);
}
.side-nav-container #folders-button #text { .side-nav-container #folders-button #text {
margin-top: 5px; margin-top: 5px;
@@ -6,7 +6,6 @@
> >
<div> <div>
<div class="nav-button" id="pinned-button"> <div class="nav-button" id="pinned-button">
<!-- <div class="nav-icon" id="pinned-icon"></div> -->
<span id="text">Quick access</span> <span id="text">Quick access</span>
</div> </div>
</div> </div>
@@ -62,7 +61,6 @@ export default {
</script> </script>
<style> <style>
#pinned-container .nav-button { #pinned-container .nav-button {
color: rgba(255, 255, 255, 0.671); color: rgba(255, 255, 255, 0.671);
} }
+105 -25
View File
@@ -1,5 +1,9 @@
<template> <template>
<div class="f-artists"> <div class="f-artists">
<div class="xcontrols">
<div class="prev" @click="scrollLeftX"></div>
<div class="next" @click="scrollRightX"></div>
</div>
<div class="artists" ref="artists_dom" v-on:mouseover="say"> <div class="artists" ref="artists_dom" v-on:mouseover="say">
<div class="artist c1"> <div class="artist c1">
<div class="blur"></div> <div class="blur"></div>
@@ -9,7 +13,7 @@
<div class="artist" v-for="artist in artists" :key="artist"> <div class="artist" v-for="artist in artists" :key="artist">
<div> <div>
<div class="artist-image image"></div> <div class="artist-image image"></div>
<p class="artist-name">{{ artist }}</p> <p class="artist-name ellipsis">{{ artist }}</p>
<div class="a-circle"></div> <div class="a-circle"></div>
</div> </div>
</div> </div>
@@ -17,38 +21,62 @@
</div> </div>
</template> </template>
<script> <script>
import { ref } from '@vue/reactivity'; import { ref } from "@vue/reactivity";
export default { export default {
setup() { setup() {
const artists = [ const artists = [
"Eminem", "Michael John Montgomery",
"Drake", "2",
"Kendrick Lamar", "3",
"Eminem", "4",
"Drake", "5",
"Kendrick Lamar", "6",
"Eminem", "7",
"Drake", "8",
"Kendrick Lamar", "9",
"Eminem", "10",
"Drake", "11",
"Kendrick Lamar",
"Eminem",
"Drake",
"Kendrick Lamar",
]; ];
const artists_dom = ref(null) const artists_dom = ref(null);
const scrollLeftX = () => {
const dom = artists_dom.value;
dom.scrollBy({
left: -700,
behavior: "smooth",
});
};
const scrollRightX = () => {
const dom = artists_dom.value;
dom.scrollBy({
left: 700,
behavior: "smooth",
});
};
const scroll = (e) => {
artists_dom.value.scrollBy({
left: e.deltaY < 0 ? -700 : 700,
behavior: "smooth",
});
};
const say = () => { const say = () => {
artists_dom.value.addEventListener("wheel", (e) => {
} e.preventDefault();
scroll(e);
});
};
return { return {
artists, artists,
artists_dom, artists_dom,
say say,
scrollLeftX,
scrollRightX,
}; };
}, },
}; };
@@ -57,7 +85,7 @@ export default {
<style lang="scss"> <style lang="scss">
.f-artists { .f-artists {
position: relative; position: relative;
height: 12em; height: 14em;
width: calc(100% - 1em); width: calc(100% - 1em);
background-color: #1f1e1d; background-color: #1f1e1d;
padding: $small; padding: $small;
@@ -65,6 +93,52 @@ export default {
user-select: none; user-select: none;
} }
.f-artists .xcontrols {
z-index: 1;
width: 5rem;
height: 2rem;
position: absolute;
top: 0.75rem;
right: 0.5rem;
display: flex;
justify-content: space-between;
.next,
.prev {
width: 2em;
height: 2em;
cursor: pointer;
transition: all 0.5s ease;
}
.next {
background: url(../../assets/icons/right-arrow.svg) no-repeat center;
}
.prev {
background: url(../../assets/icons/right-arrow.svg) no-repeat center;
transform: rotate(180deg);
}
.next:hover,
.prev:hover {
transform: scale(1.2);
transition: all 0.5s ease;
}
.prev:hover {
transform: rotate(180deg) scale(1.2);
}
.next:active {
transform: scale(0.5);
}
.prev:active {
transform: rotate(180deg) scale(0.5);
}
}
.f-artists .heading { .f-artists .heading {
color: #fff; color: #fff;
margin: 0 0 1em 1em; margin: 0 0 1em 1em;
@@ -74,11 +148,11 @@ export default {
position: absolute; position: absolute;
bottom: 1em; bottom: 1em;
width: calc(100% - 1em); width: calc(100% - 1em);
height: 11em; height: 13em;
display: flex; display: flex;
align-items: flex-end; align-items: flex-end;
flex-wrap: nowrap; flex-wrap: nowrap;
overflow-y: scroll; overflow-x: scroll;
} }
.f-artists .artists::-webkit-scrollbar { .f-artists .artists::-webkit-scrollbar {
@@ -107,9 +181,14 @@ export default {
transition: all 0.5s ease-in-out; transition: all 0.5s ease-in-out;
} }
.f-artists .artist:active {
transform: translateY(0.9);
}
.f-artists .artist-image { .f-artists .artist-image {
width: 7em; width: 7em;
height: 7em; height: 7em;
margin-left: 0.5em;
border-radius: 50%; border-radius: 50%;
margin-bottom: $small; margin-bottom: $small;
background: url(../../assets/images/girl1.jpg); background: url(../../assets/images/girl1.jpg);
@@ -127,7 +206,7 @@ export default {
margin-left: -0.1rem; margin-left: -0.1rem;
} }
.f-artists .c1:hover > .s2 { .c1:hover > .s2 {
background: rgba(53, 53, 146, 0.8); background: rgba(53, 53, 146, 0.8);
transition: all 0.5s ease; transition: all 0.5s ease;
width: 12em; width: 12em;
@@ -148,6 +227,7 @@ export default {
margin: 0; margin: 0;
text-align: center; text-align: center;
font-size: small; font-size: small;
width: 10em;
} }
.f-artists .blur { .f-artists .blur {
+2 -2
View File
@@ -152,7 +152,7 @@
width: 5em; width: 5em;
background-color: $blue; background-color: $blue;
border-radius: $small; border-radius: $small;
transition: transform 0.5s; transition: transform 1s;
} }
.p-header .info .albums .first { .p-header .info .albums .first {
@@ -185,7 +185,7 @@
} }
.p-header .info .albums .item:hover { .p-header .info .albums .item:hover {
transition: transform 1s; transition: transform .5s;
transform: scale(1.5); transform: scale(1.5);
cursor: pointer; cursor: pointer;
z-index: 3; z-index: 3;