-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy paththeme.go
More file actions
210 lines (179 loc) · 6.83 KB
/
Copy paththeme.go
File metadata and controls
210 lines (179 loc) · 6.83 KB
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
package theme
import (
"strings"
"github.com/charmbracelet/lipgloss"
)
/*
This file is for CLIs only — respects the user's terminal theme via ANSI colors.
The hex constants below are for brand identity (CSS, web, Python) — never use them in styles here.
All styles use ANSI color codes so Catppuccin, Dracula, Nord, Gruvbox etc. all look correct.
*/
const (
Gold = "#C9933A"
GoldLight = "#E8B86D"
GoldDark = "#A67830"
GoldDim = "#6B5530"
BgBase = "#0f0f0f"
BgRaised = "#1A1A1A"
BgElevated = "#242424"
BgOverlay = "#2E2E2E"
BorderSubtle = "#2A2A2A"
Border = "#3A3A3A"
BorderGold = "#5A4520"
TextPrimary = "#E8B86D"
TextSecondary = "#A67830"
TextTertiary = "#6B5530"
Success = "#4A7C59"
Warning = "#C9933A"
Error = "#8B3A3A"
Info = "#3A6B7C"
FontDisplay = "Cormorant Garamond"
FontMono = "IBM Plex Mono"
RadiusSm = 2
RadiusMd = 4
RadiusLg = 8
)
// ── Base styles ───────────────────────────────────────────────────────────────
var (
Primary = lipgloss.NewStyle().Foreground(lipgloss.Color("15")) // bright white
Muted = lipgloss.NewStyle().Foreground(lipgloss.Color("7")) // white
Dim = lipgloss.NewStyle().Foreground(lipgloss.Color("8")) // bright black
Bold = lipgloss.NewStyle().Foreground(lipgloss.Color("15")).Bold(true)
Italic = lipgloss.NewStyle().Foreground(lipgloss.Color("7")).Italic(true)
Inverse = lipgloss.NewStyle().
Foreground(lipgloss.Color("0")).
Background(lipgloss.Color("15"))
)
// ── Status styles ─────────────────────────────────────────────────────────────
var (
SuccessStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("2")).Bold(true) // green
ErrorStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("1")).Bold(true) // red
WarningStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("3")).Bold(true) // yellow
InfoStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("6")) // cyan
ProcessingStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("3")).Italic(true) // yellow italic
)
// ── Panel styles ──────────────────────────────────────────────────────────────
var (
Panel = lipgloss.NewStyle().
Border(lipgloss.RoundedBorder()).
BorderForeground(lipgloss.Color("8")).
Padding(0, 1)
PanelAccent = lipgloss.NewStyle().
Border(lipgloss.RoundedBorder()).
BorderForeground(lipgloss.Color("3")).
Padding(0, 1)
)
// ── Tag styles ────────────────────────────────────────────────────────────────
var (
// Tag — yellow, used for text note tags
Tag = lipgloss.NewStyle().
Foreground(lipgloss.Color("3")).
Background(lipgloss.Color("0")).
PaddingLeft(1).PaddingRight(1)
// TagArticle — blue, used for article note tags
TagArticle = lipgloss.NewStyle().
Foreground(lipgloss.Color("4")).
Background(lipgloss.Color("0")).
PaddingLeft(1).PaddingRight(1)
// TagImage — magenta, used for image note tags
TagImage = lipgloss.NewStyle().
Foreground(lipgloss.Color("5")).
Background(lipgloss.Color("0")).
PaddingLeft(1).PaddingRight(1)
// TagMuted — dim, used for secondary/metadata tags
TagMuted = lipgloss.NewStyle().
Foreground(lipgloss.Color("8")).
Background(lipgloss.Color("0")).
PaddingLeft(1).PaddingRight(1)
)
// ── Type badge styles ─────────────────────────────────────────────────────────
var (
// TypeText — green badge for text captures
TypeText = lipgloss.NewStyle().
Foreground(lipgloss.Color("2")).
Background(lipgloss.Color("0")).
Bold(true).
PaddingLeft(1).PaddingRight(1)
// TypeArticle — blue badge for article captures
TypeArticle = lipgloss.NewStyle().
Foreground(lipgloss.Color("4")).
Background(lipgloss.Color("0")).
Bold(true).
PaddingLeft(1).PaddingRight(1)
// TypeImage — magenta badge for image captures
TypeImage = lipgloss.NewStyle().
Foreground(lipgloss.Color("5")).
Background(lipgloss.Color("0")).
Bold(true).
PaddingLeft(1).PaddingRight(1)
)
// ── Search result styles ──────────────────────────────────────────────────────
var (
// SearchTitle — bright, bold — most prominent element per result
SearchTitle = lipgloss.NewStyle().
Foreground(lipgloss.Color("15")).
Bold(true)
// SearchScore — dim, right-aligned — present but not dominant
SearchScore = lipgloss.NewStyle().
Foreground(lipgloss.Color("8"))
// SearchDate — muted
SearchDate = lipgloss.NewStyle().
Foreground(lipgloss.Color("8"))
// SearchExcerpt — italic, muted, with left border
SearchExcerpt = lipgloss.NewStyle().
Foreground(lipgloss.Color("7")).
Italic(true).
BorderLeft(true).
BorderStyle(lipgloss.NormalBorder()).
BorderForeground(lipgloss.Color("8")).
PaddingLeft(1)
)
// ── Helper functions ──────────────────────────────────────────────────────────
// CaptureOK renders: ✓ saved · #tag1 #tag2 · 3ms
func CaptureOK(action, tags, duration string) string {
return SuccessStyle.Render("✓") + " " +
Primary.Render(action) + " " +
Muted.Render("· "+tags) + " " +
Dim.Render("· "+duration)
}
// CaptureQueued renders: ⏳ queued · type · id: xyz
func CaptureQueued(jobType, id string) string {
return ProcessingStyle.Render("⏳") + " " +
Muted.Render("queued · "+jobType) + " " +
Dim.Render("· id: "+id)
}
// Divider renders a full-width horizontal rule
func Divider(width int) string {
var b strings.Builder
for range width {
b.WriteString("─")
}
return Dim.Render(b.String())
}
// RenderTag renders a tag badge — type determines color
// noteType: "text" | "article" | "image" | "" (muted)
func RenderTag(tag, noteType string) string {
switch noteType {
case "article":
return TagArticle.Render(tag)
case "image":
return TagImage.Render(tag)
case "text":
return Tag.Render(tag)
default:
return TagMuted.Render(tag)
}
}
// RenderTypeBadge renders a capture type badge
func RenderTypeBadge(noteType string) string {
switch noteType {
case "text":
return TypeText.Render(noteType)
case "article":
return TypeArticle.Render(noteType)
case "image":
return TypeImage.Render(noteType)
default:
return TagMuted.Render(noteType)
}
}