Skip to content

Commit

Permalink
added background blur
Browse files Browse the repository at this point in the history
  • Loading branch information
Cufee committed Jan 19, 2025
1 parent 1e0dd59 commit 01aab15
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 13 deletions.
4 changes: 3 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,16 @@ go 1.23.5

require github.com/go-jet/jet/v2 v2.12.0

// replace github.com/cufee/facepaint => ../facepaint

require (
github.com/Kodeworks/golang-image-ico v0.0.0-20141118225523-73f0f4cfade9
github.com/PuerkitoBio/goquery v1.10.1
github.com/a-h/templ v0.3.819
github.com/bwmarrin/discordgo v0.28.1
github.com/cufee/aftermath-assets v0.1.0
github.com/cufee/am-wg-proxy-next/v2 v2.2.6
github.com/cufee/facepaint v0.0.6
github.com/cufee/facepaint v0.0.7
github.com/fogleman/gg v1.3.0
github.com/go-co-op/gocron v1.37.0
github.com/goccy/go-json v0.10.4
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ github.com/cufee/aftermath-assets v0.1.0 h1:r8p2mUN+h/cw1T6/oEX7bntD+lrL9Nz27GXO
github.com/cufee/aftermath-assets v0.1.0/go.mod h1:6yCITCiz7POJnUMn1oohvadLA4z5YrFNo3p9EKgRdGU=
github.com/cufee/am-wg-proxy-next/v2 v2.2.6 h1:6RAnPuYbPGtaLzOPhTk/N2Hx4KJx14x/c/cIik668xA=
github.com/cufee/am-wg-proxy-next/v2 v2.2.6/go.mod h1:x6fkRfYry3l4Ykxl+v6pJAw5ISw+CuGzJzSkc5y5SYs=
github.com/cufee/facepaint v0.0.6 h1:hs565X06BKNGJ2Yx5Iikpi1rSImIPL6Y2KBC9YM89OI=
github.com/cufee/facepaint v0.0.6/go.mod h1:7zR5lQMN3EO3qNtff0J8nzIhDb258UoYbRzhRToLQdg=
github.com/cufee/facepaint v0.0.7 h1:X8ihx5t8Zmwr9Qhx9AdmhiV+fC2qajf1mWEoMB1oo7w=
github.com/cufee/facepaint v0.0.7/go.mod h1:7zR5lQMN3EO3qNtff0J8nzIhDb258UoYbRzhRToLQdg=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
Expand Down
9 changes: 5 additions & 4 deletions internal/stats/render/period/v2/highlight-style.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ var styledHighlightCard = highlightCardStyle{
AlignItems: style.AlignItemsCenter,

BackgroundColor: common.DefaultCardColor,
BlurBackground: cardBackgroundBlur,

BorderRadiusTopLeft: common.BorderRadiusLG,
BorderRadiusTopRight: common.BorderRadiusLG,
Expand All @@ -34,10 +35,10 @@ var styledHighlightCard = highlightCardStyle{
GrowHorizontal: true,
Gap: 20,

PaddingLeft: 25,
PaddingRight: 25,
PaddingTop: 20,
PaddingBottom: 20,
PaddingLeft: cardPaddingX / 1.5,
PaddingRight: cardPaddingX / 1.5,
PaddingTop: cardPaddingY / 1.5,
PaddingBottom: cardPaddingY / 1.5,
},
titleWrapper: style.Style{
// Debug: true,
Expand Down
5 changes: 5 additions & 0 deletions internal/stats/render/period/v2/misc-style.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ import (

var (
clanTagBackgroundColor = color.NRGBA{40, 40, 40, 100}

cardBackgroundBlur = 20.0
cardPaddingX = 35.0
cardPaddingY = 30.0
)

func styledPlayerName() style.Style {
Expand All @@ -30,6 +34,7 @@ var styledPlayerNameWrapper = style.Style{
AlignItems: style.AlignItemsCenter,

BackgroundColor: common.DefaultCardColor,
BlurBackground: cardBackgroundBlur,

BorderRadiusTopLeft: common.BorderRadiusLG,
BorderRadiusTopRight: common.BorderRadiusLG,
Expand Down
9 changes: 5 additions & 4 deletions internal/stats/render/period/v2/overview-style.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ var styledUnratedOverviewCard = overviewCardStyle{
JustifyContent: style.JustifyContentSpaceBetween,

BackgroundColor: common.DefaultCardColor,
BlurBackground: cardBackgroundBlur,

BorderRadiusTopLeft: common.BorderRadiusLG,
BorderRadiusTopRight: common.BorderRadiusLG,
Expand All @@ -80,10 +81,10 @@ var styledUnratedOverviewCard = overviewCardStyle{
GrowHorizontal: true,
Gap: 15,

PaddingLeft: 25,
PaddingRight: 25,
PaddingTop: 20,
PaddingBottom: 20,
PaddingLeft: cardPaddingX,
PaddingRight: cardPaddingX,
PaddingTop: cardPaddingY,
PaddingBottom: cardPaddingY,
},
column: style.Style{
Debug: debugOverviewCards,
Expand Down
4 changes: 2 additions & 2 deletions render_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ import (
_ "github.com/joho/godotenv/autoload"
)

var bgImage = "static://bg-default"
var bgIsCustom = false
var bgImage = "static://test_user_background"
var bgIsCustom = true

func init() {
loadStaticAssets(static)
Expand Down

0 comments on commit 01aab15

Please sign in to comment.