mirror of
https://github.com/ascii-boxes/boxes.git
synced 2024-12-13 10:20:37 +01:00
Add new box designs 'info', 'warning', and 'critical'
which take advantage of coloring and unicode
This commit is contained in:
parent
863c7c1f7b
commit
d9550ac58d
150
boxes-config
150
boxes-config
@ -12,7 +12,7 @@
|
||||
#
|
||||
# ___________________________________________________________________________________________________________________
|
||||
#
|
||||
# Format: ASCII Text
|
||||
# Character Encoding: UTF-8
|
||||
# Syntax of this file: https://boxes.thomasjensen.com/config-syntax.html
|
||||
#
|
||||
#====================================================================================================================
|
||||
@ -3179,4 +3179,152 @@ END tux
|
||||
# ============================================================================
|
||||
|
||||
|
||||
BOX info
|
||||
|
||||
author "Thomas Jensen"
|
||||
designer "Thomas Jensen"
|
||||
revision "1.0"
|
||||
created "2023-10-24"
|
||||
tags "box, color, simple, unicode"
|
||||
|
||||
sample
|
||||
[34m▄▄[0m[37;44m INFO [0;34m▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄[0m
|
||||
[34m█[0m [34m█[0m
|
||||
[34m█[0m This is an informational message. [34m█[0m
|
||||
[34m█[0m Don't worry about it. [34m█[0m
|
||||
[34m█[0m [34m█[0m
|
||||
[34m▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀[0m
|
||||
ends
|
||||
|
||||
# Monochrome sample:
|
||||
# ▄▄ INFO ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
|
||||
# █ █
|
||||
# █ This is an informational message. █
|
||||
# █ Don't worry about it. █
|
||||
# █ █
|
||||
# ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
|
||||
|
||||
shapes {
|
||||
nw ("[34m▄[0m")
|
||||
nnw ("[34m▄[0m[37;44m INFO [0m")
|
||||
n ("[34m▄[0m")
|
||||
ne ("[34m▄[0m")
|
||||
w ("[34m█[0m")
|
||||
e ("[34m█[0m")
|
||||
sw ("[34m▀[0m")
|
||||
s ("[34m▀[0m")
|
||||
se ("[34m▀[0m")
|
||||
}
|
||||
|
||||
elastic (n, s, e, w)
|
||||
|
||||
padding {
|
||||
horizontal 2
|
||||
vertical 1
|
||||
}
|
||||
|
||||
END info
|
||||
|
||||
|
||||
# ============================================================================
|
||||
|
||||
|
||||
BOX warning
|
||||
|
||||
author "Thomas Jensen"
|
||||
designer "Thomas Jensen"
|
||||
revision "1.0"
|
||||
created "2023-10-24"
|
||||
tags "box, color, simple, unicode"
|
||||
|
||||
sample
|
||||
[33m▄▄[0m[30;43m WARNING [0;33m▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄[0m
|
||||
[33m█[0m [33m█[0m
|
||||
[33m█[0m Sub-zero temperatures expected. [33m█[0m
|
||||
[33m█[0m Please drive carefully. [33m█[0m
|
||||
[33m█[0m [33m█[0m
|
||||
[33m▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀[0m
|
||||
ends
|
||||
|
||||
# Monochrome sample:
|
||||
# ▄▄ WARNING ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
|
||||
# █ █
|
||||
# █ Sub-zero temperatures expected. █
|
||||
# █ Please drive carefully. █
|
||||
# █ █
|
||||
# ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
|
||||
|
||||
shapes {
|
||||
nw ("[33m▄[0m")
|
||||
nnw ("[33m▄[0m[30;43m WARNING [0m")
|
||||
n ("[33m▄[0m")
|
||||
ne ("[33m▄[0m")
|
||||
w ("[33m█[0m")
|
||||
e ("[33m█[0m")
|
||||
sw ("[33m▀[0m")
|
||||
s ("[33m▀[0m")
|
||||
se ("[33m▀[0m")
|
||||
}
|
||||
|
||||
elastic (n, s, e, w)
|
||||
|
||||
padding {
|
||||
horizontal 2
|
||||
vertical 1
|
||||
}
|
||||
|
||||
END warning
|
||||
|
||||
|
||||
# ============================================================================
|
||||
|
||||
|
||||
BOX critical
|
||||
|
||||
author "Thomas Jensen"
|
||||
designer "Thomas Jensen"
|
||||
revision "1.0"
|
||||
created "2023-10-24"
|
||||
tags "box, color, simple, unicode"
|
||||
|
||||
sample
|
||||
[31m▄▄[0m[37;41m CRITICAL [0;31m▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄[0m
|
||||
[31m█[37;48;2;128;0;0m [31m█[0m
|
||||
[31m█[37;48;2;128;0;0m Coolant levels below minimum. [31m█[0m
|
||||
[31m█[37;48;2;128;0;0m Disengage main drive and stop for repairs. [31m█[0m
|
||||
[31m█[37;48;2;128;0;0m [31m█[0m
|
||||
[31m▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀[0m
|
||||
ends
|
||||
|
||||
# Monochrome sample:
|
||||
# ▄▄ CRITICAL ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
|
||||
# █ █
|
||||
# █ Coolant levels below minimum. █
|
||||
# █ Disengage main drive and stop for repairs. █
|
||||
# █ █
|
||||
# ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
|
||||
|
||||
shapes {
|
||||
nw ("[0;31m▄[0m")
|
||||
nnw ("[31m▄[0m[37;41m CRITICAL [0m")
|
||||
n ("[31m▄[0m")
|
||||
ne ("[31m▄[0m")
|
||||
w ("[31m█[37;48;2;128;0;0m")
|
||||
e ("[31m█[0m")
|
||||
sw ("[31m▀[0m")
|
||||
s ("[31m▀[0m")
|
||||
se ("[31m▀[0m")
|
||||
}
|
||||
|
||||
elastic (n, s, e, w)
|
||||
|
||||
padding {
|
||||
horizontal 2
|
||||
vertical 1
|
||||
}
|
||||
|
||||
END critical
|
||||
|
||||
|
||||
|
||||
#EOF vim: set ai sw=4 expandtab syn=boxes:
|
||||
|
15
test/184_create_box_colored_contents.txt
Normal file
15
test/184_create_box_colored_contents.txt
Normal file
@ -0,0 +1,15 @@
|
||||
:DESC
|
||||
Creates a unicode box which also colors its contents.
|
||||
|
||||
:ARGS
|
||||
-d critical -i box
|
||||
:INPUT
|
||||
Aaargh, let go of me!
|
||||
:OUTPUT-FILTER
|
||||
:EXPECTED
|
||||
[0;31m▄[0m[31m▄[0m[37;41m CRITICAL [0m[31m▄[0m[31m▄[0m[31m▄[0m[31m▄[0m[31m▄[0m[31m▄[0m[31m▄[0m[31m▄[0m[31m▄[0m[31m▄[0m[31m▄[0m[31m▄[0m[31m▄[0m[31m▄[0m[31m▄[0m
|
||||
[31m█[37;48;2;128;0;0m [31m█[0m
|
||||
[31m█[37;48;2;128;0;0m Aaargh, let go of me! [31m█[0m
|
||||
[31m█[37;48;2;128;0;0m [31m█[0m
|
||||
[31m▀[0m[31m▀[0m[31m▀[0m[31m▀[0m[31m▀[0m[31m▀[0m[31m▀[0m[31m▀[0m[31m▀[0m[31m▀[0m[31m▀[0m[31m▀[0m[31m▀[0m[31m▀[0m[31m▀[0m[31m▀[0m[31m▀[0m[31m▀[0m[31m▀[0m[31m▀[0m[31m▀[0m[31m▀[0m[31m▀[0m[31m▀[0m[31m▀[0m[31m▀[0m[31m▀[0m
|
||||
:EOF
|
15
test/185_remove_box_uncolor_contents.txt
Normal file
15
test/185_remove_box_uncolor_contents.txt
Normal file
@ -0,0 +1,15 @@
|
||||
:DESC
|
||||
Removes a unicode box which had colored its contents, restoring the original monochrome text.
|
||||
|
||||
:ARGS
|
||||
-r
|
||||
:INPUT
|
||||
[0;31m▄[0m[31m▄[0m[37;41m CRITICAL [0m[0;31m▄[0m[0;31m▄[0m[0;31m▄[0m[0;31m▄[0m[0;31m▄[0m[0;31m▄[0m[0;31m▄[0m[0;31m▄[0m[0;31m▄[0m[0;31m▄[0m[0;31m▄[0m[0;31m▄[0m[0;31m▄[0m[0;31m▄[0m[0;31m▄[0m
|
||||
[31m█[37;48;2;128;0;0m [31m█[0m
|
||||
[31m█[37;48;2;128;0;0m Aaargh, let go of me! [31m█[0m
|
||||
[31m█[37;48;2;128;0;0m [31m█[0m
|
||||
[31m▀[0m[31m▀[0m[31m▀[0m[31m▀[0m[31m▀[0m[31m▀[0m[31m▀[0m[31m▀[0m[31m▀[0m[31m▀[0m[31m▀[0m[31m▀[0m[31m▀[0m[31m▀[0m[31m▀[0m[31m▀[0m[31m▀[0m[31m▀[0m[31m▀[0m[31m▀[0m[31m▀[0m[31m▀[0m[31m▀[0m[31m▀[0m[31m▀[0m[31m▀[0m[31m▀[0m
|
||||
:OUTPUT-FILTER
|
||||
:EXPECTED
|
||||
Aaargh, let go of me!
|
||||
:EOF
|
Loading…
Reference in New Issue
Block a user