From a710eec6be86fabb5734a85667a4a47440f61d4f Mon Sep 17 00:00:00 2001 From: TereseClaesson Date: Tue, 22 Feb 2022 20:24:14 +0100 Subject: [PATCH 1/8] Step 1 and 2 --- code/script.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/code/script.js b/code/script.js index e69de29b..40cdcd62 100644 --- a/code/script.js +++ b/code/script.js @@ -0,0 +1,18 @@ +const username = 'TereseClaesson' + +const API_URL = `https://api.github.com/users/${username}/repos` +//const API_URL_PR = 'https://api.github.com/repos/Technigo/${reponame}/pulls' + +fetch(API_URL) +.then(Response => Response.json()) +.then(repos => { +console.log(repos) + +//Use the array method Filter() to filter the array and create a new array, +//with the object properties that has been forked +//repos is the name of the array, repoFork is the name of every object in the array +//fork is the keyname of the property, true is the keyvalue that the new arrays properties has +const repoForked = repos.filter(repoFork => repoFork.fork === true) +console.log(repoForked) +}) + From 49f7f4d891a3e2fe256605c4511f59e0b489234d Mon Sep 17 00:00:00 2001 From: TereseClaesson Date: Wed, 23 Feb 2022 15:47:04 +0100 Subject: [PATCH 2/8] Fetch all the forked,pullrequest repos from technigo github --- code/script.js | 54 ++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 44 insertions(+), 10 deletions(-) diff --git a/code/script.js b/code/script.js index 40cdcd62..a2f1daea 100644 --- a/code/script.js +++ b/code/script.js @@ -1,18 +1,52 @@ -const username = 'TereseClaesson' +const username = "TereseClaesson"; +//let reponame = '' -const API_URL = `https://api.github.com/users/${username}/repos` -//const API_URL_PR = 'https://api.github.com/repos/Technigo/${reponame}/pulls' +//All my repos from github +const API_URL = `https://api.github.com/users/${username}/repos`; +//const API_URL_PR = `https://api.github.com/repos/Technigo/${reponame}/pulls` fetch(API_URL) + .then((Response) => Response.json()) + .then((repos) => { + console.log(repos); + + //Use the array method Filter() to filter the array and create a new array, + //with the object properties that has been forked from Technigo + //repos is the name of the array, repo is the name of every object in the array + //fork is the keyname of the property, true is the keyvalue that the new arrays properties has + //const repoForked = repos.filter(repoFork => repoFork.fork === true) + + const repoForked = repos.filter( + (repo) => repo.fork && repo.name.startsWith("project-")); + console.log(repoForked); + getPullRequest(repoForked); + + /*reponame = repos.name +console.log(reponame)*/ + + // declare after the data(repos in the case) been fetch, calling the const fetch on the top + /*const API_URL_PR = `https://api.github.com/repos/Technigo/${reponame}/pulls` + +fetch(API_URL_PR) .then(Response => Response.json()) .then(repos => { console.log(repos) -//Use the array method Filter() to filter the array and create a new array, -//with the object properties that has been forked -//repos is the name of the array, repoFork is the name of every object in the array -//fork is the keyname of the property, true is the keyvalue that the new arrays properties has -const repoForked = repos.filter(repoFork => repoFork.fork === true) -console.log(repoForked) -}) +})*/ + }); + +const getPullRequest = (repoForked) => { + repoForked.forEach((repo) => { + fetch("https://api.github.com/repos/Technigo/" + repo.name + "/pulls") + .then((res) => res.json()) + .then((pullreqs) => { + //console.log(pullreqs) + pullreqs.forEach((pull) => { + if (pull.user.login === username) { + console.log(pull); + } + }); + }); + }); +}; From 7d69e8d017b02ccce10c5f85733333d1f59c395c Mon Sep 17 00:00:00 2001 From: TereseClaesson Date: Wed, 23 Feb 2022 18:39:34 +0100 Subject: [PATCH 3/8] fetched profile picture and username --- code/index.html | 11 ++++++++++- code/script.js | 44 +++++++++++++++++++++++++++++++++++++++++--- 2 files changed, 51 insertions(+), 4 deletions(-) diff --git a/code/index.html b/code/index.html index 2fb5e0ae..11de6332 100644 --- a/code/index.html +++ b/code/index.html @@ -10,8 +10,17 @@

