From 4b268f957902b676d210fed340c329cda0a8c89e Mon Sep 17 00:00:00 2001 From: John McLear Date: Wed, 20 Jul 2011 21:50:58 +0100 Subject: [PATCH] Make a pulsating chat notification and remove the throb from the tab --- static/css/pad_lite.css | 18 ++++++++++++++++++ static/js/chat.js | 8 ++++---- static/js/jquery-ui.js | 14 ++++++++++++++ static/pad.html | 4 ++++ 4 files changed, 40 insertions(+), 4 deletions(-) diff --git a/static/css/pad_lite.css b/static/css/pad_lite.css index 2fd9a9b6..66480fd4 100644 --- a/static/css/pad_lite.css +++ b/static/css/pad_lite.css @@ -1022,3 +1022,21 @@ position: relative; height:50px; } +#chatthrob{ +display:none; +position:absolute; +bottom:40px; +font-size:14px; +width:150px; +height:40px; +right: 20px; +z-index: 200; +background-color: #000; +color: white; +background-color: rgb(0,0,0); +background-color: rgba(0,0,0,0.7); +padding: 10px; +-moz-border-radius: 6px; +border-radius: 6px; +opacity:.8; +} diff --git a/static/js/chat.js b/static/js/chat.js index 431be4f2..3cd7e01b 100644 --- a/static/js/chat.js +++ b/static/js/chat.js @@ -69,13 +69,13 @@ var chat = (function() var count = Number($("#chatcounter").text()); count++; $("#chatcounter").text(count); - - //animation - $("#chatcounter").css({"font-weight": "bold"}); - setTimeout('$("#chatcounter").css({"font-weight": "normal"})', 500); + // chat throb stuff -- Just make it throb in for ~2 secs then fadeotu + $('#chatthrob').html(""+authorName+"" + ": " + text); + $('#chatthrob').effect("pulsate", {times:1,mode:"hide"},2000); } self.scrollDown(); + }, init: function() { diff --git a/static/js/jquery-ui.js b/static/js/jquery-ui.js index a640b895..026ffdbe 100644 --- a/static/js/jquery-ui.js +++ b/static/js/jquery-ui.js @@ -126,6 +126,20 @@ e/2)<1)return d/2*Math.pow(2,10*(a-1))+b;return d/2*(-Math.pow(2,-10*--a)+2)+b}, h);return-(h*Math.pow(2,10*(a-=1))*Math.sin((a*e-c)*2*Math.PI/g))+b},easeOutElastic:function(c,a,b,d,e){c=1.70158;var g=0,h=d;if(a==0)return b;if((a/=e)==1)return b+d;g||(g=e*0.3);if(h +
+ +
+