summaryrefslogtreecommitdiff
path: root/internal/generator/themes.go
blob: 710047108bfbe02b3956cbcb88c32bc9827f3d28 (plain)
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
package generator

// themeRegistry maps theme names to their HTML template strings.
// Each template must use {{template "navhints" .}}, {{template "navmodal" .}},
// and {{template "navscript" .}} — these are defined in shared.go (navDefs).
var themeRegistry = map[string]string{
	"neon":      neonTemplate,
	"terminal":  terminalTemplate,
	"synthwave": synthwaveTemplate,
	"plasma":    plasmaTemplate,  // replaced "minimal" — psychedelic drifting blobs
	"brutalist": brutalistTemplate,
	"volcano":   volcanoTemplate, // replaced "paper" — rising ember particles
	"aurora":    auroraTemplate,
	"matrix":    matrixTemplate,
	"ocean":     oceanTemplate,
	"retro":     retroTemplate,
	"cosmos":    cosmosTemplate,  // replaced "glass" — ringed planet, nebula, asteroids
}

// getTheme returns the HTML template string for the given theme name.
// Falls back to the neon theme if the name is unknown.
func getTheme(name string) string {
	if t, ok := themeRegistry[name]; ok {
		return t
	}
	return neonTemplate
}

// ListThemes returns a sorted list of all available theme names.
func ListThemes() []string {
	names := make([]string, 0, len(themeRegistry))
	for k := range themeRegistry {
		names = append(names, k)
	}
	// Sort for deterministic output in --help text.
	for i := 0; i < len(names); i++ {
		for j := i + 1; j < len(names); j++ {
			if names[i] > names[j] {
				names[i], names[j] = names[j], names[i]
			}
		}
	}
	return names
}