26 lines
614 B
Go
26 lines
614 B
Go
|
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
|
||
|
}
|