constants

package
v0.0.0-...-6215870 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// P the current tea program
	P *tea.Program

	// WindowSize store the size of the terminal window
	WindowSize tea.WindowSizeMsg

	CustomTableBorder = table.Border{
		Top:    "─",
		Left:   "│",
		Right:  "│",
		Bottom: "─",

		TopRight:    "╮",
		TopLeft:     "╭",
		BottomRight: "╯",
		BottomLeft:  "╰",

		TopJunction:    "┬",
		LeftJunction:   "├",
		RightJunction:  "┤",
		BottomJunction: "┴",
		InnerJunction:  "┼",

		InnerDivider: "│",
	}

	LiveText = lipgloss.NewStyle().Background(lipgloss.AdaptiveColor{Light: "#ef2929", Dark: "#ef2929"}).Foreground(lipgloss.AdaptiveColor{Light: "#ffffff", Dark: "#ffffff"}).Bold(true)

	FinalText = lipgloss.NewStyle().Background(lipgloss.Color("#9356DF")).Foreground(lipgloss.Color("#ffffff")).Bold(true)
	DescText  = lipgloss.NewStyle().Foreground(lipgloss.Color("#818181"))

	ScoreText = lipgloss.NewStyle().Background(lipgloss.AdaptiveColor{Light: "214", Dark: "#181818"}).Foreground(lipgloss.AdaptiveColor{Light: "0", Dark: "214"})

	Accent       = lipgloss.AdaptiveColor{Light: "#5b1b7b", Dark: "#5b1b7b"}
	AccentDarker = lipgloss.AdaptiveColor{Light: "#5b1b7b", Dark: "#5b1b7b"}
	Secondary    = lipgloss.AdaptiveColor{Light: "#ed2265", Dark: "#ed2265"}
	Tertiary     = lipgloss.AdaptiveColor{Light: "#f69053", Dark: "#f69053"}

	TabStyle = lipgloss.NewStyle().
				Border(tabBorder, true).
				BorderForeground(Accent).
				Background(Accent).
				Foreground(lipgloss.Color("#FFFFFF")).
				Padding(0, 1)

	ActiveTabStyle = lipgloss.NewStyle().
					Border(activeTabBorder, true).
					BorderForeground(Secondary).
					Background(Secondary).
					Foreground(lipgloss.Color("#FFFFFF")).
					Bold(true).
					Padding(0, 1)

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

AlertStyle provides styling for alert messages

View Source
var BaseStyle = lipgloss.NewStyle().
	BorderStyle(lipgloss.RoundedBorder()).
	BorderForeground(Secondary)
View Source
var DocStyle = lipgloss.NewStyle().Margin(1, 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"))

HelpStyle styling for help context menu

View Source
var Keymap = keymap{
	Enter: key.NewBinding(
		key.WithKeys("enter"),
		key.WithHelp("↲/enter", "select"),
	),
	Yesterday: key.NewBinding(
		key.WithKeys("i", "left", "H"),
		key.WithHelp("←/i", "previous day"),
	),
	Tomorrow: key.NewBinding(
		key.WithKeys("o", "right", "L"),
		key.WithHelp("→/o", "next day"),
	),

	Follow: key.NewBinding(
		key.WithKeys("f"),
		key.WithHelp("f", "spawn a thread & sync the game live"),
	),
	PlayByPlay: key.NewBinding(
		key.WithKeys("p"),
		key.WithHelp("p", "toggle play-by-play view"),
	),
	Quit: key.NewBinding(
		key.WithKeys("ctrl+c", "q"),
		key.WithHelp("ctrl+c/q", "quit"),
	),
}

Keymap reusable key mappings shared across models

View Source
var TitleStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("#FFFFFF")).Background(Accent).Padding(0, 2)

TitleStyle styling for titles

Functions

func DescStyle

func DescStyle(desc string) string

func FinalStyle

func FinalStyle() string

func LiveStyle

func LiveStyle() string

func Max

func Max(a, b int) int

func ScoreStyle

func ScoreStyle(homeScore int, awayScore int) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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