nicer web page for mobiles

This commit is contained in:
Ville Rantanen
2021-06-10 09:46:00 +03:00
parent 425229b39d
commit 0e64f3d5fb

View File

@@ -271,7 +271,7 @@ def get_filelink(path, fname, images=False, media=False):
if media and is_videofile(fname):
fname_str = get_videostr(fname)
return (
'<tr><td><a class="link_file" href="%s">%s</a><td class="right">%s</td><td class="right bytes">%s</td><td class="right">%s</td></tr>\n'
'<tr class="row_file"><td><a class="link_file" href="%s">&nbsp;&nbsp;%s</a><td class="right">%s</td><td class="right bytes">%s</td><td class="right">%s</td></tr>\n'
% (urllib.parse.quote(fname), fname_str, fsstr, fsstrb, fdstr)
)
@@ -307,7 +307,7 @@ def get_pathlink(path, dname):
fdate = time.localtime(os.path.getmtime(os.path.join(path, dname)))
fdstr = time.strftime("%Y/%m/%d %H:%M:%S", fdate)
return (
'<tr><td><a class="link_dir" href="%s">&#8627;&nbsp;%s/</a><td class="right">[DIR]</td><td class="right bytes">0</td><td class="right">%s</td></tr>\n'
'<tr class="row_dir"><td><a class="link_dir" href="%s">&#8627;&nbsp;%s/</a><td class="right">[DIR]</td><td class="right bytes">0</td><td class="right">%s</td></tr>\n'
% (urllib.parse.quote(dname), dname, fdstr)
)
@@ -455,20 +455,22 @@ def get_header(opts):
body {
color: #222;
font: 14px monospace;
padding: 20px;
padding: 0;
background: #CCC;
}
h1 {
text-align: center;
padding: 20px 0 12px 0;
margin: 0;
margin: 0 0 0 70px;
font-family: sans-serif;
}
.container {
margin: 20px;
box-shadow: 0 5px 10px -5px rgba(0,0,0,0.5);
position: relative;
background: #eee;
border-top-left-radius: 6em;
border-top-left-radius: 70px;
display: inline-block;
min-width: calc(100% - 40px);
}
table {
background-color: #F3F3F3;
@@ -494,6 +496,9 @@ def get_header(opts):
display: block;
padding: 5px 10px;
}
td a.link_dir {
font-weight: bold;
}
th a {
padding-left: 0
}
@@ -504,10 +509,13 @@ def get_header(opts):
padding-left: 5px;
}
tr:nth-of-type(odd) {
background-color: #DDD;
background-color: #e1e1e1;
}
tr:hover td {
background-color:#BBB;
tr.row_dir:hover td {
background-color: #fbe6b3;
}
tr.row_file:hover td {
background-color: #f9cba2;
}
tr:hover td a {
color: #222;