.gitignore 🔗
@@ -41,7 +41,7 @@ Thumbs.db
.env
.env.local
-.crush/
+**/.crush/**
crush
Ayman Bagabas created
.gitignore | 2
.goreleaser.yml | 1
internal/tui/components/logo/logo.go | 46 +++++++++++++++++++++++++++++
3 files changed, 47 insertions(+), 2 deletions(-)
@@ -41,7 +41,7 @@ Thumbs.db
.env
.env.local
-.crush/
+**/.crush/**
crush
@@ -115,6 +115,7 @@ nfpms:
- formats:
- deb
- rpm
+ - archlinux
file_name_template: "{{ .ConventionalFileName }}"
contents:
- src: ./completions/crush.bash
@@ -1,3 +1,4 @@
+// Package logo renders a Crush wordmark in a stylized way.
package logo
import (
@@ -42,7 +43,14 @@ func Render(version string, compact bool, o Opts) string {
}
// Title.
- crush := renderWord(1, !compact, letterC, letterR, letterU, letterS, letterH)
+ const spacing = 1
+ crush := renderWord(spacing, !compact,
+ letterC,
+ letterR,
+ letterU,
+ letterSStylized,
+ letterH,
+ )
crushWidth := lipgloss.Width(crush)
b := new(strings.Builder)
for r := range strings.SplitSeq(crush, "\n") {
@@ -252,6 +260,42 @@ func letterS(stretch bool) string {
)
}
+// letterSStylized renders the letter S in a stylized way, more so than
+// [letterS]. It takes an integer that determines how many cells to stretch the
+// letter. If the stretch is less than 1, it defaults to no stretching.
+func letterSStylized(stretch bool) string {
+ // Here's what we're making:
+ //
+ // ▄▀▀▀▀▀
+ // ▀▀▀▀▀█
+ // ▀▀▀▀▀
+
+ left := heredoc.Doc(`
+ ▄
+ ▀
+ ▀
+ `)
+ center := heredoc.Doc(`
+ ▀
+ ▀
+ ▀
+ `)
+ right := heredoc.Doc(`
+ ▀
+ █
+ `)
+ return joinLetterform(
+ left,
+ stretchLetterformPart(center, letterformProps{
+ stretch: stretch,
+ width: 3,
+ minStretch: 7,
+ maxStretch: 12,
+ }),
+ right,
+ )
+}
+
// letterU renders the letter U in a stylized way. It takes an integer that
// determines how many cells to stretch the letter. If the stretch is less than
// 1, it defaults to no stretching.