-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
259 lines (207 loc) · 11.3 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
<!DOCTYPE html>
<html>
<head>
<title></title>
<link rel="stylesheet" href="css/vendors/bootstrap.css"/>
<link rel="stylesheet" href="css/vendors/bootstrap-theme.css"/>
<link rel="stylesheet" href="css/vendors/screen.css"/>
<link rel="stylesheet" href="css/main.css"/>
<style>
.pad-bot30{
padding-bottom: 30px;
}
.pad-left40{
padding-left: 40px;
}
</style>
<script src = "js/utility/countryCode.js"></script>
<script src = "js/utility/TemperatureConverters.js"></script>
<script src = "js/Astronomy.js"></script>
<script src ="js/Location.js"></script>
<script src="js/Temperature.js"></script>
<script src="js/Weather.js"></script>
<script src="js/Wind.js"></script>
<script src="js/utility/weatherDataFiller.js"></script>
<script src="js/weatherRequest.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="js/main.js"></script>
<script src="js/utility/helper.js"></script>
<script> function test(){
console.log($);
$.ajax({
type: 'GET',
url: 'http://weather.yahooapis.com/forecastrss?w=2211096',
dataType: "text xml",
crossDomain: true,
success: function (msg) {
alert("success");
},
error: function (request, status, error) {
// alert(request);
}
});
}
</script>
</head>
<body onload="test()" id="body" class="alert alert-info berry">
<div id="viewport">
<div class="flip row">
<div class="card">
<div class="face front">
<div class="navbar-fixed-top">
<span class="glyphicon glyphicon-search pull-left"></span>
<div id="timeStamp" class="pull-right">
</div>
</div>
</div>
<div class="face back">
<div class="navbar-fixed-top">
<span class="glyphicon glyphicon-search pull-left"></span>
<input id="searchInput" type="text" class="form-control pull-right"/>
</div>
</div>
</div>
</div>
<div class="container">
<div class="row responsiveCenter">
<div class="col-xs-12 ">
<div id="forecastIcon">
</div>
<div class="clearfix"></div>
<div class="mainContent">
<h1 id="region"></h1>
<div><h2 id="temp"></h2></div>
<!--<div class="row pad-bot30">
<div class="pad-left40">
<div class="col-xs-6 col-sm-4 col-md-3 "><span class="glyphicon glyphicon-arrow-down">31 </span> <span class="glyphicon glyphicon-arrow-up">39</span></div>
</div>
</div>-->
</div>
<!--<div class="row">
<div>
<div class="col-xs-6 col-sm-4 col-md-3">Humidity</div><div class="col-xs-6 col-sm-8 col-md-9 text-left"><b>57 °</b></div>
<div class="col-xs-6 col-sm-4 col-md-3">Dew</div><div class="col-xs-6 col-sm-8 col-md-9 text-left"><b>7°</b></div>
<div class="col-xs-6 col-sm-4 col-md-3">Wind Speed</div><div class="col-xs-6 col-sm-8 col-md-9 text-left"><b>57</b></div>
</div>
</div>-->
<div class="navbar-fixed-bottom text-center col-xs-12">
<div class="col-xs-4">
<div class="col-xs-12 bottomControls">
<svg class="socialIcon" version="1.1" id="Icons" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
width="100px" height="100px" viewBox="0 0 100 100" style="enable-background:new 0 0 100 100;" xml:space="preserve">
<path id="Facebook" d="M38.078,22.431c0,2.268,0,12.391,0,12.391H29v15.152h9.078V95h18.649V49.975h12.513
c0,0,1.172-7.265,1.74-15.209c-1.629,0-14.183,0-14.183,0s0-8.815,0-10.36c0-1.548,2.033-3.631,4.043-3.631c2.006,0,6.239,0,10.16,0
c0-2.063,0-9.191,0-15.774c-5.235,0-11.189,0-13.814,0C37.617,5,38.078,20.167,38.078,22.431z"/>
</svg>
<br/>
<span class="visible-xs">Facebook</span>
</div>
</div>
<div class="col-xs-4">
<div class="col-xs-12 bottomControls">
<svg class="socialIcon" version="1.1" id="Icons" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
width="100px" height="100px" viewBox="0 0 100 100" style="enable-background:new 0 0 100 100;" xml:space="preserve">
<path id="Twitter__x28_alt_x29_" d="M84.803,46.564c5.055-0.417,8.483-2.715,9.803-5.833c-1.824,1.12-7.484,2.341-10.61,1.178
c-0.153-0.734-0.324-1.432-0.492-2.062c-2.382-8.746-10.537-15.792-19.082-14.941c0.691-0.279,1.392-0.539,2.092-0.772
c0.94-0.337,6.459-1.235,5.59-3.183c-0.733-1.713-7.475,1.295-8.744,1.688c1.675-0.63,4.447-1.714,4.743-3.64
c-2.567,0.352-5.087,1.566-7.034,3.331c0.703-0.757,1.236-1.679,1.349-2.672C55.57,24.033,51.57,32.853,48.333,41.408
c-2.542-2.463-4.795-4.403-6.816-5.48c-5.67-3.041-12.449-6.213-23.091-10.164c-0.327,3.521,1.741,8.203,7.7,11.316
c-1.291-0.173-3.652,0.213-5.54,0.665c0.769,4.034,3.28,7.357,10.079,8.964c-3.107,0.205-4.713,0.912-6.168,2.436
c1.415,2.805,4.868,6.107,11.08,5.429c-6.906,2.977-2.816,8.49,2.804,7.667C28.794,72.143,13.679,71.416,5,63.134
c22.661,30.879,71.921,18.262,79.262-11.481c5.499,0.047,8.733-1.905,10.738-4.057C91.831,48.134,87.239,47.578,84.803,46.564z"/>
</svg>
<br/>
<span class="visible-xs">Twitter</span>
</div>
</div>
<div class="col-xs-4">
<div class="col-xs-12 bottomControls" id="menuButton" onclick="this.previousElementSibling.click()">
<svg class="socialIcon" version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
width="512px" height="512px" viewBox="0 0 512 512" enable-background="new 0 0 512 512" xml:space="preserve">
<path d="M462,280.72v-49.44l-46.414-16.48c-3.903-15.098-9.922-29.343-17.675-42.447l0.063-0.064l21.168-44.473l-34.96-34.96
l-44.471,21.167l-0.064,0.064c-13.104-7.753-27.352-13.772-42.447-17.673L280.72,50h-49.44L214.8,96.415
c-15.096,3.9-29.343,9.919-42.447,17.675l-0.064-0.066l-44.473-21.167l-34.96,34.96l21.167,44.473l0.066,0.064
c-7.755,13.104-13.774,27.352-17.675,42.447L50,231.28v49.44l46.415,16.48c3.9,15.096,9.921,29.343,17.675,42.447l-0.066,0.064
l-21.167,44.471l34.96,34.96l44.473-21.168l0.064-0.063c13.104,7.753,27.352,13.771,42.447,17.675L231.28,462h49.44l16.48-46.414
c15.096-3.903,29.343-9.922,42.447-17.675l0.064,0.063l44.471,21.168l34.96-34.96l-21.168-44.471l-0.063-0.064
c7.753-13.104,13.771-27.352,17.675-42.447L462,280.72z M256,338.4c-45.509,0-82.4-36.892-82.4-82.4c0-45.509,36.891-82.4,82.4-82.4
c45.509,0,82.4,36.891,82.4,82.4C338.4,301.509,301.509,338.4,256,338.4z"/>
</svg>
<br/>
<span class="visible-xs">Menu</span>
</div>
<div id="shatter" class="navbar-fixed-top">
<div class="col-xs-12 themesTitle">
<h3 style="color: #ffffff">Flavour</h3>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div id="world" >
</div>
</div>
<script>
weatherRequest(function(){
var weather = dataSet.weather.getAttribute();
var location = dataSet.location.getAttributes();
var temperature = dataSet.temperature.getAttributes();
callAjax('svgs/weather/'+weather.icon+'.svg', function(data){
document.getElementById('forecastIcon').innerHTML = data;
document.getElementById('forecastIcon').className += 'animated fadeInUp';
});
document.getElementById("timeStamp").innerHTML = getTimeStamp();
setInterval(function(){
document.getElementById("timeStamp").innerHTML = getTimeStamp();
}, 60000);
setTimeout(function(){
document.getElementById("region").innerHTML = location.region;
document.getElementById("region").className += 'animated fadeInUp';
}, 500);
if(location.region.length > 10){
document.getElementById("region").style.fontSize = "30px"
}else if(location.region.length > 15){
document.getElementById("region").style.fontSize = "25px"
}
setTimeout(function(){
document.getElementById("temp").innerHTML = parseInt(temperature.temperatureC)+"°C";
document.getElementById("temp").className += 'animated fadeInUp';
}, 1000)
});
document.getElementById("menuButton").addEventListener("click", function(){
document.body.className = document.body.className+" shatter";
});
var themes = ["avocado", "nectarine", "noni", "jamun", "raisin", "berry", "strawberry", "Cherymoya"];
shatterThemes();
function shatterThemes() {
themes.forEach(function(val, key, arr){
var themeSnippet = '<div class="col-xs-4">'
+ '<div class="col-xs-12 themes">'
+ '<img class="img-responsive img-thumbnail" src="img/themesImages/'+val+'.png">'
+ '<span class="visible-xs">'+val+'</span>'
+ '</div>'
+ '</div>';
document.getElementById("shatter").innerHTML += themeSnippet;
});
[].forEach.call(document.getElementsByClassName("themes"), function(element, key){
element.addEventListener("click", function(){
document.body.className = "alert alert-info "+this.innerText;
document.body.className.replace("shatter" ,"");
})
})
}
</script>
<script src="js/flip.js"></script>
<!--start links-->
<!--http://codepen.io/fixcl/pen/eBlus-->
<!--http://tympanus.net/Tutorials/AppShowcase/-->
<!--http://tympanus.net/Tutorials/ExpandingOverlayEffect/-->
<!--weather icon codes-->
<!--http://bugs.openweathermap.org/projects/api/wiki/Weather_Condition_Codes-->
<!--city list-->
<!--http://openweathermap.org/help/city_list.txt-->
<!--end links-->
</body>
</html>