1
0
forked from crony/UpFast

Serve basic files page.

This commit is contained in:
CronyAkatsuki 2023-12-19 21:17:59 +01:00
parent d68add7803
commit c2e09996a2
3 changed files with 89 additions and 0 deletions

View File

@ -35,6 +35,8 @@ func main() {
e.GET("/", Index) e.GET("/", Index)
e.GET("/files/", Files)
e.Logger.Fatal(e.Start(":1323")) e.Logger.Fatal(e.Start(":1323"))
} }
@ -52,3 +54,7 @@ func Index(c echo.Context) error {
"upload_only": true, "upload_only": true,
}) })
} }
func Files(c echo.Context) error {
return c.Render(http.StatusOK, "files", "test")
}

17
public/views/files.html Normal file
View File

@ -0,0 +1,17 @@
{{define "files"}}
<!doctype html>
<html lang="en">
<head>
<title>Files - UpFast</title>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link href="/css/files.css" rel="stylesheet" />
</head>
<body>
<h1>File List</h1>
</body>
</html>
{{end}}

66
static/css/files.css Normal file
View File

@ -0,0 +1,66 @@
html {
padding-bottom: 10%;
}
body {
max-width: 900px;
margin: auto;
background: #303446;
color: #c6d0f5;
}
h1 {
font-size: 250%;
text-align: center;
}
hr {
margin: 40px;
color: #626880;
}
img {
display: block;
margin: auto;
max-width: 800px;
max-height: 800px;
}
video {
display: block;
margin: auto;
max-width: 800px;
max-height: 800px;
}
a {
color: #f2d5cf;
text-decoration: none;
font-weight: bold;
padding: 5px;
}
a:hover {
text-decoration: underline;
}
pre {
background: #292c3c;
font-size: 1am;
padding: 10px;
max-width: 800;
max-height: 10rem;
overflow-y: auto;
overflow-x: auto;
border: none;
border-radius: 1rem;
}
.file {
display: block;
}
.info {
display: block;
text-align: center;
}