1
0
forked from nbsp/welcome
welcome/app/introduction.go
2025-04-03 05:04:46 +00:00

32 lines
1.1 KiB
Go

package app
import (
"git.sr.ht/~rockorager/vaxis"
"git.tilde.town/nbsp/welcome/ui"
)
type Introduction struct{}
func (view *Introduction) Event(state *ui.State, event vaxis.Event) (processed bool) {
if key, ok := event.(vaxis.Key); ok && key.EventType == vaxis.EventPress {
switch key.String() {
case "Ctrl+c", "Ctrl+d":
close(ui.Quit)
case "Enter":
ui.ViewChange <- NewSettings()
}
processed = true
}
win := state.Window().New(0, 0, 80, state.Window().Height)
win.Wrap(vaxis.Segment{Text: `──── welcome to tilde town ────
`, Style: vaxis.Style{Foreground: vaxis.IndexColor(5)}}, vaxis.Segment{Text: `Welcome to tilde town! we're glad you're here.
This short tutorial will help you get accustomed to the TERMINAL: the text-based user interface that you need for interacting with tilde.town. If you're here, this means you've successfully connected to town over ssh. Excellent work <3
Please make sure your terminal window is decently tall, otherwise some stuff may get cut off.
Press Enter to continue to the next page. If you want to skip this tutorial you can press Ctrl+C or Ctrl+D at any point to exit to a shell.`})
return
}