Documentation
¶
Index ¶
- Variables
- func CreateModeFromSelection(selection string, lang database.Language) modes.ModeStrategy
- func DisplayChart(wpmSamples []float64, timesSample []time.Time, width, height int) string
- func FormatTime(s int) string
- type ApplyModelOption
- type Model
- func (m Model) ApplyMode(mode modes.ModeStrategy, options ...ApplyModelOption) Model
- func (m *Model) CacheChart()
- func (m *Model) Deactivate()
- func (m Model) GetDictionnaryModel(duration int) Model
- func (m Model) GetDictionnaryModelWithWords(words int, language database.Language) Model
- func (m *Model) GetModelFromMode(mod Model) Model
- func (m *Model) GetSession() *engine.Session
- func (m *Model) GetTerminalWidth() int
- func (m *Model) GetTimeLeft() int
- func (m Model) Init() tea.Cmd
- func (m *Model) IsActive() bool
- func (m *Model) SetState(s core.SessionState)
- func (m *Model) SetTimeLeft(t int)
- func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd)
- func (m Model) View() string
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) // Live stats during typing (minimal, no border) StatsStyle = lipgloss.NewStyle(). Foreground(CatOverlay). Padding(0, 1) HeaderStyle = lipgloss.NewStyle().Foreground(CatMauve) // Mode selector styles ModeActiveStyle = lipgloss.NewStyle(). Foreground(CatMauve). Bold(true). Padding(0, 1). MarginRight(1) ModeInactiveStyle = lipgloss.NewStyle(). Foreground(CatOverlay). Padding(0, 1). MarginRight(1) ModeSelectorContainerStyle = lipgloss.NewStyle(). Padding(0, 1). MarginTop(1) // for the views ViewHeaderStyle = lipgloss.NewStyle().Foreground(CatMauve).Bold(true) // Individual stat styling (command palette & config) LabelStyle = lipgloss.NewStyle().Foreground(CatLavender).Bold(true).Width(15).Align(lipgloss.Left) ValueStyle = lipgloss.NewStyle().Foreground(CatSubtext).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 CreateModeFromSelection ¶ added in v0.1.3
func CreateModeFromSelection(selection string, lang database.Language) modes.ModeStrategy
CreateModeFromSelection parses the selection string and returns the appropriate ModeStrategy. It handles dynamic cases like "15s", "words 10"
func DisplayChart ¶ added in v0.1.3
func FormatTime ¶ added in v0.1.2
Types ¶
type ApplyModelOption ¶ added in v0.1.3
type ApplyModelOption func(*Model)
func WithSameQuote ¶ added in v0.1.3
func WithSameQuote(target string) ApplyModelOption
type Model ¶
type Model struct {
Session *engine.Session
Repo storage.HistoryRepository
Quitting bool
ProgressBar progress.Model
TerminalWidth int
TerminalHeight int
CurrentSelector components.Selector
IsSelectingMode bool
Mode modes.ModeStrategy
State core.SessionState
TimeLeft int
Active bool
// quote mode selection
QuoteType database.QuoteCategory
IsSelectingQuoteType bool
// words
InitialWords int
// Cached config or use default
CustomDashboard string
CurrentLanguage database.Language
// Cached chart for results view (prevents re-rendering shifts)
CachedChart string
// PR stats config
PRs storage.Stats
// contains filtered or unexported fields
}
func (Model) ApplyMode ¶ added in v0.1.3
func (m Model) ApplyMode(mode modes.ModeStrategy, options ...ApplyModelOption) Model
ApplyMode creates a new Model instance configured with the given strategy, preserving UI state from the current model
func (*Model) CacheChart ¶ added in v0.1.3
func (m *Model) CacheChart()
func (*Model) Deactivate ¶ added in v0.1.3
func (m *Model) Deactivate()
func (Model) GetDictionnaryModel ¶
func (Model) GetDictionnaryModelWithWords ¶
GetDictionnaryModelWithWords creates a model with custom words length for word mode typing tests
func (*Model) GetModelFromMode ¶ added in v0.1.3
GetModelFromMode does the same as the one above but just for the specific case of keytab
func (*Model) GetSession ¶ added in v0.1.3
func (*Model) GetTerminalWidth ¶ added in v0.1.3
func (*Model) GetTimeLeft ¶ added in v0.1.3
These functions are for the implementation of the ProcessTick interface
func (*Model) SetState ¶ added in v0.1.3
func (m *Model) SetState(s core.SessionState)
func (*Model) SetTimeLeft ¶ added in v0.1.3
Source Files
¶
Click to show internal directories.
Click to hide internal directories.