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

console.log('project wired!')



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"]

const botomContent = document.querySelector(".bottom-content")
botomContent.children[0].children[0].textContent = siteContent["main-content"]["services-h4"]
botomContent.children[0].children[1].textContent = siteContent["main-content"]["services-content"]
botomContent.children[1].children[0].textContent = siteContent["main-content"]["product-h4"]
botomContent.children[1].children[1].textContent = siteContent["main-content"]["product-content"]
botomContent.children[2].children[0].textContent = siteContent["main-content"]["vision-h4"]
botomContent.children[2].children[1].textContent = siteContent["main-content"]["vision-content"]

const contacts = document.querySelector(".contact")
contacts.children[0].textContent = siteContent.contact["contact-h4"]
contacts.children[1].textContent = siteContent.contact["address"]
contacts.children[2].textContent = siteContent.contact["phone"]
contacts.children[3].textContent = siteContent.contact["email"]

const anchorTags = document.querySelectorAll("header nav a")
const anchorTagsText = Object.values(siteContent.nav)
anchorTags.forEach((link, index) => {
link.textContent = anchorTagsText[index]
link.classList.add("italic")
})

// const ctaH1 = document.createElement("h1")
// const ctaButton = document.createElement("button")
// ctaH1.textContent = siteContent.cta["h1"]
// ctaButton.textContent = siteContent.cta["button"]
// document.querySelector(".cta").appendChild(ctaH1)
// document.querySelector(".cta").appendChild(ctaButton)
const cta = document.querySelector(".cta-text")
cta.children[0].textContent = siteContent.cta["h1"]
cta.children[1].textContent = siteContent.cta["button"]

const footerTags = document.querySelectorAll("footer a")
const footerTagsText = Object.values(siteContent.footer)
footerTags.forEach((link, index) => {
link.textContent = footerTagsText[index]
link.classList.add("bold")
})

const logoIMG = document.querySelector("#logo-img")
logoIMG.setAttribute("src", siteContent.images["logo-img"])

const ctaIMG = document.querySelector("#cta-img")
ctaIMG.setAttribute("src", siteContent.images["cta-img"])

const accentIMG = document.querySelector("#middle-img")
accentIMG.setAttribute("src", siteContent.images["accent-img"])