From 8d7eee27578e8bd3179c454bd1ed23c8a766702a Mon Sep 17 00:00:00 2001 From: Michael Teeuw Date: Mon, 21 Apr 2014 17:03:03 +0200 Subject: [PATCH] Remove translatebar notification. Hide compliemtns when dishwasher shows notification. --- index.php | 1 + js/main.js | 11 ++++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/index.php b/index.php index 250dcf61..ca749130 100644 --- a/index.php +++ b/index.php @@ -8,6 +8,7 @@ + diff --git a/js/main.js b/js/main.js index bbcbf855..fab9174b 100644 --- a/js/main.js +++ b/js/main.js @@ -50,9 +50,11 @@ jQuery(document).ready(function($) { var socket = io.connect('http://rpi-development.local:8080'); socket.on('dishwasher', function (dishwasherReady) { if (dishwasherReady) { - $('.dishwasher').fadeIn(); + $('.dishwasher').fadeIn(2000); + $('.lower-third').fadeOut(2000); } else { - $('.dishwasher').fadeOut(); + $('.dishwasher').fadeOut(2000); + $('.lower-third').fadeIn(2000); } }); @@ -180,6 +182,7 @@ jQuery(document).ready(function($) { (function updateCompliment() { + var compliments = [ 'Hey, handsome!', 'Hi, sexy!', @@ -194,13 +197,15 @@ jQuery(document).ready(function($) { while (compliment == lastCompliment) { compliment = Math.floor(Math.random()*compliments.length); } + $('.compliment').updateWithText(compliments[compliment], 4000); lastCompliment = compliment; setTimeout(function() { - updateCompliment(); + updateCompliment(true); }, 30000); + })(); (function updateCurrentWeather()