GitHub Tracker

Projects:

-
+
+ + + +
+
+
+
diff --git a/code/script.js b/code/script.js index a2f1daea..994c7c9f 100644 --- a/code/script.js +++ b/code/script.js @@ -1,10 +1,28 @@ +const userProfile = document.getElementById('profile') + + const username = "TereseClaesson"; //let reponame = '' //All my repos from github -const API_URL = `https://api.github.com/users/${username}/repos`; +const API_USER = `https://api.github.com/users/${username}` +const API_URL = `https://api.github.com/users/${username}/repos` //const API_URL_PR = `https://api.github.com/repos/Technigo/${reponame}/pulls` + + +const userInfo = () => { + fetch(API_USER) + .then((res) => res.json()) + .then(profile => { + userProfile.innerHTML += ` + +

${profile.name}

+ ` + }) +} + + fetch(API_URL) .then((Response) => Response.json()) .then((repos) => { @@ -25,7 +43,7 @@ fetch(API_URL) console.log(reponame)*/ // declare after the data(repos in the case) been fetch, calling the const fetch on the top - /*const API_URL_PR = `https://api.github.com/repos/Technigo/${reponame}/pulls` + /*const API_URL_PR = `https://api.github.com/repos/Technigo/${reponame/pulls` fetch(API_URL_PR) .then(Response => Response.json()) @@ -38,15 +56,35 @@ console.log(repos) const getPullRequest = (repoForked) => { repoForked.forEach((repo) => { - fetch("https://api.github.com/repos/Technigo/" + repo.name + "/pulls") + fetch('https://api.github.com/repos/Technigo/' + repo.name + '/pulls') .then((res) => res.json()) .then((pullreqs) => { //console.log(pullreqs) pullreqs.forEach((pull) => { if (pull.user.login === username) { console.log(pull); + comments(pull); + commits(pull); } }); }); }); }; + +const comments = (pullReq) => { + fetch(pullReq.review_comments_url) + .then((res) => res.json()) + .then((commentrev) => { + console.log(commentrev) + }) +} + +const commits = (pullReq) => { + fetch(pullReq.commits_url) + .then((res) => res.json()) + .then((commitNumber)=> { + console.log(commitNumber) + }) +} + +userInfo() \ No newline at end of file From 9bae35495cbda2d98cb4dc13406bd949177f5625 Mon Sep 17 00:00:00 2001 From: TereseClaesson Date: Wed, 23 Feb 2022 21:54:56 +0100 Subject: [PATCH 4/8] Added innerHTML to the javascript to display the different projects and default branch,link to github projects on the page --- code/script.js | 88 ++++++++++++++++++++++++++------------------------ 1 file changed, 46 insertions(+), 42 deletions(-) diff --git a/code/script.js b/code/script.js index 994c7c9f..a2054730 100644 --- a/code/script.js +++ b/code/script.js @@ -1,27 +1,25 @@ -const userProfile = document.getElementById('profile') - +const userProfile = document.getElementById("profile"); +const allProjects = document.getElementById("projects"); const username = "TereseClaesson"; //let reponame = '' //All my repos from github -const API_USER = `https://api.github.com/users/${username}` -const API_URL = `https://api.github.com/users/${username}/repos` +const API_USER = `https://api.github.com/users/${username}`; +const API_URL = `https://api.github.com/users/${username}/repos`; //const API_URL_PR = `https://api.github.com/repos/Technigo/${reponame}/pulls` - - const userInfo = () => { - fetch(API_USER) + fetch(API_USER) .then((res) => res.json()) - .then(profile => { - userProfile.innerHTML += ` + .then((profile) => { + console.log(profile); + userProfile.innerHTML += `

${profile.name}

