Skip to content

Commit

Permalink
added navlist, cta , top and bottom content
Browse files Browse the repository at this point in the history
  • Loading branch information
steviebanko committed Jul 9, 2018
1 parent 7884abe commit 7662210
Showing 1 changed file with 83 additions and 1 deletion.
84 changes: 83 additions & 1 deletion js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,87 @@ const siteContent = {

// Example: Update the img src for the logo
let logo = document.getElementById("logo-img");
logo.setAttribute('src', siteContent["nav"]["img-src"])
logo.setAttribute('src', siteContent["nav"]["img-src"]);

// NAV LIST
let navList = document.querySelectorAll( "nav a");
console.log(navList);

navList[0].innerHTML = (siteContent["nav"]["nav-item-1"]);
console.log(navList[0]);

navList[1].innerHTML = (siteContent["nav"]["nav-item-2"]);
console.log(navList[1]);

navList[2].innerHTML = (siteContent["nav"]["nav-item-3"]);


navList[3].innerHTML = (siteContent["nav"]["nav-item-4"]);


navList[4].innerHTML = (siteContent["nav"]["nav-item-5"]);


navList[5].innerHTML = (siteContent["nav"]["nav-item-6"]);

//CTA HEADING
let ctaHeading = document.querySelector(".cta-text h1");
ctaHeading.innerHTML = siteContent["cta"]['h1']

// CTA BUTTON
let ctaButton = document.querySelector(".cta-text button");
ctaButton.innerHTML = siteContent["cta"]["button"];

// CTA IMG
let ctaImage = document.getElementById("cta-img");
ctaImage.setAttribute('src', siteContent["cta"]["img-src"]);

// TOP CONTENT
let textContent = document.querySelectorAll(".text-content");


textContent[0].getElementsByTagName("h4").innerHTML = siteContent["main-content"]["features-h4"];
textContent[0].getElementsByTagName("p").innerHTML = siteContent["main-content"]["features-content"];
textContent[1].getElementsByTagName("h4").innerHTML = siteContent["main-content"]["about-h4"];
textContent[1].getElementsByTagName("p").innerHTML = siteContent["main-content"]["about-content"];
console.log(textContent[1]);

// MIDDLE IMG

let midImg = document.getElementById("middle-img");
midImg.setAttribute('src', siteContent['main-content']['middle-img-src']);

// BOTTOM CONTENT

textContent[2].getElementsByTagName("h4").innerHTML= siteContent["main-content"]["services-h4"];
textContent[2].getElementsByTagName("p").innerHTML= siteContent["main-content"]["services-content"];
textContent[3].getElementsByTagName("h4").innerHTML= siteContent["main-content"]["product-h4"];
textContent[3].getElementsByTagName("p").innerHTML= siteContent["main-content"]["product-content"];
textContent[4].getElementsByTagName("h4").innerHTML= siteContent["main-content"]["vision-h4"];
textContent[4].getElementsByTagName("p").innerHTML= siteContent["main-content"]["vision-content"];




// FOOTER
let foot = document.querySelector("footer p");
foot.innerHTML = (siteContent['footer']['copyright']);



// let navItem1 = document.querySelectorAll("nav a");
// navItem1[0].innerHTML = siteContent["nav"]["nav-item-1"]
// let nav2 = document.querySelector('nav');
// nav2.innerHTML = (siteContent["nav"]["nav-item-2"]);

// let nav3 = document.querySelector('nav');
// nav3.innerHTML = (siteContent["nav"]["nav-item-3"]);

// let nav4 = document.querySelector('nav');
// nav4.innerHTML = (siteContent["nav"]["nav-item-4"]);

// let nav5 = document.querySelector('nav');
// nav5.innerHTML = (siteContent["nav"]["nav-item-5"]);

// let nav6 = document.querySelector('nav');
// nav6.innerHTML = (siteContent["nav"]["nav-item-6"]);

0 comments on commit 7662210

Please sign in to comment.