summaryrefslogtreecommitdiff
path: root/internal
diff options
context:
space:
mode:
authorKyren223 <Kyren223@proton.me>2025-02-09 18:02:47 +0200
committerKyren223 <Kyren223@proton.me>2025-02-09 18:02:47 +0200
commitd95f6c48f06ede18797d8c6ac5fc841d1b456b0d (patch)
tree2fb0183a6ac853c274f41c182f1e73f37d1ee845 /internal
parentcddc7f0cc42acecd2e1e47a572980f7a45cde2a1 (diff)
Loading screen colors are now runtime-friendly
Diffstat (limited to 'internal')
-rw-r--r--internal/client/ui/loadscreen/loadscreen.go30
1 files changed, 26 insertions, 4 deletions
diff --git a/internal/client/ui/loadscreen/loadscreen.go b/internal/client/ui/loadscreen/loadscreen.go
index 4fe9a7d..2e0c9c2 100644
--- a/internal/client/ui/loadscreen/loadscreen.go
+++ b/internal/client/ui/loadscreen/loadscreen.go
@@ -8,11 +8,12 @@ import (
"github.com/charmbracelet/lipgloss"
"github.com/kyren223/eko/internal/client/ui"
+ "github.com/kyren223/eko/internal/client/ui/colors"
"github.com/kyren223/eko/pkg/assert"
)
var (
- style = lipgloss.NewStyle().Border(lipgloss.ThickBorder()).Padding(1, 3).MarginTop(2)
+ style = lipgloss.NewStyle().Border(lipgloss.ThickBorder()).Padding(1, 3)
loadingFrames = circleTrail(4, 4, 0, true, " ", "░░", "▒▒", "▓▓", "██")
loading = spinner.Spinner{
Frames: loadingFrames,
@@ -135,12 +136,33 @@ func (m Model) Init() tea.Cmd {
func (m Model) View() string {
width := lipgloss.Width(m.content)
height := lipgloss.Height(m.content)
- content := lipgloss.NewStyle().Width(width).Height(height).Render(m.content)
- content = style.Render(content)
+ content := lipgloss.NewStyle().
+ Width(width).
+ Height(height).
+ Render(m.content)
+ content = style.
+ MarginBackground(colors.Background).
+ Background(colors.Background).
+ Foreground(colors.White).
+ BorderBackground(colors.Background).
+ BorderForeground(colors.White).
+ Render(content)
+
+ spinner := m.sp.View()
+ spinner = lipgloss.NewStyle().
+ Width(lipgloss.Width(content)).
+ Align(lipgloss.Center).
+ Background(colors.Background).
+ Foreground(colors.White).
+ PaddingTop(1).PaddingBottom(2).
+ Render(spinner)
+
return lipgloss.Place(
ui.Width, ui.Height,
lipgloss.Center, lipgloss.Center,
- lipgloss.JoinVertical(lipgloss.Center, m.sp.View(), content),
+ // spinner+content,
+ lipgloss.JoinVertical(lipgloss.Top, spinner, content),
+ lipgloss.WithWhitespaceBackground(colors.Background),
)
}