1
0
mirror of https://github.com/lxsang/antd-web-apps synced 2024-12-26 01:18:21 +01:00

enable mobile compatibility

This commit is contained in:
lxsang 2021-02-07 13:23:46 +01:00
parent 9fce4a3fd5
commit 96624d2cbd
3 changed files with 70 additions and 31 deletions

View File

@ -54,10 +54,36 @@ body {
text-align: justify;
height: 100%;
}
div.doc-name {
div.doc-toc-menu {
text-align: left;
padding-top: 3px;
}
div.doc-toc-menu a {
text-decoration: none;
color: #c9c9c9;
}
div.doc-toc-legend::before
{
content: "\f0c9";
color: #2c2c2c;
width: 20px;
height: 25px;
margin-right: 3px;
font-family: "FontAwesome";
font-size: 18px;
}
div.doc-toc-menu a::before {
/* padding-top:13px; */
content: "\f02d";
color: #c9c9c9;
width: 20px;
height: 25px;
font-family: "FontAwesome";
font-size: 18px;
}
div.doc-name{
font-weight: bold;
}
div.doc-name a {
text-decoration: none;
color: #c9c9c9;
@ -66,13 +92,14 @@ div.doc-name a {
a.x-link,
a.x-link:hover {
text-decoration: none;
color: #c9c9c9;
padding-left: 15px;
color: #2c2c2c;
font-weight: bold;
/* padding-left: 15px; */
padding-top: 7px;
}
a.x-link::before {
content: "\f08e";
color: #c9c9c9;
color: #2c2c2c;
width: 20px;
height: 25px;
font-family: "FontAwesome";
@ -81,7 +108,7 @@ a.x-link::before {
div.doc-name a::before {
/* padding-top:13px; */
content: "\f015";
color: #c9c9c9;
color: #2c2c2c;
width: 20px;
height: 25px;
font-family: "FontAwesome";
@ -135,20 +162,18 @@ div.doc-toc {
button#btn_toc {
width: 33px;
height: 33px;
position: fixed;
border: 1px solid #c9c9c9;
background-color: #e3e3e3;
z-index: 21;
outline: none;
}
div.doc-to-header{
div.doc-toc-header{
display: block;
padding: 0px;
margin: 0px;
padding-left: 37px;
padding-top: 9px;
height: 24px;
padding-left: 10px;
padding: 3px;
/* height: 24px; */
border-bottom: 1px solid #c9c9c9;
font-weight: bold;
}

View File

@ -4,5 +4,9 @@ DocController:subclass("JarvisController", {
vfs_path = "book://",
local_path = "/home/mrsang/doc/jarvis",
},
name = "jarvis"
name = "jarvis",
elinks = {
{ name = "API", url = "https://doc.iohub.dev/antos/api/index.html" },
{ name = "Code", url = "https://github.com/lxsang/antos" }
}
})

View File

@ -84,25 +84,16 @@ end
<body>
<div id = "top">
<div id = "navbar" <?=book_width_css?>>
<div class = "doc-name">
<?lua
if tocdata then
?>
<div class = "doc-toc-menu">
<?lua if tocdata then ?>
<a href ="<?=HTTP_ROOT..'/'..tocdata.controller..'/'?>">
<a href ="#" id="btn_toc">
<?=tocdata.data.name?>
</a>
<?lua end ?>
</div>
<?lua
if elinks then
for k,v in ipairs(elinks) do
?>
<a class = "x-link" target="_blank" href ="<?=v.url?>">
<?=v.name?>
</a>
<?lua
end
end
if tocdata then
?>
<form id = "search_form" action="<?=HTTP_ROOT..'/'..tocdata.controller..'/search/'?>" method="get" class="search-form">
<input id = "search_box" name="q" type = "text" class = "search-box"></input>
</form>
@ -114,12 +105,31 @@ end
</div>
<div id = "cover">
<div id = "book" <?=book_width_css?>>
<?lua
if tocdata then
?>
<button id="btn_toc" class="fa fa-bars"></button>
<div id="doc_toc" class = "doc-toc">
<div class = "doc-to-header">Table of content</div>
<div class = "doc-name doc-toc-header">
<?lua if tocdata then ?>
<a href ="<?=HTTP_ROOT..'/'..tocdata.controller..'/'?>">
<?=tocdata.data.name?>
</a>
<?lua end ?>
</div>
<?lua
if tocdata then
?>
<?lua
if elinks then
for k,v in ipairs(elinks) do
?>
<div class = "doc-toc-header">
<a class = "x-link" target="_blank" href ="<?=v.url?>">
<?=v.name?>
</a>
</div>
<?lua
end
end
?>
<div class = "doc-toc-header doc-toc-legend">Table of content</div>
<?lua
if toc then
toc:set("data", tocdata)