diff --git a/src/components/search.rs b/src/components/search.rs index 52596a8..ead324f 100644 --- a/src/components/search.rs +++ b/src/components/search.rs @@ -32,15 +32,6 @@ pub fn Search() -> impl IntoView { spawn_local(async move { log!("Searching for: {:?}", search_query.get_untracked()); - // let results = search(search_query.get_untracked(), search_limit).await; - // match results { - // Ok((albums, artists, songs)) => { - // search_results.set((albums, artists, songs)); - // } - // Err(err) => { - // log!("Error searching: {:?}", err); - // } - // } let albums = search_albums(search_query.get_untracked(), search_limit).await; let artists = search_artists(search_query.get_untracked(), search_limit).await; let songs = search_songs(search_query.get_untracked(), search_limit).await; @@ -98,8 +89,9 @@ pub fn Search() -> impl IntoView {
+ // Display 3 columns of search results: songs, albums, and artists - /* { - move || search_results.with(|(albums, artists, songs)| -> (leptos::HtmlElement
} diff --git a/style/search.scss b/style/search.scss index 8a6c80d..3c18614 100644 --- a/style/search.scss +++ b/style/search.scss @@ -1,4 +1,92 @@ @import "theme.scss"; .search-container { + display: flex; + flex-direction: column; + gap: 1rem; + + .search-bar { + input[type="search"] { + width: 100%; + padding: 0.5rem 1rem; + font-size: 1rem; + border: 1px solid $search-border; + border-radius: 4px; + transition: border-color 0.2s; + + &:focus { + border-color: $accent-color; + outline: none; + } + } + } + + .search-results { + display: flex; + justify-content: space-between; + gap: 1rem; + + .search-result-list { + flex: 1; + list-style: none; + margin: 0; + padding: 0; + + .search-result { + display: flex; + flex-direction: column; + gap: 0.5rem; + padding: 0.5rem; + border: 1px solid $search-border; + border-radius: 4px; + background-color: $search-background; + transition: box-shadow 0.2s; + margin: 0.2rem; + min-height: 6rem; + + .result-container { + display: flex; + justify-content: space-between; + align-items: center; + + .search-result-album, + .search-result-artist { + font-size: 1rem; + font-weight: bold; + } + + .search-item-type { + font-size: 0.9rem; + color: $text-controls-color; + } + + .right-side-result { + display: flex; + align-items: center; + gap: 0.5rem; + + .search-result-options { + background: none; + border: none; + padding: 0; + cursor: pointer; + + .search-result-options-icon { + fill: $text-controls-color; + transition: fill 0.2s; + + &:hover { + fill: $controls-hover-color; + } + + &:active { + fill: $controls-click-color; + } + } + } + } + } + } + } + } } diff --git a/style/theme.scss b/style/theme.scss index b0cea43..dd8f4f0 100644 --- a/style/theme.scss +++ b/style/theme.scss @@ -11,6 +11,8 @@ $play-bar-background-color: #212121; $play-grad-start: #0a0533; $play-grad-end: $accent-color; $queue-background-color: $play-bar-background-color; +$search-background: $play-bar-background-color; +$search-border: #3f3f3f; $auth-inputs: #796dd4; $auth-containers: white;