package main import ( "fmt" "image/color" "github.com/BigJk/crt" bubbleadapter "github.com/BigJk/crt/bubbletea" "github.com/BigJk/crt/shader" tea "github.com/charmbracelet/bubbletea" ) type model struct { money int } func (m model) Init() tea.Cmd { return nil } func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) { switch msg := msg.(type) { case tea.KeyMsg: switch msg.String() { case "ctrl+c": return m, tea.Quit case "up": m.money += 100 case "down": m.money -= 100 } } return m, nil } func (m model) View() string { return fmt.Sprintf("---\n\nViewing %d coins\n\n---", m.money) } func main() { fonts, err := crt.LoadFaces("assets/fonts/IosevkaTerm-Extended.ttf", "assets/fonts/IosevkaTerm-ExtendedBold.ttf", "assets/fonts/IosevkaTerm-ExtendedMedium.ttf", crt.GetFontDPI(), 16.0) if err != nil { panic(err) } win, _, err := bubbleadapter.Window(1000, 600, fonts, model{}, color.RGBA{R: 35, G: 33, B: 54, A: 255}) if err != nil { panic(err) } lotte, err := shader.NewCrtBasic() if err != nil { panic(err) } win.SetShader(lotte) if err := win.Run("Simple"); err != nil { panic(err) } }