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/endpoints/subscriptions/get.php b/endpoints/subscriptions/get.php index 487490723..2614f50fb 100644 --- a/endpoints/subscriptions/get.php +++ b/endpoints/subscriptions/get.php @@ -18,6 +18,13 @@ $colorTheme = $settings['color_theme']; } +$locale = isset($_COOKIE['user_locale']) ? $_COOKIE['user_locale'] : 'en_US'; +$formatter = new IntlDateFormatter( + $locale, + IntlDateFormatter::MEDIUM, + IntlDateFormatter::NONE +); + if (isset($_SESSION['loggedin']) && $_SESSION['loggedin'] === true) { @@ -146,7 +153,9 @@ $paymentMethodId = $subscription['payment_method_id']; $print[$id]['currency_code'] = $currencies[$subscription['currency_id']]['code']; $currencyId = $subscription['currency_id']; - $print[$id]['next_payment'] = date('M d, Y', strtotime($subscription['next_payment'])); + $next_payment_timestamp = strtotime($subscription['next_payment']); + $formatted_date = $formatter->format($next_payment_timestamp); + $print[$id]['next_payment'] = $formatted_date; $paymentIconFolder = (strpos($payment_methods[$paymentMethodId]['icon'], 'images/uploads/icons/') !== false) ? "" : "images/uploads/logos/"; $print[$id]['payment_method_icon'] = $paymentIconFolder . $payment_methods[$paymentMethodId]['icon']; $print[$id]['payment_method_name'] = $payment_methods[$paymentMethodId]['name']; 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..d2186556a 100644 --- a/includes/header.php +++ b/includes/header.php @@ -1,78 +1,89 @@ 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"; +$locale = isset($_COOKIE['user_locale']) ? $_COOKIE['user_locale'] : 'en_US'; +$formatter = new IntlDateFormatter( + $locale, + IntlDateFormatter::MEDIUM, + IntlDateFormatter::NONE +); + +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"; +} + +$mobileNavigation = $settings['mobile_nav'] ? "mobile-navivagtion" : ""; ?> + Wallos - Subscription Tracker - " id="theme-color"/> + " id="theme-color" /> @@ -93,73 +104,136 @@ function hex2rgb($hex) { - - + + - + +
-
- \ No newline at end of file + + + + + + + +
\ No newline at end of file diff --git a/includes/i18n/de.php b/includes/i18n/de.php index af3ddef72..97f9218cf 100644 --- a/includes/i18n/de.php +++ b/includes/i18n/de.php @@ -214,7 +214,8 @@ "hide_disabled_subscriptions" => "Deaktivierte Abonnements verstecken", "show_disabled_subscriptions_at_the_bottom" => "Deaktivierte Abonnements am Ende anzeigen", "experimental_settings" => "Experimentelle Einstellungen", - "remove_background" => "Versuchen den Hintergrund von Logos aus der Bildersuche zu entfernen (experimentell)", + "remove_background" => "Versuchen den Hintergrund von Logos aus der Bildersuche zu entfernen", + "use_mobile_navigation_bar" => "Mobile Navigationsleiste verwenden", "experimental_info" => "Experimentelle Einstellungen funktionieren möglicherweise nicht perfekt.", "payment_methods" => "Zahlungsmethoden", "payment_methods_info" => "Zahlungsmethode zum (de-)aktivieren anklicken.", diff --git a/includes/i18n/el.php b/includes/i18n/el.php index 95afd1ec6..cec840c45 100644 --- a/includes/i18n/el.php +++ b/includes/i18n/el.php @@ -214,7 +214,8 @@ "hide_disabled_subscriptions" => "Απόκρυψη απενεργοποιημένων συνδρομών", "show_disabled_subscriptions_at_the_bottom" => "Εμφάνιση απενεργοποιημένων συνδρομών στο τέλος", "experimental_settings" => "Πειραματικές ρυθμίσεις", - "remove_background" => "Προσπάθεια αφαίρεσης του φόντου των λογότυπων από την αναζήτηση εικόνας (πειραματικά)", + "remove_background" => "Προσπάθεια αφαίρεσης του φόντου των λογότυπων από την αναζήτηση εικόνας", + "use_mobile_navigation_bar" => "Χρήση μπάρας πλοήγησης για κινητά", "experimental_info" => "Οι πειραματικές ρυθμίσεις πιθανότατα δεν θα λειτουργούν τέλεια.", "payment_methods" => "Τρόποι πληρωμής", "payment_methods_info" => "Κάνε κλικ σε μια μέθοδο πληρωμής για να την απενεργοποιήσεις/ενεργοποιήσεις.", diff --git a/includes/i18n/en.php b/includes/i18n/en.php index c873fe50e..056bd4c2c 100644 --- a/includes/i18n/en.php +++ b/includes/i18n/en.php @@ -215,7 +215,8 @@ "hide_disabled_subscriptions" => "Hide disabled subscriptions", "show_disabled_subscriptions_at_the_bottom" => "Show disabled subscriptions at the bottom", "experimental_settings" => "Experimental Settings", - "remove_background" => "Attempt to remove background of logos from image search (experimental)", + "remove_background" => "Attempt to remove background of logos from image search", + "use_mobile_navigation_bar" => "Use mobile navigation bar", "experimental_info" => "Experimental settings will probably not work perfectly.", "payment_methods" => "Payment Methods", "payment_methods_info" => "Click a payment method to disable / enable it.", diff --git a/includes/i18n/es.php b/includes/i18n/es.php index 947d5bee4..09b479fbd 100644 --- a/includes/i18n/es.php +++ b/includes/i18n/es.php @@ -214,7 +214,8 @@ "hide_disabled_subscriptions" => "Ocultar suscripciones desactivadas", "show_disabled_subscriptions_at_the_bottom" => "Mostrar suscripciones desactivadas al final", "experimental_settings" => "Configuraciones Experimentales", - "remove_background" => "Intentar quitar el fondo de los logotipos de la búsqueda de imágenes (experimental)", + "remove_background" => "Intentar quitar el fondo de los logotipos de la búsqueda de imágenes", + "use_mobile_navigation_bar" => "Usar barra de navegación móvil", "experimental_info" => "Las configuraciones experimentales probablemente no funcionarán perfectamente.", "payment_methods" => "Métodos de Pago", "payment_methods_info" => "Haz clic en un método de pago para deshabilitarlo/habilitarlo.", diff --git a/includes/i18n/fr.php b/includes/i18n/fr.php index afb52a8ce..163339c0e 100644 --- a/includes/i18n/fr.php +++ b/includes/i18n/fr.php @@ -214,7 +214,8 @@ "hide_disabled_subscriptions" => "Masquer les abonnements désactivés", "show_disabled_subscriptions_at_the_bottom" => "Afficher les abonnements désactivés en bas", "experimental_settings" => "Paramètres expérimentaux", - "remove_background" => "Tenter de supprimer l'arrière-plan des logos de la recherche d'images (expérimental)", + "remove_background" => "Tenter de supprimer l'arrière-plan des logos de la recherche d'images", + "use_mobile_navigation_bar" => "Utiliser la barre de navigation mobile", "experimental_info" => "Les paramètres expérimentaux ne fonctionneront probablement pas parfaitement.", "payment_methods" => "Méthodes de paiement", "payment_methods_info" => "Cliquez sur une méthode de paiement pour la désactiver / l'activer.", diff --git a/includes/i18n/it.php b/includes/i18n/it.php index e3eee79af..bf7191605 100644 --- a/includes/i18n/it.php +++ b/includes/i18n/it.php @@ -221,7 +221,8 @@ "hide_disabled_subscriptions" => 'Nascondi gli abbonamenti disattivati', "show_disabled_subscriptions_at_the_bottom" => 'Mostra gli abbonamenti disattivati in fondo', 'experimental_settings' => 'Impostazioni sperimentali', - 'remove_background' => 'Prova a rimuovere lo sfondo dei loghi dalla ricerca delle immagini (sperimentale)', + 'remove_background' => 'Prova a rimuovere lo sfondo dei loghi dalla ricerca delle immagini', + "use_mobile_navigation_bar" => "Utilizza la barra di navigazione mobile", 'experimental_info' => 'Le impostazioni sperimentali potrebbero non funzioneranno perfettamente.', 'payment_methods' => 'Metodi di pagamento', 'payment_methods_info' => 'Fai clic su un metodo di pagamento per abilitarlo/disabilitarlo.', diff --git a/includes/i18n/jp.php b/includes/i18n/jp.php index 4abdce71b..e176d84f9 100644 --- a/includes/i18n/jp.php +++ b/includes/i18n/jp.php @@ -214,7 +214,8 @@ "hide_disabled_subscriptions" => "無効な定期購入を非表示にする", "show_disabled_subscriptions_at_the_bottom" => "無効な定期購入を一番下に表示する", "experimental_settings" => "実験的な設定", - "remove_background" => "画像検索からロゴの背景を削除する (実験)", + "remove_background" => "画像検索からロゴの背景を削除する", + "use_mobile_navigation_bar" => "モバイルナビゲーションバーを使用する", "experimental_info" => "実験的な設定は、おそらく完全には機能しません。", "payment_methods" => "支払い方法", "payment_methods_info" => "支払い方法をクリックして無効/有効を切り替えます。", diff --git a/includes/i18n/ko.php b/includes/i18n/ko.php index b3e5909da..ddf6728d7 100644 --- a/includes/i18n/ko.php +++ b/includes/i18n/ko.php @@ -215,7 +215,8 @@ "hide_disabled_subscriptions" => "비활성화된 구독 숨기기", "show_disabled_subscriptions_at_the_bottom" => "비활성화된 구독을 하단에 표시", "experimental_settings" => "실험적 설정", - "remove_background" => "로고 이미지 검색에서 배경 삭제 (실험적)", + "remove_background" => "로고 이미지 검색에서 배경 삭제", + "use_mobile_navigation_bar" => "모바일 네비게이션 바 사용", "experimental_info" => "실험적 설정은 제대로 작동하지 않을 수 있습니다.", "payment_methods" => "결제 수단", "payment_methods_info" => "결제 수단을 클릭하여 활성화/비활성화 할 수 있습니다.", diff --git a/includes/i18n/pl.php b/includes/i18n/pl.php index 7619c7752..b85485689 100644 --- a/includes/i18n/pl.php +++ b/includes/i18n/pl.php @@ -214,7 +214,8 @@ "hide_disabled_subscriptions" => "Ukryj wyłączone subskrypcje", "show_disabled_subscriptions_at_the_bottom" => "Pokaż wyłączone subskrypcje na dole", "experimental_settings" => "Ustawienia eksperymentalne", - "remove_background" => "Próba usunięcia tła logo z wyszukiwania obrazów (eksperymentalnie)", + "remove_background" => "Próba usunięcia tła logo z wyszukiwania obrazów", + "use_mobile_navigation_bar" => "Użyj paska nawigacyjnego na urządzeniach mobilnych", "experimental_info" => "Ustawienia eksperymentalne prawdopodobnie nie będą działać idealnie.", "payment_methods" => "Metody płatności", "payment_methods_info" => "Kliknij metodę płatności, aby ją wyłączyć/włączyć..", diff --git a/includes/i18n/pt.php b/includes/i18n/pt.php index 7608597ee..c817e7acf 100644 --- a/includes/i18n/pt.php +++ b/includes/i18n/pt.php @@ -214,7 +214,8 @@ "hide_disabled_subscriptions" => "Esconder subscrições desactivadas", "show_disabled_subscriptions_at_the_bottom" => "Mostrar subscrições desactivadas no fundo da lista", "experimental_settings" => "Definições Experimentais", - "remove_background" => "Tentar remover o fundo dos logos na pesquisa de imagem (experimental)", + "remove_background" => "Tentar remover o fundo dos logos na pesquisa de imagem", + "use_mobile_navigation_bar" => "Usar barra de navegação móvel", "experimental_info" => "Definições experimentais provavelmente não funcionarão correctamente.", "payment_methods" => "Métodos de Pagamento", "payment_methods_info" => "Clique num método de pagamento para o activar / desactivar.", diff --git a/includes/i18n/pt_br.php b/includes/i18n/pt_br.php index 211d332a5..0b9501939 100644 --- a/includes/i18n/pt_br.php +++ b/includes/i18n/pt_br.php @@ -215,6 +215,7 @@ "show_disabled_subscriptions_at_the_bottom" => "Mostre as assinaturas desativadas no final da lista", "experimental_settings" => "Configurações experimentais", "remove_background" => "Tentar remover o fundo de logos na pesquisa de imagem", + "use_mobile_navigation_bar" => "Usar barra de navegação móvel", "experimental_info" => "As configurações experimentais provavelmente não funcionarão corretamente", "payment_methods" => "Métodos de pagamento", "payment_methods_info" => "Clique em um método de pagamento para ativá-lo ou desativá-lo", diff --git a/includes/i18n/ru.php b/includes/i18n/ru.php index 57e3522e5..b0af9db5e 100644 --- a/includes/i18n/ru.php +++ b/includes/i18n/ru.php @@ -214,7 +214,8 @@ "hide_disabled_subscriptions" => "Скрыть отключенные подписки", "show_disabled_subscriptions_at_the_bottom" => "Показать отключенные подписки внизу списка", "experimental_settings" => "Экспериментальные настройки", - "remove_background" => "Попытка удалить фон логотипов из поиска изображений (экспериментально).", + "remove_background" => "Попытка удалить фон логотипов из поиска изображений.", + "use_mobile_navigation_bar" => "Использовать мобильную панель навигации", "experimental_info" => "Экспериментальные настройки, вероятно, не будут работать идеально.", "payment_methods" => "Способы оплаты", "payment_methods_info" => "Нажмите на способ оплаты, чтобы отключить/включить его.", diff --git a/includes/i18n/sl.php b/includes/i18n/sl.php index 1fbeda7da..0d1773414 100644 --- a/includes/i18n/sl.php +++ b/includes/i18n/sl.php @@ -214,7 +214,8 @@ "hide_disabled_subscriptions" => "Skrij onemogočene naročnine", "show_disabled_subscriptions_at_the_bottom" => "Prikaži onemogočene naročnine na dnu seznama", "experimental_settings" => "Eksperimentalne nastavitve", - "remove_background" => "Poskusi odstraniti ozadje logotipov iz iskanja slik (eksperimentalno)", + "remove_background" => "Poskusi odstraniti ozadje logotipov iz iskanja slik", + "use_mobile_navigation_bar" => "Uporabi mobilno navigacijsko vrstico", "experimental_info" => "Poskusne nastavitve verjetno ne bodo popolnoma delovale.", "payment_methods" => "Načini plačila", "payment_methods_info" => "Kliknite način plačila, da ga onemogočite/omogočite.", diff --git a/includes/i18n/sr.php b/includes/i18n/sr.php index 713086988..abc6cc526 100644 --- a/includes/i18n/sr.php +++ b/includes/i18n/sr.php @@ -214,7 +214,8 @@ "hide_disabled_subscriptions" => "Сакриј онемогућене претплате", "show_disabled_subscriptions_at_the_bottom" => "Прикажи онемогућене претплате на дну", "experimental_settings" => "Експериментална подешавања", - "remove_background" => "Покушајте уклонити позадину логотипа са слика претраге (експериментално)", + "remove_background" => "Покушајте уклонити позадину логотипа са слика претраге", + "use_mobile_navigation_bar" => "Користите мобилну навигациону траку", "experimental_info" => "Експериментална подешавања вероватно неће радити савршено.", "payment_methods" => "Начини плаћања", "payment_methods_info" => "Кликните на начин плаћања да бисте га онемогућили / омогућили.", diff --git a/includes/i18n/sr_lat.php b/includes/i18n/sr_lat.php index 6a5c89ae2..be9101245 100644 --- a/includes/i18n/sr_lat.php +++ b/includes/i18n/sr_lat.php @@ -214,7 +214,8 @@ "hide_disabled_subscriptions" => "Sakrij onemogućene pretplate", "show_disabled_subscriptions_at_the_bottom" => "Prikaži onemogućene pretplate na dnu", "experimental_settings" => "Eksperimentalna podešavanja", - "remove_background" => "Pokušajte ukloniti pozadinu logotipa sa pretrage slika (eksperimentalno)", + "remove_background" => "Pokušajte ukloniti pozadinu logotipa sa pretrage slika", + "use_mobile_navigation_bar" => "Koristi navigacionu traku za mobilne uređaje", "experimental_info" => "Eksperimentalna podešavanja verovatno neće savršeno funkcionisati.", "payment_methods" => "Načini plaćanja", "payment_methods_info" => "Kliknite na način plaćanja da biste ga onemogućili / omogućili.", diff --git a/includes/i18n/tr.php b/includes/i18n/tr.php index cf6b13dfa..8a47f8c2d 100644 --- a/includes/i18n/tr.php +++ b/includes/i18n/tr.php @@ -214,7 +214,8 @@ "hide_disabled_subscriptions" => "Devre dışı bırakılan abonelikleri gizle", "show_disabled_subscriptions_at_the_bottom" => "Devre dışı bırakılan abonelikleri altta göster", "experimental_settings" => "Deneysel Ayarlar", - "remove_background" => "Görsel aramadan logoların arka planını kaldırmayı deneyin (deneysel)", + "remove_background" => "Görsel aramadan logoların arka planını kaldırmayı deneyin", + "use_mobile_navigation_bar" => "Mobil cihazlarda gezinme çubuğunu kullan", "experimental_info" => "Deneysel ayarlar muhtemelen mükemmel çalışmayacak.", "payment_methods" => "Ödeme Yöntemleri", "payment_methods_info" => "Bir ödeme yöntemini devre dışı bırakmak / etkinleştirmek için tıklayın.", diff --git a/includes/i18n/zh_cn.php b/includes/i18n/zh_cn.php index 8bcf7eba8..77cd39570 100644 --- a/includes/i18n/zh_cn.php +++ b/includes/i18n/zh_cn.php @@ -222,7 +222,8 @@ "hide_disabled_subscriptions" => "隐藏已停用的订阅", "show_disabled_subscriptions_at_the_bottom" => "在订阅列表底部显示已停用的订阅", "experimental_settings" => "实验性设置", - "remove_background" => "尝试从图片搜索中移除标志的背景(实验性)", + "remove_background" => "尝试从图片搜索中移除标志的背景", + "use_mobile_navigation_bar" => "使用移动导航栏", "experimental_info" => "实验性设置,可能存在问题。", "payment_methods" => "支付方式", "payment_methods_info" => "点击支付方式以禁用/启用。", diff --git a/includes/i18n/zh_tw.php b/includes/i18n/zh_tw.php index c94ab24ea..b93940875 100644 --- a/includes/i18n/zh_tw.php +++ b/includes/i18n/zh_tw.php @@ -214,7 +214,8 @@ "hide_disabled_subscriptions" => "隱藏已停用的訂閱", "show_disabled_subscriptions_at_the_bottom" => "將已停用的訂閱顯示在底部", "experimental_settings" => "實驗性設定", - "remove_background" => "嘗試從圖片搜尋中移除圖示的背景顏色(實驗性)", + "remove_background" => "嘗試從圖片搜尋中移除圖示的背景顏色", + "use_mobile_navigation_bar" => "使用移動設備導航欄", "experimental_info" => "實驗性設定,可能存在問題。", "payment_methods" => "付款方式", "payment_methods_info" => "點選付款方式以停用/啟用。", diff --git a/includes/version.php b/includes/version.php index 8e607f72b..cd3fb878d 100644 --- a/includes/version.php +++ b/includes/version.php @@ -1,3 +1,3 @@ \ No newline at end of file diff --git a/index.php b/index.php index 3306025cc..e673e078e 100644 --- a/index.php +++ b/index.php @@ -155,7 +155,7 @@ ?>
- @@ -334,7 +334,9 @@ $paymentMethodId = $subscription['payment_method_id']; $print[$id]['currency_code'] = $currencies[$subscription['currency_id']]['code']; $currencyId = $subscription['currency_id']; - $print[$id]['next_payment'] = date('M d, Y', strtotime($subscription['next_payment'])); + $next_payment_timestamp = strtotime($subscription['next_payment']); + $formatted_date = $formatter->format($next_payment_timestamp); + $print[$id]['next_payment'] = $formatted_date; $paymentIconFolder = (strpos($payment_methods[$paymentMethodId]['icon'], 'images/uploads/icons/') !== false) ? "" : "images/uploads/logos/"; $print[$id]['payment_method_icon'] = $paymentIconFolder . $payment_methods[$paymentMethodId]['icon']; $print[$id]['payment_method_name'] = $payment_methods[$paymentMethodId]['name']; @@ -568,7 +570,14 @@ - + + \ No newline at end of file diff --git a/migrations/000028.php b/migrations/000028.php new file mode 100644 index 000000000..1c776d107 --- /dev/null +++ b/migrations/000028.php @@ -0,0 +1,11 @@ +query("SELECT * FROM pragma_table_info('settings') where name='mobile_nav'"); +$columnRequired = $columnQuery->fetchArray(SQLITE3_ASSOC) === false; + +if ($columnRequired) { + $db->exec('ALTER TABLE settings ADD COLUMN mobile_nav BOOLEAN DEFAULT 0'); +} \ No newline at end of file diff --git a/scripts/common.js b/scripts/common.js index f681dcb44..35a0b5c96 100644 --- a/scripts/common.js +++ b/scripts/common.js @@ -70,6 +70,9 @@ function showSuccessMessage(message) { document.addEventListener('DOMContentLoaded', function () { + const userLocale = navigator.language || navigator.languages[0]; + document.cookie = `user_locale=${userLocale}; expires=Fri, 31 Dec 9999 23:59:59 GMT; SameSite=Strict`; + if (window.update_theme_settings) { const prefersDarkMode = window.matchMedia('(prefers-color-scheme: dark)').matches; const themePreference = prefersDarkMode ? 'dark' : 'light'; diff --git a/scripts/login.js b/scripts/login.js index 2cf93b75e..fddc7f5f5 100644 --- a/scripts/login.js +++ b/scripts/login.js @@ -1,13 +1,16 @@ document.addEventListener('DOMContentLoaded', function () { - if (window.update_theme_settings) { - const prefersDarkMode = window.matchMedia('(prefers-color-scheme: dark)').matches; - const themePreference = prefersDarkMode ? 'dark' : 'light'; - const darkThemeCss = document.querySelector("#dark-theme"); - darkThemeCss.disabled = themePreference === 'light'; - document.body.className = themePreference; - const themeColorMetaTag = document.querySelector('meta[name="theme-color"]'); - themeColorMetaTag.setAttribute('content', themePreference === 'dark' ? '#222222' : '#FFFFFF'); - } + const userLocale = navigator.language || navigator.languages[0]; + document.cookie = `user_locale=${userLocale}; expires=Fri, 31 Dec 9999 23:59:59 GMT; SameSite=Strict`; + + if (window.update_theme_settings) { + const prefersDarkMode = window.matchMedia('(prefers-color-scheme: dark)').matches; + const themePreference = prefersDarkMode ? 'dark' : 'light'; + const darkThemeCss = document.querySelector("#dark-theme"); + darkThemeCss.disabled = themePreference === 'light'; + document.body.className = themePreference; + const themeColorMetaTag = document.querySelector('meta[name="theme-color"]'); + themeColorMetaTag.setAttribute('content', themePreference === 'dark' ? '#222222' : '#FFFFFF'); + } }); \ No newline at end of file diff --git a/scripts/settings.js b/scripts/settings.js index fd60b1491..e482c81dd 100644 --- a/scripts/settings.js +++ b/scripts/settings.js @@ -934,6 +934,13 @@ function setShowOriginalPrice() { storeSettingsOnDB('show_original_price', value); } +function setMobileNavigation() { + const mobileNavigationCheckbox = document.querySelector("#mobilenavigation"); + const value = mobileNavigationCheckbox.checked; + + storeSettingsOnDB('mobile_navigation', value); +} + function saveCategorySorting() { const categories = document.getElementById('categories'); const categoryIds = Array.from(categories.children).map(category => category.dataset.categoryid); diff --git a/settings.php b/settings.php index 33ae335a9..2c484a819 100644 --- a/settings.php +++ b/settings.php @@ -1390,6 +1390,14 @@ class="thin">
+
+
+ > + +
+

diff --git a/styles/dark-theme.css b/styles/dark-theme.css index 1e7972cd9..6a44c1b5e 100644 --- a/styles/dark-theme.css +++ b/styles/dark-theme.css @@ -218,14 +218,14 @@ button.dark-theme-button:hover { border: 1px solid #666; } -input[type="checkbox"] + label::before, -input[type="radio"] + label::before { +input[type="checkbox"]+label::before, +input[type="radio"]+label::before { background: #555; border: 1px solid #666; } -input[type="checkbox"]:disabled + label::before, -input[type="radio"]:disabled + label::before { +input[type="checkbox"]:disabled+label::before, +input[type="radio"]:disabled+label::before { background-color: #333; border-color: #222; cursor: not-allowed; @@ -248,4 +248,25 @@ input { .totp-backup-codes { background-color: #111; border: 2px dashed #444; +} + +@media (max-width: 768px) { + .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>i { + color: #777; + } + + .mobile-nav>a.active>i { + color: #f0f0F0; + } } \ No newline at end of file diff --git a/styles/styles.css b/styles/styles.css index e9032a930..2b4edae44 100644 --- a/styles/styles.css +++ b/styles/styles.css @@ -10,6 +10,12 @@ body.no-scroll { overflow-y: hidden; } +@media (max-width: 768px) { + .mobile-navivagtion main { + margin-bottom: 70px; + } +} + input, button, select, @@ -121,6 +127,13 @@ header .logo .logo-image svg { content: " ▼"; } +@media (max-width: 768px) { + .mobile-navivagtion .dropbtn:after { + content: ""; + display: none; + } +} + .dropbtn { display: flex; flex-direction: row; @@ -277,12 +290,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 +1677,7 @@ button.dark-theme-button i { @media (max-width: 768px) { .toast { - bottom: 0px; + bottom: 70px; right: 0px; left: 0px; width: 100%; @@ -2471,7 +2484,7 @@ input[type="radio"]:checked+label::after { color: #222; } -.update-banner > span { +.update-banner>span { font-weight: 500; } @@ -2553,4 +2566,57 @@ 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 20px 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; + } + + .mobile-navivagtion .mobileNavigationHideOnMobile { + display: none !important; + } } \ No newline at end of file