From 3c8a3790efa1f52a59783b9e0180f233c69eef2b Mon Sep 17 00:00:00 2001
From: savannah-hayes <79738821+savannah-hayes@users.noreply.github.com>
Date: Mon, 21 Feb 2022 18:29:32 +0100
Subject: [PATCH 01/24] Display profile data
---
.gitignore | 1 +
.vscode/settings.json | 3 ---
code/index.html | 21 ---------------------
code/style.css | 3 ---
images/location.png | Bin 0 -> 360 bytes
index.html | 32 ++++++++++++++++++++++++++++++++
{code => src}/chart.js | 0
src/script.js | 30 ++++++++++++++++++++++++++++++
code/script.js => src/style.css | 0
9 files changed, 63 insertions(+), 27 deletions(-)
create mode 100644 .gitignore
delete mode 100644 .vscode/settings.json
delete mode 100644 code/index.html
delete mode 100644 code/style.css
create mode 100644 images/location.png
create mode 100644 index.html
rename {code => src}/chart.js (100%)
create mode 100644 src/script.js
rename code/script.js => src/style.css (100%)
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 00000000..e43b0f98
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+.DS_Store
diff --git a/.vscode/settings.json b/.vscode/settings.json
deleted file mode 100644
index e8783bfe..00000000
--- a/.vscode/settings.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "liveServer.settings.port": 5505
-}
\ No newline at end of file
diff --git a/code/index.html b/code/index.html
deleted file mode 100644
index 2fb5e0ae..00000000
--- a/code/index.html
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
-
-
-
-
- Project GitHub Tracker
-
-
-
- GitHub Tracker
- Projects:
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/code/style.css b/code/style.css
deleted file mode 100644
index 7c8ad447..00000000
--- a/code/style.css
+++ /dev/null
@@ -1,3 +0,0 @@
-body {
- background: #FFECE9;
-}
\ No newline at end of file
diff --git a/images/location.png b/images/location.png
new file mode 100644
index 0000000000000000000000000000000000000000..021bb5d869a173cf54c05f5867b5786325cc7be4
GIT binary patch
literal 360
zcmV-u0hj)XP)4oJTwk22!B9>zBCX@Sb@7=o+iC=PxnRDj*n>mvi{)1{b#2wzEXyPEsRnj)v_|Awn
zwyMB8Iq+U|1~IAi*?Bx(Fr5Y(%`n)mC%DBtCW72J-f>m*1oyEWK4CV<*CWHQ
zrdbpYud&5PDK*EE7oN~ahQU{Xy7*jtO|EVvTT~D7bCNB(P6Lf)7+hc}7*FZ;_$(Ul
zU@~P*VJ#~52Ewn2|s&>N*Di0000
+
+
+
+
+
+
+ GitHub Tracker
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/code/chart.js b/src/chart.js
similarity index 100%
rename from code/chart.js
rename to src/chart.js
diff --git a/src/script.js b/src/script.js
new file mode 100644
index 00000000..fc414054
--- /dev/null
+++ b/src/script.js
@@ -0,0 +1,30 @@
+const profileDetails = document.getElementById("aside");
+const projects = document.getElementById("projects");
+
+const username = "savannah-hayes"
+const USER_URL = `https://api.github.com/users/${username}`
+
+const displayProfileData = (data) => {
+ console.log(data)
+ const image = data.avatar_url;
+ const name = data.name;
+ const username = data.login;
+ const bio = data.bio;
+ const followers = data.followers;
+ const following = data.following;
+ const location = data.location;
+
+ profileDetails.innerHTML = `
+
+
+ ${username}
+ ${bio}
+ 馃懃 ${followers} followers 路 ${following} following
+
${location}
+ `;
+}
+
+
+fetch(USER_URL)
+ .then(res => res.json())
+ .then(displayProfileData)
diff --git a/code/script.js b/src/style.css
similarity index 100%
rename from code/script.js
rename to src/style.css
From bb8facabc9fbd3032053c26d63fef5e484d763aa Mon Sep 17 00:00:00 2001
From: savannah-hayes <79738821+savannah-hayes@users.noreply.github.com>
Date: Mon, 21 Feb 2022 20:01:21 +0100
Subject: [PATCH 02/24] Display repository data
---
src/script.js | 31 ++++++++++++++++++++++++++++---
1 file changed, 28 insertions(+), 3 deletions(-)
diff --git a/src/script.js b/src/script.js
index fc414054..9d0a9496 100644
--- a/src/script.js
+++ b/src/script.js
@@ -1,11 +1,11 @@
const profileDetails = document.getElementById("aside");
const projects = document.getElementById("projects");
-const username = "savannah-hayes"
-const USER_URL = `https://api.github.com/users/${username}`
+const username = "savannah-hayes";
+const USER_URL = `https://api.github.com/users/${username}`;
+const REPOS_URL = `https://api.github.com/users/${username}/repos`;
const displayProfileData = (data) => {
- console.log(data)
const image = data.avatar_url;
const name = data.name;
const username = data.login;
@@ -24,7 +24,32 @@ const displayProfileData = (data) => {
`;
}
+const displayRepositories = (repositories) => {
+ console.log(repositories);
+ repositories.filter(repo => {
+ let language = repo.language;
+ const visibility = repo.visibility;
+ const oneDay = 24 * 60 * 60 * 1000;
+ const currentDate = new Date();
+ const projectDate = new Date(repo.pushed_at);
+ let numberOfDays = Math.round(Math.abs((currentDate - projectDate) / oneDay));
+
+ language === "HTML" ? language = `馃敶 ${language}` : language = `馃煛 ${language}`;
+
+ if (repo.fork === true && repo.name !== "unit-tests") {
+ projects.innerHTML += `
+ ${repo.name} ${visibility}
+ Forked from Technigo/project-${repo.name}
+ ${language} Updated ${numberOfDays} days ago
+ `;
+ }
+ })
+}
fetch(USER_URL)
.then(res => res.json())
.then(displayProfileData)
+
+fetch(REPOS_URL)
+ .then(res => res.json())
+ .then(displayRepositories)
From da026abdc2af1cc843b7f22deb8e598de2936198 Mon Sep 17 00:00:00 2001
From: savannah-hayes <79738821+savannah-hayes@users.noreply.github.com>
Date: Tue, 22 Feb 2022 10:29:18 +0100
Subject: [PATCH 03/24] Integrate chart.js and display doughnut chart
---
.gitignore | 1 +
index.html | 12 +++++++-----
src/chart.js | 32 +++++++++++++++++++++++++++++---
src/script.js | 12 ++++++++++--
4 files changed, 47 insertions(+), 10 deletions(-)
diff --git a/.gitignore b/.gitignore
index e43b0f98..34615b71 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,2 @@
.DS_Store
+config.js
\ No newline at end of file
diff --git a/index.html b/index.html
index 237f36cd..7d91e356 100644
--- a/index.html
+++ b/index.html
@@ -10,8 +10,7 @@
-
-
+
@@ -19,14 +18,17 @@ Repositories
-
-
+
-
+
+
+