TheMathemagicians/sevenkeys/ui/view.go

26 lines
614 B
Go
Raw Normal View History

2024-06-05 12:06:24 +00:00
package ui
import (
"os"
"path/filepath"
"github.com/lukesampson/figlet/figletlib"
)
func (m Model) View() string {
var ui string
if m.WindowWidth > 0 {
cwd, _ := os.Getwd()
fontsdir := filepath.Join(cwd, "fonts")
slantFont, _ := figletlib.GetFontByName(fontsdir, "slant")
termFont, _ := figletlib.GetFontByName(fontsdir, "term")
ui += figletlib.SprintMsg("SEVENKEYS", slantFont, m.WindowWidth, slantFont.Settings(), "center")
ui += figletlib.SprintMsg("the ultimate Magic: the Gathering trading card storage system", termFont, m.WindowWidth, termFont.Settings(), "center")
}
return ui
}