1
0
mirror of https://github.com/mrusme/neonmodem.git synced 2024-11-03 04:27:16 -05:00

Adjusted colors, improved UI

This commit is contained in:
マリウス 2023-01-01 01:23:46 -05:00
parent f087546f21
commit c119cd9f73
No known key found for this signature in database
GPG Key ID: 272ED814BF63261F
2 changed files with 17 additions and 11 deletions

View File

@ -158,7 +158,7 @@ func SetDefaults(cacheDir string) {
[]bool{true, true, true, true},
)
viper.SetDefault("Theme.PostsList.List.Focused.Border.Foreground",
lipgloss.AdaptiveColor{Light: "#333333", Dark: "#cccccc"})
lipgloss.AdaptiveColor{Light: "#00ffff", Dark: "#00ffff"})
// PostsList List:Blurred
viper.SetDefault("Theme.PostsList.List.Blurred.Margin",
@ -194,21 +194,21 @@ func SetDefaults(cacheDir string) {
[]bool{false, false, false, true},
)
viper.SetDefault("Theme.PostsList.Item.Selected.Border.Foreground",
lipgloss.AdaptiveColor{Light: "#000000", Dark: "#FFFFFF"})
lipgloss.AdaptiveColor{Light: "#ffd500", Dark: "#ffd500"})
viper.SetDefault("Theme.PostsList.Item.Selected.Foreground",
lipgloss.AdaptiveColor{Light: "#000000", Dark: "#FFFFFF"})
lipgloss.AdaptiveColor{Light: "#F25D94", Dark: "#F25D94"})
// PostsList ItemDetail:Focused
viper.SetDefault("Theme.PostsList.ItemDetail.Focused.Padding",
[]int{0, 0, 0, 2})
viper.SetDefault("Theme.PostsList.ItemDetail.Focused.Foreground",
lipgloss.AdaptiveColor{Light: "#333333", Dark: "#cccccc"})
lipgloss.AdaptiveColor{Light: "#666666", Dark: "#4d4d4d"})
// PostsList ItemDetail:Blurred
viper.SetDefault("Theme.PostsList.ItemDetail.Blurred.Padding",
[]int{0, 0, 0, 2})
viper.SetDefault("Theme.PostsList.ItemDetail.Blurred.Foreground",
lipgloss.AdaptiveColor{Light: "#cccccc", Dark: "#333333"})
lipgloss.AdaptiveColor{Light: "#666666", Dark: "#4d4d4d"})
// PostsList ItemDetail:Selected
viper.SetDefault("Theme.PostsList.ItemDetail.Selected.Padding",
@ -219,7 +219,7 @@ func SetDefaults(cacheDir string) {
[]bool{false, false, false, true},
)
viper.SetDefault("Theme.PostsList.ItemDetail.Selected.Border.Foreground",
lipgloss.AdaptiveColor{Light: "#000000", Dark: "#FFFFFF"})
lipgloss.AdaptiveColor{Light: "#ffd500", Dark: "#ffd500"})
viper.SetDefault("Theme.PostsList.ItemDetail.Selected.Foreground",
lipgloss.AdaptiveColor{Light: "#000000", Dark: "#FFFFFF"})
@ -274,5 +274,5 @@ func SetDefaults(cacheDir string) {
viper.SetDefault("Theme.Reply.Author.Foreground",
lipgloss.AdaptiveColor{Light: "#000000", Dark: "#00000"})
viper.SetDefault("Theme.Reply.Author.Background",
lipgloss.AdaptiveColor{Light: "#5f9ea0", Dark: "#5f9ea0"})
lipgloss.AdaptiveColor{Light: "#ffd500", Dark: "#ffd500"})
}

View File

@ -301,7 +301,7 @@ func (m *Model) renderViewport(p *post.Post) string {
body = p.Body
}
out += fmt.Sprintf(
" %s\n %s\n%s",
" %s\n\n %s\n%s",
m.ctx.Theme.Post.Author.Render(
fmt.Sprintf("%s %s:", p.Author.Name, adj),
),
@ -309,7 +309,7 @@ func (m *Model) renderViewport(p *post.Post) string {
body,
)
out += m.renderReplies(0, p.Author.Name, &p.Replies)
out += m.renderReplies(0, 1, p.Author.Name, &p.Replies)
m.focused = "post"
return out
@ -317,6 +317,7 @@ func (m *Model) renderViewport(p *post.Post) string {
func (m *Model) renderReplies(
level int,
idx int,
inReplyTo string,
replies *[]reply.Reply,
) string {
@ -344,17 +345,22 @@ func (m *Model) renderReplies(
author = re.Author.Name
}
out += fmt.Sprintf(
"\n\n %s %s\n%s",
"\n\n %s %s%s%s\n%s",
m.ctx.Theme.Reply.Author.Render(
author,
),
lipgloss.NewStyle().
Foreground(m.ctx.Theme.Reply.Author.GetBackground()).
Render(fmt.Sprintf("writes in reply to %s:", inReplyTo)),
strings.Repeat(" ", (m.viewport.Width-len(author)-len(inReplyTo)-26)),
lipgloss.NewStyle().
Foreground(lipgloss.Color("#777777")).
Render(fmt.Sprintf("#%d", idx)),
body,
)
out += m.renderReplies(level+1, re.Author.Name, &re.Replies)
idx++
out += m.renderReplies(level+1, idx, re.Author.Name, &re.Replies)
}
return out