diff --git a/static/server/caret.png b/static/server/caret.png new file mode 100644 index 0000000..96b67db Binary files /dev/null and b/static/server/caret.png differ diff --git a/static/server/home.html.tmpl b/static/server/home.html.tmpl index db4d554..e2f898d 100644 --- a/static/server/home.html.tmpl +++ b/static/server/home.html.tmpl @@ -40,6 +40,7 @@ } .book__info { line-height: 18px; color: #777; font-weight: bold; font-size: 13px; } + diff --git a/static/server/include.html.part b/static/server/include.html.part index 7996fcb..635e6f9 100644 --- a/static/server/include.html.part +++ b/static/server/include.html.part @@ -25,3 +25,4 @@ jk("html").addClass("cybook"); } + \ No newline at end of file diff --git a/static/server/resources_list.txt b/static/server/resources_list.txt index 9df07e1..078bb6f 100644 --- a/static/server/resources_list.txt +++ b/static/server/resources_list.txt @@ -19,6 +19,8 @@ jquery-ui/jquery-ui.theme.min.css jquery-ui/jquery-ui.min.css home.html.tmpl include.html.part +caret.png +taskbar.js taskbar.css taskbar.html.part global_taskbar.html.part diff --git a/static/server/taskbar.css b/static/server/taskbar.css index 1efc6f3..37f8d36 100644 --- a/static/server/taskbar.css +++ b/static/server/taskbar.css @@ -52,16 +52,6 @@ display: none; } -#button_show_toggle:not(:checked)~label:after { - content: '⌃'; - transform: rotate(180deg); -} - -#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; @@ -71,12 +61,18 @@ display: none; } -label[for="button_show_toggle"]:after { - transition: 0.1s; +label[for="button_show_toggle"] { display: inline-block; - font-size: 30px; - line-height: 21px; - vertical-align: middle; + height: 26px; +} + +label[for="button_show_toggle"] img { + transition: 0.1s; + height: 26px; +} + +#button_show_toggle:checked~label img { + transform: rotate(-180deg); } label[for="button_show_toggle"], diff --git a/static/server/taskbar.html.part b/static/server/taskbar.html.part index 63a3717..c7f819d 100644 --- a/static/server/taskbar.html.part +++ b/static/server/taskbar.html.part @@ -9,7 +9,7 @@ - +
@@ -19,54 +19,4 @@
-
- \ No newline at end of file +
\ No newline at end of file diff --git a/static/server/taskbar.js b/static/server/taskbar.js new file mode 100644 index 0000000..bf35a1a --- /dev/null +++ b/static/server/taskbar.js @@ -0,0 +1,49 @@ + +(function ($) { + if ($(window).width() < 520) { + var didScroll; + var lastScrollTop = 0; + var delta = 5; + // on scroll, let the interval function know the user has scrolled + $(window).scroll(function (event) { + didScroll = true; + }); + // run hasScrolled() and reset didScroll status + setInterval(function () { + if (didScroll) { + hasScrolled(); + didScroll = false; + } + }, 250); + function hasScrolled() { + var st = $(this).scrollTop(); + + // Make sure they scroll more than delta + if (Math.abs(lastScrollTop - st) <= delta) + return; + + // If they scrolled down and are past the navbar, add class .nav-up. + // This is necessary so you never see what is "behind" the navbar. + if (st > lastScrollTop) { + // Scroll Down + $('#kiwixtoolbar').css({ top: '-100%' }); + } else { + // Scroll Up + $('#kiwixtoolbar').css({ top: '0' }); + } + + lastScrollTop = st; + } + } + + $('#kiwixsearchbox').on({ + focus: function () { + $('.kiwix_searchform').addClass('full_width'); + $('label[for="button_show_toggle"], .kiwix_button_cont').addClass('searching'); + }, + blur: function () { + $('.kiwix_searchform').removeClass('full_width'); + $('label[for="button_show_toggle"], .kiwix_button_cont').removeClass('searching'); + } + }); +})(jQuery); \ No newline at end of file