-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
160 lines (160 loc) · 6.72 KB
/
index.php
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
<?php
extract($_GET);
require_once('config.php');
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1.0, maximum-scale=1.0" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<link href="images/favicon-152.png" media="(device-width: 320px) and (-webkit-device-pixel-ratio: 2)" rel="apple-touch-startup-image" />
<link rel="apple-touch-icon" href="images/favicon-152.png" />
<title>Weather Forecast</title>
<link href="css/WeatherStationNew.css" rel="stylesheet" />
<?php If ($v) { ?><link href="css/light.css" rel="stylesheet" /><?php } ?>
<link href="css/WeatherStationMedia.css" rel="stylesheet" />
<link rel="icon" sizes="32x32" href="images/favicon-152.png" />
</head>
<body>
<div id="weatherwrap">
<div id="graphs">
<div class="row">
<div id="ForecastIO"><div id="loading"><canvas id="icon-loading" width="150" height="150"></canvas><br /><br />Loading...</div></div>
</div>
<div class="row span12">
<div class="title">Precip & Cloud Cover</div>
<div id="chart-rain" class="widget"></div>
</div>
<div class="row span12">
<div class="title">Temps</div>
<div id="chart-temp" class="widget"></div>
</div>
<div class="row span12">
<div class="title">Winds</div>
<div id="chart-wind" class="widget"></div>
</div>
<div class="row span12">
<div class="title">Pressure</div>
<div id="chart-pressure" class="widget"></div>
</div>
</div>
<div id="gauges">
<div class="padtop"></div>
<div class="row span5">
<div class="title"> </div>
<div id="pie-riseset" class="gauge"></div>
</div>
<div class="row span5">
<div class="map gauge">
<div id="map-rain"></div>
</div>
</div>
<div class="row span5">
<div class="title"> </div>
<div id="pie-temperature" class="gauge"></div>
</div>
<div class="row span5">
<div class="map gauge">
<div id="map-lightning"></div>
</div>
</div>
<div class="row span5">
<div class="title"> </div>
<div id="pie-pressure" class="gauge"></div>
</div>
</div>
<div class="row clear">
<div id="footer"><a href="https://darksky.net/poweredby/">Powered by Dark Sky</a> | <span id="dateW"></span> | Switch to: <a href="/<?php if ($v) { ?>">Dark<?php }else{ ?>?v=l">Light<?php } ?> Theme</a></div>
</div>
</div>
<div id="ecobeewrap">
<h1 class="Owhite">Weather</h1>
<hr />
<div class="datawrap">
<div id="currArea" class="Owhite"><span id="loading2">Loading...</span></div>
<div class="Ogray"><a id="dm" href="#"><</a> <span id="dateE"></span> <a id="dp" href="#">></a></div>
<canvas id="icon-image" class="left" width="260" height="260"></canvas>
<div id="current-temp" class="left Owhite"></div>
<div id="current-conditions" class="clear Owhite"></div>
<div class="left Ogray">
POP <span id="current-precip"></span>%
HUM. <span id="current-humid"></span>%
</div>
<div class="right Ogray">
<span id="current-high"></span>
<span id="current-low"></span>
</div>
<div class="clear"></div>
</div>
<hr />
<div class="datawrap Ogray">
<div class="fcast left">Morning</div><canvas id="icon-morning" class="left" width="22" height="22"></canvas><div id="temp-morning" class="Owhite tcast right"></div>
<div class="clear fcast left">Midday</div><canvas id="icon-midday" class="left" width="22" height="22"></canvas><div id="temp-midday" class="Owhite tcast right"></div>
<div class="clear fcast left">Afternoon</div><canvas id="icon-afternoon" class="left" width="22" height="22"></canvas><div id="temp-afternoon" class="Owhite tcast right"></div>
<div class="clear fcast left">Evening</div><canvas id="icon-evening" class="left" width="22" height="22"></canvas><div id="temp-evening" class="Owhite tcast right"></div>
<div class="clear fcast left">Overnight</div><canvas id="icon-overnight" class="left" width="22" height="22"></canvas><div id="temp-overnight" class="Owhite tcast right"></div>
</div>
<div id="footer2" class="clear Ogray"><br />Powered by: <a href="https://darksky.net/poweredby/">Powered by Dark Sky</a> | Inspired by <a href="http://ecobee.com">ecobee<sub>3</sub></a></div>
</div>
</body>
<!-- script type="text/javascript" src="js/jquery-2.1.1.min.js"></script -->
<script src="https://code.jquery.com/jquery-3.1.1.min.js" integrity="sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8=" crossorigin="anonymous"></script>
<script type="text/javascript" src="js/highcharts.js"></script>
<script type="text/javascript" src="js/highcharts-more.js"></script>
<script type="text/javascript" src="js/solid-gauge.src.js"></script>
<script type="text/javascript" src="js/skycons.js"></script>
<script type="text/javascript" src="js/WeatherStationNew.js"></script>
<script>
//** Default variables ********************************************
var timeColor = '#<?php echo $timeColor; ?>';
var color = '<?php echo $color; ?>';
var IOcolor = '<?php echo $IOcolor; ?>';
var Lat = '<?php echo $Lat; ?>';
var Lng = '<?php echo $Lng; ?>';
var WUarea = '<?php echo $WUarea; ?>';
var v = '<?php echo $v; ?>';
var oset = 0;
var apikey = '<?php echo $apikey; ?>';
//** Loading Skycon ********************************************
var skyconsL = new Skycons({"color": "#" + color});
skyconsL.add("icon-loading", "clear-day");
skyconsL.play();
//** Weather theme for Highcharts JS ********************************************
Highcharts.theme={chart:{backgroundColor:'#<?php echo $bgcolor; ?>'},title:{style:{color:"#"+IOcolor,fontFamily:"Helvetica"}},xAxis:{gridLineWidth:1,lineColor:"#"+color,tickColor:"#"+color,labels:{style:{color:"#"+color}}},yAxis:{gridLineColor:"#"+color,labels:{style:{color:"#"+color}}},plotOptions:{area:{marker:{enabled:false}},series:{lineWidth:1}},labels:{style:{color:"#"+color}}}
var highchartsOptions = Highcharts.setOptions(Highcharts.theme);
$(document).ready(function () {
//** Load the Data ********************************************
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(success, error);
var refreshIntervalId = setInterval(function(){
navigator.geolocation.getCurrentPosition(success, error);
}, 600000);
} else {
error();
}
$("#dp").click(function() {
if(oset < 6) {
oset++;
$("#dm").show();
renderData(hourlyspan, forecastdata, current, dailyspan);
if(oset == 6) {
$("#dp").hide();
}
}
return false;
});
$("#dm").click(function() {
if(oset > -1) {
oset--;
$("#dp").show();
renderData(hourlyspan, forecastdata, current, dailyspan);
if(oset == 0) {
$("#dm").hide();
}
}
return false;
});
});
</script>
</html>