html/index.js
/*  musicSelection
    a function to find out what music button was pressed
    (and send that information to another function that makes
        the api call to spotify?)
    once one button is pressed the click features are disabled 
    from the other buttons, and the clicked button will change color.
    @params
        button_id: the id of the button that was pressed
    @returns
        user_music_selection: the needed spotify term for what music 
                            was selected
*/
musicSelection
a function to find out what music button was pressed
(and send that information to another function that makes
the api call to spotify?)
once one button is pressed the click features are disabled
from the other buttons, and the clicked button will change color.
musicSelection a function to find out what music button was pressed ( and send that information to another function that makes the api call to spotify? ) once one button is pressed the click features are disabled from the other buttons and the clicked button will change color .
function musicSelection(button_id) {
    let selected_button = document.getElementById(button_id);
    selected_button.style.background = "black";
    selected_button.style.color = "#cfe8fa";
    if (button_id == "artist-music-button" || 
        button_id == "song-music-button" ||
        button_id == "album-music-button" ) {
        document.getElementById("genre-music-button").style.background = "#cfe8fa";
        document.getElementById("genre-music-button").style.color = "black";    
    }
    if (button_id == "artist-music-button" || 
        button_id == "song-music-button" ||
        button_id == "genre-music-button" ) {
        document.getElementById("album-music-button").style.background = "#cfe8fa";
        document.getElementById("album-music-button").style.color = "black";
    }
    if (button_id == "artist-music-button" || 
        button_id == "album-music-button" ||
        button_id == "genre-music-button" ) {
        document.getElementById("song-music-button").style.background = "#cfe8fa";
        document.getElementById("song-music-button").style.color = "black";
    }
    if (button_id == "song-music-button" || 
        button_id == "album-music-button" ||
        button_id == "genre-music-button" ) {
        document.getElementById("artist-music-button").style.background = "#cfe8fa";
        document.getElementById("artist-music-button").style.color = "black";
    }
    let selection_arr = button_id.split("-");
    console.log(selection_arr);
    user_music_selection = selection_arr[0];
    console.log(user_music_selection);
}
function musicSelection ( button_id ) { let selected_button = document . getElementById ( button_id ) ; selected_button . style . background = "black" ; selected_button . style . color = "#cfe8fa" ; if ( button_id == "artist-music-button" || button_id == "song-music-button" || button_id == "album-music-button" ) { document . getElementById ( "genre-music-button" ) . style . background = "#cfe8fa" ; document . getElementById ( "genre-music-button" ) . style . color = "black" ; } if ( button_id == "artist-music-button" || button_id == "song-music-button" || button_id == "genre-music-button" ) { document . getElementById ( "album-music-button" ) . style . background = "#cfe8fa" ; document . getElementById ( "album-music-button" ) . style . color = "black" ; } if ( button_id == "artist-music-button" || button_id == "album-music-button" || button_id == "genre-music-button" ) { document . getElementById ( "song-music-button" ) . style . background = "#cfe8fa" ; document . getElementById ( "song-music-button" ) . style . color = "black" ; } if ( button_id == "song-music-button" || button_id == "album-music-button" || button_id == "genre-music-button" ) { document . getElementById ( "artist-music-button" ) . style . background = "#cfe8fa" ; document . getElementById ( "artist-music-button" ) . style . color = "black" ; } let selection_arr = button_id . split ( "-" ) ; console . log ( selection_arr ) ; user_music_selection = selection_arr [ 0 ] ; console . log ( user_music_selection ) ; }
musicSelection
a function to find out what music button was pressed
(and send that information to another function that makes
the api call to spotify?)
musicSelection a function to find out what music button was pressed ( and send that information to another function that makes the api call to spotify? )
/*  get the button, and change the color to show selection */ /* black out previously clicked buttons */ /*  button_id looks like artist-music-button    */ /*  user_music_selection is just one word: artist, song, album, or genre */ /* will need to return this information to send it somewhere */