src

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2025 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultForegroundColor         = gloss.AdaptiveColor{Light: conf.defaultUnfocusedLight, Dark: conf.defaultForegroundDark}
	DefaultUnfocusedColor          = gloss.AdaptiveColor{Light: conf.defaultUnfocusedLight, Dark: conf.defaultUnfocusedDark}
	DefaultActiveTabIndicatorColor = gloss.AdaptiveColor{Light: conf.defaultActiveTabLight, Dark: conf.defaultActiveTabDark}

	DefaultWindowBorder = gloss.Border{
		Top:         " ",
		Bottom:      "─",
		Left:        "│",
		Right:       "│",
		TopLeft:     "│",
		TopRight:    "│",
		BottomLeft:  "└",
		BottomRight: "┘",
	}

	DefaultTabBorder = gloss.Border{
		Top:         "─",
		Bottom:      "─",
		Left:        "│",
		Right:       "│",
		TopLeft:     "╭'",
		TopRight:    "╮",
		BottomLeft:  "┴",
		BottomRight: "┴",
	}

	DefaultActiveTabBorder = gloss.Border{
		Top:         "─",
		Bottom:      " ",
		Left:        "│",
		Right:       "│",
		TopLeft:     "╭'",
		TopRight:    "╮",
		BottomLeft:  "┘",
		BottomRight: "└",
	}

	DefaultTabSpacerBorder = gloss.Border{
		Bottom:      "─",
		BottomRight: "┐",
	}
)

Default colors and borders are defined here as adaptive properties to support light and dark modes. These settings provide a cohesive appearance across different themes.

Functions

func AutoHeal added in v1.1.0

func AutoHeal()

* AutoHeal * ------------------ * This function is responsible for downloading missing components (internal dependecies) such * as the update script, uninstaller, config files and the VERSION profile, which are important * for the application to function properly. * If the script fails to run, an error message is displayed on the terminal, * and the program exits with a non-zero status.

func ExecuteAppStub

func ExecuteAppStub()

func ExpandPath

func ExpandPath(path string) string

func RunUninstalScript

func RunUninstalScript()

func RunUpdateScript

func RunUpdateScript()

func ViewVersion

func ViewVersion()

* ViewVersion * ------------------ * This function is responsible for printing the VERSION information of * the application * If the script fails to run, an error message is displayed on the terminal, * and the program exits with a non-zero status.

Types

type Anime added in v1.1.0

type Anime struct {
	ID       string   `json:"id"`
	Title    string   `json:"title"`
	SubCount float64  `json:"subCount"`
	DubCount float64  `json:"dubCount"`
	Episodes Episodes `json:"episodes"`
}

AnimeResponse is a struct that represents the response format for anime search queries. It contains a single field, Result, which is a slice of slices containing interface{} elements. This is used to store the search results from the API response.

type AnimeResponse

type AnimeResponse struct {
	Result []Anime `json:"result"`
}

ApiResponse represents the overall API response structure

type AppState

type AppState int
const (
	AppScreen AppState = iota
	ErrorScreen
)

AppStates for AppScreen and ErrorScreen for window resize errors

type Config

type Config struct {
	Tab1FocusActive             string
	Tab1FocusInactive           string
	Tab1TableSelectedBackground string
	Tab1TableSelectedForeground string
	Tab1SpinnerColor            string
	Tab1SpinnerMsgColor         string
	Tab1KaizenAscciArtColor     string
	// contains filtered or unexported fields
}

func LoadConfig

func LoadConfig() Config

type Episodes added in v1.1.0

type Episodes struct {
	Sub []string `json:"sub"`
	Dub []string `json:"dub"`
}

Episodes represents the subtitled and dubbed episode lists

type MainModel

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

func (MainModel) Init

func (m MainModel) Init() tea.Cmd

func (MainModel) Update

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

Update handles incoming messages and updates the MainModel's state. * Parameters: * - msg: The incoming message to handle. * Returns: An updated MainModel and a command to execute.

func (MainModel) View

func (m MainModel) View() string

View renders the current screen based on the AppState. Returns: A string representing the current screen's content.

type StreamUtils

type StreamUtils struct {
	Link string `json:"direct"`
}

StreamUtils is a struct that represents the response format for retrieving a direct streaming link. It contains a single field, Link, which holds the direct URL to the stream.

type Styles

type Styles struct {
	Tab               gloss.Style
	ActiveTab         gloss.Style
	TabSpacer         gloss.Style
	TabIndicator      gloss.Style
	TabIndicatorLeft  string
	TabIndicatorRight string
	TabWindow         gloss.Style
}

Styles struct defines the styling properties for UI components in the application. It includes styles for tabs, active tabs, tab spacers, tab indicators, and the tab window. The styles use the Lipgloss library to manage colors, borders, and padding.

func NewTabStyles

func NewTabStyles() Styles

NewTabStyles creates and returns a Styles struct configured with default properties. These styles define the appearance of the tabs and their associated elements like borders and indicators.

type Tab1Model

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

func NewTab1Model

func NewTab1Model() Tab1Model

func (Tab1Model) Init

func (m Tab1Model) Init() tea.Cmd

func (Tab1Model) Update

func (m Tab1Model) Update(msg tea.Msg) (Tab1Model, tea.Cmd)

func (Tab1Model) View

func (m Tab1Model) View() string

* View * ----- * Renders the TUI, with active components and ASCII art. * Renders the spinner when required, and removes when required

type Tab1styles

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

Tab1styles struct defines the styling for the specific elements of Tab1. This includes borders for lists, inputs, tables, and active/inactive color properties. It uses the Lipgloss library for consistent styling throughout the UI.

func Tab1Styles

func Tab1Styles() Tab1styles

Tab1Styles creates and returns a Tab1styles struct configured with specific styles for Tab1 components. This includes list borders, input borders, table borders, and active/inactive color settings.

type Tab2Model

type Tab2Model struct{}

func NewTab2Model

func NewTab2Model() Tab2Model

func (Tab2Model) Init

func (m Tab2Model) Init() tea.Cmd

func (Tab2Model) Update

func (m Tab2Model) Update(_ tea.Msg) (Tab2Model, tea.Cmd)

func (Tab2Model) View

func (m Tab2Model) View() string

Jump to

Keyboard shortcuts

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