-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathQuotesRand.go
34 lines (26 loc) · 865 Bytes
/
QuotesRand.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package main
import (
"github.com/charmbracelet/lipgloss"
)
func RenderQuote() string {
width := 72
dialogBoxStyle := lipgloss.NewStyle().
Border(lipgloss.RoundedBorder()).
BorderForeground((lipgloss.Color("#B071CC"))).
Padding(1, 0).
BorderTop(true).
BorderBottom(true).
BorderLeft(true).
BorderRight(true)
quote := GetQuotes()
cnt := lipgloss.NewStyle().Width(60).Align(lipgloss.Center).Render(quote.Content)
atr := lipgloss.NewStyle().Width(20).Align(lipgloss.Center).Render(quote.Author)
ui := lipgloss.JoinVertical(lipgloss.Center, cnt, atr)
dialog := lipgloss.Place(width, 10,
lipgloss.Center, lipgloss.Center,
dialogBoxStyle.Render(ui),
lipgloss.WithWhitespaceChars(""),
lipgloss.WithWhitespaceForeground(lipgloss.AdaptiveColor{Light: "#D9DCCF", Dark: "#383838"}),
)
return dialog
}