-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
76 lines (68 loc) · 3.28 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<!DOCTYPE html>
<html >
<head>
<meta charset="UTF-8">
<title>Simple Weather Widget</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel='stylesheet prefetch' href='https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css'>
<link rel='stylesheet prefetch' href='https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.2.3/animate.min.css'>
<link rel='stylesheet prefetch' href='https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css'>
<link rel="stylesheet" href="css/style.css">
<script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script>
<script src='https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js'></script>
</head>
</body>
<div class="heading-box">
<h1>Simple <span style="color:#FF5900">Weather</span> Widget</h1>
<small><a href="https://s.codepen.io/ALF3run/full/MKXvxv" target="_blank">by ALF</a></small>
</div>
<div class="container-fluid text-center">
<div class="row">
<div class="col-sm-4 col-sm-offset-4 ">
<!-- Here start the widget. This part of code can work alone with the javascript code -->
<div id="widget" class="panel panel-primary">
<div class="panel-heading">
<!-- the action="javascript:void(0);" prevent the form from reload the page everytime it's submitted -->
<form id="search" class="form-inline" role="form" action="javascript:void(0);">
<div class="form-group">
<label class="sr-only" for="city">Search a city</label>
<div class="input-group">
<input type="text" id="city" class="form-control input-sm" placeholder="City, country" autocomplete></input>
<span class="input-group-btn">
<button class="btn btn-default btn-sm"><i class="glyphicon glyphicon-search"></i></button>
</span>
</div>
</div>
</form>
</div>
<div class="panel-body">
<div class="row">
<div class="col-xs-7">
<h5>Today</h5>
<div id="icon"></div>
<p id="weather"></p>
</div>
<div class="col-xs-5">
<div>
<p>Temperature:</p>
<p><span id="temp"></span> <span id="unit">°C</span></p>
</div>
<div>
<p>Humidity:</p>
<p><span id="hum"></span> %</p>
</div>
</div>
</div>
</div>
<div class="panel-footer">
<a href="https://openweathermap.org/"><small>powered by OpenWeatherMap</small></a>
</div>
</div>
<!-- End of the widget -->
</div>
</div>
</div>
<!-- my script -->
<script src="js/index.js"></script>
</body>
</html>