- ` - }) -} - + `; + }); +}; fetch(API_URL) .then((Response) => Response.json()) @@ -35,36 +33,42 @@ fetch(API_URL) //const repoForked = repos.filter(repoFork => repoFork.fork === true) const repoForked = repos.filter( - (repo) => repo.fork && repo.name.startsWith("project-")); + (repo) => repo.fork && repo.name.startsWith("project-") + ); + repoForked.forEach((repo) => { + allProjects.innerHTML += ` +
+

${repo.name}

+

PUSH ${repo.pushed_at}

//slice -take away the last part of push +

main branch ${repo.default_branch}

+

${repo.name}

+

${repo.commits_url}

+
+ `; + }); console.log(repoForked); - getPullRequest(repoForked); - - /*reponame = repos.name -console.log(reponame)*/ - - // declare after the data(repos in the case) been fetch, calling the const fetch on the top - /*const API_URL_PR = `https://api.github.com/repos/Technigo/${reponame/pulls` -fetch(API_URL_PR) -.then(Response => Response.json()) -.then(repos => { -console.log(repos) - - -})*/ + getPullRequest(repoForked); }); const getPullRequest = (repoForked) => { repoForked.forEach((repo) => { - fetch('https://api.github.com/repos/Technigo/' + repo.name + '/pulls') + fetch("https://api.github.com/repos/Technigo/" + repo.name + "/pulls") .then((res) => res.json()) .then((pullreqs) => { - //console.log(pullreqs) + console.log(pullreqs) pullreqs.forEach((pull) => { if (pull.user.login === username) { console.log(pull); + comments(pull); commits(pull); + + repoForked.innerHTML += ` +
+

Commit messages ${pullreqs.commitNumber}

+
+ ` } }); }); @@ -72,19 +76,19 @@ const getPullRequest = (repoForked) => { }; const comments = (pullReq) => { - fetch(pullReq.review_comments_url) - .then((res) => res.json()) - .then((commentrev) => { - console.log(commentrev) - }) -} + fetch(pullReq.review_comments_url) + .then((res) => res.json()) + .then((commentrev) => { + console.log(commentrev); + }); +}; const commits = (pullReq) => { - fetch(pullReq.commits_url) + fetch(pullReq.commits_url) .then((res) => res.json()) - .then((commitNumber)=> { - console.log(commitNumber) - }) -} + .then((commitNumber) => { + console.log(commitNumber); + }); +}; -userInfo() \ No newline at end of file +userInfo(); From df420f1935c992c6f2c4a196c925c3bea77d5409 Mon Sep 17 00:00:00 2001 From: TereseClaesson Date: Fri, 25 Feb 2022 15:26:15 +0100 Subject: [PATCH 5/8] Added commits,pull requestlinks and change the structures for the fetches --- code/chart.js | 35 ++++++++++++++ code/index.html | 4 +- code/script.js | 118 ++++++++++++++++++++++++------------------------ 3 files changed, 94 insertions(+), 63 deletions(-) diff --git a/code/chart.js b/code/chart.js index 92e85a30..3346b889 100644 --- a/code/chart.js +++ b/code/chart.js @@ -2,3 +2,38 @@ const ctx = document.getElementById('chart').getContext('2d') //"Draw" the chart here 👇 +const myChart = new Chart(ctx, { + type: 'bar', + data: { + labels: ['Red', 'Blue', 'Yellow', 'Green', 'Purple', 'Orange'], + datasets: [{ + label: '# of Votes', + data: [12, 19, 3, 5, 2, 3], + backgroundColor: [ + 'rgba(255, 99, 132, 0.2)', + 'rgba(54, 162, 235, 0.2)', + 'rgba(255, 206, 86, 0.2)', + 'rgba(75, 192, 192, 0.2)', + 'rgba(153, 102, 255, 0.2)', + 'rgba(255, 159, 64, 0.2)' + ], + + borderColor: [ + 'rgba(255, 99, 132, 1)', + 'rgba(54, 162, 235, 1)', + 'rgba(255, 206, 86, 1)', + 'rgba(75, 192, 192, 1)', + 'rgba(153, 102, 255, 1)', + 'rgba(255, 159, 64, 1)' + ], + borderWidth: 1 + }] + }, + options: { + scales: { + y: { + beginAtZero: true + } + } + } +}); \ No newline at end of file diff --git a/code/index.html b/code/index.html index 11de6332..af4a71f6 100644 --- a/code/index.html +++ b/code/index.html @@ -12,9 +12,7 @@

GitHub Tracker

Projects:

- +
diff --git a/code/script.js b/code/script.js index a2054730..4849eff2 100644 --- a/code/script.js +++ b/code/script.js @@ -1,94 +1,92 @@ -const userProfile = document.getElementById("profile"); +//DOM selectors +const profileInfo = document.getElementById("profile"); const allProjects = document.getElementById("projects"); const username = "TereseClaesson"; -//let reponame = '' +const API_PROFILE = `https://api.github.com/users/${username}`; +const API_URL_REPOS = `https://api.github.com/users/${username}/repos`; -//All my repos from github -const API_USER = `https://api.github.com/users/${username}`; -const API_URL = `https://api.github.com/users/${username}/repos`; -//const API_URL_PR = `https://api.github.com/repos/Technigo/${reponame}/pulls` - -const userInfo = () => { - fetch(API_USER) +//Functions to get the username and profilepicture +const userProfile = () => { + fetch(API_PROFILE) .then((res) => res.json()) - .then((profile) => { - console.log(profile); - userProfile.innerHTML += ` - -

