Add new box designs 'info', 'warning', and 'critical'

which take advantage of coloring and unicode
This commit is contained in:
Thomas Jensen 2023-10-24 21:43:00 +02:00
parent 863c7c1f7b
commit d9550ac58d
No known key found for this signature in database
GPG Key ID: A4ACEE270D0FB7DB
3 changed files with 179 additions and 1 deletions

View File

@ -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
▄▄ INFO ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
█ █
█ This is an informational message. █
█ Don't worry about it. █
█ █
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
ends
# Monochrome sample:
# ▄▄ INFO ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
# █ █
# █ This is an informational message. █
# █ Don't worry about it. █
# █ █
# ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
shapes {
nw ("▄")
nnw ("▄ INFO ")
n ("▄")
ne ("▄")
w ("█")
e ("█")
sw ("▀")
s ("▀")
se ("▀")
}
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
▄▄ WARNING ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
█ █
█ Sub-zero temperatures expected. █
█ Please drive carefully. █
█ █
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
ends
# Monochrome sample:
# ▄▄ WARNING ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
# █ █
# █ Sub-zero temperatures expected. █
# █ Please drive carefully. █
# █ █
# ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
shapes {
nw ("▄")
nnw ("▄ WARNING ")
n ("▄")
ne ("▄")
w ("█")
e ("█")
sw ("▀")
s ("▀")
se ("▀")
}
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
▄▄ CRITICAL ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
█ █
█ Coolant levels below minimum. █
█ Disengage main drive and stop for repairs. █
█ █
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
ends
# Monochrome sample:
# ▄▄ CRITICAL ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
# █ █
# █ Coolant levels below minimum. █
# █ Disengage main drive and stop for repairs. █
# █ █
# ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
shapes {
nw ("▄")
nnw ("▄ CRITICAL ")
n ("▄")
ne ("▄")
w ("█")
e ("█")
sw ("▀")
s ("▀")
se ("▀")
}
elastic (n, s, e, w)
padding {
horizontal 2
vertical 1
}
END critical
#EOF vim: set ai sw=4 expandtab syn=boxes:

View 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
▄▄ CRITICAL ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
█ █
█ Aaargh, let go of me! █
█ █
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
:EOF

View File

@ -0,0 +1,15 @@
:DESC
Removes a unicode box which had colored its contents, restoring the original monochrome text.
:ARGS
-r
:INPUT
▄▄ CRITICAL ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
█ █
█ Aaargh, let go of me! █
█ █
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
:OUTPUT-FILTER
:EXPECTED
Aaargh, let go of me!
:EOF