homepagejs.js
//add the category list to the ul tag for categories
add the category list to the ul tag for categories
add the category list to the ul tag for categories
function renderCategories(doc) {
    let li = document.createElement('li');
    let a_tag = document.createElement('a');
    let name = document.createElement('p');
    let image = document.createElement('img');
    name.textContent = doc.data().name;
    imageUrl = doc.data().imageUrl;
    var hrefer = name.textContent.replace(/\s/g, "");
    categorylist.appendChild(li);
    li.appendChild(a_tag);
    a_tag.appendChild(image).setAttribute('style', 'background-image: url(' + imageUrl + ");");
    a_tag.href = "#" + hrefer;
    a_tag.appendChild(name);
    name.classList.add('name');
}
function renderCategories ( doc ) { let li = document . createElement ( 'li' ) ; let a_tag = document . createElement ( 'a' ) ; let name = document . createElement ( 'p' ) ; let image = document . createElement ( 'img' ) ; name . textContent = doc . data ( ) . name ; imageUrl = doc . data ( ) . imageUrl ; var hrefer = name . textContent . replace ( / \s / g , "" ) ; categorylist . appendChild ( li ) ; li . appendChild ( a_tag ) ; a_tag . appendChild ( image ) . setAttribute ( 'style' , 'background-image: url(' + imageUrl + ");" ) ; a_tag . href = "#" + hrefer ; a_tag . appendChild ( name ) ; name . classList . add ( 'name' ) ; }
add the category list to the ul tag for categories
add the category list to the ul tag for categories
//category name //image url /*take out spacing in category name to put in the 
    href attribute of <a> tag */ //create li element that will hold name and image //add child a_tag //add category image to <image> tag //add href to name tag and category name /* This is how it will look in HTML:
    <li>
    <a>
    <img>
    <p class = "name"></p>
    </a>
    </li>
    */