From 09c2958a0ef426af96a32acb02beee6c1416621e Mon Sep 17 00:00:00 2001 From: metamuffin Date: Sun, 3 Nov 2024 23:33:09 +0100 Subject: stupid features --- abrechenbarkeit.lua | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'abrechenbarkeit.lua') diff --git a/abrechenbarkeit.lua b/abrechenbarkeit.lua index 2faa38e..0768d4a 100755 --- a/abrechenbarkeit.lua +++ b/abrechenbarkeit.lua @@ -54,6 +54,21 @@ local query = parse_query(os.getenv("QUERY_STRING")) local stylesheet = io.open("style.css"):read("a") local script = io.open("script.js"):read("a") +local function get_user_theme(username) + local c = "" + if username == "_jeb" then + c = "html { animation: 2s jeb infinite; }" + c = c .. "@keyframes jeb {\n" + for i=0,100 do + c = c .. string.format("%.02f%% { --hue: %.02f; } \n", i, i / 100 * 360) + end + c = c .. "\n}" + elseif username == "Dinnerbone" then + c = "html { transform: scale(-1); } " + end + return c +end + local function respond(status, title, body) print(string.format("Status: %d", status)) print("Content-Type: text/html") @@ -64,6 +79,7 @@ local function respond(status, title, body) %s + %s @@ -79,7 +95,13 @@ local function respond(status, title, body) Products Source - ]], escape(title), stylesheet, script, config.head_extra or "")) + ]], + escape(title), + stylesheet, + get_user_theme(path and path:sub(2)), + script, + config.head_extra or "" + )) body() print("") end -- cgit v1.2.3-70-g09d2