From 66e60b233dc61547ee5d5e78fcc1ba620d14943e Mon Sep 17 00:00:00 2001 From: martind2000 Date: Tue, 1 Mar 2016 00:43:34 +0000 Subject: [PATCH] added clock --- app/css/clock.css | 143 ++++++++++++++++++++++++++++++++-------------- app/js/clock.js | 28 +++++---- 2 files changed, 118 insertions(+), 53 deletions(-) diff --git a/app/css/clock.css b/app/css/clock.css index 5237117..2e3dd4d 100644 --- a/app/css/clock.css +++ b/app/css/clock.css @@ -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; } \ No newline at end of file diff --git a/app/js/clock.js b/app/js/clock.js index 4989fb4..1202a23 100644 --- a/app/js/clock.js +++ b/app/js/clock.js @@ -45,15 +45,14 @@ $('#wTtext').empty().html(storedData.data.weather.today); // $('#wDaily').empty(); - for( var t=0; t'; + 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(); })();