css fixes

This commit is contained in:
ston1th 2022-03-20 21:50:12 +01:00
commit 814fd8a5f7
2 changed files with 27 additions and 17 deletions

View file

@ -41,6 +41,7 @@ func (s *statusInterceptor) Status() int {
type dirContents struct { type dirContents struct {
AllPaths []string `xml:"a"` AllPaths []string `xml:"a"`
Base string `xml:"-"`
Dirs dirs `xml:"-"` Dirs dirs `xml:"-"`
Files files `xml:"-"` Files files `xml:"-"`
} }
@ -97,6 +98,7 @@ func (r *responseInterceptor) GetPaths(path string, fs *fs.FS) (dc dirContents,
if err != nil { if err != nil {
return return
} }
dc.Base = path
path = strings.TrimSuffix(path, "/") path = strings.TrimSuffix(path, "/")
for _, p := range dc.AllPaths { for _, p := range dc.AllPaths {
p = strings.ReplaceAll(p, "&", "&") p = strings.ReplaceAll(p, "&", "&")

View file

@ -6,13 +6,16 @@ import "html/template"
var ( var (
index = template.Must(template.New("index").Parse(`<!doctype html> index = template.Must(template.New("index").Parse(`<!doctype html>
<html> <html lang="en">
<head> <head>
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="theme-color" content="#222222">
<meta name="description" content="cachefs">
<title>cachefs | {{.Base}}</title>
<style> <style>
body { body {
font: 20px Helvetica, sans-serif; font: 20px Helvetica, sans-serif;
background-color: #111111; background-color: #111;
color: #e6e6e6; color: #e6e6e6;
margin: 0px; margin: 0px;
padding: 0 150px 0 150px; padding: 0 150px 0 150px;
@ -23,8 +26,7 @@ body {
} }
} }
article { article {
background-color: #222222; background-color: #222;
display: block; text-align: left; margin: 0 auto; box-shadow: 0px 0px 50px 10px #000000;
} }
pre { pre {
margin: 0; margin: 0;
@ -38,7 +40,7 @@ a:visited {
color: #e6e6e6; color: #e6e6e6;
} }
a:hover { a:hover {
color: #ffffff; color: #fff;
text-decoration: underline; text-decoration: underline;
} }
a:active { a:active {
@ -46,13 +48,13 @@ a:active {
} }
table { table {
border-collapse: collapse; border-collapse: collapse;
width: 100%;
margin-bottom: 50px; margin-bottom: 50px;
} }
td {
padding: 0;
}
.listitem { .listitem {
background-color: #333333; background-color: #333;
height: 45px;
margin: 3px 0px;
} }
.listitem:hover { .listitem:hover {
background-color: #404040; background-color: #404040;
@ -60,25 +62,30 @@ table {
.listitem:active { .listitem:active {
background-color: #202020; background-color: #202020;
} }
.listitem td {
padding: 5px;
vertical-align: middle;
display: table-cell;
}
.listpath { .listpath {
white-space: normal; white-space: normal;
overflow: hidden;
width: 100%; width: 100%;
} }
.listpath a {
display: block;
min-height: 45px;
padding: 0.55em 0 0 5px;
overflow: hidden;
width: 100%;
box-sizing: border-box;
word-break: break-all;
}
.listoptions { .listoptions {
padding-right: 5px;
white-space: nowrap; white-space: nowrap;
text-align: right; text-align: right;
} }
.listoptions span, a { .listoptions span, .listoptions a {
margin-left: 10px; margin-left: 10px;
} }
.spacer { .spacer {
height: 3px; height: 3px;
width: 0%;
} }
.red { .red {
background-color: #e74c3c; background-color: #e74c3c;
@ -132,9 +139,10 @@ span {
</body> </body>
</html>`)) </html>`))
video = template.Must(template.New("video").Parse(`<!doctype html> video = template.Must(template.New("video").Parse(`<!doctype html>
<html> <html lang="en">
<head> <head>
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<title>cachefs | {{.}}</title>
</head> </head>
<body> <body>
<video id="video" style="width: 100%; height: 100%;" src="{{.}}" controls=""></video> <video id="video" style="width: 100%; height: 100%;" src="{{.}}" controls=""></video>