mirror of
https://github.com/mrusme/neonmodem.git
synced 2024-12-04 14:46:37 -05:00
Adjusted UI and colors
This commit is contained in:
parent
7c9c3413cb
commit
7308c9388e
@ -16,12 +16,24 @@ import (
|
|||||||
"github.com/mrusme/gobbs/ui/helpers"
|
"github.com/mrusme/gobbs/ui/helpers"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
|
ViewBorderColor = lipgloss.AdaptiveColor{
|
||||||
|
Light: "#b0c4de",
|
||||||
|
Dark: "#b0c4de",
|
||||||
|
}
|
||||||
|
|
||||||
|
DialogBorderColor = lipgloss.AdaptiveColor{
|
||||||
|
Light: "#b0c4de",
|
||||||
|
Dark: "#b0c4de",
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
listStyle = lipgloss.NewStyle().
|
listStyle = lipgloss.NewStyle().
|
||||||
Margin(0, 0, 0, 0).
|
Margin(0, 0, 0, 0).
|
||||||
Padding(1, 1).
|
Padding(1, 1).
|
||||||
Border(lipgloss.DoubleBorder()).
|
Border(lipgloss.DoubleBorder()).
|
||||||
BorderForeground(lipgloss.Color("#874BFD")).
|
BorderForeground(ViewBorderColor).
|
||||||
BorderTop(true).
|
BorderTop(true).
|
||||||
BorderLeft(true).
|
BorderLeft(true).
|
||||||
BorderRight(true).
|
BorderRight(true).
|
||||||
@ -36,25 +48,26 @@ var (
|
|||||||
BorderBottom(false)
|
BorderBottom(false)
|
||||||
|
|
||||||
dialogBoxStyle = lipgloss.NewStyle().
|
dialogBoxStyle = lipgloss.NewStyle().
|
||||||
Border(lipgloss.NormalBorder()).
|
Border(lipgloss.ThickBorder()).
|
||||||
BorderForeground(lipgloss.Color("#874BFD")).
|
BorderForeground(DialogBorderColor).
|
||||||
Padding(1, 0).
|
Padding(0, 0).
|
||||||
BorderTop(true).
|
Margin(0, 0, 0, 0).
|
||||||
|
BorderTop(false).
|
||||||
BorderLeft(true).
|
BorderLeft(true).
|
||||||
BorderRight(true).
|
BorderRight(true).
|
||||||
BorderBottom(true)
|
BorderBottom(true)
|
||||||
|
|
||||||
buttonStyle = lipgloss.NewStyle().
|
dialogBoxTitlebarStyle = lipgloss.NewStyle().
|
||||||
Foreground(lipgloss.Color("#FFF7DB")).
|
Align(lipgloss.Center).
|
||||||
Background(lipgloss.Color("#888B7E")).
|
Background(lipgloss.Color("#87cefa")).
|
||||||
Padding(0, 3).
|
Foreground(lipgloss.Color("#000000")).
|
||||||
MarginTop(1)
|
Padding(0, 1).
|
||||||
|
Margin(0, 0, 1, 0)
|
||||||
|
|
||||||
activeButtonStyle = buttonStyle.Copy().
|
dialogBoxBottombarStyle = lipgloss.NewStyle().
|
||||||
Foreground(lipgloss.Color("#FFF7DB")).
|
Foreground(lipgloss.Color("#999999")).
|
||||||
Background(lipgloss.Color("#F25D94")).
|
Padding(0, 1).
|
||||||
MarginRight(2).
|
Margin(1, 0, 0, 0)
|
||||||
Underline(true)
|
|
||||||
|
|
||||||
postAuthorStyle = lipgloss.NewStyle().
|
postAuthorStyle = lipgloss.NewStyle().
|
||||||
Foreground(lipgloss.Color("#F25D94")).
|
Foreground(lipgloss.Color("#F25D94")).
|
||||||
@ -199,14 +212,19 @@ func (m Model) View() string {
|
|||||||
))
|
))
|
||||||
|
|
||||||
if m.viewportOpen {
|
if m.viewportOpen {
|
||||||
okButton := activeButtonStyle.Render("[R]eply")
|
titlebar := dialogBoxTitlebarStyle.
|
||||||
cancelButton := buttonStyle.Render("Close")
|
Width(m.viewport.Width + 4).
|
||||||
|
Render("Post")
|
||||||
|
|
||||||
|
bottombar := dialogBoxBottombarStyle.
|
||||||
|
Width(m.viewport.Width + 4).
|
||||||
|
Render("r reply · esc close")
|
||||||
|
|
||||||
buttons := lipgloss.JoinHorizontal(lipgloss.Top, okButton, cancelButton)
|
|
||||||
ui := lipgloss.JoinVertical(
|
ui := lipgloss.JoinVertical(
|
||||||
lipgloss.Center,
|
lipgloss.Center,
|
||||||
|
titlebar,
|
||||||
viewportStyle.Render(m.viewport.View()),
|
viewportStyle.Render(m.viewport.View()),
|
||||||
buttons,
|
bottombar,
|
||||||
)
|
)
|
||||||
|
|
||||||
return helpers.PlaceOverlay(3, 2, dialogBoxStyle.Render(ui), view.String())
|
return helpers.PlaceOverlay(3, 2, dialogBoxStyle.Render(ui), view.String())
|
||||||
|
Loading…
Reference in New Issue
Block a user