From 22313d657ffbe1191eec878014b9922409bad23d Mon Sep 17 00:00:00 2001 From: grandeljay Date: Sun, 27 Feb 2022 19:47:02 +0100 Subject: [PATCH 1/4] Experiment with hamburger menu --- src/assets/css/default.css | 9 +++++++++ src/assets/js/default.js | 16 ++++++++++++++++ src/classes/page.php | 10 +++++++++- 3 files changed, 34 insertions(+), 1 deletion(-) diff --git a/src/assets/css/default.css b/src/assets/css/default.css index f9424eef..615e00cc 100644 --- a/src/assets/css/default.css +++ b/src/assets/css/default.css @@ -206,3 +206,12 @@ p .ui.horizontal.label { margin-bottom: 0; } } + +/** + * Menu + */ +@media (min-width: 768px) { + .menu.toggle { + display: none; + } +} diff --git a/src/assets/js/default.js b/src/assets/js/default.js index c252dd7f..43120adc 100644 --- a/src/assets/js/default.js +++ b/src/assets/js/default.js @@ -95,6 +95,22 @@ $(function() { $.fn.toast.settings.class = 'success'; $.fn.toast.settings.showIcon = 'check'; $.fn.toast.settings.title = 'Success'; + + /** + * Menu + */ + $(document).on('click', '.menu.toggle', function() { + $('.menu.sidebar').sidebar('show'); + }); + + $(window).resize(function(event) { + if ($(window).width() > 768) { + $('.menu.sidebar').removeClass('vertical sidebar'); + } else { + $('.menu.sidebar').addClass('vertical sidebar'); + } + }); + $(window).trigger('resize'); }); /** diff --git a/src/classes/page.php b/src/classes/page.php index 1af1067b..5af4a071 100644 --- a/src/classes/page.php +++ b/src/classes/page.php @@ -255,7 +255,7 @@ class Page ); } ?> -