From 067e0f3db1e0c44f11a486528b6341f6ae291fb6 Mon Sep 17 00:00:00 2001 From: Miguel Ribeiro Date: Sun, 29 Sep 2024 21:40:00 +0200 Subject: [PATCH] put mobile menu behind experimental settings --- endpoints/settings/mobile_navigation.php | 36 ++++++++++++ includes/header.php | 72 +++++++++++++----------- includes/i18n/de.php | 3 +- includes/i18n/el.php | 3 +- includes/i18n/en.php | 3 +- includes/i18n/es.php | 3 +- includes/i18n/fr.php | 3 +- includes/i18n/it.php | 3 +- includes/i18n/jp.php | 3 +- includes/i18n/ko.php | 3 +- includes/i18n/pl.php | 3 +- includes/i18n/pt.php | 3 +- includes/i18n/pt_br.php | 1 + includes/i18n/ru.php | 3 +- includes/i18n/sl.php | 3 +- includes/i18n/sr.php | 3 +- includes/i18n/sr_lat.php | 3 +- includes/i18n/tr.php | 3 +- includes/i18n/zh_cn.php | 3 +- includes/i18n/zh_tw.php | 3 +- index.php | 2 +- migrations/000028.php | 11 ++++ scripts/settings.js | 7 +++ settings.php | 8 +++ styles/styles.css | 15 +++-- 25 files changed, 147 insertions(+), 56 deletions(-) create mode 100644 endpoints/settings/mobile_navigation.php create mode 100644 migrations/000028.php diff --git a/endpoints/settings/mobile_navigation.php b/endpoints/settings/mobile_navigation.php new file mode 100644 index 000000000..4d9ee7580 --- /dev/null +++ b/endpoints/settings/mobile_navigation.php @@ -0,0 +1,36 @@ + false, + "message" => translate('session_expired', $i18n) + ])); +} + +if ($_SERVER["REQUEST_METHOD"] === "POST") { + $postData = file_get_contents("php://input"); + $data = json_decode($postData, true); + + $mobile_nav = $data['value']; + + $stmt = $db->prepare('UPDATE settings SET mobile_nav = :mobile_nav WHERE user_id = :userId'); + $stmt->bindParam(':mobile_nav', $mobile_nav, SQLITE3_INTEGER); + $stmt->bindParam(':userId', $userId, SQLITE3_INTEGER); + + if ($stmt->execute()) { + die(json_encode([ + "success" => true, + "message" => translate("success", $i18n) + ])); + } else { + die(json_encode([ + "success" => false, + "message" => translate("error", $i18n) + ])); + } +} +« + +?> \ No newline at end of file diff --git a/includes/header.php b/includes/header.php index dd5592e10..239af3999 100644 --- a/includes/header.php +++ b/includes/header.php @@ -65,6 +65,8 @@ function hex2rgb($hex) return "$r, $g, $b"; } +$mobileNavigation = $settings['mobile_nav'] ? "mobile-navivagtion" : ""; + ?> @@ -139,7 +141,7 @@ function hex2rgb($hex) - +

diff --git a/styles/styles.css b/styles/styles.css index f2f7489fe..8c8a453e5 100644 --- a/styles/styles.css +++ b/styles/styles.css @@ -123,9 +123,14 @@ header .logo .logo-image svg { display: inline-block; } -@media (min-width: 768px) { - .dropbtn:after { - content: " ▼"; +.dropbtn:after { + content: " ▼"; +} + +@media (max-width: 768px) { + .mobile-navivagtion .dropbtn:after { + content: ""; + display: none; } } @@ -2610,10 +2615,8 @@ input[type="radio"]:checked+label::after { .mobile-nav>button>i { color: #fff; } -} -@media (max-width: 768px) { - .hideOnMobile { + .mobile-navivagtion .mobileNavigationHideOnMobile { display: none !important; } } \ No newline at end of file