diff --git a/public/js/mirror.js b/public/js/mirror.js index 2d1b8d4..f525187 100755 --- a/public/js/mirror.js +++ b/public/js/mirror.js @@ -1,7 +1,7 @@ ;(function() { 'use strict'; - var time, date, day, fcast, temp, weatherDesc, loc, weathericon; + var time, date, day, fcast, temp, weatherDesc, loc, reminder, weathericon; var MIRROR_STATES = { BLANK: 'blank', // Basic state. No face detected in screen. No one logged in. @@ -39,6 +39,9 @@ var desc = current.conditions(); var city = current.city(); var icon = Weather.Utils.getIcon(current.icon()); + var rem = current.reminder(); + + reminder.html(rem); temp.html(Weather.kelvinToFahrenheit(current.temperature()).toFixed(0) + '\xB0'); weatherDesc.html(desc); @@ -99,6 +102,7 @@ temp = $('.temperature'); weatherDesc = $('.conditions span'); loc = $('.weather-location'); + reminder = $('.weather-reminder'); weathericon = $('#weather-icon'); updateTime(); updateWeather(); diff --git a/public/js/weather.js b/public/js/weather.js index 95bdd05..f1c8492 100755 --- a/public/js/weather.js +++ b/public/js/weather.js @@ -219,6 +219,20 @@ Weather.Current = function(data) { this.data = data; }; +Weather.Current.prototype.reminder = function() { + var conditionID = this.data.weather[0].id; + var firstDigit = conditionID.toString()[0]; + var reminder; + var sunny = "Don't worry, it's gonna be a sunny day!" + var rain = "Don't forget to bring an umbrella!"; + if (firstDigit != '8') { + reminder = rain; + } else { + reminder = sunny; + } + return reminder; +} + Weather.Current.prototype.temperature = function() { return this.data.main.temp; }; diff --git a/views/layouts/main.html b/views/layouts/main.html index a9f18d7..d56117f 100755 --- a/views/layouts/main.html +++ b/views/layouts/main.html @@ -23,4 +23,4 @@ {{/if}} - \ No newline at end of file + diff --git a/views/partials/weather.html b/views/partials/weather.html index 9cb3506..e1df5bb 100644 --- a/views/partials/weather.html +++ b/views/partials/weather.html @@ -5,4 +5,5 @@
+