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 up! #1610

Open
wants to merge 1 commit 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
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"liveServer.settings.port": 5501
}
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,23 @@ Inside `src/index.js` there is declared an object literal containing all the dat

## Git Setup

* [ ] Create a forked copy of this project.
* [ ] Clone your OWN version of the repository.
* [ ] Create a new branch: `git checkout -b <firstName-lastName>`.
* [ ] Implement the project on your newly created `<firstName-lastName>` branch, committing changes regularly.
* [ ] Push commits: `git push origin <firstName-lastName>`.
* [x] Create a forked copy of this project.
* [x] Clone your OWN version of the repository.
* [x] Create a new branch: `git checkout -b <firstName-lastName>`.
* [x] Implement the project on your newly created `<firstName-lastName>` branch, committing changes regularly.
* [x] Push commits: `git push origin <firstName-lastName>`.

## Running the project

* [ ] Run `npm install` to download the project's dependencies.
* [ ] Run `npm start` to launch the page on `http://localhost:3000`.
* [ ] Run `npm test` to execute auto tests against your work (you'll need a new terminal window).
* [x] Run `npm install` to download the project's dependencies.
* [x] Run `npm start` to launch the page on `http://localhost:3000`.
* [x] Run `npm test` to execute auto tests against your work (you'll need a new terminal window).

## MVP

### Create selectors to access the relevant elements

* [ ] Declare variables pointing to the relevant DOM elements, using any of the selectors you have learned.
* [x] Declare variables pointing to the relevant DOM elements, using any of the selectors you have learned.

### Add text contents

Expand All @@ -38,12 +38,12 @@ Inside `src/index.js` there is declared an object literal containing all the dat
### Add class names

* [ ] Give the anchor tags _inside the nav_ an italic style by adding the classname `italic` to them alone.
* [ ] Give the anchor tag _inside the footer_ a bolder appearence by adding the classname `bold` to it alone.
* [x] Give the anchor tag _inside the footer_ a bolder appearence by adding the classname `bold` to it alone.

### Add image sources

* [ ] Make the img tags on the page display the correct images by editing their `src` attribute.
* [ ] Find the correct URLs for the images inside the data object in `src/index.js`.
* [x] Make the img tags on the page display the correct images by editing their `src` attribute.
* [x] Find the correct URLs for the images inside the data object in `src/index.js`.

## Submission Format

Expand Down
67 changes: 67 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,70 @@ const siteContent = { // DO NOT CHANGE THIS OBJECT
};

console.log('project wired!')

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

//nav bar
const navBar = document.querySelectorAll("header nav a")
// navBar.children[0].textContent = siteContent.nav["nav-item-1"]
// navBar.children[1].textContent = siteContent.nav["nav-item-2"]
// navBar.children[2].textContent = siteContent.nav["nav-item-3"]
// navBar.children[3].textContent = siteContent.nav["nav-item-4"]
// navBar.children[4].textContent = siteContent.nav["nav-item-5"]
// navBar.children[5].textContent = siteContent.nav["nav-item-6"]

const navLinkTexts = Object.values(siteContent.nav)
navBar.forEach((link, idx) => {
link.textContent=navLinkTexts[idx]
link.classList.add("italic")
});


// main content

//button section
const buttonTitle = document.querySelector("h1")
buttonTitle.textContent = siteContent.cta.h1

const buttonSect = document.querySelector("button")
buttonSect.textContent = siteContent.cta.button

//top
const topContent = document.querySelector(".top-content")
console.log(topContent)
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
const bottomContent = document.querySelector(".bottom-content")
console.log(topContent)
bottomContent.children[0].children[0].textContent = siteContent["main-content"]["services-h4"]
bottomContent.children[0].children[1].textContent = siteContent["main-content"]["services-content"]
bottomContent.children[1].children[0].textContent = siteContent["main-content"]["product-h4"]
bottomContent.children[1].children[1].textContent = siteContent["main-content"]["product-content"]
bottomContent.children[2].children[0].textContent = siteContent["main-content"]["vision-h4"]
bottomContent.children[2].children[1].textContent = siteContent["main-content"]["vision-content"]




//contact
const contact = document.querySelector(".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"]

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