diff --git a/server/app/api.py b/server/app/api.py index c6ad1a6d..4e975d3f 100644 --- a/server/app/api.py +++ b/server/app/api.py @@ -50,7 +50,7 @@ def search_by_title(): for song in albums: album_obj = { "name": song["album"], - "artists": song["artists"], + "artist": song["album_artist"], } if album_obj not in albums_dicts: @@ -67,6 +67,7 @@ def search_by_title(): artist_obj = { "name": artist, + "image": "http://0.0.0.0:8900/images/artists/webp/" + artist.replace("/", "::") + ".webp" } if artist_obj not in artists_dicts: @@ -91,8 +92,8 @@ def search_by_title(): return {'data': [ {'tracks': tracks[:5], 'more': more_tracks}, - {'albums': albums_dicts[:10], 'more': more_albums}, - {'artists': artists_dicts[:10], 'more': more_artists} + {'albums': albums_dicts[:5], 'more': more_albums}, + {'artists': artists_dicts[:5], 'more': more_artists} ]} @bp.route('/populate') diff --git a/src/assets/css/Search/Search.scss b/src/assets/css/Search/Search.scss new file mode 100644 index 00000000..6b38294a --- /dev/null +++ b/src/assets/css/Search/Search.scss @@ -0,0 +1,118 @@ +.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 { + position: relative; + border-radius: $small; + margin: 0.5rem 0 0 0; + padding: 1rem $small 0 0; + background-color: #03000eab; + overflow: hidden; + width: auto; + + .no-res { + text-align: center; + height: calc(100% - 1rem); + display: grid; + + .highlight { + padding: $small; + background-color: rgb(29, 26, 26); + } + } + + .heading { + margin-left: $small; + background-color: rgb(3, 54, 112); + width: 6rem; + padding: $small; + border-radius: $small; + margin-bottom: $small; + } + + .input { + display: flex; + align-items: center; + position: relative; + } + + .search-icon { + position: absolute; + height: 2.5rem; + width: 2.5rem; + background-image: url(../../icons/search.svg); + background-size: 70%; + } + + .v11 { + opacity: 0; + transform: translateY(-4rem); + transition: all 0.2s ease-in; + } + + .v00 { + opacity: 1; + transition: all 0.2s ease-in; + } + + .suggestions { + display: flex; + gap: 0.5rem; + margin-left: 1rem; + position: absolute; + right: 2.5rem; + + .item::before { + content: "#"; + color: grey; + } + } +} + +.right-search .scrollable { + width: 100%; + height: 26rem; + overflow-y: auto; + scroll-behavior: smooth; + padding: 0 $small 0 0; + margin-bottom: 0.5rem; +} + +.right-search { + .input-loader { + width: 100%; + border-radius: 0.4rem; + position: relative; + + input { + width: calc(100% - 6rem); + border: none; + line-height: 2.5rem; + background-color: transparent; + color: rgb(255, 255, 255); + font-size: 1rem; + outline: none; + transition: all 0.5s ease; + padding-left: $small; + + &:focus { + transition: all 0.5s ease; + color: rgb(255, 255, 255); + outline: none; + + &::placeholder { + display: none; + } + } + } + } +} + + diff --git a/src/assets/css/global.scss b/src/assets/css/global.scss index e3c00235..743195d9 100644 --- a/src/assets/css/global.scss +++ b/src/assets/css/global.scss @@ -142,7 +142,6 @@ button { } } - .image { background-position: center; background-repeat: no-repeat; @@ -248,4 +247,19 @@ button { transition: all 0.3s ease-in-out; } +.item { + position: relative; + background-color: rgba(34, 33, 33, 0.637); + padding: 0.5rem; + border-radius: 0.5rem; + cursor: pointer; + margin: 0 $small 0 0; + display: flex; + align-items: center; + font-size: 0.9rem; + color: rgb(250, 250, 250); + &:hover { + background-color: rgb(170, 50, 50); + } +} diff --git a/src/components/PlaylistView/FeaturedArtists.vue b/src/components/PlaylistView/FeaturedArtists.vue index 7f7f3e65..bbf1fb51 100644 --- a/src/components/PlaylistView/FeaturedArtists.vue +++ b/src/components/PlaylistView/FeaturedArtists.vue @@ -10,7 +10,7 @@
Featured Artists
-{{ artist.name }}
+{{ artist.name }}