Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions fetch/chapter-examples/fetching-data/fetch-weather-part-1.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Launch Status</title>
<script>
window.addEventListener("load", function() {
fetch("https://handlers.education.launchcode.org/static/weather.json").then( function(response) {
console.log(response);
} );
});
</script>
</head>
<body>
<h1>Launch Status</h1>
Weather Conditions
<div id="weather-conditions">
<!-- TODO: dynamically add html about weather using data from API -->
</div>
</body>
</html>
24 changes: 24 additions & 0 deletions fetch/chapter-examples/fetching-data/fetch-weather-part-2.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Launch Status</title>
<script>
window.addEventListener("load", function() {
fetch("https://handlers.education.launchcode.org/static/weather.json").then( function(response) {
// Access the JSON in the response
response.json().then( function(json) {
console.log(json);
});
});
});
</script>
</head>
<body>
<h1>Launch Status</h1>
Weather Conditions
<div id="weather-conditions">
<!-- TODO: dynamically add html about weather using data from API -->
</div>
</body>
</html>
32 changes: 32 additions & 0 deletions fetch/chapter-examples/fetching-data/fetch-weather-part-3.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Launch Status</title>
<script>
window.addEventListener("load", function() {
fetch("https://handlers.education.launchcode.org/static/weather.json").then( function(response) {
// Access the JSON in the response
response.json().then( function(json) {
const div = document.getElementById('weather-conditions');
div.innerHTML = `
<ul>
<li>Temp ${json.temp}</li>
<li>Wind Speed ${json.windSpeed}</li>
<li>Status ${json.status}</li>
<li>Chance of Precip ${json.chanceOfPrecipitation}</li>
</ul>
`;
});
});
});
</script>
</head>
<body>
<h1>Launch Status</h1>
Weather Conditions
<div id="weather-conditions">
<!-- TODO: dynamically add html about weather using data from API -->
</div>
</body>
</html>
16 changes: 16 additions & 0 deletions fetch/studio/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Astronauts</title>
<link href="style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<script src="script.js"></script>
<h1>Astronauts</h1>
<div id="container">
<!-- List of astronauts will be added here dynamically -->
</div>
</body>
</html>
1 change: 1 addition & 0 deletions fetch/studio/script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
//TODO: Add Your Code Below
16 changes: 16 additions & 0 deletions fetch/studio/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
.avatar {
border-radius: 50%;
height: 100px;
float:right;
}

.astronaut {
border: 1px solid black;
display: flex;
justify-content: space-between;
width: 500px;
align-items: center;
padding: 5px;
margin-bottom: 20px;
border-radius: 6px;
}