From f3155cbc866a1b261a0aafe61683da1e3c25b1ef Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Fri, 10 Apr 2026 09:22:06 +0300 Subject: add WebGL scenes to all themes, sounds, image sizing, new themes - All 11 themes now have unique Three.js WebGL backgrounds: aurora: flowing sine-wave ribbon meshes with additive blending brutalist: harsh rotating white/red wireframe boxes glass: drifting crystal icosahedron shards, semi-transparent matrix: digital rain particle columns with per-vertex colour fade ocean: animated vertex-displaced wave surface with orbiting light retro: amber demo-scene cube with orbiting octahedrons synthwave: sunset sphere with scan-line rings and perspective grid terminal: green icosahedron wireframe with orbiting torus particles neon: existing Three.js orb and rings (unchanged) plasma (replaces minimal): drifting additive-blend colour blobs volcano (replaces paper): rising ember particles with lifecycle - shared.go: distinct sounds for j/k nav (220Hz beep), Enter (ascending triangle chime), and Esc (descending sine sweep) - shared.go: images are now thumbnails (max-height:220px) in list view and expand to full width inside the modal (CSS override in navmodal) - main.go: --list-themes flag prints all theme names and exits; --theme random picks a random theme at all generation time - themes.go: updated registry with plasma/volcano replacing minimal/paper Co-Authored-By: Claude Sonnet 4.6 --- cmd/snonux/main.go | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'cmd') diff --git a/cmd/snonux/main.go b/cmd/snonux/main.go index 5a9c9d3..58d6cb5 100644 --- a/cmd/snonux/main.go +++ b/cmd/snonux/main.go @@ -11,8 +11,10 @@ import ( "flag" "fmt" "log" + "math/rand" "os" "path/filepath" + "strings" "codeberg.org/snonux/snonux/internal/config" "codeberg.org/snonux/snonux/internal/generator" @@ -31,15 +33,29 @@ func main() { } // parseFlags reads CLI flags and returns a validated Config. +// Special theme value "random" picks a theme at random from the registry. func parseFlags() (*config.Config, error) { cfg := &config.Config{} + listThemes := flag.Bool("list-themes", false, "print all available theme names and exit") flag.StringVar(&cfg.InputDir, "input", "./inbox", "directory containing new source files to process") flag.StringVar(&cfg.OutputDir, "output", "~/git/snonux.foo/dist", "root directory for generated static site output") flag.StringVar(&cfg.BaseURL, "base-url", "https://snonux.foo", "canonical base URL used in Atom feed links") - flag.StringVar(&cfg.Theme, "theme", "neon", "visual theme: aurora, brutalist, glass, matrix, minimal, neon, ocean, paper, retro, synthwave, terminal") + flag.StringVar(&cfg.Theme, "theme", "neon", "visual theme name, or \"random\" to pick one at random") flag.Parse() + if *listThemes { + fmt.Println(strings.Join(generator.ListThemes(), "\n")) + os.Exit(0) + } + + // Resolve the special "random" value before any further validation. + if cfg.Theme == "random" { + themes := generator.ListThemes() + cfg.Theme = themes[rand.Intn(len(themes))] + log.Printf("random theme selected: %s", cfg.Theme) + } + var err error cfg.InputDir, err = expandHome(cfg.InputDir) -- cgit v1.2.3