Make a pulsating chat notification and remove the throb from the tab
parent
fba2c5ccb2
commit
4b268f9579
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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("<b>"+authorName+"</b>" + ": " + text);
|
||||
$('#chatthrob').effect("pulsate", {times:1,mode:"hide"},2000);
|
||||
}
|
||||
|
||||
self.scrollDown();
|
||||
|
||||
},
|
||||
init: function()
|
||||
{
|
||||
|
|
|
@ -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<Math.abs(d)){h=d;c=g/4}else c=g/(2*Math.PI)*Math.asin(d/h);return h*Math.pow(2,-10*a)*Math.sin((a*e-c)*2*Math.PI/g)+d+b},easeInOutElastic:function(c,a,b,d,e){c=1.70158;var g=0,h=d;if(a==0)return b;if((a/=e/2)==2)return b+d;g||(g=e*0.3*1.5);if(h<Math.abs(d)){h=d;c=g/4}else c=g/(2*Math.PI)*Math.asin(d/h);if(a<1)return-0.5*
|
||||
h*Math.pow(2,10*(a-=1))*Math.sin((a*e-c)*2*Math.PI/g)+b;return h*Math.pow(2,-10*(a-=1))*Math.sin((a*e-c)*2*Math.PI/g)*0.5+d+b},easeInBack:function(c,a,b,d,e,g){if(g==j)g=1.70158;return d*(a/=e)*a*((g+1)*a-g)+b},easeOutBack:function(c,a,b,d,e,g){if(g==j)g=1.70158;return d*((a=a/e-1)*a*((g+1)*a+g)+1)+b},easeInOutBack:function(c,a,b,d,e,g){if(g==j)g=1.70158;if((a/=e/2)<1)return d/2*a*a*(((g*=1.525)+1)*a-g)+b;return d/2*((a-=2)*a*(((g*=1.525)+1)*a+g)+2)+b},easeInBounce:function(c,a,b,d,e){return d-f.easing.easeOutBounce(c,
|
||||
e-a,0,d,e)+b},easeOutBounce:function(c,a,b,d,e){return(a/=e)<1/2.75?d*7.5625*a*a+b:a<2/2.75?d*(7.5625*(a-=1.5/2.75)*a+0.75)+b:a<2.5/2.75?d*(7.5625*(a-=2.25/2.75)*a+0.9375)+b:d*(7.5625*(a-=2.625/2.75)*a+0.984375)+b},easeInOutBounce:function(c,a,b,d,e){if(a<e/2)return f.easing.easeInBounce(c,a*2,0,d,e)*0.5+b;return f.easing.easeOutBounce(c,a*2-e,0,d,e)*0.5+d*0.5+b}})}(jQuery);
|
||||
;/*
|
||||
* jQuery UI Effects Pulsate 1.8.14
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* http://docs.jquery.com/UI/Effects/Pulsate
|
||||
*
|
||||
* Depends:
|
||||
* jquery.effects.core.js
|
||||
*/
|
||||
(function(d){d.effects.pulsate=function(a){return this.queue(function(){var b=d(this),c=d.effects.setMode(b,a.options.mode||"show");times=(a.options.times||5)*2-1;duration=a.duration?a.duration/2:d.fx.speeds._default/2;isVisible=b.is(":visible");animateTo=0;if(!isVisible){b.css("opacity",0).show();animateTo=1}if(c=="hide"&&isVisible||c=="show"&&!isVisible)times--;for(c=0;c<times;c++){b.animate({opacity:animateTo},duration,a.options.easing);animateTo=(animateTo+1)%2}b.animate({opacity:animateTo},duration,
|
||||
a.options.easing,function(){animateTo==0&&b.hide();a.callback&&a.callback.apply(this,arguments)});b.queue("fx",function(){b.dequeue()}).dequeue()})}})(jQuery);
|
||||
;/*
|
||||
* jQuery UI Effects Slide 1.8.14
|
||||
*
|
||||
|
|
|
@ -255,6 +255,10 @@ Use this link to share a read-only version of your pad:<input id="readonlyInput"
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div id="chatthrob">
|
||||
|
||||
</div>
|
||||
|
||||
<div id="chaticon">
|
||||
<a onClick="chat.show();return false;"
|
||||
title="Open the chat for this pad">
|
||||
|
|
Loading…
Reference in New Issue