${profile.name}

+ .then(profileData => { + profileInfo.innerHTML += ` +

GitHub Tracker

+ +

${profileData.name}

+

${profileData.login}

`; - }); + }) }; -fetch(API_URL) - .then((Response) => Response.json()) - .then((repos) => { - console.log(repos); - - //Use the array method Filter() to filter the array and create a new array, - //with the object properties that has been forked from Technigo - //repos is the name of the array, repo is the name of every object in the array - //fork is the keyname of the property, true is the keyvalue that the new arrays properties has - //const repoForked = repos.filter(repoFork => repoFork.fork === true) +//Repos +const repositories = () => { +fetch(API_URL_REPOS) + .then((res) => res.json()) + .then((allRepos) => { - const repoForked = repos.filter( - (repo) => repo.fork && repo.name.startsWith("project-") - ); - repoForked.forEach((repo) => { + const forkedRepos = allRepos.filter((repo) => repo.fork && repo.name.startsWith("project-")); + forkedRepos.forEach((repo) => { allProjects.innerHTML += `
-

${repo.name}

-

PUSH ${repo.pushed_at}

//slice -take away the last part of push -

main branch ${repo.default_branch}

-

${repo.name}

-

${repo.commits_url}

+

Project name: ${repo.name}

+

Latest push: ${new Date(repo.pushed_at).toLocaleString('en-GB', { dateStyle:'short',})}

+

Default branch: ${repo.default_branch}

+ ${repo.name} +

+

Commits:

- `; + ` + commits(repo.commits_url, repo.name) }); - console.log(repoForked); - - getPullRequest(repoForked); + getPullRequest(forkedRepos); }); +} -const getPullRequest = (repoForked) => { - repoForked.forEach((repo) => { - fetch("https://api.github.com/repos/Technigo/" + repo.name + "/pulls") +const getPullRequest = (forkedRepos) => { + forkedRepos.forEach((repo) => { + + const PULL_URL = `https://api.github.com/repos/Technigo/${repo.name}/pulls?per_page=100` + + fetch(PULL_URL) .then((res) => res.json()) - .then((pullreqs) => { - console.log(pullreqs) - pullreqs.forEach((pull) => { + .then((pullReqs) => { + let groupProject = true + pullReqs.forEach((pull) => { if (pull.user.login === username) { - console.log(pull); - - comments(pull); - commits(pull); - - repoForked.innerHTML += ` -
-

Commit messages ${pullreqs.commitNumber}

-
+ groupProject = false + document.getElementById(`pull-${repo.name}`).innerHTML = ` + Go to pull request ` } }); + + if (groupProject === true) { + document.getElementById(`pull-${repo.name}`).innerHTML = ` +

No pull request, group project

+ ` + } }); }); }; -const comments = (pullReq) => { +/*const comments = (pullReq) => { fetch(pullReq.review_comments_url) .then((res) => res.json()) .then((commentrev) => { console.log(commentrev); }); -}; +};*/ -const commits = (pullReq) => { - fetch(pullReq.commits_url) +const commits = (myCommits, repoName) => { + let commitUrl = myCommits.replace('{/sha}','') + fetch(commitUrl) .then((res) => res.json()) .then((commitNumber) => { - console.log(commitNumber); - }); + document.getElementById(`commit-${repoName}`).innerHTML += commitNumber.length; + }) }; -userInfo(); +userProfile(); +repositories(); From 0ffb520df8a0d46262e64bdb1fecef145d9e1f97 Mon Sep 17 00:00:00 2001 From: TereseClaesson Date: Fri, 25 Feb 2022 17:53:26 +0100 Subject: [PATCH 6/8] Added a chart to display at my page,change the color i CSS and changed my structure in HTML --- code/chart.js | 60 ++++++++++++++++++++----------------------------- code/index.html | 10 +++++---- code/script.js | 1 + code/style.css | 2 +- 4 files changed, 32 insertions(+), 41 deletions(-) diff --git a/code/chart.js b/code/chart.js index 3346b889..d4a83b5f 100644 --- a/code/chart.js +++ b/code/chart.js @@ -1,39 +1,27 @@ //DOM-selector for the canvas 👇 -const ctx = document.getElementById('chart').getContext('2d') +const ctx = document.getElementById('chart').getContext('2d'); //"Draw" the chart here 👇 -const myChart = new Chart(ctx, { - type: 'bar', - data: { - labels: ['Red', 'Blue', 'Yellow', 'Green', 'Purple', 'Orange'], - datasets: [{ - label: '# of Votes', - data: [12, 19, 3, 5, 2, 3], - backgroundColor: [ - 'rgba(255, 99, 132, 0.2)', - 'rgba(54, 162, 235, 0.2)', - 'rgba(255, 206, 86, 0.2)', - 'rgba(75, 192, 192, 0.2)', - 'rgba(153, 102, 255, 0.2)', - 'rgba(255, 159, 64, 0.2)' - ], - - borderColor: [ - 'rgba(255, 99, 132, 1)', - 'rgba(54, 162, 235, 1)', - 'rgba(255, 206, 86, 1)', - 'rgba(75, 192, 192, 1)', - 'rgba(153, 102, 255, 1)', - 'rgba(255, 159, 64, 1)' - ], - borderWidth: 1 - }] - }, - options: { - scales: { - y: { - beginAtZero: true - } - } - } -}); \ No newline at end of file +const drawChart = (amount) => { + const data = { + labels: [ + 'completed projects', + 'projects left' + ], + datasets: [ + { + backgroundColor: ['grey', 'black'], + data: [amount, 19 - amount], + hoverOffSet: 4, + }, + ], + +}; + const config = { + type: 'doughnut', + data: data + }; + const myChart = new Chart(ctx,config); + +}; + diff --git a/code/index.html b/code/index.html index af4a71f6..8b60fc80 100644 --- a/code/index.html +++ b/code/index.html @@ -6,8 +6,11 @@ Project GitHub Tracker + + +

GitHub Tracker

Projects:

@@ -19,10 +22,9 @@

Projects:

- - - - + + + \ No newline at end of file diff --git a/code/script.js b/code/script.js index 4849eff2..93526d1b 100644 --- a/code/script.js +++ b/code/script.js @@ -41,6 +41,7 @@ fetch(API_URL_REPOS) commits(repo.commits_url, repo.name) }); getPullRequest(forkedRepos); + drawChart(forkedRepos.length); }); } diff --git a/code/style.css b/code/style.css index 7c8ad447..5e453959 100644 --- a/code/style.css +++ b/code/style.css @@ -1,3 +1,3 @@ body { - background: #FFECE9; + background: #d5cac4; } \ No newline at end of file From 6efe3fb8deb44c5c29447ceb06fbe3d621a3ed0e Mon Sep 17 00:00:00 2001 From: TereseClaesson Date: Sun, 27 Feb 2022 22:05:09 +0100 Subject: [PATCH 7/8] Added styling and resposivness --- README.md | 8 ++- code/chart.js | 36 ++++++------- code/index.html | 62 ++++++++++++---------- code/script.js | 66 +++++++++++------------ code/style.css | 138 +++++++++++++++++++++++++++++++++++++++++++++++- 5 files changed, 219 insertions(+), 91 deletions(-) diff --git a/README.md b/README.md index 1613a3b0..a5bb0972 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,11 @@ # GitHub Tracker -Replace this readme with your own information about your project. - -Start by briefly describing the assignment in a sentence or two. Keep it short and to the point. +This weeks project where a deep dive into more APIs and to start using npm,unit tests and 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 started this weeks projects as usuals, looking through all information and reading the instructions.After that I did start the project by fecthing API from my gitHub repositories etc. It was hard for me to grasp what the assignment was and what I was suppose to do! So I spent a lot of time googling on the wrong search words and just trying to understand the instructions and trying to wrap my head around the task. I asked my teammates for help. ## 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. + diff --git a/code/chart.js b/code/chart.js index d4a83b5f..c9fb3d29 100644 --- a/code/chart.js +++ b/code/chart.js @@ -1,27 +1,21 @@ //DOM-selector for the canvas 👇 -const ctx = document.getElementById('chart').getContext('2d'); +const ctx = document.getElementById("chart").getContext("2d"); //"Draw" the chart here 👇 const drawChart = (amount) => { - const data = { - labels: [ - 'completed projects', - 'projects left' - ], - datasets: [ - { - backgroundColor: ['grey', 'black'], - data: [amount, 19 - amount], - hoverOffSet: 4, - }, + const data = { + labels: ["completed projects", "projects left"], + datasets: [ + { + backgroundColor: ["grey", "black"], + data: [amount, 19 - amount], + hoverOffSet: 4, + }, ], - -}; - const config = { - type: 'doughnut', - data: data - }; - const myChart = new Chart(ctx,config); - + }; + const config = { + type: "doughnut", + data: data, + }; + const myChart = new Chart(ctx, config); }; - diff --git a/code/index.html b/code/index.html index 8b60fc80..fd88239d 100644 --- a/code/index.html +++ b/code/index.html @@ -1,30 +1,38 @@ - - - - - Project GitHub Tracker - - - - - - -

GitHub Tracker

-

Projects:

-
- - - -
+ + + + + Project GitHub Tracker + + + + +

GitHub Tracker

-
-
-
- - - - - - \ No newline at end of file +
+ + +
+
+
+
+
+ +
Created by Terese Claesson
+ + + + + diff --git a/code/script.js b/code/script.js index 93526d1b..b0d441d2 100644 --- a/code/script.js +++ b/code/script.js @@ -10,83 +10,77 @@ const API_URL_REPOS = `https://api.github.com/users/${username}/repos`; const userProfile = () => { fetch(API_PROFILE) .then((res) => res.json()) - .then(profileData => { + .then((profileData) => { profileInfo.innerHTML += ` -

GitHub Tracker

${profileData.name}

${profileData.login}

`; - }) + }); }; //Repos -const repositories = () => { -fetch(API_URL_REPOS) - .then((res) => res.json()) - .then((allRepos) => { - - const forkedRepos = allRepos.filter((repo) => repo.fork && repo.name.startsWith("project-")); - forkedRepos.forEach((repo) => { - allProjects.innerHTML += ` +const repositories = () => { + fetch(API_URL_REPOS) + .then((res) => res.json()) + .then((allRepos) => { + const forkedRepos = allRepos.filter( + (repo) => repo.fork && repo.name.startsWith("project-") + ); + forkedRepos.forEach((repo) => { + allProjects.innerHTML += ` - ` - commits(repo.commits_url, repo.name) + `; + commits(repo.commits_url, repo.name); + }); + getPullRequest(forkedRepos); + drawChart(forkedRepos.length); }); - getPullRequest(forkedRepos); - drawChart(forkedRepos.length); - }); -} +}; const getPullRequest = (forkedRepos) => { forkedRepos.forEach((repo) => { - - const PULL_URL = `https://api.github.com/repos/Technigo/${repo.name}/pulls?per_page=100` - + const PULL_URL = `https://api.github.com/repos/Technigo/${repo.name}/pulls?per_page=100`; + fetch(PULL_URL) .then((res) => res.json()) .then((pullReqs) => { - let groupProject = true + let groupProject = true; pullReqs.forEach((pull) => { if (pull.user.login === username) { - groupProject = false + groupProject = false; document.getElementById(`pull-${repo.name}`).innerHTML = ` Go to pull request - ` + `; } }); if (groupProject === true) { document.getElementById(`pull-${repo.name}`).innerHTML = `

No pull request, group project

- ` + `; } }); }); }; -/*const comments = (pullReq) => { - fetch(pullReq.review_comments_url) - .then((res) => res.json()) - .then((commentrev) => { - console.log(commentrev); - }); -};*/ - const commits = (myCommits, repoName) => { - let commitUrl = myCommits.replace('{/sha}','') + let commitUrl = myCommits.replace("{/sha}", ""); fetch(commitUrl) .then((res) => res.json()) .then((commitNumber) => { - document.getElementById(`commit-${repoName}`).innerHTML += commitNumber.length; - }) + document.getElementById(`commit-${repoName}`).innerHTML += + commitNumber.length; + }); }; userProfile(); diff --git a/code/style.css b/code/style.css index 5e453959..58170037 100644 --- a/code/style.css +++ b/code/style.css @@ -1,3 +1,137 @@ body { - background: #d5cac4; -} \ No newline at end of file + margin: 0; + background: #e3ded9; + box-sizing: border-box; +} + +h1 { + text-align: center; + font-size: 3em; +} + +.flex { + display: flex; + flex-direction: column; +} + +.profile { + display: flex; + align-content: space-between; + flex-direction: column; + text-align: center; + margin: 3rem; +} + +.chart { + margin: 1rem; +} + +.profile h3 { + font-size: 2rem; +} + +.profile img { + border-radius: 50%; + max-height: 30rem; + max-height: 30rem; +} + +.projects { + display: flex; + flex-wrap: wrap; + flex-direction: column; +} + +.projects div { + flex-direction: column; + flex-wrap: wrap; + border: 0.2rem solid black; + text-align: center; + margin: 1rem; + border-radius: 1rem; + background-color: #8aa4ab; + color: #e3ded9; +} + +.projects div:hover { + background-color: #416270; +} + +footer { + text-align: center; + margin: 2rem; + font-size: 1em; +} + +@media screen and (min-width: 678px) and (max-width: 1024px) { + .body h1 { + font-size: 6em; + } + + .flex { + background-color: #416270; + display: flex; + flex-direction: column; + align-content: space-around; + } + + .profile { + display: flex; + align-items: center; + color: #e3ded9; + margin: 1rem; + } + + .profile h3 { + font-size: 2.5rem; + } + + .chart { + margin: 10rem; + } + + .projects { + display: flex; + flex-direction: row; + flex-wrap: wrap; + justify-content: space-around; + } + + .projects div { + padding: 2rem; + } +} + +@media screen and (min-width: 1025px) { + .flex { + background-color: #416270; + display: flex; + flex-direction: row; + justify-content: space-around; + align-items: center; + } + + .profile { + display: flex; + padding: 3rem; + text-align: center; + font-size: 1.5em; + color: #e3ded9; + } + + .profile h3 { + font-size: 3rem; + } + + .projects { + display: flex; + flex-direction: row; + flex-wrap: wrap; + justify-content: space-around; + } + + .projects div { + padding: 1.5rem; + font-size: 1.6rem; + } +} From 51a91158035ff32e38e47bd72829759be6497e72 Mon Sep 17 00:00:00 2001 From: TereseClaesson Date: Sun, 27 Feb 2022 22:12:55 +0100 Subject: [PATCH 8/8] Added this weeks netlify --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a5bb0972..447c913d 100644 --- a/README.md +++ b/README.md @@ -8,4 +8,4 @@ I started this weeks projects as usuals, looking through all information and rea ## View it live - +https://tracker-bootcamp2022.netlify.app/