From f4e40cf4afddccb41a62f0929926c474da53832c Mon Sep 17 00:00:00 2001 From: Miguel Ribeiro Date: Sun, 29 Sep 2024 15:48:03 +0200 Subject: [PATCH] test mobile menu on the bottom --- includes/footer.php | 50 ++++----- includes/header.php | 239 ++++++++++++++++++++++++++---------------- index.php | 11 +- styles/dark-theme.css | 16 ++- styles/styles.css | 75 +++++++++++-- 5 files changed, 267 insertions(+), 124 deletions(-) diff --git a/includes/footer.php b/includes/footer.php index 0ef9f170a..0684cf747 100644 --- a/includes/footer.php +++ b/includes/footer.php @@ -1,35 +1,35 @@ - + -
-
- -
- - -
+
+
+ +
+ +
- -
+ +
+
-
-
- -
- - -
+
+
+ +
+ +
- -
+ +
+
- close(); - } - ?> +close(); +} +?> - + \ No newline at end of file diff --git a/includes/header.php b/includes/header.php index 0b4a0bf02..dd5592e10 100644 --- a/includes/header.php +++ b/includes/header.php @@ -1,78 +1,80 @@ close(); - header("Location: registration.php"); - exit(); - } +if ($userCount == 0) { + $db->close(); + header("Location: registration.php"); + exit(); +} - $demoMode = getenv('DEMO_MODE'); +$demoMode = getenv('DEMO_MODE'); - $theme = "automatic"; - if (isset($settings['theme'])) { - $theme = $settings['theme']; - } +$theme = "automatic"; +if (isset($settings['theme'])) { + $theme = $settings['theme']; +} - $updateThemeSettings = false; - if (isset($settings['update_theme_setttings'])) { - $updateThemeSettings = $settings['update_theme_setttings']; - } +$updateThemeSettings = false; +if (isset($settings['update_theme_setttings'])) { + $updateThemeSettings = $settings['update_theme_setttings']; +} - $colorTheme = "blue"; - if (isset($settings['color_theme'])) { - $colorTheme = $settings['color_theme']; - } +$colorTheme = "blue"; +if (isset($settings['color_theme'])) { + $colorTheme = $settings['color_theme']; +} - $customCss = ""; - if (isset($settings['customCss'])) { - $customCss = $settings['customCss']; - } +$customCss = ""; +if (isset($settings['customCss'])) { + $customCss = $settings['customCss']; +} - if (isset($themeValue)) { - $cookieExpire = time() + (30 * 24 * 60 * 60); - setcookie('theme', $themeValue, [ - 'expires' => $cookieExpire, - 'samesite' => 'Strict' - ]); - } +if (isset($themeValue)) { + $cookieExpire = time() + (30 * 24 * 60 * 60); + setcookie('theme', $themeValue, [ + 'expires' => $cookieExpire, + 'samesite' => 'Strict' + ]); +} - $isAdmin = $_SESSION['userId'] == 1; +$isAdmin = $_SESSION['userId'] == 1; - function hex2rgb($hex) { - $hex = str_replace("#", "", $hex); - if(strlen($hex) == 3) { - $r = hexdec(substr($hex,0,1).substr($hex,0,1)); - $g = hexdec(substr($hex,1,1).substr($hex,1,1)); - $b = hexdec(substr($hex,2,1).substr($hex,2,1)); - } else { - $r = hexdec(substr($hex,0,2)); - $g = hexdec(substr($hex,2,2)); - $b = hexdec(substr($hex,4,2)); - } - return "$r, $g, $b"; +function hex2rgb($hex) +{ + $hex = str_replace("#", "", $hex); + if (strlen($hex) == 3) { + $r = hexdec(substr($hex, 0, 1) . substr($hex, 0, 1)); + $g = hexdec(substr($hex, 1, 1) . substr($hex, 1, 1)); + $b = hexdec(substr($hex, 2, 1) . substr($hex, 2, 1)); + } else { + $r = hexdec(substr($hex, 0, 2)); + $g = hexdec(substr($hex, 2, 2)); + $b = hexdec(substr($hex, 4, 2)); } + return "$r, $g, $b"; +} ?> + Wallos - Subscription Tracker - " id="theme-color"/> + " id="theme-color" /> @@ -93,73 +95,130 @@ function hex2rgb($hex) { - - + + +
-
- \ No newline at end of file + + + + + +
\ No newline at end of file diff --git a/index.php b/index.php index 3306025cc..5f35129a9 100644 --- a/index.php +++ b/index.php @@ -155,7 +155,7 @@ ?>
- @@ -568,7 +568,14 @@ - + + \ No newline at end of file diff --git a/styles/dark-theme.css b/styles/dark-theme.css index 1e7972cd9..ad8fc6d9c 100644 --- a/styles/dark-theme.css +++ b/styles/dark-theme.css @@ -248,4 +248,18 @@ input { .totp-backup-codes { background-color: #111; border: 2px dashed #444; -} \ No newline at end of file +} + +.mobile-nav { + background-color: #222; + border-top: #111; + box-shadow: 0 -2px 5px rgba(120, 120, 120, 0.1);; +} + +.mobile-nav>a { + padding: 0px 10px; +} + +.mobile-nav>a.active>i { + color: #BBB; + } \ No newline at end of file diff --git a/styles/styles.css b/styles/styles.css index e9032a930..541555949 100644 --- a/styles/styles.css +++ b/styles/styles.css @@ -10,6 +10,12 @@ body.no-scroll { overflow-y: hidden; } +@media (max-width: 768px) { + main { + margin-bottom: 60px; + } +} + input, button, select, @@ -117,8 +123,10 @@ header .logo .logo-image svg { display: inline-block; } -.dropbtn:after { - content: " ▼"; +@media (min-width: 768px) { + .dropbtn:after { + content: " ▼"; + } } .dropbtn { @@ -277,12 +285,12 @@ button:hover svg .main-color { flex-grow: 1; } -.top-actions .search > input[type="text"] { +.top-actions .search>input[type="text"] { padding-right: 40px; } .top-actions>.search>.search-icon, -.top-actions>.search>.clear-search { +.top-actions>.search>.clear-search { float: right; right: 15px; margin-top: -35px; @@ -1664,7 +1672,7 @@ button.dark-theme-button i { @media (max-width: 768px) { .toast { - bottom: 0px; + bottom: 60px; right: 0px; left: 0px; width: 100%; @@ -2471,7 +2479,7 @@ input[type="radio"]:checked+label::after { color: #222; } -.update-banner > span { +.update-banner>span { font-weight: 500; } @@ -2553,4 +2561,59 @@ input[type="radio"]:checked+label::after { list-style: none; padding: 5px 10px; font-weight: 500; +} + +.mobile-nav { + display: none; +} + +@media (max-width: 768px) { + .mobile-nav { + position: fixed; + bottom: 0px; + width: 100%; + background-color: #FFFFFF; + border-top: 1px solid #EEEEEE; + display: flex; + flex-direction: row; + justify-content: space-around; + z-index: 2; + padding: 10px 0px; + font-size: 28px; + box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.1); + box-sizing: border-box; + align-items: baseline; + } + + .mobile-nav>a>i { + color: #AAA; + } + + .mobile-nav>a.active>i { + color: #202020; + } + + .mobile-nav>a.secondary, + .mobile-nav>button { + background-color: var(--main-color); + border: none; + border-radius: 35px; + padding: 3px 8px; + } + + .mobile-nav>button { + border: none; + font-size: 28px; + } + + .mobile-nav>a.secondary>i, + .mobile-nav>button>i { + color: #fff; + } +} + +@media (max-width: 768px) { + .hideOnMobile { + display: none !important; + } } \ No newline at end of file