From bad7f2ddf120b672a523f2effaa061a73ef00fbe Mon Sep 17 00:00:00 2001 From: Joe Reeve Date: Mon, 17 Jun 2019 14:21:00 +0100 Subject: [PATCH] Make server toolbar auto-hide and collapse buttons into dropdown on small screens --- static/server/taskbar.css | 36 ++++++++++++++++++++-- static/server/taskbar.html.part | 53 +++++++++++++++++++++++++++++---- 2 files changed, 82 insertions(+), 7 deletions(-) diff --git a/static/server/taskbar.css b/static/server/taskbar.css index f8a3aa7..96b38db 100644 --- a/static/server/taskbar.css +++ b/static/server/taskbar.css @@ -5,6 +5,8 @@ right:0; top: 0; z-index:100; + background-position-y: 0px; + transition: 0.3s; } #kiwixtoolbar > a { @@ -28,8 +30,26 @@ max-width: 720px; margin: 0 auto; } -.kiwix .kiwix_button_wrapper { - float: left; +#button_show_toggle { + display: none; +} + +#button_show_toggle:not(:checked) ~ label:after { + content:'►'; +} +#button_show_toggle:checked ~ label:after { + content:'▼'; +} +#button_show_toggle:checked ~ label ~ .kiwix_button_cont, +#button_show_toggle:checked ~ label ~ .kiwix_button_cont > a { + display: block; +} +#button_show_toggle:not(:checked) ~ label ~ .kiwix_button_cont { + display: none; +} +label[for="button_show_toggle"], +.kiwix_button_cont { + display: block; } .kiwix .kiwix_searchform { float: right; @@ -72,6 +92,18 @@ li.ui-state-focus { font-weight: bold; } +@media(min-width:415px) { + .kiwix_button_cont { + display: block !important; + } + .kiwix_button_cont > a { + display: inline-block !important; + } + label[for="button_show_toggle"] { + display: none; + } +} + @media (max-width: 520px) { .kiwixsearch { margin-top: 5px; diff --git a/static/server/taskbar.html.part b/static/server/taskbar.html.part index 3ea5226..8cd2471 100644 --- a/static/server/taskbar.html.part +++ b/static/server/taskbar.html.part @@ -1,11 +1,6 @@
-
@@ -13,7 +8,55 @@
+ + +
+ \ No newline at end of file