summaryrefslogtreecommitdiff
path: root/sw-ui/src/main
diff options
context:
space:
mode:
authorjoffrey-bion <joffrey.bion@gmail.com>2020-11-29 17:36:31 +0100
committerjoffrey-bion <joffrey.bion@gmail.com>2020-11-29 17:37:21 +0100
commita89665998671d49aaf9b0b025b999cc2a2b95780 (patch)
treed8f8f0d4ede5b44ecdbaa4dfd3a7edcf6d18167e /sw-ui/src/main
parentRemove unrealistic transaction options (diff)
downloadseven-wonders-a89665998671d49aaf9b0b025b999cc2a2b95780.tar.gz
seven-wonders-a89665998671d49aaf9b0b025b999cc2a2b95780.tar.bz2
seven-wonders-a89665998671d49aaf9b0b025b999cc2a2b95780.zip
Add rotation to "best price indicator"
Diffstat (limited to 'sw-ui/src/main')
-rw-r--r--sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/components/game/GameStyles.kt13
-rw-r--r--sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/components/game/TransactionsSelector.kt5
2 files changed, 11 insertions, 7 deletions
diff --git a/sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/components/game/GameStyles.kt b/sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/components/game/GameStyles.kt
index 0490a907..c3fb46a1 100644
--- a/sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/components/game/GameStyles.kt
+++ b/sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/components/game/GameStyles.kt
@@ -8,11 +8,6 @@ object GameStyles : StyleSheet("GameStyles", isStatic = true) {
private val sandColor = Color.paleGoldenrod.withAlpha(0.7)
- val bestPrice by css {
- fontWeight = FontWeight.bold
- color = rgb(50, 120, 50)
- }
-
val fullBoardPreviewPopover by css {
val bgColor = sandColor
backgroundColor = bgColor
@@ -51,6 +46,14 @@ object GameStyles : StyleSheet("GameStyles", isStatic = true) {
}
}
+ val bestPrice by css {
+ fontWeight = FontWeight.bold
+ color = rgb(50, 120, 50)
+ transform {
+ rotate((-20).deg)
+ }
+ }
+
val discardMoveText by css {
display = Display.flex
alignItems = Align.center
diff --git a/sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/components/game/TransactionsSelector.kt b/sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/components/game/TransactionsSelector.kt
index 7920eaea..bb6a51f5 100644
--- a/sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/components/game/TransactionsSelector.kt
+++ b/sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/components/game/TransactionsSelector.kt
@@ -87,6 +87,7 @@ private fun RBuilder.optionsTable(
val bestPrice = state.transactionsOptions.bestPrice
val hasExpensiveOptions = state.transactionsOptions.any { it.totalPrice != bestPrice }
state.transactionsOptions.forEach { transactions ->
+ val isCheapest = transactions.totalPrice == bestPrice
styledTr {
css {
cursor = Cursor.pointer
@@ -120,8 +121,8 @@ private fun RBuilder.optionsTable(
css {
width = 1.5.rem
}
- if (hasExpensiveOptions && transactions.totalPrice == bestPrice) {
- styledSpan {
+ if (hasExpensiveOptions && isCheapest) {
+ styledDiv {
css {
+GameStyles.bestPrice
}
bgstack15