added README
This commit is contained in:
50
gallery/readme_banner.typ
Normal file
50
gallery/readme_banner.typ
Normal file
@@ -0,0 +1,50 @@
|
||||
#import "/src/lib.typ": *
|
||||
|
||||
#let dark = sys.inputs.at("dark", default: "false") == "true"
|
||||
|
||||
#set page(
|
||||
width: auto,
|
||||
height: auto,
|
||||
margin: 1cm,
|
||||
fill: none
|
||||
)
|
||||
|
||||
#set text(
|
||||
size: 12pt,
|
||||
font: "Source Sans 3",
|
||||
fill: if dark {white} else {black}
|
||||
)
|
||||
|
||||
#let hex-abc = "0123456789abcdef"
|
||||
#let g = gradient.linear(
|
||||
red,
|
||||
orange,
|
||||
yellow,
|
||||
green,
|
||||
aqua,
|
||||
blue,
|
||||
purple
|
||||
)
|
||||
#let colorize-hex(txt) = {
|
||||
let chars = txt.clusters().map(c => {
|
||||
let v = hex-abc.position(c)
|
||||
let color = g.sample(v * 100% / 15).lighten(20%).desaturate(40%)
|
||||
box(
|
||||
fill: color,
|
||||
inset: (x: 1pt),
|
||||
outset: (
|
||||
top: 1pt + 0.5pt * v,
|
||||
bottom: 1pt + 0.5pt * v
|
||||
),
|
||||
raw(c)
|
||||
)
|
||||
})
|
||||
|
||||
set text(fill: black)
|
||||
chars.join()
|
||||
}
|
||||
|
||||
#let txt = "Jumble"
|
||||
#let cipher = bytes-to-hex(sha1(txt))
|
||||
|
||||
*sha1("#txt") =* #colorize-hex(cipher)
|
||||
Reference in New Issue
Block a user