polish up html endpoint stuff
This commit is contained in:
parent
9b2a1315ea
commit
6e04027170
|
@ -1,6 +1,6 @@
|
||||||
<h1 style="vertical-align:center">
|
<h1 style="vertical-align:center">
|
||||||
<center>
|
<center>
|
||||||
<img src="./docs/crystal-gauntlet-icon.png" width="auto" height="32"> crystal-gauntlet
|
<img src="./public/favicon.png" width="auto" height="32"> crystal-gauntlet
|
||||||
</center>
|
</center>
|
||||||
</h1>
|
</h1>
|
||||||
|
|
||||||
|
|
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 33 KiB |
|
@ -0,0 +1,45 @@
|
||||||
|
:root {
|
||||||
|
font-size: 16px;
|
||||||
|
line-height: 1;
|
||||||
|
font-weight: 400;
|
||||||
|
|
||||||
|
color-scheme: light dark;
|
||||||
|
|
||||||
|
text-rendering: optimizeLegibility;
|
||||||
|
-webkit-font-smoothing: antialiased;
|
||||||
|
-moz-osx-font-smoothing: grayscale;
|
||||||
|
-webkit-text-size-adjust: 100%;
|
||||||
|
|
||||||
|
background-color: #fff;
|
||||||
|
color: #111;
|
||||||
|
|
||||||
|
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
|
||||||
|
|
||||||
|
--accent-color: rgb(243, 159, 215);
|
||||||
|
--accent-color-bri: rgb(241, 181, 221);
|
||||||
|
accent-color: var(--accent-color);
|
||||||
|
}
|
||||||
|
|
||||||
|
::selection {
|
||||||
|
background-color: var(--accent-color);
|
||||||
|
color: #000;
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
margin: 2rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
a {
|
||||||
|
color: var(--accent-color);
|
||||||
|
transition: 0.2s color;
|
||||||
|
}
|
||||||
|
a:hover {
|
||||||
|
color: var(--accent-color-bri);
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (prefers-color-scheme: dark) {
|
||||||
|
:root {
|
||||||
|
background-color: #111;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,13 +1,17 @@
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
|
<meta charset="UTF-8" />
|
||||||
|
<link rel="icon" type="image/png" href="/favicon.png" />
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
|
<link rel="stylesheet" href="/style.css" />
|
||||||
<title>Song Uploader</title>
|
<title>Song Uploader</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<%- if error -%>
|
<%- if error -%>
|
||||||
<div>Error while uploading: <%= error %></div><br />
|
<div>Error while uploading: <%= error %></div><br />
|
||||||
<%- elsif song_id -%>
|
<%- elsif song_id -%>
|
||||||
<div>Uploaded successfully! Song ID: <%= song_id %></div><br />
|
<div>Uploaded successfully! Song ID: <b><%= song_id %></b></div><br />
|
||||||
<%- end -%>
|
<%- end -%>
|
||||||
|
|
||||||
<form action="/tools/song_upload" method="post">
|
<form action="/tools/song_upload" method="post">
|
|
@ -201,6 +201,7 @@ module CrystalGauntlet
|
||||||
else
|
else
|
||||||
server = HTTP::Server.new([
|
server = HTTP::Server.new([
|
||||||
HTTP::LogHandler.new,
|
HTTP::LogHandler.new,
|
||||||
|
HTTP::StaticFileHandler.new("public/", fallthrough: true, directory_listing: false),
|
||||||
HTTP::StaticFileHandler.new("data/", fallthrough: true, directory_listing: false),
|
HTTP::StaticFileHandler.new("data/", fallthrough: true, directory_listing: false),
|
||||||
CrystalGauntlet::GDHandler.new,
|
CrystalGauntlet::GDHandler.new,
|
||||||
CrystalGauntlet::TemplateHandler.new
|
CrystalGauntlet::TemplateHandler.new
|
||||||
|
|
|
@ -28,11 +28,11 @@ CrystalGauntlet.template_endpoints["/tools/song_upload"] = ->(context : HTTP::Se
|
||||||
DATABASE.exec("insert into songs (id, url) values (?, ?)", song_id, params["url"])
|
DATABASE.exec("insert into songs (id, url) values (?, ?)", song_id, params["url"])
|
||||||
rescue error
|
rescue error
|
||||||
# todo: HELP HOW DO I DO THIS BUT BETTER
|
# todo: HELP HOW DO I DO THIS BUT BETTER
|
||||||
ECR.render("./template/song_upload.ecr")
|
ECR.render("./public/template/song_upload.ecr")
|
||||||
else
|
else
|
||||||
ECR.render("./template/song_upload.ecr")
|
ECR.render("./public/template/song_upload.ecr")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
ECR.render("./template/song_upload.ecr")
|
ECR.render("./public/template/song_upload.ecr")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue