From 29cf2eb5171e7532d8b99e1da6a7165e6d522a0d Mon Sep 17 00:00:00 2001 From: KCCoderGirl Date: Tue, 8 Feb 2022 14:36:45 -0600 Subject: [PATCH 1/3] completed project --- index.html | 1 + script.js | 41 ++++++++++++++++++++++++++++++++++++++++- styles.css | 3 +++ 3 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 styles.css diff --git a/index.html b/index.html index c69204f..039000e 100644 --- a/index.html +++ b/index.html @@ -5,6 +5,7 @@ Astronauts + diff --git a/script.js b/script.js index 9417030..bf33148 100644 --- a/script.js +++ b/script.js @@ -1 +1,40 @@ -// TODO: add code here \ No newline at end of file +window.addEventListener('load',function(){ + let astronauts = fetch("https://handlers.education.launchcode.org/static/astronauts.json"); + astronauts.then(function(response){ + let data = response.json(); + data.then(function(data){ + let results = document.querySelector('#container'); + data.sort((a,b)=>b.hoursInSpace-a.hoursInSpace); + for(let a=0;a + +
+

${data[a].firstName} ${data[a].lastName}

+
    +
  • Hours in space: ${data[a].hoursInSpace}
  • +
  • Active: ${data[a].active}
  • +
  • Skills: ${data[a].skills}
  • +
+
+ + + `; + } + let count = document.querySelector('h1'); + count.innerHTML += ` ${data.length}`; + setColor(); + }); + }); +}); +function setColor(){ + let elements = document.querySelectorAll('li'); + for(let a=0;a Date: Tue, 8 Feb 2022 14:45:25 -0600 Subject: [PATCH 2/3] Set theme jekyll-theme-minimal --- _config.yml | 1 + 1 file changed, 1 insertion(+) create mode 100644 _config.yml diff --git a/_config.yml b/_config.yml new file mode 100644 index 0000000..2f7efbe --- /dev/null +++ b/_config.yml @@ -0,0 +1 @@ +theme: jekyll-theme-minimal \ No newline at end of file From 74b5c7ee40189d9efcd0dc35b8ce199f5e65b311 Mon Sep 17 00:00:00 2001 From: KCCoderGirl Date: Tue, 8 Feb 2022 15:01:22 -0600 Subject: [PATCH 3/3] removed extra space --- script.js | 1 - 1 file changed, 1 deletion(-) diff --git a/script.js b/script.js index bf33148..e69c480 100644 --- a/script.js +++ b/script.js @@ -8,7 +8,6 @@ window.addEventListener('load',function(){ for(let a=0;a -

${data[a].firstName} ${data[a].lastName}