diff options
| -rw-r--r-- | public/assets/app.css | 19 | ||||
| -rw-r--r-- | reluax.luax | 31 |
2 files changed, 28 insertions, 22 deletions
diff --git a/public/assets/app.css b/public/assets/app.css index a45fc5e..765b1d6 100644 --- a/public/assets/app.css +++ b/public/assets/app.css @@ -32,25 +32,6 @@ filter: drop-shadow(0 0 2em #673ab8aa); } -/* fade in */ -@keyframes fade-in { - 0% { - opacity: 0; - transform: translateY(1em); - } - 60% { - transform: translateY(-0.2em); - } - 100% { - opacity: 1; - transform: translateY(0); - } -} - -.main-info > * { - animation: fade-in 0.2s ease-in; -} - @media (max-width: 480px) { #app-main { max-width: 100%; diff --git a/reluax.luax b/reluax.luax index cb45ae6..034d408 100644 --- a/reluax.luax +++ b/reluax.luax @@ -15,7 +15,12 @@ local blogposts = require("blog.posts") math.randomseed(os.time()) -local function wrap_component(component) +local redirects = { + { slug = "mrfinalboss", url = "https://jellingfish-games.itch.io/mr-final-boss" }, + { slug = "bumblingbuilders", url = "https://oroshibu.itch.io/bumbling-builders" } +} + +local wrap_component = function(component) return <Common> <Navbar /> @@ -28,8 +33,28 @@ local function wrap_component(component) </Common> end -local function route(path) - if path == '/' then +local route = function(path, method, headers, body) + if method ~= 'GET' then + return 405, "Method not allowed" + end + + if reluax.url_matches('/r/{slug}', path) then + local slug = reluax.url_extract('/r/{slug}', path).slug + local redirect = nil + for _, r in ipairs(redirects) do + if r.slug == slug then + redirect = r + break + end + end + if redirect then + local headers = { + ["Location"] = redirect.url + } + local body = <a>You are being redirected...</a> + return 301, reluax.headers(body, headers) + end + elseif path == '/' then return 200, wrap_component(<Home />) elseif path == '/projects' then return 200, wrap_component(<Projects />) |
