Add a status color line to cards in decks

This will eventually represent whether the card is available in the
collection for use in the deck, and whether a version was chosen from
those available.
This commit is contained in:
Correl Roush 2024-02-25 17:18:35 -05:00
parent 187c83b6f7
commit b30a467793
2 changed files with 53 additions and 32 deletions

View file

@ -142,13 +142,25 @@ viewDeck symbols deck =
, E.wrappedRow [ E.spacing 10 ] <|
List.map
(\dc ->
UI.cardRow
{ foil = False
, subtitle = "x" ++ String.fromInt dc.quantity
}
[ E.width <| E.px 400, E.clipX, Background.color UI.colors.background ]
symbols
dc.card
E.column []
[ UI.cardRow
{ foil = False
, subtitle = "x" ++ String.fromInt dc.quantity
}
[ E.width <| E.px 400
, E.height <| E.px 66
, E.clipX
, Background.color UI.colors.background
]
symbols
dc.card
, E.el
[ E.height <| E.px 2
, E.width E.fill
, Background.color UI.colors.states.unknown
]
E.none
]
)
group.cards
]

View file

@ -75,6 +75,33 @@ colors =
common =
E.rgb255 47 79 79
mana =
{ white =
{ fg = E.rgb255 249 250 244
, bg = E.rgb255 248 231 185
}
, black =
{ fg = E.rgb255 21 11 0
, bg = E.rgb255 166 159 157
}
, blue =
{ fg = E.rgb255 14 104 171
, bg = E.rgb255 179 206 234
}
, green =
{ fg = E.rgb255 0 114 62
, bg = E.rgb255 196 211 202
}
, red =
{ fg = E.rgb255 211 32 42
, bg = E.rgb255 235 159 130
}
, generic =
{ fg = E.rgb255 190 190 190
, bg = E.rgb255 250 250 250
}
}
in
{ primary = blue
, secondary = slate
@ -90,31 +117,12 @@ colors =
, rare = rare
, uncommon = uncommon
, common = common
, mana =
{ white =
{ fg = E.rgb255 249 250 244
, bg = E.rgb255 248 231 185
}
, black =
{ fg = E.rgb255 21 11 0
, bg = E.rgb255 166 159 157
}
, blue =
{ fg = E.rgb255 14 104 171
, bg = E.rgb255 179 206 234
}
, green =
{ fg = E.rgb255 0 114 62
, bg = E.rgb255 196 211 202
}
, red =
{ fg = E.rgb255 211 32 42
, bg = E.rgb255 235 159 130
}
, generic =
{ fg = E.rgb255 190 190 190
, bg = E.rgb255 250 250 250
}
, mana = mana
, states =
{ okay = mana.green.fg
, warning = rare
, problem = mythic
, unknown = uncommon
}
}
@ -283,6 +291,7 @@ cardRow options attributes symbols card =
E.row
(List.append
[ E.width E.fill
, E.height (E.fill |> E.minimum 66)
, E.spacing 10
, E.padding 3
, E.mouseOver [ Background.color colors.hover ]