From 2931445ceb51e471291c9a8fd90ffa0d67b3d801 Mon Sep 17 00:00:00 2001 From: Jason Woofenden Date: Sat, 5 Nov 2011 01:39:17 -0400 Subject: [PATCH] fix shuffling, auto hide/show card text overflow --- client.coffee | 12 +++++++----- index.html | 2 +- server.coffee | 5 ++--- style.less | 3 +++ 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/client.coffee b/client.coffee index 0c54a71..6da0968 100644 --- a/client.coffee +++ b/client.coffee @@ -298,7 +298,7 @@ init_card_designer = -> container.append ul - submit = $ $ "
Done
" + submit = $ $ "
Done
" submit.bind 'click', -> $('#deck_designer').remove() show_message cards_in_deck @@ -310,15 +310,17 @@ init_card_designer = -> pile: "#{state.agent}_draw" x: 0 y: 0 - z: next_card_z() flipped: true } cards.push card - cards.push card - cards.push card - cards.push card + cards.push $.extend {}, card # clone + cards.push $.extend {}, card # clone + cards.push $.extend {}, card # clone + # asign z-index in random order cards.shuffle() + for card in cards + card.z = next_card_z() show_message cards # let server assign card numbers diff --git a/index.html b/index.html index 548d51d..0602c9f 100644 --- a/index.html +++ b/index.html @@ -22,6 +22,6 @@
Cards in this green area (except the two piles on the right) always appear face-down to the other player.
-

Deck Designer

Click each card you'd like in your deck and then click "done" at the bottom.

+

Deck Designer

Click each card you'd like in your deck (you'll get four of each) and then click "done" at the bottom.

diff --git a/server.coffee b/server.coffee index 29b3e50..91250cb 100644 --- a/server.coffee +++ b/server.coffee @@ -143,9 +143,8 @@ answer_now = (game) -> queue = game.p2_queue game.p2_waiter = false game.p2_queue = [] - timeout 2000, -> # FIXME remove this delay for player 2 (just here to test lag handling) - waiter.writeHead 200, 'Content-Type': 'text/javascript' - waiter.end JSON.stringify queue + waiter.writeHead 200, 'Content-Type': 'text/javascript' + waiter.end JSON.stringify queue # this marks a game as "dirty" and makes sure there's exactly one timeout # that'll respond to any clients that are waiting, and now have messages. diff --git a/style.less b/style.less index 622e725..bc3eae3 100644 --- a/style.less +++ b/style.less @@ -63,9 +63,12 @@ h1 { .card { background: #fff; border: 2px solid #fff; + overflow: hidden; .shadow(1px, 1px, 8px, 0.4); &:hover { + height: auto; + min-height: @card-height; z-index: 9999 !important; } .button { -- 1.7.10.4