ui

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Base Palette
	CatMauve    = lipgloss.Color("#cba6f7") // Primary/Logo
	CatLavender = lipgloss.Color("#b4befe") // Secondary
	CatSapphire = lipgloss.Color("#74c7ec") // Accent
	CatText     = lipgloss.Color("#cdd6f4") // Standard Text
	CatSubtext  = lipgloss.Color("#a6adc8") // Faint/Muted

	// Functional Colors
	CatGreen   = lipgloss.Color("#a6e3a1") // Correct
	CatRed     = lipgloss.Color("#f38ba8") // Wrong
	CatYellow  = lipgloss.Color("#f9e2af") // Warning/Highlight
	CatOverlay = lipgloss.Color("#6c7086") // Pending/Placeholder
	CatSurface = lipgloss.Color("#313244") // Background highlights
)
View Source
var (
	// The characters you've typed correctly (Soothing Green)
	CorrectStyle = lipgloss.NewStyle().Foreground(CatGreen)

	// Incorrect characters (Soft Red)
	WrongStyle = lipgloss.NewStyle().Foreground(CatRed)

	// If the user misses a space, we highlight the background so it's visible
	SpaceStyle = lipgloss.NewStyle().Background(CatRed).Foreground(CatSurface)

	// Characters remaining in the quote (Muted/Faint)
	PendingStyle = lipgloss.NewStyle().Foreground(CatOverlay)

	// The current character under the cursor (Bold & Underlined)
	HighlightStyle = lipgloss.NewStyle().
					Foreground(CatYellow).
					Underline(true).
					Bold(true)

	// Your WPM/ACC display (Vibrant Sapphire)
	StatsStyle = lipgloss.NewStyle().
				Foreground(CatSapphire).
				Bold(true).
				Padding(0, 1).
				BorderStyle(lipgloss.NormalBorder()).
				BorderForeground(CatSurface)

	HeaderStyle = lipgloss.NewStyle().Foreground(CatLavender)

	// Mode selector styles
	ModeActiveStyle = lipgloss.NewStyle().
					Foreground(CatSurface).
					Background(CatMauve).
					Bold(true).
					Padding(0, 2).
					MarginRight(1)

	ModeInactiveStyle = lipgloss.NewStyle().
						Foreground(CatSubtext).
						Background(CatSurface).
						Padding(0, 2).
						MarginRight(1)

	ModeSelectorContainerStyle = lipgloss.NewStyle().
								Border(lipgloss.RoundedBorder()).
								BorderForeground(CatOverlay).
								Padding(0, 1).
								MarginTop(1)

	// for the views
	// CatMauve
	ViewHeaderStyle = lipgloss.NewStyle().Foreground(CatMauve).Bold(true)

	// Stats Section - Using a box to make it stand out
	StatsTitleStyle = lipgloss.NewStyle().Foreground(CatSapphire).Bold(true).MarginBottom(1)

	// Individual stat styling
	LabelStyle = lipgloss.NewStyle().Foreground(CatMauve).Width(15).Align(lipgloss.Left)
	ValueStyle = lipgloss.NewStyle().Foreground(CatSubtext).Bold(true).Width(30).Align(lipgloss.Right)

	// Footer Section
	HelpStyle = lipgloss.NewStyle().Foreground(CatOverlay).MarginTop(1)
)
View Source
var CouikASCII = `` /* 429-byte string literal not displayed */
View Source
var CouikASCII2 = `` /* 417-byte string literal not displayed */
View Source
var CouikASCII3 = `` /* 558-byte string literal not displayed */

Functions

func FormatTime added in v0.1.2

func FormatTime(s int) string

func Tick added in v0.1.1

func Tick() tea.Cmd

Types

type Model

type Model struct {
	Session        *engine.Session
	Repo           storage.HistoryRepository
	Quitting       bool
	ProgressBar    progress.Model
	TerminalWidth  int
	TerminalHeight int

	// mode selecting
	CurrentSelector components.Selector

	// for mode selecting
	IsSelectingMode bool
	// Cursor          int
	// Choices         []string
	Mode TypingMode

	// state
	State sessionState

	Active bool

	// quote mode selection
	QuoteType quoteType
	// QuoteTypeCursor      int
	// QuoteTypeChoices     []string
	IsSelectingQuoteType bool

	// words
	InitialWords int

	// User defaults
	// config cli.Config
	CustomDashboard string
	// contains filtered or unexported fields
}

func NewModel

func NewModel(target string) Model

func (Model) GetDictionnaryModel

func (m Model) GetDictionnaryModel(duration int) Model

func (Model) GetDictionnaryModelWithWords

func (m Model) GetDictionnaryModelWithWords(words int) Model

GetDictionnaryModelWithWords creates a model with custom words length for word mode typing tests

func (Model) GetModelWithCustomTarget

func (m Model) GetModelWithCustomTarget(target string) Model

GetModelWithCustomTarget creates a model with custom target for word mode typing tests

func (Model) GetModelWithQuoteType added in v0.1.1

func (m Model) GetModelWithQuoteType(option string) Model

func (Model) GetQuoteModel

func (m Model) GetQuoteModel() Model

func (Model) GetTimeModelWithCustomTarget

func (m Model) GetTimeModelWithCustomTarget(initialTime int, target string) Model

GetTimeModelWithCustomTarget creates a model with custom target for time mode typing tests

func (Model) Init

func (m Model) Init() tea.Cmd

func (Model) Update

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

func (Model) View

func (m Model) View() string

type TickMsg added in v0.1.1

type TickMsg time.Time

type TypingMode

type TypingMode int

Typing mode

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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