From 67eeac762984efe4b2b6121f7380f40fb0392fe3 Mon Sep 17 00:00:00 2001 From: Benny Powers Date: Tue, 1 Nov 2022 11:34:02 +0200 Subject: [PATCH] feat(ui): bottom nav --- src/inline-script/inline-script.js | 3 +++ src/intl/en-US.js | 1 + src/routes/_components/Nav.html | 7 ++++++- src/routes/_layout.html | 8 +++++++- src/routes/_pages/settings/general.html | 5 +++++ src/routes/_store/observers/bottomNavObservers.js | 8 ++++++++ src/routes/_store/observers/loggedInObservers.js | 2 ++ src/routes/_store/observers/observers.js | 2 ++ src/routes/_store/store.js | 1 + src/scss/global.scss | 2 +- 10 files changed, 36 insertions(+), 3 deletions(-) create mode 100644 src/routes/_store/observers/bottomNavObservers.js diff --git a/src/inline-script/inline-script.js b/src/inline-script/inline-script.js index aced0545..5eed21fa 100644 --- a/src/inline-script/inline-script.js +++ b/src/inline-script/inline-script.js @@ -16,6 +16,7 @@ const { currentInstance, instanceThemes, disableCustomScrollbars, + bottomNav, enableGrayscale, pushSubscription, loggedInInstancesInOrder, @@ -53,6 +54,8 @@ if (disableCustomScrollbars) { .setAttribute('media', 'only x') // disables the style } +document.body.classList.toggle('bottom-nav', bottomNav); + if (centerNav) { document.getElementById('theCenterNavStyle') .setAttribute('media', 'all') // enables the style diff --git a/src/intl/en-US.js b/src/intl/en-US.js index 106e7c97..fb5d71b2 100644 --- a/src/intl/en-US.js +++ b/src/intl/en-US.js @@ -382,6 +382,7 @@ export default { theme: 'Theme', themeForInstance: 'Theme for {instance}', disableCustomScrollbars: 'Disable custom scrollbars', + bottomNav: 'Place the navigation bar at the bottom of the screen', centerNav: 'Center the navigation header', preferences: 'Preferences', hotkeySettings: 'Hotkey settings', diff --git a/src/routes/_components/Nav.html b/src/routes/_components/Nav.html index 60af408e..a0cf86e7 100644 --- a/src/routes/_components/Nav.html +++ b/src/routes/_components/Nav.html @@ -1,4 +1,4 @@ -