Use legible figlet block-art banner (CLEANUP SERVER) with per-line rainbow
Replaces the gradient-bar version with proper figlet-style ASCII art so the title is actually readable; each line colored in a rainbow gradient, with a Vietnamese subtitle. Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
+24
-28
@@ -18,39 +18,35 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# -----------------------------
|
# -----------------------------
|
||||||
# Banner rainbow nhưng đọc được: thanh gradient + tiêu đề rõ
|
# Banner rainbow (ASCII art figlet, per-line gradient)
|
||||||
# -----------------------------
|
# -----------------------------
|
||||||
repeat_char() {
|
|
||||||
# $1 = số lượng, $2 = ký tự
|
|
||||||
printf "%${1}s" "" | tr ' ' "$2"
|
|
||||||
}
|
|
||||||
|
|
||||||
# In 1 thanh block gradient rainbow (TTY) hoặc '#' (non-TTY)
|
|
||||||
rainbow_bar() {
|
|
||||||
local width="$1"
|
|
||||||
if [ -t 1 ]; then
|
|
||||||
local -a codes=(51 87 123 159 220 214 209 204)
|
|
||||||
local n=${#codes[@]} seg i line=""
|
|
||||||
for ((i = 0; i < n; i++)); do
|
|
||||||
seg=$(( (width + n - 1 - i) / n ))
|
|
||||||
line+="$(printf '\033[1;38;5;%dm' "${codes[$i]}")""$(repeat_char "$seg" "█")"
|
|
||||||
done
|
|
||||||
printf '%s%s\n' "$line" "$C_RESET"
|
|
||||||
else
|
|
||||||
repeat_char "$width" "#"
|
|
||||||
echo
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
print_banner() {
|
print_banner() {
|
||||||
|
local -a lines=(
|
||||||
|
'▗▄▄▄▖▗▖ ▗▄▄▖▗▄▄▄▖▗▄▄▖ ▗▖ ▗▖▗▄▄▄▖▗▄▄▖ ▗▄▄▖▗▖ ▗▄▄▄▖ ▗▄▖ ▗▖ ▗▖▗▄▄▄▖▗▄▖ '
|
||||||
|
' █ ▐▌ ▐▌ ▐▌ ▐▌ ▐▌▐▌ ▐▌▐▌ ▐▌ ▐▌ ▐▌ ▐▌ ▐▌ ▐▌ ▐▌▐▛▚▖▐▌▐▌ ▐▌ ▐▌'
|
||||||
|
' █ ▐▌ ▝▀▚▖▐▛▀▀▘▐▛▀▚▖▐▌ ▐▌▐▛▀▀▘▐▛▀▚▖ ▐▌ ▐▌ ▐▛▀▀▘▐▛▀▜▌▐▌ ▝▜▌▐▛▀▀▘▐▛▀▚▖'
|
||||||
|
' █ ▐▙▄▄▖ ▗▄▄▞▘▐▙▄▄▖▐▌ ▐▌ ▝▚▞▘ ▐▙▄▄▖▐▌ ▐▌ ▝▚▄▄▖▐▙▄▄▖▐▙▄▄▖▐▌ ▐▌▐▌ ▐▌▐▙▄▄▖▐▌ ▐▌'
|
||||||
|
)
|
||||||
|
local -a colors=()
|
||||||
|
if [ -t 1 ]; then
|
||||||
|
colors=(
|
||||||
|
$'\033[1;38;5;51m' # cyan
|
||||||
|
$'\033[1;38;5;120m' # xanh lá
|
||||||
|
$'\033[1;38;5;220m' # vàng gold
|
||||||
|
$'\033[1;38;5;209m' # cam-đỏ
|
||||||
|
)
|
||||||
|
fi
|
||||||
echo ""
|
echo ""
|
||||||
rainbow_bar 56
|
local i
|
||||||
echo ""
|
for ((i = 0; i < ${#lines[@]}; i++)); do
|
||||||
printf ' %s🧹 CLEANUP-SERVER%s\n' "$C_TITLE" "$C_RESET"
|
if [ -t 1 ]; then
|
||||||
|
printf '%s%s%s\n' "${colors[$i]}" "${lines[$i]}" "$C_RESET"
|
||||||
|
else
|
||||||
|
printf '%s\n' "${lines[$i]}"
|
||||||
|
fi
|
||||||
|
done
|
||||||
printf ' %sDọn dẹp + nâng cấp server (Ubuntu / Arch)%s\n' "$C_WARN" "$C_RESET"
|
printf ' %sDọn dẹp + nâng cấp server (Ubuntu / Arch)%s\n' "$C_WARN" "$C_RESET"
|
||||||
echo ""
|
echo ""
|
||||||
rainbow_bar 56
|
|
||||||
echo ""
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# -----------------------------
|
# -----------------------------
|
||||||
|
|||||||
Reference in New Issue
Block a user