navbar toggle fixes

This commit is contained in:
Lucy Cifferello
2021-04-14 14:59:19 -06:00
parent 1feae3ea4f
commit 784c82fc4b
3 changed files with 21 additions and 10 deletions

View File

@@ -24,6 +24,8 @@ pip3 install sphinx-book-theme || pip install git+https://github.com/executableb
Run: `sphinx-autobuild source build/html` to activate a live-reload environment on `localhost:8000`. Run: `sphinx-autobuild source build/html` to activate a live-reload environment on `localhost:8000`.
To run in development mode when actively changing js/css files run: `sphinx-autobuild source build/html source/_static/js/main.js source/_static/default.css`. this will auto-load with changes to noted files.
The main configuration file for this project is located at `./source/conf.py`. The main configuration file for this project is located at `./source/conf.py`.
The navigation structure is aligned with the folder/file organization under `./source/`. This is where the individual page `.rst` files live and can be edited. The navigation structure is aligned with the folder/file organization under `./source/`. This is where the individual page `.rst` files live and can be edited.

View File

@@ -1,6 +1,8 @@
body, h1, h2, h3, h4, nav, .topbar, .topbar-main, .tocsection, .form-control, .bd-toc { body, p, h1, h2, h3, h4, nav, .topbar, .topbar-main, .tocsection, .form-control, .bd-toc, .bd-sidebar {
background-color: #2b2b2b!important; background-color: #2b2b2b!important;
color: #f8f8ff!important; color: #f8f8ff!important;
/* font-family: Lato,sans-serif!important; */
line-height: 1.65;
} }
h1 { h1 {
@@ -191,3 +193,7 @@ nav.bd-links > ul.nav {
.navbar-brand-box { .navbar-brand-box {
text-align: center; text-align: center;
} }
.above {
margin-top: -1000px!important;
}

View File

@@ -1,8 +1,7 @@
$(document).ready(function () { $(document).ready(function (e) {
// open external links in separate tab // open external links in separate tab
$('a[href^="http://"], a[href^="https://"]').not('a[class*=internal]').attr('target', '_blank'); $('a[href^="http://"], a[href^="https://"]').not('a[class*=internal]').attr('target', '_blank');
$(".fa-arrow-left").attr("class", "fas fa-times");
$(".fa-arrow-up").attr("class", "fas fa-times");
// toggle hidable sections // toggle hidable sections
$(".toggle > *").hide(); $(".toggle > *").hide();
$(".toggle .admonition-title").show(); $(".toggle .admonition-title").show();
@@ -10,12 +9,16 @@ $(document).ready(function () {
$(this).parent().children().not(".admonition-title").toggle(400); $(this).parent().children().not(".admonition-title").toggle(400);
$(this).parent().children(".admonition-title").toggleClass("open"); $(this).parent().children(".admonition-title").toggleClass("open");
}) })
// default menu to open on initial load
$('.site-navigation').removeClass('collapsing'); // change appearance of arrow to X for menu closing
$('.site-navigation').removeClass('collapse'); $(".fa-arrow-left").attr("class", "fas fa-times");
$('.site-navigation').addClass('show'); $(".fa-arrow-up").attr("class", "fas fa-times");
// initially hide menu close button
// initially hide menu close button on small screen widths
if ($(window).width() < 768) {
$('.fa-times').addClass('hidden'); $('.fa-times').addClass('hidden');
}
$('#navbar-toggler').click(function() { $('#navbar-toggler').click(function() {
// toggle menu open/close button depending on collapsed state // toggle menu open/close button depending on collapsed state
if ($('#navbar-toggler').hasClass("collapsed")) { if ($('#navbar-toggler').hasClass("collapsed")) {