Add play to beat image ui

This commit is contained in:
Jesse C. Fisher 2019-10-26 01:36:58 -07:00
parent 0bd8f226d4
commit d01f4c7486
3 changed files with 29 additions and 2 deletions

View File

@ -111,11 +111,17 @@ ol#cards-to-beat
flex-wrap: wrap
text-align: center
li
margin-left: -21vmin
// Don't offset first card
&:first-of-type
// margin-left: 0
margin-left: -4vmin
flex: 1 1 auto
//flex: 1 1 auto
text-align: center
display: inline-block
img
width: 6vmin
width: 16vmin
border: 1px solid black
border-radius: .3vmin

View File

@ -0,0 +1,18 @@
#play-to-beat
%h4 Hand to beat:
- if @game.play_to_beat.play == nil
None
- else
%div.hand-type= @game.play_to_beat.play.hand_type.capitalize
%span= @game.play_to_beat.play.to_s
-# - @game.play_to_beat.play.player_cards.each do |card|
= card.to_s
%div= @game.play_to_beat.play.player.display_name
%ol#cards-to-beat
- @game.play_to_beat.play.player_cards.each do |card|
%li
-# TODO: Don't hard code face cards here
%img{alt: card.rank + ' ' + card.suit,
src: '/assets/cards/png/' + (card.rank.gsub('J','jack').gsub('Q','queen').gsub('K','king').gsub('A','ace') + '_of_' + card.suit.downcase + 's.png').gsub('11','jack').gsub('12','queen').gsub('13','king').gsub('14','ace').gsub('15','2') }

View File

@ -66,7 +66,10 @@
= render "seat", seat: @seats[0]
#mid
= render "seat", seat: @seats[1]
-# <HandToBeat cards={this.props.game.cards_to_beat} />
= render "play_to_beat"
= render "seat", seat: @seats[2]
#bot
= render "seat", seat: @seats[3]