summaryrefslogtreecommitdiff
path: root/internal/client/ui/ui.go
diff options
context:
space:
mode:
authorKyren223 <Kyren223@proton.me>2025-01-30 20:33:02 +0200
committerKyren223 <Kyren223@proton.me>2025-01-30 20:33:02 +0200
commitac01dff4e7b85198bd6c5179da93284cc57a96a8 (patch)
tree91bad79063e65fc03df17d0e44ba24971ceeb538 /internal/client/ui/ui.go
parent088baa6d3a63a7a6dea80afd07c48da99e2d19e8 (diff)
Started working on notifications for networks (got to carried away with
how it looks lol)
Diffstat (limited to 'internal/client/ui/ui.go')
-rw-r--r--internal/client/ui/ui.go21
1 files changed, 21 insertions, 0 deletions
diff --git a/internal/client/ui/ui.go b/internal/client/ui/ui.go
index 3d13ee8..1d07f40 100644
--- a/internal/client/ui/ui.go
+++ b/internal/client/ui/ui.go
@@ -219,6 +219,7 @@ func clamp(v, lower, upper int) int {
🭏🬽 🭈🭄
*/
+
func IconStyle(icon string, iconFg, iconBg, bg lipgloss.Color) lipgloss.Style {
bgStyle := lipgloss.NewStyle().Background(iconBg).Foreground(bg)
top := bgStyle.Render("🭠🭘 🭣🭕")
@@ -229,3 +230,23 @@ func IconStyle(icon string, iconFg, iconBg, bg lipgloss.Color) lipgloss.Style {
combined := lipgloss.JoinVertical(lipgloss.Left, top, middle, bottom)
return lipgloss.NewStyle().SetString(combined)
}
+
+var notifications = []string{
+ "󰲠", "󰲢", "󰲤", "󰲦", "󰲨", "󰲪", "󰲬", "󰲮", "󰲰", "󰲲",
+}
+
+func IconStyleNotif(icon string, iconFg, iconBg, bg lipgloss.Color, count int) lipgloss.Style {
+ notifStyle := lipgloss.NewStyle().Background(iconBg).Foreground(colors.Red)
+ notif := notifications[min(0, max(10, count)-1)]
+ notif = notifStyle.Render(notif)
+
+ bgStyle := lipgloss.NewStyle().Background(iconBg).Foreground(bg)
+ top := bgStyle.Render("🭠🭘 🭣🭕")
+ middle := lipgloss.NewStyle().Width(6).Align(lipgloss.Center).
+ Background(iconBg).Foreground(iconFg).Render(icon)
+ bgStyle2 := lipgloss.NewStyle().Foreground(iconBg).Background(bg)
+ bottom := bgStyle2.Render("🭥🭓██") + notif + bgStyle.Render("")
+ combined := lipgloss.JoinVertical(lipgloss.Left, top, middle, bottom)
+ return lipgloss.NewStyle().SetString(combined)
+}
+