more refactors

This commit is contained in:
geoffrey45
2022-02-24 09:05:50 +03:00
parent 38df211882
commit ca790e97d9
10 changed files with 29 additions and 24 deletions
+1
View File
@@ -269,6 +269,7 @@ def get_album_tracks(title: str, artist: str):
"count": len(songs), "count": len(songs),
"duration": "56 Minutes", "duration": "56 Minutes",
"image": songs[0].image, "image": songs[0].image,
"date": songs[0].date,
"artist": songs[0].albumartist, "artist": songs[0].albumartist,
"artist_image": "http://127.0.0.1:8900/images/artists/" "artist_image": "http://127.0.0.1:8900/images/artists/"
+ songs[0].albumartist.replace("/", "::") + songs[0].albumartist.replace("/", "::")
+4 -3
View File
@@ -1,5 +1,6 @@
.b-bar { .b-bar {
height: 100%; height: 100%;
border-top: solid 1px $gray;
.grid { .grid {
display: grid; display: grid;
@@ -62,12 +63,12 @@
width: 100%; width: 100%;
.durationx { .durationx {
background-color: #97979725; background-color: $black;
// border: solid 1px rgba(255, 255, 255, 0.253);
padding: $smaller; padding: $smaller;
border-radius: 0.75rem; border-radius: 0.5rem;
margin: 0 $small 0 $small; margin: 0 $small 0 $small;
font-size: 0.8rem; font-size: 0.8rem;
min-width: 2.5rem;
} }
} }
} }
+1 -1
View File
@@ -5,7 +5,7 @@ input[type="range"] {
height: 0.3rem; height: 0.3rem;
border-radius: 5px; border-radius: 5px;
background-size: 0 100%; background-size: 0 100%;
background: rgb(59, 57, 57) linear-gradient($blue, $blue) no-repeat; background: $black linear-gradient($blue, $blue) no-repeat;
} }
/* Input Thumb */ /* Input Thumb */
+1 -1
View File
@@ -40,7 +40,7 @@ a {
} }
.border { .border {
border: solid 2px #27262654; border: solid 1px $gray;
} }
.border-sm { .border-sm {
+11 -5
View File
@@ -11,7 +11,7 @@
<div class="separator no-border"></div> <div class="separator no-border"></div>
<div class="bottom"> <div class="bottom">
<div class="stats"> <div class="stats">
{{ album_info.count }} Tracks {{ album_info.duration }} 2021 {{ album_info.count }} Tracks {{ album_info.duration }} {{album_info.date}}
</div> </div>
<div class="play rounded" @click="playAlbum"> <div class="play rounded" @click="playAlbum">
<div class="icon"></div> <div class="icon"></div>
@@ -58,7 +58,7 @@ export default {
overflow: hidden; overflow: hidden;
display: flex; display: flex;
align-items: center; align-items: center;
padding: 1rem; padding: $small;
height: 100%; height: 100%;
background-image: url("../../assets/images/abg.webp"); background-image: url("../../assets/images/abg.webp");
background-position: 0% 60%; background-position: 0% 60%;
@@ -74,7 +74,7 @@ export default {
.top { .top {
.h { .h {
color: rgba(255, 255, 255, 0.795); color: #ffffffcb;
} }
.title { .title {
font-size: 2rem; font-size: 2rem;
@@ -94,9 +94,16 @@ export default {
} }
.bottom { .bottom {
position: relative;
.stats { .stats {
background-color: #1f1f1f8e;
padding: $small;
border-radius: $small;
position: absolute;
right: 0;
bottom: 0;
font-weight: bold; font-weight: bold;
display: none;
} }
.play { .play {
@@ -106,7 +113,6 @@ export default {
align-items: center; align-items: center;
background: $highlight-blue; background: $highlight-blue;
padding: $small; padding: $small;
margin: $small 0;
cursor: pointer; cursor: pointer;
.icon { .icon {
+1 -1
View File
@@ -1,5 +1,5 @@
<template> <template>
<div class="b-bar border"> <div class="b-bar">
<div class="grid"> <div class="grid">
<SongCard :collapsed="props.collapsed" /> <SongCard :collapsed="props.collapsed" />
<div class="controlsx rounded"> <div class="controlsx rounded">
+3 -4
View File
@@ -15,7 +15,7 @@
<div class="search"> <div class="search">
<input <input
type="text" type="text"
class="search-input" class="search-input border"
placeholder="Search this folder" placeholder="Search this folder"
v-model="query" v-model="query"
/> />
@@ -68,11 +68,10 @@ export default {
.search-input { .search-input {
max-width: 20rem; max-width: 20rem;
width: 100%; width: 100%;
border: 1px solid $separator;
border-radius: 0.5rem; border-radius: 0.5rem;
padding-left: 1rem; padding-left: 1rem;
background-color: #46454500; background-color: transparent;
color: #fff; color: $white;
font-size: 1rem; font-size: 1rem;
line-height: 2.2rem; line-height: 2.2rem;
outline: none; outline: none;
+2 -2
View File
@@ -13,7 +13,7 @@
<UpNext /> <UpNext />
</div> </div>
</div> </div>
<div class="tab-keys border"> <div class="tab-keys">
<Tabs :current_tab="current_tab" :tabs="tabs" @changeTab="changeTab" /> <Tabs :current_tab="current_tab" :tabs="tabs" @changeTab="changeTab" />
</div> </div>
</div> </div>
@@ -100,9 +100,9 @@ function changeTab(tab) {
height: 100%; height: 100%;
position: absolute; position: absolute;
grid-area: tabs; grid-area: tabs;
// padding: $small 0;
border-radius: 0; border-radius: 0;
overflow: hidden; overflow: hidden;
border-left: solid 1px $gray;
} }
} }
} }
+2 -2
View File
@@ -1,11 +1,11 @@
<template> <template>
<input <input
class="progress-bar"
id="progress" id="progress"
type="range" type="range"
:value="pos" :value="pos"
min="0" min="0"
max="1000" max="100"
step="0.1"
@change="seek()" @change="seek()"
/> />
</template> </template>
+3 -5
View File
@@ -14,8 +14,7 @@ const playing = ref(state.is_playing);
const url = "http://0.0.0.0:9876/file/"; const url = "http://0.0.0.0:9876/file/";
const playAudio = (trackid) => { const playAudio = (trackid) => {
const elem = document.getElementsByClassName('progress-bar')[0]; const elem = document.getElementById('progress');
const bottom_elem = document.getElementsByClassName('progress-bar')[1];
const full_path = url + encodeURIComponent(trackid); const full_path = url + encodeURIComponent(trackid);
@@ -32,11 +31,10 @@ const playAudio = (trackid) => {
); );
audio.ontimeupdate = () => { audio.ontimeupdate = () => {
current_time.value = audio.currentTime; current_time.value = audio.currentTime;
pos.value = (audio.currentTime / audio.duration) * 1000; pos.value = (audio.currentTime / audio.duration) * 100;
let bg_size = ((audio.currentTime / audio.duration) * 100) let bg_size = ((audio.currentTime / audio.duration) * 100)
elem.style.backgroundSize = `${bg_size}% 100%`; elem.style.backgroundSize = `${bg_size}% 100%`;
bottom_elem.style.backgroundSize = `${bg_size}% 100%`;
}; };
}) })
.catch((err) => console.log(err)); .catch((err) => console.log(err));
@@ -54,7 +52,7 @@ function playPrev() {
} }
function seek(position) { function seek(position) {
audio.currentTime = (position / 1000) * audio.duration; audio.currentTime = (position / 100) * audio.duration;
} }
function playPause() { function playPause() {