added clock

This commit is contained in:
martind2000 2016-03-01 00:43:34 +00:00
parent 527dd8ce9c
commit 66e60b233d
2 changed files with 118 additions and 53 deletions

View File

@ -1,51 +1,110 @@
body {
font-family: 'Roboto Slab', "Helvetica Neue", Helvetica, Arial;
@media (min-width:800px) {
body {
font-family: 'Roboto Slab', "Helvetica Neue", Helvetica, Arial;
}
#clock {
font-family: 'Share Tech Mono';
position: absolute;
top: 0;
left: 0;
width: 800px;
height: 300px;
background-color: #212121;
font-size: 180px;
text-align: center;
vertical-align: middle;
color: #fff;
}
#clockDisplay {
margin-top: 50;
}
#weather {
position: absolute;
top: 300px;
left: 0;
width: 800px;
height: 150px;
background-color: #312121;
}
#misc {
position: absolute;
top: 450px;
left: 0;
width: 800px;
height: 150px;
background-color: #213121;
}
.weatherBit {
color: #fff;
font-size: 36px;
}
.wday {
color: #fff;
text-align: center;
text-transform: capitalize;
}
}
@media (min-width:1024px){
#clock{
font-family: 'Share Tech Mono' ;
position:absolute;
top:0;
left:0;
width:800px;
height:300px;
background-color: #212121;
font-size: 180px;
text-align: center;
vertical-align: middle;
color:#fff;
}
body {
font-family: 'Roboto Slab', "Helvetica Neue", Helvetica, Arial;
background-color: #212121;
color: #fff;
}
#clockDisplay {
margin-top:50;
}
#clock {
font-family: 'Share Tech Mono';
position: absolute;
top: 0;
left: 0;
width: 1024px;
height: 384px;
background-color: #212121;
font-size: 180px;
text-align: center;
vertical-align: middle;
color: #fff;
}
#weather{
position:absolute;
top:300px;
left:0;
width:800px;
height:150px;
background-color: #312121;
}
#clockDisplay {
margin-top: 50;
}
#misc{
position:absolute;
top:450px;
left:0;
width:800px;
height:150px;
background-color: #213121;
}
#weather {
position: absolute;
top: 384px;
left: 0;
width: 1024px;
height: 192px;
background-color: #312121;
}
#misc {
position: absolute;
top: 576px;
left: 0;
width: 1024px;
height: 192px;
background-color: #213121;
}
.weatherBit {
color: #fff;
font-size: 36px;
}
.wday {
color: #fff;
text-align: center;
text-transform: capitalize;
}
.weatherBit {
color:#fff;
font-size: 36px;
}
.wday {
color:#fff;
text-align: center;
text-transform: capitalize;
}

View File

@ -45,15 +45,14 @@
$('#wTtext').empty().html(storedData.data.weather.today);
// $('#wDaily').empty();
for( var t=0; t<storedData.data.weather.data.daily.data.length;t++)
{
var m = 'icon' + (t+1).toString();
var d = '#d' + (t+1).toString();
for (var t = 0; t < storedData.data.weather.data.daily.data.length; t++) {
var m = 'icon' + (t + 1).toString();
var d = '#d' + (t + 1).toString();
var ts = parseInt(storedData.data.weather.data.daily.data[t].time) * 1000;
var n = Date.create(ts).format('{weekday}');
// var m = '<td>' + storedData.data.weather.data.daily.data[t].icon + '</td>';
skycons.add(m, storedData.data.weather.data.daily.data[t].icon);
$(d).empty().html(n);
$(d).empty().html(n);
}
skycons.play();
@ -65,12 +64,12 @@
function switchWeather() {
weatherCount++;
weatherCount = weatherCount<4 ? weatherCount : 0;
weatherCount = weatherCount < 4 ? weatherCount : 0;
$('#wCurrent').toggle(weatherCount==0);
$('#wLater').toggle(weatherCount==1);
$('#wToday').toggle(weatherCount==2);
$('#wDaily').toggle(weatherCount==3);
$('#wCurrent').toggle(weatherCount == 0);
$('#wLater').toggle(weatherCount == 1);
$('#wToday').toggle(weatherCount == 2);
$('#wDaily').toggle(weatherCount == 3);
}
@ -98,7 +97,14 @@
}, 1000);
}
function refresh() {
setInterval(function () {
getData()
}, 900000);
}
startClock();
getData();
refresh();
})();