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 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..e69c480 100644 --- a/script.js +++ b/script.js @@ -1 +1,39 @@ -// 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}

+ +
+ + + `; + } + let count = document.querySelector('h1'); + count.innerHTML += ` ${data.length}`; + setColor(); + }); + }); +}); +function setColor(){ + let elements = document.querySelectorAll('li'); + for(let a=0;a