diff --git a/src/index.js b/src/index.js index e3fb5d7143..b5591b6cd4 100644 --- a/src/index.js +++ b/src/index.js @@ -39,4 +39,56 @@ const siteContent = { // DO NOT CHANGE THIS OBJECT }, }; -console.log('project wired!') +// IMAGES +const logoImg = document.querySelector("#logo-img") +logoImg.src = siteContent.images['logo-img'] +const ctaImg = document.querySelector('#cta-img') +ctaImg.src = siteContent.images['cta-img'] +const midImg = document.querySelector('#middle-img') +midImg.setAttribute('src',siteContent.images['accent-img']) + +// FOOTER +const footerLink = document.querySelector('footer a') +footerLink.textContent = siteContent.footer.copyright +footerLink.classList.add('bold') + +//CONTACT +const contact = document.querySelector('section.contact') +contact.children[0].textContent = siteContent.contact['contact-h4'] +contact.children[1].textContent = siteContent.contact['address'] +contact.children[2].textContent = siteContent.contact['phone'] +contact.children[3].textContent = siteContent.contact['email'] + +// TOP CONTENT +const topContent = document.querySelector('.top-content') +topContent.children[0].children[0].textContent = siteContent['main-content']['features-h4'] +topContent.children[0].children[1].textContent = siteContent['main-content']['features-content'] +topContent.children[1].children[0].textContent = siteContent['main-content']['about-h4'] +topContent.children[1].children[1].textContent = siteContent['main-content']['about-content'] + +// BOTTOM CONTENT +const bottomContent = document.querySelector('.bottom-content') +const h4sBottom = bottomContent.querySelectorAll('h4') +h4sBottom[0].textContent = siteContent['main-content']['services-h4'] +h4sBottom[1].textContent = siteContent['main-content']['product-h4'] +h4sBottom[2].textContent = siteContent['main-content']['vision-h4'] +const psBottom = bottomContent.querySelectorAll('p') +psBottom[0].textContent = siteContent['main-content']['services-content'] +psBottom[1].textContent = siteContent['main-content']['product-content'] +psBottom[2].textContent = siteContent['main-content']['vision-content'] + +// CTA +document.querySelector('.cta .cta-text h1').textContent = siteContent.cta.h1 +document.querySelector('.cta .cta-text button').textContent = siteContent.cta.button + +// NAV LINKS +const navLinks = document.querySelectorAll('header nav a') +const navLinkTexts = Object.values(siteContent.nav) +navLinks.forEach((link, idx) =>{ + link.textContent = navLinkTexts[idx] + link.classList.add('italic') +}) + +for(let link of navLinks){ + console.log(link) +} \ No newline at end of file