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:
2026-07-22 00:26:25 +07:00
co-authored by Claude
parent ab9d62fac6
commit b64303bb23
+24 -28
View File
@@ -18,39 +18,35 @@ else
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() {
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 ""
rainbow_bar 56
echo ""
printf ' %s🧹 CLEANUP-SERVER%s\n' "$C_TITLE" "$C_RESET"
local i
for ((i = 0; i < ${#lines[@]}; i++)); do
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"
echo ""
rainbow_bar 56
echo ""
}
# -----------------------------