diff --git a/presentation/role.go b/presentation/role.go index c320b99..9769d5c 100644 --- a/presentation/role.go +++ b/presentation/role.go @@ -1,8 +1,6 @@ package presentation import ( - "fmt" - "git.sapphic.engineer/roleypoly/v4/types" "git.sapphic.engineer/roleypoly/v4/utils" ) @@ -43,6 +41,7 @@ func Role(category *types.Category, role *types.Role, selected bool) Presentable type PresentableRoleColors struct { Main string + Alt string IsDark bool } @@ -50,9 +49,11 @@ func GetColors(roleColor uint32) PresentableRoleColors { // TODO: no color r, g, b := utils.IntToRgb(roleColor) + altR, altG, altB := utils.AltColor(r, g, b) return PresentableRoleColors{ - Main: fmt.Sprintf("#%x", roleColor), + Main: utils.RgbToString(r, g, b), + Alt: utils.RgbToString(altR, altG, altB), IsDark: utils.IsDarkColor(r, g, b), } } diff --git a/static/main.css b/static/main.css index 409d3de..b3ace6b 100644 --- a/static/main.css +++ b/static/main.css @@ -43,8 +43,11 @@ body { user-select: none; padding: 0.217rem; /* this is silly number pls ignore :3 (^noe) */ gap: 0.215rem; + cursor: pointer; + transition: all 0.35s ease-in-out; input { + cursor: pointer; appearance: none; position: relative; width: 1.216rem; @@ -52,9 +55,17 @@ body { margin: 0; padding: 0; border: 2px solid var(--role-color); - transition: all 0.35s ease-in-out; + transition: all 0.25s ease-in-out; border-radius: 1.216rem; + &:hover { + background-color: var(--role-color); + &::before { + opacity: 1; + background-color: var(--contrast-color); + } + } + &::before { transition: all 0.35s ease-in-out; content: ""; @@ -72,6 +83,7 @@ body { } label { + cursor: pointer; } &:has(input:checked) { diff --git a/templates/components/role.html b/templates/components/role.html index 40f0963..f65b1db 100644 --- a/templates/components/role.html +++ b/templates/components/role.html @@ -1,7 +1,7 @@ {{ $for := printf "category-%s_role-%s" .CategoryID .ID }}