Skip to content

FInished Project Dom-I #1608

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 53 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}