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

- + diff --git a/src/components/Search.vue b/src/components/Search.vue index 38486566..6bd4451f 100644 --- a/src/components/Search.vue +++ b/src/components/Search.vue @@ -2,16 +2,7 @@ - - \ No newline at end of file diff --git a/src/components/Search/AlbumGrid.vue b/src/components/Search/AlbumGrid.vue new file mode 100644 index 00000000..fd6cbb90 --- /dev/null +++ b/src/components/Search/AlbumGrid.vue @@ -0,0 +1,49 @@ + + + + + \ No newline at end of file diff --git a/src/components/Search/ArtistGrid.vue b/src/components/Search/ArtistGrid.vue new file mode 100644 index 00000000..7bc9c09d --- /dev/null +++ b/src/components/Search/ArtistGrid.vue @@ -0,0 +1,50 @@ + + + + + \ No newline at end of file diff --git a/src/components/Search/Filters.vue b/src/components/Search/Filters.vue new file mode 100644 index 00000000..ac145814 --- /dev/null +++ b/src/components/Search/Filters.vue @@ -0,0 +1,50 @@ + + + + + \ No newline at end of file diff --git a/src/components/Search/LoadMore.vue b/src/components/Search/LoadMore.vue new file mode 100644 index 00000000..aae8b5cb --- /dev/null +++ b/src/components/Search/LoadMore.vue @@ -0,0 +1,35 @@ + + + + + \ No newline at end of file diff --git a/src/components/Search/Loader.vue b/src/components/Search/Loader.vue new file mode 100644 index 00000000..9f268e67 --- /dev/null +++ b/src/components/Search/Loader.vue @@ -0,0 +1,36 @@ + + + + + \ No newline at end of file diff --git a/src/components/Search/Options.vue b/src/components/Search/Options.vue new file mode 100644 index 00000000..7c8634e3 --- /dev/null +++ b/src/components/Search/Options.vue @@ -0,0 +1,62 @@ + + + + + \ No newline at end of file diff --git a/src/components/Search/TracksGrid.vue b/src/components/Search/TracksGrid.vue new file mode 100644 index 00000000..dc7b0275 --- /dev/null +++ b/src/components/Search/TracksGrid.vue @@ -0,0 +1,43 @@ + + + + + \ No newline at end of file diff --git a/src/components/shared/AlbumCard.vue b/src/components/shared/AlbumCard.vue new file mode 100644 index 00000000..21ede12e --- /dev/null +++ b/src/components/shared/AlbumCard.vue @@ -0,0 +1,51 @@ + + + + + \ No newline at end of file diff --git a/src/components/shared/ArtistCard.vue b/src/components/shared/ArtistCard.vue index 9e54efb7..b9871b01 100644 --- a/src/components/shared/ArtistCard.vue +++ b/src/components/shared/ArtistCard.vue @@ -1,19 +1,18 @@ @@ -22,11 +21,11 @@ export default { flex: 0 0 auto; overflow: hidden; position: relative; - margin: 0 $smaller 0 $smaller; + margin: 0 $small 0 0; + width: 9em; height: 11em; border-radius: $small; - background-color: #232452; display: flex; flex-direction: column; align-items: center; diff --git a/src/components/shared/SongItem.vue b/src/components/shared/SongItem.vue index e90447bc..e9ddeec1 100644 --- a/src/components/shared/SongItem.vue +++ b/src/components/shared/SongItem.vue @@ -1,8 +1,8 @@