1
0
mirror of https://github.com/lxsang/antd-web-apps synced 2024-11-20 02:18:20 +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; text-align: justify;
height: 100%; height: 100%;
} }
div.doc-name { div.doc-toc-menu {
text-align: left; text-align: left;
padding-top: 3px; 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 { div.doc-name a {
text-decoration: none; text-decoration: none;
color: #c9c9c9; color: #c9c9c9;
@ -66,13 +92,14 @@ div.doc-name a {
a.x-link, a.x-link,
a.x-link:hover { a.x-link:hover {
text-decoration: none; text-decoration: none;
color: #c9c9c9; color: #2c2c2c;
padding-left: 15px; font-weight: bold;
/* padding-left: 15px; */
padding-top: 7px; padding-top: 7px;
} }
a.x-link::before { a.x-link::before {
content: "\f08e"; content: "\f08e";
color: #c9c9c9; color: #2c2c2c;
width: 20px; width: 20px;
height: 25px; height: 25px;
font-family: "FontAwesome"; font-family: "FontAwesome";
@ -81,7 +108,7 @@ a.x-link::before {
div.doc-name a::before { div.doc-name a::before {
/* padding-top:13px; */ /* padding-top:13px; */
content: "\f015"; content: "\f015";
color: #c9c9c9; color: #2c2c2c;
width: 20px; width: 20px;
height: 25px; height: 25px;
font-family: "FontAwesome"; font-family: "FontAwesome";
@ -135,20 +162,18 @@ div.doc-toc {
button#btn_toc { button#btn_toc {
width: 33px; width: 33px;
height: 33px; height: 33px;
position: fixed;
border: 1px solid #c9c9c9; border: 1px solid #c9c9c9;
background-color: #e3e3e3; background-color: #e3e3e3;
z-index: 21;
outline: none; outline: none;
} }
div.doc-to-header{ div.doc-toc-header{
display: block; display: block;
padding: 0px; padding: 0px;
margin: 0px; margin: 0px;
padding-left: 37px; padding-left: 10px;
padding-top: 9px; padding: 3px;
height: 24px; /* height: 24px; */
border-bottom: 1px solid #c9c9c9; border-bottom: 1px solid #c9c9c9;
font-weight: bold; font-weight: bold;
} }

View File

@ -4,5 +4,9 @@ DocController:subclass("JarvisController", {
vfs_path = "book://", vfs_path = "book://",
local_path = "/home/mrsang/doc/jarvis", 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> <body>
<div id = "top"> <div id = "top">
<div id = "navbar" <?=book_width_css?>> <div id = "navbar" <?=book_width_css?>>
<div class = "doc-name"> <?lua
if tocdata then
?>
<div class = "doc-toc-menu">
<?lua if tocdata then ?> <?lua if tocdata then ?>
<a href ="<?=HTTP_ROOT..'/'..tocdata.controller..'/'?>"> <a href ="#" id="btn_toc">
<?=tocdata.data.name?> <?=tocdata.data.name?>
</a> </a>
<?lua end ?> <?lua end ?>
</div> </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"> <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> <input id = "search_box" name="q" type = "text" class = "search-box"></input>
</form> </form>
@ -114,12 +105,31 @@ end
</div> </div>
<div id = "cover"> <div id = "cover">
<div id = "book" <?=book_width_css?>> <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 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 <?lua
if toc then if toc then
toc:set("data", tocdata) toc:set("data", tocdata)