From b6e175c1931a80b9c2972978d6afd61b7484303b Mon Sep 17 00:00:00 2001 From: Ali Asaria Date: Sun, 29 May 2011 15:06:18 -0400 Subject: [PATCH] allow card init animation to be controllable --- client/script.js | 7 +++++-- nodemon-ignore | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/client/script.js b/client/script.js index 95fdd80..ecb8886 100644 --- a/client/script.js +++ b/client/script.js @@ -134,7 +134,7 @@ function getMessage( m ) -function drawNewCard(id, text, x, y, rot, colour, sticker) +function drawNewCard(id, text, x, y, rot, colour, sticker, animationspeed) { //cards[id] = {id: id, text: text, x: x, y: y, rot: rot, colour: colour}; @@ -181,10 +181,13 @@ function drawNewCard(id, text, x, y, rot, colour, sticker) } ); + var speed = Math.floor(Math.random() * 1000); + if (typeof(animationspeed) != 'undefined') speed = animationspeed; + $("#" + id).animate({ left: x + "px", top: y + "px" - }, Math.floor(Math.random() * 1000)); + }, speed); $("#" + id).hover( function(){ diff --git a/nodemon-ignore b/nodemon-ignore index 34ae1ae..6edb2b5 100644 --- a/nodemon-ignore +++ b/nodemon-ignore @@ -1,3 +1,4 @@ /client/* .DS_Store /.git/* +*.rdb