habittracker

package
v0.0.0-...-9808391 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AlertStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("62")).Render

AlertStyle provides styling for alert messages

View Source
var DocStyle = lipgloss.NewStyle().Margin(0, 2)

DocStyle styling for viewports

View Source
var ErrStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("#bd534b")).Render

ErrStyle provides styling for error messages

View Source
var HelpStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("241")).Render

HelpStyle styling for help context menu

View Source
var Keymap = keymap{
	Create: key.NewBinding(
		key.WithKeys("c"),
		key.WithHelp("c", "create"),
	),
	Enter: key.NewBinding(
		key.WithKeys("enter"),
		key.WithHelp("enter", "select"),
	),
	Rename: key.NewBinding(
		key.WithKeys("r"),
		key.WithHelp("r", "rename"),
	),
	Delete: key.NewBinding(
		key.WithKeys("d"),
		key.WithHelp("d", "delete"),
	),
	Back: key.NewBinding(
		key.WithKeys("esc"),
		key.WithHelp("esc", "back"),
	),
	Quit: key.NewBinding(
		key.WithKeys("ctrl+c", "q"),
		key.WithHelp("ctrl+c/q", "quit"),
	),
	Tab: key.NewBinding(
		key.WithKeys("tab", ""),
		key.WithHelp("tab", "tab"),
	),
	Filter: key.NewBinding(
		key.WithKeys("/"),
		key.WithHelp("f", "filter"),
	),
	Tick: key.NewBinding(
		key.WithKeys("t"),
		key.WithHelp("t", "tick"),
	),
}

Keymap reusable key mappings shared across models

Functions

This section is empty.

Types

type Animation

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

func (*Animation) Complete

func (a *Animation) Complete() bool

func (*Animation) New

func (a *Animation) New()

func (*Animation) Selected

func (a *Animation) Selected() int

func (*Animation) Update

func (a *Animation) Update(s int, complete bool)

type Model

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

Model holds necessary charm models and more to bring the habit tracker to life!

func New

func New(cli api.HabitsClient) *Model

New creates a new Model.

func (Model) Init

func (m Model) Init() tea.Cmd

Init initializes Model behaviour. Here we start to tick to launch the progress bar animation

func (*Model) Update

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

Update captures the new tea.Msg and runs actions depending on the new message. msg can be a window resize, a keystroke, or a tick.

func (Model) View

func (m Model) View() string

View renders the view of the Model in a charming way.

Jump to

Keyboard shortcuts

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