common

package
v0.0.0-...-88edec5 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2024 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Frames = []string{
	`
 /$$                   /$$                     /$$$$$$            /$$           /$$
| $$                  | $$                    /$$__  $$          |__/          | $$
| $$        /$$$$$$  /$$$$$$   /$$$$$$$      | $$  \ $$ /$$   /$$ /$$ /$$$$$$$$| $$
| $$       /$$__  $$|_  $$_/  /$$_____/      | $$  | $$| $$  | $$| $$|____ /$$/| $$
| $$      | $$$$$$$$  | $$   |  $$$$$$       | $$  | $$| $$  | $$| $$   /$$$$/ |__/
| $$      | $$_____/  | $$ /$$\____  $$      | $$/$$ $$| $$  | $$| $$  /$$__/      
| $$$$$$$$|  $$$$$$$  |  $$$$//$$$$$$$/      |  $$$$$$/|  $$$$$$/| $$ /$$$$$$$$ /$$
|________/ \_______/   \___/ |_______/        \____ $$$ \______/ |__/|________/|__/
                                                   \__/
`,
	`
 /$$                   /$$                     /$$$$$$            /$$           /$$
| $$                  | $$                    /$$__  $$          |__/          | $$
| $$        /$$$$$$  /$$$$$$   /$$$$$$$      | $$  \ $$ /$$   /$$ /$$ /$$$$$$$$| $$
| $$       /$$__  $$|_  $$_/  /$$_____/      | $$  | $$| $$  | $$| $$|____ /$$/| $$
| $$      | $$$$$$$$  | $$   |  $$$$$$       | $$  | $$| $$  | $$| $$   /$$$$/ |__/
| $$      | $$_____/  | $$ /$$\____  $$      | $$/$$ $$| $$  | $$| $$  /$$__/      
| $$$$$$$$|  $$$$$$$  |  $$$$//$$$$$$$/      |  $$$$$$/|  $$$$$$/| $$ /$$$$$$$$ /$$
|________/ \_______/   \___/ |_______/        \____ $$$ \______/ |__/|________/|__/
                                                   \__/
`,
}

Functions

func Tick

func Tick() tea.Cmd

Types

type Button

type Button struct {
	Label string
}

type ConfirmationDialog

type ConfirmationDialog struct {
	Message    string
	Active     bool
	Confirmed  bool
	ConfirmKey key.Binding
	CancelKey  key.Binding
}

func NewConfirmationDialog

func NewConfirmationDialog() ConfirmationDialog

func (*ConfirmationDialog) Update

func (d *ConfirmationDialog) Update(msg tea.Msg) (bool, bool)

func (*ConfirmationDialog) View

func (d *ConfirmationDialog) View() string

type Model

type Model struct {
	CurrentScreen      string
	Cursor             int
	Choices            []string
	Selected           string
	Tick               tea.Cmd
	Banner             string
	Frame              int
	WindowWidth        int
	WindowHeight       int
	ButtonPos          []Rect
	Table              table.Model
	Buttons            []Button
	Form               *huh.Form
	ConfirmationDialog ConfirmationDialog
	Focused            string
	IsPlaying          bool
}

func InitializeChoices

func InitializeChoices(screen string) Model

InitializeChoices sets up the initial choices for a given screen

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 QuizDynamicFormsCompletedMsg

type QuizDynamicFormsCompletedMsg struct{}

QuizDynamicFormsCompletedMsg is a message used to signal that all dynamic forms has been completed.

type QuizMetaDataFormCompletedMsg

type QuizMetaDataFormCompletedMsg struct{}

QuizMetaDataFormCompletedMsg is a message used to signal that a metadata form has been completed.

type Rect

type Rect struct {
	X      int
	Y      int
	Width  int
	Height int
}

type TickMsg

type TickMsg time.Time

Jump to

Keyboard shortcuts

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