diff --git a/internal/app/app.go b/internal/app/app.go index b502763..0b31050 100644 --- a/internal/app/app.go +++ b/internal/app/app.go @@ -7,12 +7,15 @@ import ( tea "github.com/charmbracelet/bubbletea" "github.com/charmbracelet/lipgloss" "github.com/dustin-ward/termtyping/internal/character" + "github.com/dustin-ward/termtyping/internal/config" "github.com/dustin-ward/termtyping/internal/data" "github.com/dustin-ward/termtyping/internal/stats" "github.com/dustin-ward/termtyping/internal/statusbar" "github.com/dustin-ward/termtyping/internal/styles" ) +var Config config.Config + type AppState int const ( @@ -107,9 +110,15 @@ func (m AppModel) View() string { view_text = b.String() } - return styles.BorderStyle.Render(lipgloss.JoinVertical( - lipgloss.Left, - styles.StatusBar.Render(m.status_bar.View()), - styles.TextBox.Render(view_text), - )) + var view string + if Config.ZenMode { + view = styles.BorderStyle.Render(styles.Zen_TextBox.Render(view_text)) + } else { + view = styles.BorderStyle.Render(lipgloss.JoinVertical( + lipgloss.Left, + styles.StatusBar.Render(m.status_bar.View()), + styles.TextBox.Render(view_text), + )) + } + return view } diff --git a/internal/config/config.go b/internal/config/config.go new file mode 100644 index 0000000..f8445ae --- /dev/null +++ b/internal/config/config.go @@ -0,0 +1,5 @@ +package config + +type Config struct { + ZenMode bool +} diff --git a/internal/styles/styles.go b/internal/styles/styles.go index b55be1b..3aaea6b 100644 --- a/internal/styles/styles.go +++ b/internal/styles/styles.go @@ -14,7 +14,11 @@ var ( RemainingText = lipgloss.NewStyle().Foreground(LightGrey) ActiveText = lipgloss.NewStyle().Foreground(White) + // Regular Mode TextBox = lipgloss.NewStyle().Width(APP_WIDTH).Margin(0, 2) StatusBar = lipgloss.NewStyle().Width(APP_WIDTH).Margin(0, 2).Border(lipgloss.NormalBorder()).BorderForeground(LightGrey).BorderTop(false).BorderLeft(false).BorderRight(false) BorderStyle = lipgloss.NewStyle().BorderStyle(lipgloss.RoundedBorder()).Foreground(White) + + // Zen Mode + Zen_TextBox = lipgloss.NewStyle().Width(APP_WIDTH).Margin(1, 2) ) diff --git a/main.go b/main.go index 94ab3f5..882ebb5 100644 --- a/main.go +++ b/main.go @@ -1,13 +1,27 @@ package main import ( + "flag" "log" tea "github.com/charmbracelet/bubbletea" "github.com/dustin-ward/termtyping/internal/app" + "github.com/dustin-ward/termtyping/internal/config" ) +var zen_flag bool + +func init() { + flag.BoolVar(&zen_flag, "zen", false, "enable zen mode (default=false)") + flag.Parse() +} + func main() { + config := config.Config{ + ZenMode: zen_flag, + } + app.Config = config + p := tea.NewProgram(app.NewAppModel(app.StateDefault, nil)) if _, err := p.Run(); err != nil { log.Fatal(err)