Skip to content
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

complete #1620

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
80 changes: 80 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,83 @@ const siteContent = { // DO NOT CHANGE THIS OBJECT
};

console.log('project wired!')

//Header
// const serviceNav = document.querySelector('nav a:nth-of-type(1)');
// serviceNav.textContent = 'Services'

// const productNav = document.querySelector('nav a:nth-of-type(2)');
// productNav.textContent = 'Product';

// const visionNav = document.querySelector('nav a:nth-of-type(3)');
// visionNav.textContent = 'Vision';

// const featuresNav = document.querySelector('nav a:nth-of-type(4)');
// featuresNav.textContent = 'Features';

// const aboutNav = document.querySelector('nav a:nth-of-type(5)');
// aboutNav.textContent = 'About';

// const contactNav = document.querySelector('nav a:nth-of-type(6)');
// contactNav.textContent = 'Contact';

const navItem = document.querySelectorAll('header nav a')
const navItemLinks = Object.values(siteContent.nav)
navItem.forEach((link, index) => {
link.textContent = navItemLinks[index]
link.classList.add('italic')
});

//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 accentImg = document.querySelector('#middle-img');
accentImg.src = siteContent.images['accent-img'];

//Top left section
const headOne = document.querySelector('h1');
headOne.textContent = siteContent.cta.h1;
const button = document.querySelector('button');
button.textContent = siteContent.cta.button
//siteContent['cta']['button']

//Top Main Content
const topContent = document.querySelector('.top-content')
const h4Top = topContent.querySelectorAll('h4')
h4Top[0].textContent = siteContent['main-content']['features-h4']
h4Top[1].textContent = siteContent['main-content']['about-h4']

//bottom Content h4
const botContent = document.querySelector('.bottom-content')
const h4Bot = botContent.querySelectorAll('h4')
h4Bot[0].textContent = siteContent['main-content']['services-h4']
h4Bot[1].textContent = siteContent['main-content']['product-h4']
h4Bot[2].textContent = siteContent['main-content']['vision-h4']

//top Ps
const topP = topContent.querySelectorAll('p')
topP[0].textContent = siteContent['main-content']['features-content']
topP[1].textContent = siteContent['main-content']['about-content']

//bot Ps
const botP = botContent.querySelectorAll('p')
botP[0].textContent = siteContent['main-content']['services-content']
botP[1].textContent = siteContent['main-content']['product-content']
botP[2].textContent = siteContent['main-content']['vision-content']

//contact section
const contactHeading = document.querySelector('.contact')
contactHeading.querySelector('h4').textContent = siteContent.contact['contact-h4']
const contactPara = document.querySelectorAll('.contact p')
contactPara[0].textContent = siteContent['contact']['address']

contactPara[1].textContent = siteContent['contact']['phone']

contactPara[2].textContent = siteContent['contact']['email']

//footer
const copyright = document.querySelector('footer a');
copyright.classList.add('bold')
copyright.textContent = siteContent.footer.copyright