Skip to content

Commit

Permalink
feat: splash working end-to-end
Browse files Browse the repository at this point in the history
  • Loading branch information
cfoust committed Nov 2, 2023
1 parent 113c2a3 commit 5d5b643
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
5 changes: 3 additions & 2 deletions pkg/cy/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -340,9 +340,10 @@ func (c *Client) initialize(handshake *P.HandshakeMessage) error {
screen.WithInteractive,
)

splashScreen := splash.New(c.Ctx(), handshake.Size)
c.outerLayers.NewLayer(
c.Ctx(),
splash.New(c.Ctx(), handshake.Size),
splashScreen.Ctx(),
splashScreen,
screen.PositionTop,
screen.WithOpaque,
screen.WithInteractive,
Expand Down
8 changes: 7 additions & 1 deletion pkg/mux/screen/splash/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ func (s *Splash) Update(msg tea.Msg) (taro.Model, tea.Cmd) {
switch msg.(type) {
case taro.ScreenUpdate:
return s, taro.WaitScreens(s.Ctx(), s.anim)
case taro.KeyMsg:
return s, tea.Quit
}

return s, nil
Expand Down Expand Up @@ -63,11 +65,15 @@ func (s *Splash) View(state *tty.State) {
"",
"by Caleb Foust",
"cy is open source and freely distributable",
"",
s.render.NewStyle().
Foreground(lipgloss.Color("2")).
Render("press any key to continue"),
)

boxStyle := s.render.NewStyle().
Border(lipgloss.RoundedBorder()).
BorderForeground(lipgloss.Color("#874BFD")).
BorderForeground(lipgloss.Color("7")).
BorderTop(true).
BorderLeft(true).
BorderRight(true).
Expand Down

0 comments on commit 5d5b643

Please sign in to comment.