From aa77d0befd6d8476da34c2ffc2f7a536ef606d9d Mon Sep 17 00:00:00 2001
From: e-delsol <80672920+e-delsol@users.noreply.github.com>
Date: Mon, 27 Sep 2021 22:14:58 +0200
Subject: [PATCH 01/12] fetch repos
---
code/chart.js | 4 +++-
code/script.js | 15 +++++++++++++++
2 files changed, 18 insertions(+), 1 deletion(-)
diff --git a/code/chart.js b/code/chart.js
index 92e85a30..8daf14a3 100644
--- a/code/chart.js
+++ b/code/chart.js
@@ -1,4 +1,6 @@
//DOM-selector for the canvas 👇
-const ctx = document.getElementById('chart').getContext('2d')
+const ctx = document.getElementById("chart").getContext("2d");
//"Draw" the chart here 👇
+
+console.log("chart is heart");
diff --git a/code/script.js b/code/script.js
index e69de29b..a7116693 100644
--- a/code/script.js
+++ b/code/script.js
@@ -0,0 +1,15 @@
+const USER = "ebbadelsol";
+const REPOS_URL = `https://api.github.com/users/${USER}/repos`;
+const projectsContainer = document.getElementById("projects");
+
+const getRepos = () => {
+ fetch(REPOS_URL)
+ .then((response) => response.json())
+ .then((data) => {
+ console.log("All Repos from the json:", data);
+ const technigoProjects = data.filter((repo) => repo.fork && repo.name.startsWith("project-"));
+ technigoProjects.forEach((repo) => (projectsContainer.innerHTML += /*html*/ `
${repo.name}
`));
+ });
+};
+
+getRepos();
From 0b6405606ad5d161471dfdd0bef474a6eca3864e Mon Sep 17 00:00:00 2001
From: e-delsol <80672920+e-delsol@users.noreply.github.com>
Date: Tue, 28 Sep 2021 20:28:26 +0200
Subject: [PATCH 02/12] chart
---
code/chart.js | 18 ++++++++++++++++--
code/index.html | 38 +++++++++++++++++++++-----------------
2 files changed, 37 insertions(+), 19 deletions(-)
diff --git a/code/chart.js b/code/chart.js
index 8daf14a3..025c68f9 100644
--- a/code/chart.js
+++ b/code/chart.js
@@ -1,6 +1,20 @@
//DOM-selector for the canvas 👇
const ctx = document.getElementById("chart").getContext("2d");
-//"Draw" the chart here 👇
+// Chart
+const config = {
+ type: "doughnut",
+ data: {
+ labels: ["Red", "Yellow"], //Change the label
+ datasets: [
+ {
+ label: "My First Dataset", //Change the label
+ data: [5, 19 - 5], // Change the data
+ backgroundColor: ["rgb(255, 99, 132)", "rgb(255, 205, 86)"],
+ hoverOffset: 4,
+ },
+ ],
+ },
+};
-console.log("chart is heart");
+const reposChart = new Chart(ctx, config);
diff --git a/code/index.html b/code/index.html
index 2fb5e0ae..30ba4362 100644
--- a/code/index.html
+++ b/code/index.html
@@ -1,21 +1,25 @@
-
-
-
-
- Project GitHub Tracker
-
-
-
- GitHub Tracker
- Projects:
-
+
+
+
+
+ Project GitHub Tracker
+
+
+
+
+
+ GitHub Tracker
+ Projects:
+
-
-
+
+
+
+
-
-
-
-
\ No newline at end of file
+
+
+
+