ui

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var LinesWindowSize = 3

Functions

func CalcHorizontalPadding

func CalcHorizontalPadding() int

func CalcPaddingToCenterVertically

func CalcPaddingToCenterVertically(height, lines, offset int) string

func GetTermDimensions

func GetTermDimensions() (int, int, error)

Types

type Line

type Line struct {
	Text  []rune
	Start int
}

func AssignWords

func AssignWords(wordlist *wordlist.WordList, mode typing.Mode, duration time.Duration, wordCount int) (text []rune, lines []Line, lineBreaks []int)

func GetLinesFromWrappedText

func GetLinesFromWrappedText(text string) []Line

type Model

type Model struct {
	Text   []rune
	State  UIState
	Engine *typing.Engine
	Lines  []Line
	Width  int
	Height int
	Stats  *typing.Stats
	typing.Model
}

func NewModel

func NewModel(wordlist *wordlist.WordList, mode typing.Mode, duration time.Duration, wordCount int) Model

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() tea.View

type UIState

type UIState int
const (
	StateMenu UIState = iota
	StateTyping
	StateResults
)

Jump to

Keyboard shortcuts

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