mirror of
https://github.com/EnumeratedDev/stormfetch.git
synced 2026-09-16 07:56:12 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9ce8e5ef0b
|
||
|
|
92ea038c77
|
@@ -1,23 +1,23 @@
|
||||
#/43;45;45;15
|
||||
${C3}.%1-------------------------:
|
||||
%3.%1-------------------------:
|
||||
.%2+=%1========================.
|
||||
:%2++%1===%2++===%1===============- :%2++%1-
|
||||
:%2*++%1====%2+++++==%1===========- .==:
|
||||
-%2*+++%1=====%2+***++=%1=========:
|
||||
=%2*++++=%1=======------------:
|
||||
=%2*+++++=%1====- ${C3}...%1
|
||||
=%2*+++++=%1====- %3...%1
|
||||
.%2+*+++++%1=-===: .%2=+++=%1:
|
||||
:%2++++%1=====-==: -***%2**%1+
|
||||
:%2++=%1=======-=. .=+**+${C3}.%1
|
||||
.%2+%1==========-. ${C3}.%1
|
||||
:%2+++++++%1====- ${C3}.%1--==-${C3}.%1
|
||||
:%2++%1==========. ${C3}:%2+++++++%1${C3}:
|
||||
:%2++=%1=======-=. .=+**+%3.%1
|
||||
.%2+%1==========-. %3.%1
|
||||
:%2+++++++%1====- %3.%1--==-%3.%1
|
||||
:%2++%1==========. %3:%2+++++++%1%3:
|
||||
%1.-===========. =*****+*+
|
||||
%1.-===========: .+*****+:
|
||||
%1-=======%2++++%1:::::::::::::::::::::::::-: ${C3}.%1---:
|
||||
%1-=======%2++++%1:::::::::::::::::::::::::-: %3.%1---:
|
||||
:======%2++++%1====%2+++******************=.
|
||||
%1:=====%2+++%1==========%2++++++++++++++*-
|
||||
%1.====%2++%1==============%2++++++++++*-
|
||||
%1.===%2+%1==================%2+++++++:
|
||||
%1.-=======================%2+++:
|
||||
${C3}..........................
|
||||
%3..........................
|
||||
|
||||
+16
-1
@@ -6,6 +6,7 @@ import (
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
"unicode"
|
||||
)
|
||||
|
||||
// Build-time variables
|
||||
@@ -48,6 +49,20 @@ func run() {
|
||||
}
|
||||
asciiArtNoColor := asciiArt
|
||||
|
||||
// Rewrite last color code to the start of the next line
|
||||
lastColor := "0"
|
||||
for i := 1; i < len(asciiArt); i++ {
|
||||
rune := rune(asciiArt[i])
|
||||
|
||||
if unicode.IsDigit(rune) && asciiArt[i-1] == '%' {
|
||||
lastColor = string(rune)
|
||||
}
|
||||
|
||||
if rune == '\n' {
|
||||
asciiArt = asciiArt[:i+1] + "%" + lastColor + asciiArt[i+1:]
|
||||
}
|
||||
}
|
||||
|
||||
// Setup color map and replace colors in ascii art
|
||||
colorMap := setupColorMap(asciiArtHeader)
|
||||
for key, value := range colorMap {
|
||||
@@ -107,7 +122,7 @@ func run() {
|
||||
}
|
||||
}
|
||||
|
||||
// Split ascii art into each lien
|
||||
// Split ascii art into each line
|
||||
asciiArtSplit := strings.Split(asciiArt, "\n")
|
||||
asciiArtNoColorSplit := strings.Split(asciiArtNoColor, "\n")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user