Skip to content
Draft
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
Empty file added API_Projects/WeatherJS/app.js
Empty file.
74 changes: 74 additions & 0 deletions API_Projects/WeatherJS/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="https://bootswatch.com/4/cerulean/bootstrap.min.css">
<title>Weather JS</title>
</head>
<body>
<div class="container">
<div class="row">
<div class="col-md-6 mx-auto text-center bg-primary mt-5 p-5 rounded">
<h1 id="w-location"></h1>
<h3 class="text-dark" id="w-desc"></h3>
<h3 id="w-string"></h3>
<img id="w-icon">
<ul id="w-details" class="list-group mt-3">
<li class="list-group-item" id="w-humidity"></li>
<li class="list-group-item" id="w-dewpoint"></li>
<li class="list-group-item" id="w-feels-like"></li>
<li class="list-group-item" id="w-wind"></li>
</ul>
<hr>
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#locModal">
Change Location
</button>
</div>
</div>
</div>

<!-- Modal -->
<div class="modal fade" id="locModal" tabindex="-1" role="dialog" aria-labelledby="locModalLabel"
aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="locModalLabel">Choose Location</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<form id="w-form">
<div class="form-group">
<label for="city">City</label>
<input type="text" id="city" class="form-control">
</div>
<div class="form-group">
<label for="state">State</label>
<input type="text" id="state" class="form-control">
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<button id="w-change-btn" type="button" class="btn btn-primary">Save changes</button>
</div>
</div>
</div>
</div>

<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js"
integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js"
integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"
integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>

<script src="storage.js"></script>
<script src="weather.js"></script>
<script src="ui.js"></script>
<script src="app.js"></script>
</body>
</html>
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remember to enable in VSCode the addition of a new line at the end of the file.

Empty file.
Empty file added API_Projects/WeatherJS/ui.js
Empty file.
12 changes: 12 additions & 0 deletions API_Projects/WeatherJS/weather.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
class Weather {
constructor(city, state) {
this.apiKey = 'PTBU6Qvi3OpYi0NysIzHoromExQphhfl';
this.city = city;
this.state = state;
}

//Fetch weather from API
async getWeather() {
const response = await fetch(`https://data.climacell.co/v4/locations?apikey=API_KEY`);
}
}