From 7662210d00e5708eff1b372a58b8d28d2cc651f3 Mon Sep 17 00:00:00 2001 From: Stephanie Banks Date: Mon, 9 Jul 2018 18:23:21 -0500 Subject: [PATCH] added navlist, cta , top and bottom content --- js/index.js | 84 ++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 83 insertions(+), 1 deletion(-) diff --git a/js/index.js b/js/index.js index 1c0b8abbf1..3fc4a541df 100644 --- a/js/index.js +++ b/js/index.js @@ -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"]);