package net import ( "strings" "thehouseoficarus/internal/color" ) func artColor(r rune) string { switch r { case '@': return color.FgCode("ansi", 4) case '!', ':', '.': return color.StyleCode("dim") + color.FgCode("ansi", 4) case ',': return color.FgCode("ansi", 5) case '*': return color.FgCode("ansi", 5) case '+', '|', '-': return color.FgCode("ansi", 3) } return "" } func colorizeRunes(s string) string { var sb strings.Builder current := "" for _, r := range s { want := artColor(r) if want != current { if current != "" { sb.WriteString(color.Reset) } if want != "" { sb.WriteString(want) } current = want } sb.WriteRune(r) } if current != "" { sb.WriteString(color.Reset) } return sb.String() } func colorizeArt(art string) string { welcomeText := "welcome to the house of icarus" before, after, found := strings.Cut(art, welcomeText) if found { return colorizeRunes(before) + color.FgCode("ansi", 7) + welcomeText + color.Reset + colorizeRunes(after) } return colorizeRunes(art) } func WelcomeBanner() string { return colorizeArt(` | * * + -+- . , | . , . , * @@@@@@@ @@@ @@@ @@@@@@@@ @@@ @@@ @@@@@@ @@@ @@@ @@@@@@ @@@@@@@@ + @@! @@! @@@ @@! + @@! @@@ @@! @@@ @@! @@@ !@@ @@! @!! @!@!@!@! @!!!:! @!@!@!@! @!@ !@! @!@ !@! !@@!! @!!!:! * !!: !!: !!! !!: . !!: !!! !!: !!! !!: !!! :!; !!: : : : : : :: ::: : : : : :. : :.:: : ::.: : : :: ::: . . + * welcome to the house of icarus , , , . @@@@@@ @@@@@@@@ @@@ @@@@@@@ @@@@@@ @@@@@@@ @@@ @@@ @@@@@@ @@! @@@ @@! , @@! !@@ @@! @@@ @@! @@@ @@! @@@ !@@ | @!@ !@! @!!!:! !!@ @!@ @!@!@!@! @!@!!@! @!@ !@! !@@!! -+- !!: !!! !!: !!: :!! !!: !!! !!: :!! !!: !!! :! | : :. : : . : :: :: : : : : : : : :.:: : ::.: : , . + , . . , * . , * + `) }