diff --git a/README.md b/README.md index 1613a3b0..739dfaa5 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,21 @@ # GitHub Tracker -Replace this readme with your own information about your project. +This week we are creating a GitHub tracker -Start by briefly describing the assignment in a sentence or two. Keep it short and to the point. +Requirements: +• A list of all repos that are forked from Technigo +• Your username and profile picture +• Most recent update (push) for each repo +• Name of your default branch for each repo +• URL to the actual GitHub repo +• Number of commits for each repo +• It should be responsive (mobile first) +• A visualisation, for example through a pie chart, of how many projects you've done so far, compared to how many you will do (in total it will be 19 weekly projects 🥳) using Chart.js. ## The problem -Describe how you approached to problem, and what tools and techniques you used to solve it. How did you plan? What technologies did you use? If you had more time, what would be next? +I stated by reviewing the GitHub documentation. Then looked at the instructions hos to use the dynamic id. The profile section was easy to get up, but then I struggled with getting commits up. I had an error in the dynamic id. Once I solved it I moved on to the chart. Getting the data up was not easy, it took me some time to understand how to pass on the info from script to the chart. ## View it live -Every project should be deployed somewhere. Be sure to include the link to the deployed project so that the viewer can click around and see what it's all about. +https://laughing-bardeen-1bdbb2.netlify.app/ diff --git a/code/chart.js b/code/chart.js index 92e85a30..12aa8055 100644 --- a/code/chart.js +++ b/code/chart.js @@ -1,4 +1,26 @@ //DOM-selector for the canvas 👇 -const ctx = document.getElementById('chart').getContext('2d') - +const ctx = document.getElementById("chart").getContext("2d"); +Chart.defaults.font.family = "Poppins"; //"Draw" the chart here 👇 +const drawChart = (projects) => { + const labels = ["DONE", "STILL TO DO"]; + + const data = { + labels: labels, + datasets: [ + { + data: [projects, 19 - projects], + backgroundColor: ["rgb(157,219,201)", "#8286db"], + borderColor: ["rgb(157,219,201)", "#8286db"], + }, + ], + }; + + const config = { + type: "doughnut", + data: data, + // // options: {} + }; + + new Chart(document.getElementById("chart"), config); +}; diff --git a/code/images/bag.png b/code/images/bag.png new file mode 100644 index 00000000..9e83c69d Binary files /dev/null and b/code/images/bag.png differ diff --git a/code/images/blob-red.png b/code/images/blob-red.png new file mode 100644 index 00000000..aacc10b1 Binary files /dev/null and b/code/images/blob-red.png differ diff --git a/code/images/wave-2.png b/code/images/wave-2.png new file mode 100644 index 00000000..a3a72d7f Binary files /dev/null and b/code/images/wave-2.png differ diff --git a/code/index.html b/code/index.html index 2fb5e0ae..3efa986e 100644 --- a/code/index.html +++ b/code/index.html @@ -1,21 +1,37 @@ -
- - - -
+
+