enhanced

package
v0.10.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 26, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAllThemes

func GetAllThemes() map[string]*Theme

GetAllThemes returns all available themes

Types

type AnimatedProgressBar added in v0.10.1

type AnimatedProgressBar struct {
	// contains filtered or unexported fields
}

AnimatedProgressBar represents an animated progress bar

func NewAnimatedProgressBar added in v0.10.1

func NewAnimatedProgressBar(width int) *AnimatedProgressBar

NewAnimatedProgressBar creates a new animated progress bar

func (*AnimatedProgressBar) IsAnimating added in v0.10.1

func (apb *AnimatedProgressBar) IsAnimating() bool

IsAnimating returns true if the progress bar is currently animating

func (*AnimatedProgressBar) Render added in v0.10.1

func (apb *AnimatedProgressBar) Render() string

Render renders the animated progress bar

func (*AnimatedProgressBar) Update added in v0.10.1

func (apb *AnimatedProgressBar) Update(targetPercent float64)

Update updates the progress bar animation

type AnimationConfig

type AnimationConfig struct {
	Duration   int // milliseconds
	Enabled    bool
	EasingType string
}

AnimationConfig defines animation settings

type ColorScheme

type ColorScheme struct {
	Primary    lipgloss.Color // 主色调
	Secondary  lipgloss.Color // 辅助色
	Accent     lipgloss.Color // 强调色
	Background lipgloss.Color // 背景色
	Surface    lipgloss.Color // 表面色
	Text       lipgloss.Color // 文本色
	TextMuted  lipgloss.Color // 次要文本色
	Success    lipgloss.Color // 成功色
	Warning    lipgloss.Color // 警告色
	Error      lipgloss.Color // 错误色
	Info       lipgloss.Color // 信息色
}

ColorScheme defines the color palette for a theme

type EnhancedDashboard

type EnhancedDashboard struct {
	// contains filtered or unexported fields
}

EnhancedDashboard represents the new enhanced TUI dashboard

func NewEnhancedDashboard

func NewEnhancedDashboard(db *database.DB) *EnhancedDashboard

NewEnhancedDashboard creates a new enhanced dashboard

func (*EnhancedDashboard) Init

func (d *EnhancedDashboard) Init() tea.Cmd

Init initializes the dashboard

func (*EnhancedDashboard) SetModePreference

func (d *EnhancedDashboard) SetModePreference(mode string)

SetModePreference sets the preferred display mode

func (*EnhancedDashboard) Update

func (d *EnhancedDashboard) Update(msg tea.Msg) (tea.Model, tea.Cmd)

Update handles messages and updates the model

func (*EnhancedDashboard) View

func (d *EnhancedDashboard) View() string

View renders the dashboard

type KeyMap

type KeyMap struct {
	Quit     key.Binding
	Help     key.Binding
	Refresh  key.Binding
	NextTab  key.Binding
	PrevTab  key.Binding
	Settings key.Binding
}

KeyMap defines keyboard shortcuts

func DefaultKeyMap

func DefaultKeyMap() KeyMap

DefaultKeyMap returns the default key bindings

type Spacing

type Spacing struct {
	Small  int
	Medium int
	Large  int
	XLarge int
}

Spacing defines layout spacing

type TabType

type TabType int

TabType represents different dashboard tabs

const (
	HomeTab TabType = iota
	AnalyticsTab
	GamificationTab
	ActivityTab
	ToolsTab
	SettingsTab
)

type Theme

type Theme struct {
	Name       string
	Colors     ColorScheme
	Typography Typography
	Spacing    Spacing
	Animations AnimationConfig
}

Theme represents a complete UI theme

func CyberpunkTheme

func CyberpunkTheme() *Theme

CyberpunkTheme returns a cyberpunk-style theme

func DefaultSpaceTheme

func DefaultSpaceTheme() *Theme

DefaultSpaceTheme returns the default space theme

func MinimalTheme

func MinimalTheme() *Theme

MinimalTheme returns a minimal, clean theme

func NatureTheme

func NatureTheme() *Theme

NatureTheme returns a nature-inspired theme

func RetroTheme

func RetroTheme() *Theme

RetroTheme returns a retro/vintage theme

func (*Theme) ButtonStyle

func (t *Theme) ButtonStyle(active bool) lipgloss.Style

func (*Theme) CardStyle

func (t *Theme) CardStyle() lipgloss.Style

func (*Theme) ErrorStyle

func (t *Theme) ErrorStyle() lipgloss.Style

func (*Theme) HeaderStyle

func (t *Theme) HeaderStyle() lipgloss.Style

Style helpers for common UI elements

func (*Theme) InfoStyle

func (t *Theme) InfoStyle() lipgloss.Style

func (*Theme) MutedStyle

func (t *Theme) MutedStyle() lipgloss.Style

func (*Theme) ProgressBarStyle

func (t *Theme) ProgressBarStyle() lipgloss.Style

func (*Theme) SuccessStyle

func (t *Theme) SuccessStyle() lipgloss.Style

type ThemeManager

type ThemeManager struct {
	// contains filtered or unexported fields
}

ThemeManager manages theme switching and persistence

func NewThemeManager

func NewThemeManager() *ThemeManager

NewThemeManager creates a new theme manager

func (*ThemeManager) GetAvailableThemes

func (tm *ThemeManager) GetAvailableThemes() []string

GetAvailableThemes returns a list of available theme names

func (*ThemeManager) GetCurrentTheme

func (tm *ThemeManager) GetCurrentTheme() *Theme

GetCurrentTheme returns the current active theme

func (*ThemeManager) SetTheme

func (tm *ThemeManager) SetTheme(name string) error

SetTheme switches to a different theme

type Typography

type Typography struct {
	HeaderSize  int
	BodySize    int
	CaptionSize int
	LineHeight  float64
}

Typography defines text styling

type XPProgressRenderer added in v0.10.1

type XPProgressRenderer struct {
	// contains filtered or unexported fields
}

XPProgressRenderer handles XP progress rendering with animations

func NewXPProgressRenderer added in v0.10.1

func NewXPProgressRenderer() *XPProgressRenderer

NewXPProgressRenderer creates a new XP progress renderer

func (*XPProgressRenderer) RenderXPProgress added in v0.10.1

func (xpr *XPProgressRenderer) RenderXPProgress(currentXP, currentLevel int) string

RenderXPProgress renders animated XP progress

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL