clone

fifteen puzzle games for the terminal, with daily puzzles, weekly ladders and xp, built on bubble tea

new styles (ew purple grosss)

Dami committed 174e229
commit
174e22933af5cfd13f445619666bb9d45b7d078c
parent
df60dd8244eeec9335b75c7db610d3b9e84d964b
author
Dami <dami@Damis-MacBook-Air.local>
4 files changed, +68 -17
MCLAUDE.md4++
Mgame/style.go6++--
Mmodel.go51+++++++++++++++++++++++++++++-
Mwordsearch/style.go24+++++++-------
M CLAUDE.md +4 -0
M game/style.go +3 -3
M model.go +49 -2
@@ -20,6 +20,14 @@ import (
2020 )2121 2222 var (23+ // Purple palette for menus — ANSI 256 colors with light/dark adaptivity.24+ menuAccent = lipgloss.AdaptiveColor{Light: "55", Dark: "134"}25+ menuAccentLight = lipgloss.AdaptiveColor{Light: "97", Dark: "140"}26+ menuText = lipgloss.AdaptiveColor{Light: "235", Dark: "252"}27+ menuTextDim = lipgloss.AdaptiveColor{Light: "243", Dark: "243"}28+ menuDim = lipgloss.AdaptiveColor{Light: "250", Dark: "238"}29+ menuTableHeader = lipgloss.AdaptiveColor{Light: "55", Dark: "183"}30+2331 rootStyle = lipgloss.NewStyle().Margin(1, 2)2432 debugStyle = lipgloss.NewStyle().Border(lipgloss.RoundedBorder(), true).BorderForeground(lipgloss.Color("124"))2533
@@ -263,7 +271,13 @@ func (m model) View() string {
263271 if len(m.continueGames) == 0 {264272 return rootStyle.Render("No saved games yet.\n\nPress Escape to return.")265273 }266- return rootStyle.Render(m.continueTable.View())274+ title := lipgloss.NewStyle().275+ Bold(true).276+ Foreground(lipgloss.AdaptiveColor{Light: "255", Dark: "255"}).277+ Background(menuAccent).278+ Padding(0, 1).279+ Render("Saved Games")280+ return rootStyle.Render(lipgloss.JoinVertical(lipgloss.Left, title, "", m.continueTable.View()))267281 case gameView:268282 if m.game == nil {269283 return ""
@@ -285,8 +299,25 @@ func (m model) View() string {
285299 }286300 287301 func initList(items []list.Item, title string) list.Model {288- l := list.New(items, list.NewDefaultDelegate(), 64, 64)302+ d := list.NewDefaultDelegate()303+ d.Styles.SelectedTitle = d.Styles.SelectedTitle.304+ Foreground(menuAccent).305+ BorderLeftForeground(menuAccent)306+ d.Styles.SelectedDesc = d.Styles.SelectedDesc.307+ Foreground(menuAccentLight).308+ BorderLeftForeground(menuAccent)309+ d.Styles.NormalTitle = d.Styles.NormalTitle.310+ Foreground(menuText)311+ d.Styles.NormalDesc = d.Styles.NormalDesc.312+ Foreground(menuTextDim)313+314+ l := list.New(items, d, 64, 64)289315 l.Title = title316+ l.Styles.Title = lipgloss.NewStyle().317+ Bold(true).318+ Foreground(lipgloss.AdaptiveColor{Light: "255", Dark: "255"}).319+ Background(menuAccent).320+ Padding(0, 1)290321 l.DisableQuitKeybindings()291322 l.SetFilteringEnabled(false)292323 l.SetShowHelp(false)
@@ -338,6 +369,22 @@ func (m *model) initContinueTable() {
338369 table.WithFocused(true),339370 table.WithHeight(10),340371 )372+373+ s := table.DefaultStyles()374+ s.Header = s.Header.375+ Bold(true).376+ Foreground(menuTableHeader).377+ BorderStyle(lipgloss.NormalBorder()).378+ BorderBottom(true).379+ BorderForeground(menuDim)380+ s.Selected = s.Selected.381+ Foreground(lipgloss.AdaptiveColor{Light: "255", Dark: "255"}).382+ Background(menuAccent).383+ Bold(true)384+ s.Cell = s.Cell.385+ Foreground(menuText)386+ t.SetStyles(s)387+341388 m.continueTable = t342389 }343390
M wordsearch/style.go +12 -12
@@ -10,35 +10,35 @@ import (
1010 1111 var (1212 normalStyle = lipgloss.NewStyle().13- Foreground(lipgloss.Color("#1a1a1a")).14- Background(lipgloss.Color("#ffffff"))13+ Foreground(lipgloss.AdaptiveColor{Light: "236", Dark: "252"}).14+ Background(lipgloss.AdaptiveColor{Light: "254", Dark: "236"})1515 1616 cursorStyle = lipgloss.NewStyle().17- Foreground(lipgloss.Color("#ffffff")).18- Background(lipgloss.Color("#ff00ff"))17+ Foreground(lipgloss.AdaptiveColor{Light: "255", Dark: "235"}).18+ Background(lipgloss.AdaptiveColor{Light: "30", Dark: "38"})1919 2020 selectionStyle = lipgloss.NewStyle().21- Foreground(lipgloss.Color("#1a1a1a")).22- Background(lipgloss.Color("#ffff00"))21+ Foreground(lipgloss.AdaptiveColor{Light: "235", Dark: "235"}).22+ Background(lipgloss.AdaptiveColor{Light: "172", Dark: "179"})2323 2424 foundStyle = lipgloss.NewStyle().25- Foreground(lipgloss.Color("#ffffff")).26- Background(lipgloss.Color("#00ff00"))25+ Foreground(lipgloss.AdaptiveColor{Light: "22", Dark: "151"}).26+ Background(lipgloss.AdaptiveColor{Light: "194", Dark: "237"})2727 2828 wordListHeaderStyle = lipgloss.NewStyle().29- Foreground(lipgloss.Color("#00ffff")).29+ Foreground(lipgloss.AdaptiveColor{Light: "30", Dark: "38"}).3030 Bold(true).3131 Underline(true)3232 3333 foundWordStyle = lipgloss.NewStyle().34- Foreground(lipgloss.Color("#00ff00")).34+ Foreground(lipgloss.AdaptiveColor{Light: "28", Dark: "115"}).3535 Strikethrough(true)3636 3737 unfoundWordStyle = lipgloss.NewStyle().38- Foreground(lipgloss.Color("#888888"))38+ Foreground(lipgloss.AdaptiveColor{Light: "103", Dark: "103"})3939 4040 statusBarStyle = lipgloss.NewStyle().41- Foreground(lipgloss.Color("#888888")).41+ Foreground(lipgloss.AdaptiveColor{Light: "103", Dark: "103"}).4242 MarginTop(1)4343 )4444