gallery

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	APIBaseURL        = `https://api.trace.moe/search?anilistInfo`
	APIByURLParameter = `&url=`
)

Variables

View Source
var DefaultKeyMap = KeyMap{
	Paginator: paginator.KeyMap{
		NextPage: key.NewBinding(
			key.WithKeys("right", "l"),
			key.WithHelp("→/l", "Next Card"),
		),
		PrevPage: key.NewBinding(
			key.WithKeys("left", "h"),
			key.WithHelp("←/h", "Prev Card"),
		),
	},
	AltScreen: key.NewBinding(
		key.WithKeys("ctrl+s"),
		key.WithHelp("ctrl+s", "Toggle AltScreen"),
	),
	Search: key.NewBinding(
		key.WithKeys("enter"),
		key.WithHelp("enter", "Search"),
	),
	Focus: key.NewBinding(
		key.WithKeys("j"),
		key.WithHelp("j", "Form Focus"),
	),
	Blur: key.NewBinding(
		key.WithKeys("esc"),
		key.WithHelp("esc", "Form Blur"),
	),
	Help: key.NewBinding(
		key.WithKeys("ctrl+g"),
		key.WithHelp("ctrl+g", "Toggle Help"),
	),
	Quit: key.NewBinding(
		key.WithKeys("ctrl+c"),
		key.WithHelp("ctrl+c", "Quit"),
	),
}

Functions

This section is empty.

Types

type KeyMap

type KeyMap struct {
	Paginator paginator.KeyMap
	AltScreen key.Binding
	Search    key.Binding
	Focus     key.Binding
	Blur      key.Binding
	Help      key.Binding
	Quit      key.Binding
}

TODO: divide KeyMap in SearchMap, GalleryMap and GlobalMap structs

func (KeyMap) FullHelp

func (k KeyMap) FullHelp() [][]key.Binding

func (KeyMap) ShortHelp

func (k KeyMap) ShortHelp() []key.Binding

type Model

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

func New

func New(path string) Model

func (Model) Init

func (m Model) Init() tea.Cmd

func (Model) Update

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

func (Model) View

func (m Model) View() string

Jump to

Keyboard shortcuts

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