tui

package
v0.9.4 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2025 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateAchievementProgressBar

func CreateAchievementProgressBar(current, target int, achievementName, icon string) string

CreateAchievementProgressBar creates a styled achievement progress bar

func CreateLevelProgressIndicator

func CreateLevelProgressIndicator(currentLevel, nextLevel int, progress float64) string

CreateLevelProgressIndicator creates a level-up progress indicator

func CreateXPProgressBar

func CreateXPProgressBar(currentXP, levelXP, totalXP int, level int, title string) string

CreateXPProgressBar creates a styled XP progress bar

func RunDashboard

func RunDashboard(db *database.DB) error

RunDashboard starts the interactive dashboard

func RunSimpleDashboard

func RunSimpleDashboard(db *database.DB) error

RunSimpleDashboard starts the simple interactive dashboard

Types

type AdvancedProgress

type AdvancedProgress struct {
	progress.Model
	// contains filtered or unexported fields
}

AdvancedProgress represents an enhanced progress bar with animations

func NewAdvancedProgress

func NewAdvancedProgress(width int, style ProgressStyle) *AdvancedProgress

NewAdvancedProgress creates a new enhanced progress bar

func (*AdvancedProgress) SetAnimated

func (p *AdvancedProgress) SetAnimated(animated bool)

SetAnimated enables/disables smooth animations

func (*AdvancedProgress) SetLabel

func (p *AdvancedProgress) SetLabel(label string)

SetLabel sets the progress bar label

func (*AdvancedProgress) SetShowPercent

func (p *AdvancedProgress) SetShowPercent(show bool)

SetShowPercent controls whether to show percentage

func (*AdvancedProgress) SetTarget

func (p *AdvancedProgress) SetTarget(target float64)

SetTarget sets the target value for animated progress

func (*AdvancedProgress) SetValue

func (p *AdvancedProgress) SetValue(value float64)

SetValue sets the current value (immediately if not animated)

func (*AdvancedProgress) Update

func (p *AdvancedProgress) Update(msg tea.Msg) (*AdvancedProgress, tea.Cmd)

Update handles progress animations

func (*AdvancedProgress) View

func (p *AdvancedProgress) View() string

View renders the enhanced progress bar

func (*AdvancedProgress) ViewWithStats

func (p *AdvancedProgress) ViewWithStats(current, total int, timeRemaining string) string

ViewWithStats renders progress with additional statistics

type DashboardModel

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

DashboardModel represents the main dashboard model

func NewDashboardModel

func NewDashboardModel(db *database.DB) (*DashboardModel, error)

NewDashboardModel creates a new dashboard model

func (DashboardModel) Init

func (m DashboardModel) Init() tea.Cmd

Init implements tea.Model

func (DashboardModel) Update

func (m DashboardModel) Update(msg tea.Msg) (tea.Model, tea.Cmd)

Update implements tea.Model

func (DashboardModel) View

func (m DashboardModel) View() string

View implements tea.Model

type ListItem

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

ListItem represents an item in the list

func (ListItem) Description

func (i ListItem) Description() string

func (ListItem) FilterValue

func (i ListItem) FilterValue() string

func (ListItem) Title

func (i ListItem) Title() string

type ProgressStyle

type ProgressStyle struct {
	FilledColor   lipgloss.Color
	EmptyColor    lipgloss.Color
	PercentColor  lipgloss.Color
	LabelColor    lipgloss.Color
	BorderColor   lipgloss.Color
	GradientStart lipgloss.Color
	GradientEnd   lipgloss.Color
	UseGradient   bool
}

ProgressStyle defines the visual style of the progress bar

func DefaultProgressStyle

func DefaultProgressStyle() ProgressStyle

DefaultProgressStyle returns a default purple gradient style

func GamificationProgressStyle

func GamificationProgressStyle() ProgressStyle

GamificationProgressStyle returns a gaming-themed style

func XPProgressStyle

func XPProgressStyle() ProgressStyle

XPProgressStyle returns an XP-themed style

type ProgressTickMsg

type ProgressTickMsg struct {
	Time time.Time
}

ProgressTickMsg represents a progress animation tick

type SimpleDashboard

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

SimpleDashboard represents a simple dashboard model

func NewSimpleDashboard

func NewSimpleDashboard(db *database.DB) (*SimpleDashboard, error)

NewSimpleDashboard creates a new simple dashboard

func (SimpleDashboard) Init

func (m SimpleDashboard) Init() tea.Cmd

Init implements tea.Model

func (SimpleDashboard) Update

func (m SimpleDashboard) Update(msg tea.Msg) (tea.Model, tea.Cmd)

Update implements tea.Model

func (SimpleDashboard) View

func (m SimpleDashboard) View() string

View implements tea.Model

type Tab

type Tab struct {
	ID    TabID
	Title string
	Icon  string
}

Tab represents a dashboard tab

type TabID

type TabID int

TabID represents different tabs in the dashboard

const (
	StatsTab TabID = iota
	AnalyticsTab
	HeatmapTab
	AchievementsTab
	SettingsTab
)

Jump to

Keyboard shortcuts

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