From 51e3629fa5b66c846672abe7eb8a80823094f97d Mon Sep 17 00:00:00 2001 From: efim Date: Thu, 14 Mar 2024 13:04:30 +0000 Subject: [PATCH] feat(18): resize without transform, hover states using transform influences text size, and size of rounded corners current way hardcodes 8rem for the columns, maybe i'll pass it as parameter when start doing desktop, i don't know feels like not a good choice overall, but yeah --- 18-expenses-chart/templates/index.templ | 29 ++++++++++++++++--------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/18-expenses-chart/templates/index.templ b/18-expenses-chart/templates/index.templ index c76043e..448a95f 100644 --- a/18-expenses-chart/templates/index.templ +++ b/18-expenses-chart/templates/index.templ @@ -11,9 +11,15 @@ type PageData struct { } templ myBalanceComponent(balance float32) { -
- My balance -

${ fmt.Sprintf("%.2f", balance) }

+
+
+ My balance +

${ fmt.Sprintf("%.2f", balance) }

+
+ App logo: a white circle overlapping from the left a filled in black circle
} @@ -38,17 +44,20 @@ func prepareSummaryComponent(expenses []float32, totalThisMonth, percentCompared css expenseBarVars(percentage float32) { --height-percentage: { fmt.Sprintf("%.2f", percentage) }; - transform: scaleY(var(--height-percentage)); + height: calc(var(--height-percentage) * 8rem); } templ dayExpenseColumn(expense, percentage float32, day string, isCurrentDay bool) { -
+
+ templ.KV("bg-primary-soft-red hover:bg-primary-soft-red/70", !isCurrentDay), + templ.KV("bg-primary-cyan hover:bg-primary-cyan/70", isCurrentDay), + "hover:cursor-pointer" } + > + ${ fmt.Sprintf("%.2f", expense ) } +

{ day }

} @@ -91,7 +100,7 @@ templ IndexPage(pageData PageData) { - + Frontend Mentor | Expenses chart component