summaryrefslogtreecommitdiff
path: root/.zs/components/wavy
blob: 645442ed3169c2c53948ab877653eab0199f6b16 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/usr/bin/lua

package.path = ".zs/?.lua;" .. package.path
local html = require "components.html"

-- select what message to use
local name = arg[1]

local TEXT = {
    hey = "hey there!",
    ["404"] = "alas, there is nothing to be found here"
}

local acc = {}

local i = 0
for char in TEXT[name or "hey"]:gmatch(".") do
    table.insert(acc, {
        tag = "span",
        style = "animation-delay:" .. (-800 * i) .. "ms",
        char
    })
    i = i + 1
end

print(html {
    tag = "div",
    class = "wavy",
    acc
})