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

Finished Unit 2 Week 1 Module 1 #1626

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
62 changes: 36 additions & 26 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,57 +14,67 @@
<div class="container">
<header>
<nav>
<a href="#"></a>
<a href="#"></a>
<a href="#"></a>
<a href="#"></a>
<a href="#"></a>
<a href="#"></a>
<a href="#" class="italic">Services</a>
<a href="#" class="italic">Product</a>
<a href="#" class="italic">Vision</a>
<a href="#" class="italic">Features</a>
<a href="#" class="italic">About</a>
<a href="#" class="italic">Contact</a>
</nav>
<img id="logo-img" class="logo" alt="Great Idea! Company logo">
<img id="logo-img" class="logo" src="http://localhost:9000/img/logo.png" alt="Great Idea! Company logo">
</header>
<section class="cta">
<div class="cta-text">
<h1></h1>
<button></button>
<h1>DOM Is Awesome</h1>
<button>Get Started</button>
</div>
<img id="cta-img" alt="Image of a code snippet">
<img id="cta-img" src="http://localhost:9000/img/cta.png" alt="Image of a code snippet">
</section>
<section class="main-content">
<div class="top-content">
<div class="text-content">
<h4></h4>
<p></p>
<h4>Features</h4>
<p>Features content elementum magna eros, ac posuere elvit tempus et. Suspendisse vel tempus odio,
in interdutm nisi. Suspendisse eu ornare nisl. Nullam convallis augue justo, at imperdiet metus
scelerisque quis.</p>
</div>
<div class="text-content">
<h4></h4>
<p></p>
<h4>About</h4>
<p>About content elementum magna eros, ac posuere elvit tempus et. Suspendisse vel tempus odio, in
interdutm nisi. Suspendisse eu ornare nisl. Nullam convallis augue justo, at imperdiet metus
scelerisque quis.</p>
</div>
</div>
<img class="middle-img" id="middle-img" alt="Image of code snippets across the screen">
<img class="middle-img" id="middle-img" src="http://localhost:9000/img/accent.png" alt="Image of code snippets across the screen">
<div class="bottom-content">
<div class="text-content">
<h4></h4>
<p></p>
<h4>Services</h4>
<p>Services content elementum magna eros, ac posuere elvit tempus et. Suspendisse vel tempus odio,
in interdutm nisi. Suspendisse eu ornare nisl. Nullam convallis augue justo, at imperdiet metus
scelerisque quis.</p>
</div>
<div class="text-content">
<h4></h4>
<p></p>
<h4>Product</h4>
<p>Services content elementum magna eros, ac posuere elvit tempus et. Suspendisse vel tempus odio,
in interdutm nisi. Suspendisse eu ornare nisl. Nullam convallis augue justo, at imperdiet metus
scelerisque quis.</p>
</div>
<div class="text-content">
<h4></h4>
<p></p>
<h4>Vision</h4>
<p>Services content elementum magna eros, ac posuere elvit tempus et. Suspendisse vel tempus odio,
in interdutm nisi. Suspendisse eu ornare nisl. Nullam convallis augue justo, at imperdiet metus
scelerisque quis.</p>
</div>
</div>
</section>
<section class="contact">
<h4></h4>
<p></p>
<p></p>
<p></p>
<h4>Contact</h4>
<p>123 Way 456 Street Somewhere. USA</p>
<p>1 (888) 888-8888</p>
<p>[email protected]</p>
</section>
<footer>
<a href="#"></a>
<a href="#" class="bold">Copyright Great Idea! 2022</a>
</footer>
</div>
</body>
Expand Down
65 changes: 64 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,67 @@ 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"];

// BOTTTOM 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 navLinksText = Object.values(siteContent.nav);
navLinks.forEach((link, idx) => {
link.textContent = navLinksText[idx];
link.classList.add("italic");
});
2 changes: 1 addition & 1 deletion src/original.html
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ <h4>Contact</h4>
<p>[email protected]</p>
</section>
<footer>
<a href="#" class="bold">Copyright Great Idea! 2021</a>
<a href="#" class="bold">Copyright Great Idea! 2022</a>
</footer>
</div>
</body>
Expand Down