Skip to content

Commit

Permalink
Add logo to main page
Browse files Browse the repository at this point in the history
  • Loading branch information
RamanaReddy0M committed Feb 9, 2023
1 parent 83d8a12 commit efcf1ec
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 9 deletions.
46 changes: 46 additions & 0 deletions internal/ui/logo.go
@@ -0,0 +1,46 @@
package ui

import (
"strings"

"github.com/derailed/tview"
"github.com/gdamore/tcell/v2"
)

// LogoSmall cls small log.
var LogoSmall = []string{
`_________ .__ `,
`\_ ___ \| | ______`,
`/ \ \/| | / ___/`,
`\ \___| |__\___ \ `,
` \______ /____/____ >`,
` \/ \/ `,
}

// LogoBig cls big logo for splash page.
var LogoBig = []string{
`█▀▀ █ █▀▀█ █ █ █▀▀▄ █ █▀▀ █▀▀▄ █▀▀`,
`█ █ █ █ █ █ █ █ █ █▀▀ █ █ ▀▀█`,
`▀▀▀ ▀▀▀ ▀▀▀▀ ▀▀▀ ▀▀▀ ▀▀▀ ▀▀▀ ▀ ▀ ▀▀▀`,
}

type Logo struct {
*tview.Flex
logo *tview.TextView
}

func NewLogo() *Logo {
l := Logo{
Flex: tview.NewFlex(),
logo: tview.NewTextView(),
}
l.SetDirection(tview.FlexRow)
l.buildLogo()
l.AddItem(l.logo, 6, 1, false)
return &l
}

func (l *Logo) buildLogo() {
l.logo.SetText(strings.Join(LogoSmall, "\n"))
l.logo.SetTextColor(tcell.ColorOrange)
}
6 changes: 0 additions & 6 deletions internal/ui/splash.go
Expand Up @@ -7,12 +7,6 @@ import (
"github.com/gdamore/tcell/v2"
)

// LogoBig K9s big logo for splash page.
var LogoBig = []string{
`█▀▀ █░░ █▀▀█ █░░█ █▀▀▄ █░░ █▀▀ █▀▀▄ █▀▀`,
`█░░ █░░ █░░█ █░░█ █░░█ █░░ █▀▀ █░░█ ▀▀█`,
`▀▀▀ ▀▀▀ ▀▀▀▀ ░▀▀▀ ▀▀▀░ ▀▀▀ ▀▀▀ ▀░░▀ ▀▀▀`,
}

type Splash struct {
*tview.Flex
Expand Down
6 changes: 3 additions & 3 deletions internal/view/app.go
Expand Up @@ -956,9 +956,9 @@ func (a *App) buildHeader() tview.Primitive {
if !a.showHeader {
return header
}
header.AddItem(a.info(), 0, 1, false)
header.AddItem(a.Menu(), 0, 2, false)
header.AddItem(tview.NewBox(), 0, 1, false)
header.AddItem(a.info(), 50, 1, false)
header.AddItem(a.Menu(), 0, 1, false)
header.AddItem(ui.NewLogo(), 26, 1, false)
return header
}

Expand Down

0 comments on commit efcf1ec

Please sign in to comment.