From d1ded8a8c656ba3df4927e8bafaaa37097efda97 Mon Sep 17 00:00:00 2001 From: Xevion Date: Mon, 1 Jul 2019 11:20:19 -0500 Subject: [PATCH] added burger menu support, removed a couple imports --- app/static/script.js | 23 +++++++++++++++++++++++ app/templates/base.html | 13 +++++-------- 2 files changed, 28 insertions(+), 8 deletions(-) create mode 100644 app/static/script.js diff --git a/app/static/script.js b/app/static/script.js new file mode 100644 index 0000000..5af30e4 --- /dev/null +++ b/app/static/script.js @@ -0,0 +1,23 @@ +console.log('loaded') + +// Close mobile & tablet menu on item click + $('.navbar-item').each(function (e) { + $(this).click(function () { + if ($('#navbar-burger-id').hasClass('is-active')) { + $('#navbar-burger-id').removeClass('is-active'); + $('#navbar-menu-id').removeClass('is-active'); + } + }); + }); + + // Open or Close mobile & tablet menu + $('#navbar-burger-id').click(function () { + console.log("hit") + if ($('#navbar-burger-id').hasClass('is-active')) { + $('#navbar-burger-id').removeClass('is-active'); + $('#navbar-menu-id').removeClass('is-active'); + } else { + $('#navbar-burger-id').addClass('is-active'); + $('#navbar-menu-id').addClass('is-active'); + } + }); \ No newline at end of file diff --git a/app/templates/base.html b/app/templates/base.html index c8e8a9d..7591211 100644 --- a/app/templates/base.html +++ b/app/templates/base.html @@ -4,7 +4,7 @@ {% block title %} {% if title %} - {{ title }} - Xevion.dev + {{ title }} - Xevion.dev {% else %} Xevion.dev {% endif %} @@ -12,10 +12,8 @@ {% block head %} - -