made the file index work on phones

This commit is contained in:
Nixietab 2026-08-23 08:08:23 -03:00
parent 581d3e6da5
commit 523e519a3b
3 changed files with 36 additions and 5 deletions

View file

@ -48,6 +48,13 @@ footer {
color: #666;
letter-spacing: .08em;
}
@media (max-width: 600px) {
body {
padding: 12px;
font-size: 13px;
}
}
</style>
</head>
<body>

View file

@ -139,20 +139,36 @@ footer a:hover {
font-size: 12px;
}
}
@media (max-width: 430px) {
body {
padding: 8px;
font-size: 12px;
}
td,
th {
padding: 4px;
}
.ty {
display: none;
}
}
</style>
</head>
<body>
<nav class="crumbs">{{range $i, $c := .Crumbs}}{{if $i}} / {{end}}<a href="{{$c.URL}}">{{$c.Name}}</a>{{end}}</nav>
<div class="wrap">
<table>
<thead><tr>{{range .Headers}}<th><a href="{{.URL}}">{{.Label}}{{if .Active}}{{if .Desc}} ▼{{else}} ▲{{end}}{{end}}</a></th>{{end}}</tr></thead>
<thead><tr>{{range .Headers}}<th{{if .Class}} class="{{.Class}}"{{end}}><a href="{{.URL}}">{{.Label}}{{if .Active}}{{if .Desc}} ▼{{else}} ▲{{end}}{{end}}</a></th>{{end}}</tr></thead>
<tbody>
{{if .HasParent}}<tr><td><a href="../">../</a></td><td class="num">-</td><td class="num"></td><td class="num mod"></td></tr>{{end}}
{{if .HasParent}}<tr><td><a href="../">../</a></td><td class="num ty">-</td><td class="num sz"></td><td class="num mod"></td></tr>{{end}}
{{range .Rows}}
<tr{{if .IsDir}} class="dir"{{end}}>
<td><a href="{{.URL}}"{{if not .IsDir}} download{{end}}>{{.Name}}</a></td>
<td class="num">{{.Type}}</td>
<td class="num">{{if .IsDir}}-{{else}}{{.SizeS}}{{end}}</td>
<td class="num ty">{{.Type}}</td>
<td class="num sz">{{if .IsDir}}-{{else}}{{.SizeS}}{{end}}</td>
<td class="num mod">{{.ModS}}</td>
</tr>
{{else}}<tr><td colspan="4" class="empty">empty directory</td></tr>{{end}}