improved message fadeout behaviour
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,5 +1,6 @@
|
|||||||
/Debug/
|
/Debug/
|
||||||
*.pyc
|
*.pyc
|
||||||
|
*.log
|
||||||
/bin/
|
/bin/
|
||||||
/target/
|
/target/
|
||||||
/default.*
|
/default.*
|
||||||
|
|||||||
@@ -110,7 +110,6 @@ svg circle{
|
|||||||
}
|
}
|
||||||
|
|
||||||
#messages{
|
#messages{
|
||||||
display: none;
|
|
||||||
position: fixed;
|
position: fixed;
|
||||||
bottom: 5px;
|
bottom: 5px;
|
||||||
right: 5px;
|
right: 5px;
|
||||||
|
|||||||
@@ -7,8 +7,11 @@ const SVG = 'svg';
|
|||||||
const PLAN = '#plan';
|
const PLAN = '#plan';
|
||||||
const POST = 'POST';
|
const POST = 'POST';
|
||||||
const CU = 'cu';
|
const CU = 'cu';
|
||||||
|
const OPAC = 100;
|
||||||
var selected = null;
|
var selected = null;
|
||||||
var mode = null;
|
var mode = null;
|
||||||
|
var messageTimer = null;
|
||||||
|
var messageOpacity = 0;
|
||||||
|
|
||||||
function addClass(data){
|
function addClass(data){
|
||||||
parts = data.split(" ");
|
parts = data.split(" ");
|
||||||
@@ -16,7 +19,18 @@ function addClass(data){
|
|||||||
}
|
}
|
||||||
|
|
||||||
function addMessage(txt){
|
function addMessage(txt){
|
||||||
$('#messages').html(txt).show().delay(2000).fadeOut(1);
|
$('#messages').html(txt);
|
||||||
|
if (messageTimer != null) window.clearInterval(messageTimer);
|
||||||
|
messageOpacity = 300;
|
||||||
|
messageTimer = setInterval(fadeMessage,100);
|
||||||
|
}
|
||||||
|
|
||||||
|
function fadeMessage(){
|
||||||
|
messageOpacity -= 10;
|
||||||
|
if (messageOpacity < 1) window.clearInterval(messageTimer);
|
||||||
|
var o = messageOpacity;
|
||||||
|
if (o>OPAC) o=OPAC;
|
||||||
|
$('#messages').css('opacity',o/OPAC);
|
||||||
}
|
}
|
||||||
|
|
||||||
function addTile(x,y){
|
function addTile(x,y){
|
||||||
|
|||||||
Reference in New Issue
Block a user