From: Jason Woofenden Date: Tue, 1 Nov 2011 02:05:56 +0000 (-0400) Subject: display opponent's cards upside down X-Git-Url: https://jasonwoof.com/gitweb/?p=peach-cgt.git;a=commitdiff_plain;h=b828a190d7672e89aa84801b66edb0d82076e45d display opponent's cards upside down --- diff --git a/client.coffee b/client.coffee index e02df72..a773c5d 100644 --- a/client.coffee +++ b/client.coffee @@ -40,7 +40,12 @@ bring_card_to_front = (card) -> instantiate_card = (card) -> text = card.text - view = $ $ "
#{text}
" + if card.owner is state.agent + card_class = 'my_card' + else + card_class = 'your_card' + + view = $ $ "
#{text}
" button_box = $ $ '
' flip_button = new_button "flip over" mark_button = new_button "mark" diff --git a/server.coffee b/server.coffee index d3441d0..94672a9 100644 --- a/server.coffee +++ b/server.coffee @@ -184,16 +184,16 @@ test_init = -> test_game = new_game 'test' timeout 4000, -> test_game.set_cards 'server', [ - { text: "Wildabeast 2/2", x: 220, y: 200} - { text: "Wild beast 2/2", x: 350, y: 200} - { text: "Angora bunny 1/1", x: 500, y: 200} - { text: "Ambulatory Cactus 2/1", x: 650, y: 200} - { text: "Ent 0/5", x: 800, y: 200} - { text: "Carnivore 2/1", x: 220, y: 420} - { text: "Herbivore 1/2", x: 350, y: 420} - { text: "Stone Wall 0/10", x: 500, y: 420} - { text: "Log 0/1", x: 650, y: 420} - { text: "Ent 0/5", x: 800, y: 420} + { text: "Wildabeast 2/2", x: 220, y: 200, owner: 'p2'} + { text: "Wild beast 2/2", x: 350, y: 200, owner: 'p2'} + { text: "Angora bunny 1/1", x: 500, y: 200, owner: 'p2'} + { text: "Ambulatory Cactus 2/1", x: 650, y: 200, owner: 'p2'} + { text: "Ent 0/5", x: 800, y: 200, owner: 'p2'} + { text: "Carnivore 2/1", x: 220, y: 420, owner: 'p1'} + { text: "Herbivore 1/2", x: 350, y: 420, owner: 'p1'} + { text: "Stone Wall 0/10", x: 500, y: 420, owner: 'p1'} + { text: "Log 0/1", x: 650, y: 420, owner: 'p1'} + { text: "Ent 0/5", x: 800, y: 420, owner: 'p1'} ] test_init() diff --git a/style.less b/style.less index 58cb359..610023f 100644 --- a/style.less +++ b/style.less @@ -73,6 +73,21 @@ h1 { } } +.your_card { + -webkit-transform: rotate(180deg); + -moz-transform: rotate(180deg); + -ms-transform: rotate(180deg); + -o-transform: rotate(180deg); + transform: rotate(180deg); + &:hover { + -webkit-transform: none; + -moz-transform: none; + -ms-transform: none; + -o-transform: none; + transform: none; + } +} + .marked { border-color: black; }