From d1eb8a1fe39e03b2ce6d0ffea51d5fc620c2bd25 Mon Sep 17 00:00:00 2001 From: Brandon Green Date: Thu, 5 Sep 2019 17:18:47 -0500 Subject: [PATCH] github usercard --- .vscode/settings.json | 3 ++ GitHubCard/index.js | 77 ++++++++++++++++++++++++++++++++++++++++--- README.md | 18 +++++----- index.html | 38 +++++++++++---------- package.json | 5 +++ yarn.lock | 35 ++++++++++++++++++++ 6 files changed, 146 insertions(+), 30 deletions(-) create mode 100644 .vscode/settings.json create mode 100644 package.json create mode 100644 yarn.lock diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 000000000..6f3a2913e --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "liveServer.settings.port": 5501 +} \ No newline at end of file diff --git a/GitHubCard/index.js b/GitHubCard/index.js index 5c303ad69..b6f665ecd 100644 --- a/GitHubCard/index.js +++ b/GitHubCard/index.js @@ -1,5 +1,5 @@ /* Step 1: using axios, send a GET request to the following URL - (replacing the palceholder with your Github name): + (replacing the placeholder with your Github name): https://api.github.com/users/ */ @@ -35,7 +35,7 @@ const followersArray = [];

{users name}

{users user name}

Location: {users location}

-

Profile: +

Profile: {address to users github page}

Followers: {users followers count}

@@ -43,13 +43,82 @@ const followersArray = [];

Bio: {users bio}

- */ -/* List of LS Instructors Github username's: +/* List of LS Instructors Github username's: tetondan dustinmyers justsml luishrd bigknell */ +axios.get('https://api.github.com/users/1professionalusername') + .then(response => { + console.log(response) + }) + .catch(err => { + + }) + +//create elements +// function createCard(imgUrl) { +// const newcard = document.createElement('div') +// newimage = document.createElement("img"), +// cardinfo = document.createElement("div"), +// name = document.createElement("h3"); +// username = document.createElement("p"), +// location = document.createElement("p"), +// followers = document.createElement("p"); +// following = document.createElement("p"), +// bio = document.createElement("p"), + +// //content +// name.textContent = "blue"; +// newimage.src = 'blue'; + +// //classes +// newcard.classList.add("card"); +// cardInfo.classList.add("card-info"); +// name.classList.add('name'); +// username.classList.add('username'); + +// //append +// newCard.appendChild(newImage); +// newCard.appendChild(cardInfo); +// cardInfo.appendChild(name); +// cardInfo.appendChild(username); +// cardInfo.appendChild(location); +// cardInfo.appendChild(profile); +// profile.appendChild(a); +// cardInfo.appendChild(followers); +// cardInfo.appendChild(following); +// cardInfo.appendChild(bio); + +// // add this functionality later +// newCard.addEventListener("click", () => { +// newCard.classList.toggle("selected"); +// }); + +// return createCard; +// } + +function DogCard(imgUrl) { + const + newCard = document.createElement("div"), + newImage = document.createElement("h3"), + breed = document.createElement("h3"); + + breed.textContent = "Breed: Mastiff"; + newImage.textContent = "Breed"; + newImage.classList.add("dog-image"); + newCard.classList.add("dog-card"); + newCard.appendChild(newImage); + newCard.appendChild(breed); + + // add this functionality later + newCard.addEventListener("click", () => { + newCard.classList.toggle("selected"); + }); + + return newCard; +} \ No newline at end of file diff --git a/README.md b/README.md index b1a84e5c7..fb4455e52 100644 --- a/README.md +++ b/README.md @@ -18,18 +18,18 @@ In this project we are going to be accessing the GitHub API and building a socia **Follow these steps to set up and work on your project:** -* [ ] Create a forked copy of this project. -* [ ] Add your project manager as collaborator on Github. -* [ ] Clone your OWN version of the repository (Not Lambda's by mistake!). -* [ ] Create a new branch: git checkout -b ``. -* [ ] Implement the project on your newly created `` branch, committing changes regularly. -* [ ] Push commits: git push origin ``. +* [x] Create a forked copy of this project. +* [x] Add your project manager as collaborator on Github. +* [x] Clone your OWN version of the repository (Not Lambda's by mistake!). +* [x] Create a new branch: git checkout -b ``. +* [x] Implement the project on your newly created `` branch, committing changes regularly. +* [x] Push commits: git push origin ``. **Follow these steps for completing your project.** -* [ ] Submit a Pull-Request to merge Branch into master (student's Repo). **Please don't merge your own pull request** -* [ ] Add your project manager as a reviewer on the pull-request -* [ ] Your project manager will count the project as complete by merging the branch back into master. +* [x] Submit a Pull-Request to merge Branch into master (student's Repo). **Please don't merge your own pull request** +* [x] Add your project manager as a reviewer on the pull-request +* [x] Your project manager will count the project as complete by merging the branch back into master. ### Preprocessor Setup diff --git a/index.html b/index.html index 9cf6e5c27..fa139f7ea 100644 --- a/index.html +++ b/index.html @@ -1,21 +1,25 @@ - - - - - - -
-
- Lambda Logo -

❤️'s

- GitHub Logo -
-
+ + + + + + + + + +
+
+ Lambda Logo +

❤️'s

+ GitHub Logo
- - - +
+
+ + + + - + \ No newline at end of file diff --git a/package.json b/package.json new file mode 100644 index 000000000..3639dee59 --- /dev/null +++ b/package.json @@ -0,0 +1,5 @@ +{ + "dependencies": { + "axios": "^0.19.0" + } +} diff --git a/yarn.lock b/yarn.lock new file mode 100644 index 000000000..350b1089e --- /dev/null +++ b/yarn.lock @@ -0,0 +1,35 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +axios@^0.19.0: + version "0.19.0" + resolved "https://registry.yarnpkg.com/axios/-/axios-0.19.0.tgz#8e09bff3d9122e133f7b8101c8fbdd00ed3d2ab8" + integrity sha512-1uvKqKQta3KBxIz14F2v06AEHZ/dIoeKfbTRkK1E5oqjDnuEerLmYTgJB5AiQZHJcljpg1TuRzdjDR06qNk0DQ== + dependencies: + follow-redirects "1.5.10" + is-buffer "^2.0.2" + +debug@=3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261" + integrity sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g== + dependencies: + ms "2.0.0" + +follow-redirects@1.5.10: + version "1.5.10" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.5.10.tgz#7b7a9f9aea2fdff36786a94ff643ed07f4ff5e2a" + integrity sha512-0V5l4Cizzvqt5D44aTXbFZz+FtyXV1vrDN6qrelxtfYQKW0KO0W2T/hkE8xvGa/540LkZlkaUjO4ailYTFtHVQ== + dependencies: + debug "=3.1.0" + +is-buffer@^2.0.2: + version "2.0.3" + resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-2.0.3.tgz#4ecf3fcf749cbd1e472689e109ac66261a25e725" + integrity sha512-U15Q7MXTuZlrbymiz95PJpZxu8IlipAp4dtS3wOdgPXx3mqBnslrWU14kxfHB+Py/+2PVKSr37dMAgM2A4uArw== + +ms@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" + integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=