bash <<'EOF'
trap 'tput cnorm; exit' INT; tput civis
rows=$(tput lines); cols=$(tput cols)
mask=(
" ███████ "
" ████████████ "
" ██████████████ "
" ██████████ ██████ "
" ███████████ █████ "
" █████████████ ███████ "
" █████████ ██████████████ "
" ███████ ████████████ "
" █████ ████████████ "
" ███ ██████████████ "
" ██████ ████████ "
" ████ █████████ "
" ██ "
)
mh=${#mask[@]}; mw=${#mask[0]}
oy=$((rows/2 - mh/2))
ox=$((cols/2 - mw/2))
t1="SOLUTIONS"; t2="BLACK FRIDAY"
shift=8
x1=$((cols/2 - ${#t1}/2 - shift))
x2=$((cols/2 - ${#t2}/2 - shift))
chars=(ア イ ウ エ オ カ キ ク ケ コ 1 2 3 4 5 6 7 8 9)
green=("\e[38;5;28m" "\e[38;5;34m" "\e[38;5;46m")
for ((i=0;i<cols;i++)); do drop[$i]=$((RANDOM%rows)); done
draw_text(){ tput cup $((oy-3)) "$x1"; echo -e "\e[1;37m$t1\e[0m"; tput cup $((oy+mh+1)) "$x2"; echo -e "\e[1;37m$t2\e[0m"; }
draw_text
while :; do
for ((x=0;x<cols;x++)); do
y=${drop[$x]}; tput cup "$y" "$x"
rl=$((y-oy)); cl=$((x-ox))
sym=${chars[$((RANDOM%${#chars[@]}))]}
if ((rl>=0 && rl<mh && cl>=0 && cl<mw)); then
ch="${mask[rl]:cl:1}"
if [[ $ch == "█" || $ch == "░" ]]; then
printf "\e[1;37m$ch\e[0m"
else
printf "${green[RANDOM%3]}$sym\e[0m"
fi
else
printf "${green[RANDOM%3]}$sym\e[0m"
fi
drop[$x]=$(((y+1)%rows))
done
draw_text
sleep 0.01
done
EOF
Post #2432
34.9K