From 3ccbeee4e6fcb3a1ea1a57b7c8dd2fb9cac0ad8b Mon Sep 17 00:00:00 2001 From: Miguel Ribeiro Date: Fri, 4 Oct 2024 15:02:27 +0200 Subject: [PATCH 1/7] Add API --- api/subscriptions/get_monthly_cost.php | 151 +++++++++++ endpoints/user/regenerateapikey.php | 40 +++ includes/header.php | 2 + includes/i18n/de.php | 7 +- includes/i18n/el.php | 7 +- includes/i18n/en.php | 7 +- includes/i18n/es.php | 7 +- includes/i18n/fr.php | 7 +- includes/i18n/it.php | 7 +- includes/i18n/jp.php | 7 +- includes/i18n/ko.php | 7 +- includes/i18n/pl.php | 7 +- includes/i18n/pt.php | 7 +- includes/i18n/pt_br.php | 7 +- includes/i18n/ru.php | 7 +- includes/i18n/sl.php | 7 +- includes/i18n/sr.php | 7 +- includes/i18n/sr_lat.php | 7 +- includes/i18n/tr.php | 7 +- includes/i18n/zh_cn.php | 7 +- includes/i18n/zh_tw.php | 7 +- migrations/000029.php | 21 ++ profile.php | 303 +++++++++++++++++++++ scripts/profile.js | 356 +++++++++++++++++++++++++ scripts/settings.js | 329 +---------------------- settings.php | 277 +------------------ styles/styles.css | 6 +- 27 files changed, 1000 insertions(+), 611 deletions(-) create mode 100644 api/subscriptions/get_monthly_cost.php create mode 100644 endpoints/user/regenerateapikey.php create mode 100644 migrations/000029.php create mode 100644 profile.php create mode 100644 scripts/profile.js diff --git a/api/subscriptions/get_monthly_cost.php b/api/subscriptions/get_monthly_cost.php new file mode 100644 index 000000000..e0e7f4bc5 --- /dev/null +++ b/api/subscriptions/get_monthly_cost.php @@ -0,0 +1,151 @@ + false, + "title" => "Missing parameters" + ]; + echo json_encode($response); + exit; + } + + $month = $_REQUEST['month']; + $year = $_REQUEST['year']; + $apiKey = $_REQUEST['api_key']; + + $sql = "SELECT * FROM user WHERE api_key = :apiKey"; + $stmt = $db->prepare($sql); + $stmt->bindValue(':apiKey', $apiKey); + $result = $stmt->execute(); + $user = $result->fetchArray(SQLITE3_ASSOC); + + $sql = "SELECT * FROM last_exchange_update"; + $result = $db->query($sql); + $lastExchangeUpdate = $result->fetchArray(SQLITE3_ASSOC); + + $userId = $user['id']; + $userCurrencyId = $user['main_currency']; + $needsCurrencyConversion = false; + $canConvertCurrency = empty($lastExchangeUpdate['date']) ? false : true; + + $sql = "SELECT * FROM currencies WHERE id = :currencyId"; + $stmt = $db->prepare($sql); + $stmt->bindValue(':currencyId', $userCurrencyId); + $result = $stmt->execute(); + $currency = $result->fetchArray(SQLITE3_ASSOC); + $currency_code = $currency['code']; + $currency_symbol = $currency['symbol']; + + + $title = date('F Y', strtotime($year . '-' . $month . '-01')); + $monthlyCost = 0; + $notes = []; + + $sql = "SELECT * FROM subscriptions WHERE user_id = :userId AND inactive = 0"; + $stmt = $db->prepare($sql); + $stmt->bindValue(':userId', $userId); + $result = $stmt->execute(); + $subscriptions = []; + while ($subscription = $result->fetchArray(SQLITE3_ASSOC)) { + $subscriptions[] = $subscription; + if ($subscription['currency_id'] !== $userCurrencyId) { + $needsCurrencyConversion = true; + } + } + + if ($needsCurrencyConversion) { + if (!$canConvertCurrency) { + $notes[] = "You are using multiple currencies, but the exchange rates have not been updated yet. Please check your Fixer API Key."; + } else { + $sql = "SELECT * FROM currencies WHERE user_id = :userId"; + $stmt = $db->prepare($sql); + $stmt->bindValue(':userId', $userId); + $result = $stmt->execute(); + $currencies = []; + while ($currency = $result->fetchArray(SQLITE3_ASSOC)) { + $currencies[$currency['id']] = $currency['rate']; + } + } + } + + // Calculate the monthly cost based on the next_payment_date, payment cycle, and payment frequency + foreach ($subscriptions as $subscription) { + $nextPaymentDate = strtotime($subscription['next_payment']); + $cycle = $subscription['cycle']; // Integer from 1 to 4 + $frequency = $subscription['frequency']; + + // Determine the strtotime increment string based on cycle + switch ($cycle) { + case 1: // Days + $incrementString = "+{$frequency} days"; + break; + case 2: // Weeks + $incrementString = "+{$frequency} weeks"; + break; + case 3: // Months + $incrementString = "+{$frequency} months"; + break; + case 4: // Years + $incrementString = "+{$frequency} years"; + break; + default: + $incrementString = "+{$frequency} months"; // Default case, if needed + } + + // Calculate the start of the month + $startOfMonth = strtotime($year . '-' . str_pad($month, 2, '0', STR_PAD_LEFT) . '-01'); + + // Find the first payment date of the month by moving backwards + $startDate = $nextPaymentDate; + while ($startDate > $startOfMonth) { + $startDate = strtotime("-" . $incrementString, $startDate); + } + + // Calculate the monthly cost + for ($date = $startDate; $date <= strtotime("+1 month", $startOfMonth); $date = strtotime($incrementString, $date)) { + if (date('Y-m', $date) == $year . '-' . str_pad($month, 2, '0', STR_PAD_LEFT)) { + $price = $subscription['price']; + if ($userCurrencyId !== $subscription['currency_id']) { + $price *= $currencies[$userCurrencyId] / $currencies[$subscription['currency_id']]; + } + $monthlyCost += $price; + } + } + } + + $formatter = new NumberFormatter('en_US', NumberFormatter::CURRENCY); + $localizedMonthlyCost = $formatter->formatCurrency($monthlyCost, $currency_code); + + echo json_encode([ + 'success' => true, + 'title' => $title, + 'monthly_cost' => number_format($monthlyCost, 2), + 'localized_monthly_cost' => $localizedMonthlyCost, + 'currency_code' => $currency_code, + 'currency_symbol' => $currency_symbol, + 'notes' => $notes + ], JSON_UNESCAPED_UNICODE); + +} +?> \ No newline at end of file diff --git a/endpoints/user/regenerateapikey.php b/endpoints/user/regenerateapikey.php new file mode 100644 index 000000000..3034d12d3 --- /dev/null +++ b/endpoints/user/regenerateapikey.php @@ -0,0 +1,40 @@ + false, + "message" => translate('session_expired', $i18n) + ])); +} + +if ($_SERVER["REQUEST_METHOD"] === "POST") { + $postData = file_get_contents("php://input"); + $data = json_decode($postData, true); + + $apiKey = bin2hex(random_bytes(32)); + + $sql = "UPDATE user SET api_key = :apiKey WHERE id = :userId"; + $stmt = $db->prepare($sql); + $stmt->bindValue(':apiKey', $apiKey, SQLITE3_TEXT); + $stmt->bindValue(':userId', $userId, SQLITE3_TEXT); + $result = $stmt->execute(); + + if ($result) { + $response = [ + "success" => true, + "message" => translate('user_details_saved', $i18n), + "apiKey" => $apiKey + ]; + echo json_encode($response); + } else { + $response = [ + "success" => false, + "message" => translate('error_updating_user_data', $i18n) + ]; + echo json_encode($response); + } + +} + +?> \ No newline at end of file diff --git a/includes/header.php b/includes/header.php index d2186556a..e140a6827 100644 --- a/includes/header.php +++ b/includes/header.php @@ -165,6 +165,8 @@ function hex2rgb($hex) - - diff --git a/styles/styles.css b/styles/styles.css index 2b4edae44..517b41832 100644 --- a/styles/styles.css +++ b/styles/styles.css @@ -1677,11 +1677,15 @@ button.dark-theme-button i { @media (max-width: 768px) { .toast { - bottom: 70px; + bottom: 0px; right: 0px; left: 0px; width: 100%; } + + .mobile-navivagtion .toast { + bottom: 70px; + } } .toast.active { From d601921dd4ffcd785536ce48235cf6108f39ec8a Mon Sep 17 00:00:00 2001 From: Miguel Ribeiro Date: Fri, 4 Oct 2024 15:07:20 +0200 Subject: [PATCH 2/7] remove duplicate translation key --- includes/i18n/de.php | 1 - includes/i18n/el.php | 1 - includes/i18n/en.php | 1 - includes/i18n/es.php | 1 - includes/i18n/fr.php | 1 - includes/i18n/it.php | 1 - includes/i18n/jp.php | 1 - includes/i18n/ko.php | 1 - includes/i18n/pl.php | 1 - includes/i18n/pt.php | 1 - includes/i18n/pt_br.php | 1 - includes/i18n/ru.php | 1 - includes/i18n/sl.php | 1 - includes/i18n/sr.php | 1 - includes/i18n/sr_lat.php | 1 - includes/i18n/tr.php | 1 - includes/i18n/zh_cn.php | 1 - includes/i18n/zh_tw.php | 1 - 18 files changed, 18 deletions(-) diff --git a/includes/i18n/de.php b/includes/i18n/de.php index ad9d7e108..2fe140b8f 100644 --- a/includes/i18n/de.php +++ b/includes/i18n/de.php @@ -191,7 +191,6 @@ "currency_info" => "Finde die unterstützten Währungen und korrekten Währungscodes auf", "currency_performance" => "Aus Gründen der Performance wähle bitte ausschließlich die genutzen Währungen.", "fixer_api_key" => "Fixer API Key", - "api_key" => "API Key", "provider" => "Anbieter", "fixer_info" => "Falls du mehrere Währungen nutzt und genaue Statistiken und die Sortierungsfunktion nutzen möchtest, wird ein kostenfreier API Key von Fixer benötigt.", "get_key" => "Erhalte deinen key bei", diff --git a/includes/i18n/el.php b/includes/i18n/el.php index 530627cbb..de41bd6c7 100644 --- a/includes/i18n/el.php +++ b/includes/i18n/el.php @@ -191,7 +191,6 @@ "currency_info" => "Βρες τα υποστηριζόμενα νομίσματα και τους σωστούς κωδικούς νομίσματος στο", "currency_performance" => "Για βελτιωμένη απόδοση κράτησε μόνο τα νομίσματα που χρησιμοποιείς.", "fixer_api_key" => "Fixer API κλειδί", - "api_key" => "API κλειδί", "provider" => "Πάροχος", "fixer_info" => "Εάν χρησιμοποιείς πολλαπλά νομίσματα και θέλεις ακριβή στατιστικά στοιχεία και ταξινόμηση των συνδρομών, είναι απαραίτητο ένα ΔΩΡΕΑΝ κλειδί API από το Fixer.", "get_key" => "Απόκτησε το κλειδί στο", diff --git a/includes/i18n/en.php b/includes/i18n/en.php index 7900289f7..abeb0648b 100644 --- a/includes/i18n/en.php +++ b/includes/i18n/en.php @@ -192,7 +192,6 @@ "currency_info" => "Find the supported currencies and correct currency codes on", "currency_performance" => "For improved performance keep only the currencies you use.", "fixer_api_key" => "Fixer API Key", - "api_key" => "API Key", "provider" => "Provider", "fixer_info" => "If you use multiple currencies, and want accurate statistics and sorting on the subscriptions, a FREE API Key from Fixer is necessary.", "get_key" => "Get your key at", diff --git a/includes/i18n/es.php b/includes/i18n/es.php index ae7b0b94e..e79e354f2 100644 --- a/includes/i18n/es.php +++ b/includes/i18n/es.php @@ -191,7 +191,6 @@ "currency_info" => "Encuentra las monedas admitidas y los códigos de moneda correctos en", "currency_performance" => "Para un rendimiento mejorado, guarda solo las monedas que uses.", "fixer_api_key" => "API Key de Fixer", - "api_key" => "API Key", "provider" => "Proveedor", "fixer_info" => "Si usas varias monedas y deseas estadísticas y orden precisos en las suscripciones, es necesaria una API KEY gratuita de Fixer.", "get_key" => "Obtén tu clave en", diff --git a/includes/i18n/fr.php b/includes/i18n/fr.php index 8c84ecb8e..79a63f252 100644 --- a/includes/i18n/fr.php +++ b/includes/i18n/fr.php @@ -191,7 +191,6 @@ "currency_info" => "Trouvez les devises prises en charge et les codes de devise corrects sur", "currency_performance" => "Pour des performances améliorées, ne conservez que les devises que vous utilisez.", "fixer_api_key" => "Clé API de Fixer", - "api_key" => "Clé API", "provider" => "Fournisseur", "fixer_info" => "Si vous utilisez plusieurs devises et souhaitez des statistiques et un tri précis sur les abonnements, une clé API GRATUITE de Fixer est nécessaire.", "get_key" => "Obtenez votre clé sur", diff --git a/includes/i18n/it.php b/includes/i18n/it.php index 153f5034a..9f1b685cb 100644 --- a/includes/i18n/it.php +++ b/includes/i18n/it.php @@ -198,7 +198,6 @@ 'currency_info' => 'Trova le valute supportate e i codici valuta corretti su', 'currency_performance' => 'Per garantire prestazioni migliori, tieni solo le valute che utilizzi.', 'fixer_api_key' => 'Chiave API di Fixer', - 'api_key' => 'Chiave API', 'provider' => 'Fornitore', 'fixer_info' => 'Se utilizzi più valute e desideri visualizzare statistiche e ordinamenti accurati sugli abbonamenti, è necessaria una chiave API (Gratuita) da Fixer.', 'get_key' => 'Ottieni la tua chiave su', diff --git a/includes/i18n/jp.php b/includes/i18n/jp.php index fe151f4b8..7ba8a3741 100644 --- a/includes/i18n/jp.php +++ b/includes/i18n/jp.php @@ -191,7 +191,6 @@ "currency_info" => "サポートされている通貨と正しい通貨コードを見つける", "currency_performance" => "Fパフォーマンスを向上させるには、使用する通貨のみを保持してください。", "fixer_api_key" => "FixerのAPIキー", - "api_key" => "APIキー", "provider" => "プロバイダ", "fixer_info" => "複数の通貨を使用し、定期購入に関する正確な統計と並べ替えが必要な場合は、Fixerからの無料APIキーが必要です。", "get_key" => "キーを入手する", diff --git a/includes/i18n/ko.php b/includes/i18n/ko.php index dffb86c57..339211976 100644 --- a/includes/i18n/ko.php +++ b/includes/i18n/ko.php @@ -192,7 +192,6 @@ "currency_info" => "지원하는 통화와 정확한 통화 코드 찾기", "currency_performance" => "성능을 향상시키기 위해서는 사용할 통화들만 유지하세요.", "fixer_api_key" => "Fixer API 키", - "api_key" => "API 키", "provider" => "제공자", "fixer_info" => "여러 통화를 사용하고, 정확한 통계와 구독별 정렬을 원하시느 경우에는, Fixer에서 발급받은 무료 API 키가 필요합니다.", "get_key" => "키 얻기", diff --git a/includes/i18n/pl.php b/includes/i18n/pl.php index e70f69c42..41d9684fb 100644 --- a/includes/i18n/pl.php +++ b/includes/i18n/pl.php @@ -191,7 +191,6 @@ "currency_info" => "Znajdź obsługiwane waluty i prawidłowe kody walut na", "currency_performance" => "W celu poprawy wydajności przechowuj tylko te waluty, których używasz.", "fixer_api_key" => "Klucz API Fixer'a", - "api_key" => "Klucz API", "provider" => "Dostawca", "fixer_info" => "Jeśli używasz wielu walut i chcesz dokładnych statystyk i sortowania subskrypcji, niezbędny jest DARMOWY klucz API z Fixer'a.", "get_key" => "Zdobądź klucz na stronie", diff --git a/includes/i18n/pt.php b/includes/i18n/pt.php index e62bf3a5e..eb2050fa1 100644 --- a/includes/i18n/pt.php +++ b/includes/i18n/pt.php @@ -191,7 +191,6 @@ "currency_info" => "Encontre a lista de moedas e os respectivos códigos em", "currency_performance" => "Por motivos de desempenho mantenha apenas as moedas que usa.", "fixer_api_key" => "Fixer API Key", - "api_key" => "API Key", "provider" => "Fornecedor", "fixer_info" => "Se usa multiplas moedas e deseja estatísticas correctas é necessário uma API Key grátis do Fixer.", "get_key" => "Obtenha a sua API Key em", diff --git a/includes/i18n/pt_br.php b/includes/i18n/pt_br.php index 0ae5399d8..63f7eac49 100644 --- a/includes/i18n/pt_br.php +++ b/includes/i18n/pt_br.php @@ -191,7 +191,6 @@ "currency_info" => "Encontre as moedas suportadas e os códigos de moeda em", "currency_performance" => "Para um melhor desempenho, mantenha apenas as moedas que você utiliza.", "fixer_api_key" => "Chave da API do Fixer", - "api_key" => "Chave da API", "provider" => "Fornecedor", "fixer_info" => "Se você utiliza múltiplas moedas e deseja ter estatísticas precisas e ordenação das assinaturas, uma chave GRATUÍTA da API do Fixer é necessária.", "get_key" => "Obtenha a sua chave em", diff --git a/includes/i18n/ru.php b/includes/i18n/ru.php index 7a99a0f9e..7f00ce9cb 100644 --- a/includes/i18n/ru.php +++ b/includes/i18n/ru.php @@ -191,7 +191,6 @@ "currency_info" => "Найдите поддерживаемые валюты и правильные коды валют на", "currency_performance" => "Для повышения производительности сохраняйте только те валюты, которые вы используете.", "fixer_api_key" => "Ключ Fixer API", - "api_key" => "API ключ", "provider" => "Провайдер", "fixer_info" => "Если вы используете несколько валют и хотите получить точную статистику и сортировку подписок, вам необходим БЕСПЛАТНЫЙ ключ API от Fixer.", "get_key" => "Получите ключ по адресу", diff --git a/includes/i18n/sl.php b/includes/i18n/sl.php index 241b1b7dd..d4e05ab15 100644 --- a/includes/i18n/sl.php +++ b/includes/i18n/sl.php @@ -191,7 +191,6 @@ "currency_info" => "Poiščite podprte valute in pravilne kode valut na", "currency_performance" => "Za izboljšano delovanje obdržite samo valute, ki jih uporabljate.", "fixer_api_key" => "API ključ za Fixer", - "api_key" => "Fixer API", "provider" => "Ponudnik", "fixer_info" => "Če uporabljate več valut in želite natančno statistiko in razvrščanje naročnin, potrebujete BREZPLAČNI API ključ od Fixerja.", "get_key" => "Pridobite svoj ključ pri", diff --git a/includes/i18n/sr.php b/includes/i18n/sr.php index cb99cb6f9..775c2fa01 100644 --- a/includes/i18n/sr.php +++ b/includes/i18n/sr.php @@ -191,7 +191,6 @@ "currency_info" => "Пронађите подржане валуте и исправне кодове валута на", "currency_performance" => "За побољшану перформансу, задржите само валуте које користите.", "fixer_api_key" => "Fixer API кључ", - "api_key" => "API кључ", "provider" => "Провајдер", "fixer_info" => "Ако користите више валута и желите тачне статистике и сортирање претплата, неопходан је БЕСПЛАТНИ API кључ од Fixer.", "get_key" => "Добијте свој кључ на", diff --git a/includes/i18n/sr_lat.php b/includes/i18n/sr_lat.php index 50fc4dfdf..45ed458fd 100644 --- a/includes/i18n/sr_lat.php +++ b/includes/i18n/sr_lat.php @@ -191,7 +191,6 @@ "currency_info" => "Pronađite podržane valute i ispravne kodove valuta na", "currency_performance" => "Za poboljšanu performansu, zadržite samo valute koje koristite.", "fixer_api_key" => "Fixer API ključ", - "api_key" => "API ključ", "provider" => "Provajder", "fixer_info" => "Ako koristite više valuta i želite tačne statistike i sortiranje pretplata, neophodan je BESPLATNI API ključ sa Fixer-a.", "get_key" => "Pronađite svoj ključ na", diff --git a/includes/i18n/tr.php b/includes/i18n/tr.php index b89f0e963..85facc83d 100644 --- a/includes/i18n/tr.php +++ b/includes/i18n/tr.php @@ -191,7 +191,6 @@ "currency_info" => "Desteklenen para birimlerini ve doğru para birimi kodlarını burada bulun", "currency_performance" => "Performansı artırmak için sadece kullandığınız para birimlerini tutun.", "fixer_api_key" => "Fixer API Anahtarı", - "api_key" => "API Anahtarı", "provider" => "Sağlayıcı", "fixer_info" => "Birden fazla para birimi kullanıyorsanız ve aboneliklerde doğru istatistikler ve sıralama istiyorsanız, Fixer'dan ÜCRETSİZ bir API Anahtarı gereklidir.", "get_key" => "Anahtarınızı şuradan alın", diff --git a/includes/i18n/zh_cn.php b/includes/i18n/zh_cn.php index d6255dfc7..08e1d6025 100644 --- a/includes/i18n/zh_cn.php +++ b/includes/i18n/zh_cn.php @@ -199,7 +199,6 @@ "currency_info" => "如要查找支持的货币与对应代码,请前往", "currency_performance" => "为提高性能,建议您只保留常用货币。", "fixer_api_key" => "Fixer API 密钥", - "api_key" => "API 密钥", "provider" => "提供商", "fixer_info" => "如果您使用多种货币,希望统计信息和订阅排序更精确,则需要 Fixer API 密钥来查询汇率(可免费申请)。", "get_key" => "申请密钥", diff --git a/includes/i18n/zh_tw.php b/includes/i18n/zh_tw.php index 9ff75a31b..54cc72b63 100644 --- a/includes/i18n/zh_tw.php +++ b/includes/i18n/zh_tw.php @@ -191,7 +191,6 @@ "currency_info" => "如要查詢支援的貨幣與相對應的貨幣代碼,請前往", "currency_performance" => "為提高效能,建議您只保留常用的貨幣。", "fixer_api_key" => "Fixer API 金鑰", - "api_key" => "API 金鑰", "provider" => "提供者", "fixer_info" => "如果您使用多種貨幣單位,且希望統計資訊和訂閱排序更加精確,則需要 Fixer API 金鑰來查詢匯率(可免費申請)。", "get_key" => "申請金鑰", From 11c21929dde2cdffa40dd50c9a54b3b6f9d8fbe1 Mon Sep 17 00:00:00 2001 From: Miguel Ribeiro Date: Fri, 4 Oct 2024 15:31:19 +0200 Subject: [PATCH 3/7] add new profile page into the mobile navigation menu --- includes/header.php | 40 ++++++++++++++-------------------------- index.php | 2 +- styles/styles.css | 10 +++++++++- 3 files changed, 24 insertions(+), 28 deletions(-) diff --git a/includes/header.php b/includes/header.php index e140a6827..c5c13bfc8 100644 --- a/includes/header.php +++ b/includes/header.php @@ -206,33 +206,21 @@ class="fa-solid fa-arrow-right-from-bracket">
- diff --git a/styles/styles.css b/styles/styles.css index 517b41832..19e51e474 100644 --- a/styles/styles.css +++ b/styles/styles.css @@ -2587,12 +2587,20 @@ input[type="radio"]:checked+label::after { flex-direction: row; justify-content: space-around; z-index: 2; - padding: 10px 0px 20px 0px; + padding: 5px 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 { + flex-basis: 20%; + flex-grow: 0; + flex-shrink: 0; + text-align: center; + padding: 5px 0px 15px 0px; + } .mobile-nav>a>i { color: #AAA; From 448f347342de15186ab2c6540d9d6001f6463a01 Mon Sep 17 00:00:00 2001 From: Miguel Ribeiro Date: Fri, 4 Oct 2024 15:32:39 +0200 Subject: [PATCH 4/7] fix typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index bf51ff148..d55352435 100644 --- a/README.md +++ b/README.md @@ -190,5 +190,5 @@ I strongly believe in the importance of open source software and the collaborati ## Links - The author: [henrique.pt](https://henrique.pt) -- Wallos Landinpage: [wallosapp.com](https://wallosapp.com) +- Wallos Landingpage: [wallosapp.com](https://wallosapp.com) - Join the conversation: [Discord Server](https://discord.gg/anex9GUrPW) \ No newline at end of file From 03b66dd769b4acdec492c008d473251ebc8616a6 Mon Sep 17 00:00:00 2001 From: Miguel Ribeiro Date: Fri, 4 Oct 2024 17:11:53 +0200 Subject: [PATCH 5/7] redesign mobile menu --- about.php | 9 ++++ images/siteicons/svg/mobile-menu/calendar.php | 3 ++ images/siteicons/svg/mobile-menu/home.php | 3 ++ images/siteicons/svg/mobile-menu/profile.php | 3 ++ images/siteicons/svg/mobile-menu/settings.php | 3 ++ .../siteicons/svg/mobile-menu/statistics.php | 3 ++ includes/header.php | 18 +++++--- styles/dark-theme.css | 9 +--- styles/styles.css | 45 +++++++------------ 9 files changed, 55 insertions(+), 41 deletions(-) create mode 100644 images/siteicons/svg/mobile-menu/calendar.php create mode 100644 images/siteicons/svg/mobile-menu/home.php create mode 100644 images/siteicons/svg/mobile-menu/profile.php create mode 100644 images/siteicons/svg/mobile-menu/settings.php create mode 100644 images/siteicons/svg/mobile-menu/statistics.php diff --git a/about.php b/about.php index 8ba26f31f..8929afa92 100644 --- a/about.php +++ b/about.php @@ -78,6 +78,15 @@

+

+ Icons by icons8: + + https://icons8.com/ + + + + +

diff --git a/images/siteicons/svg/mobile-menu/calendar.php b/images/siteicons/svg/mobile-menu/calendar.php new file mode 100644 index 000000000..cc9b50d5b --- /dev/null +++ b/images/siteicons/svg/mobile-menu/calendar.php @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/images/siteicons/svg/mobile-menu/home.php b/images/siteicons/svg/mobile-menu/home.php new file mode 100644 index 000000000..af054b52f --- /dev/null +++ b/images/siteicons/svg/mobile-menu/home.php @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/images/siteicons/svg/mobile-menu/profile.php b/images/siteicons/svg/mobile-menu/profile.php new file mode 100644 index 000000000..831ce536d --- /dev/null +++ b/images/siteicons/svg/mobile-menu/profile.php @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/images/siteicons/svg/mobile-menu/settings.php b/images/siteicons/svg/mobile-menu/settings.php new file mode 100644 index 000000000..8aa56fd95 --- /dev/null +++ b/images/siteicons/svg/mobile-menu/settings.php @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/images/siteicons/svg/mobile-menu/statistics.php b/images/siteicons/svg/mobile-menu/statistics.php new file mode 100644 index 000000000..94306005a --- /dev/null +++ b/images/siteicons/svg/mobile-menu/statistics.php @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/includes/header.php b/includes/header.php index c5c13bfc8..9adfdbc2a 100644 --- a/includes/header.php +++ b/includes/header.php @@ -200,6 +200,7 @@ class="fa-solid fa-arrow-right-from-bracket"> a { - padding: 0px 10px; + color: #909090; } - .mobile-nav>a>i { - color: #777; - } - - .mobile-nav>a.active>i { + .mobile-nav>a.active { color: #f0f0F0; } } \ No newline at end of file diff --git a/styles/styles.css b/styles/styles.css index 19e51e474..dcc1cea72 100644 --- a/styles/styles.css +++ b/styles/styles.css @@ -2587,45 +2587,34 @@ input[type="radio"]:checked+label::after { flex-direction: row; justify-content: space-around; z-index: 2; - padding: 5px 0px; - font-size: 28px; + padding: 7px 0px; box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.1); box-sizing: border-box; - align-items: baseline; + align-items: center; } .mobile-nav>a { - flex-basis: 20%; - flex-grow: 0; + flex-grow: 1; flex-shrink: 0; text-align: center; - padding: 5px 0px 15px 0px; - } - - .mobile-nav>a>i { + padding: 5px 0px 10px 0px; 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; + font-size: 10px; + text-decoration: none; + + display: flex; + flex-direction: column; + align-items: center; } - .mobile-nav>button { - border: none; - font-size: 28px; + .mobile-nav>a>svg { + width: 30px; + height: 30px; + max-width: 85%; } - - .mobile-nav>a.secondary>i, - .mobile-nav>button>i { - color: #fff; + + .mobile-nav>a.active{ + color: #202020; } .mobile-navivagtion .mobileNavigationHideOnMobile { From 900f6321a500f3ec541a23dd8fe37b38c4114d9f Mon Sep 17 00:00:00 2001 From: Miguel Ribeiro Date: Fri, 4 Oct 2024 17:19:34 +0200 Subject: [PATCH 6/7] fix button not full width on mobile --- profile.php | 6 +++--- styles/styles.css | 7 ++++++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/profile.php b/profile.php index b15199458..29e664a19 100644 --- a/profile.php +++ b/profile.php @@ -151,12 +151,12 @@ class="thin mobile-grow" />

-
+
+ onClick="enableTotp()" class="button thin mobile-grow"/>

@@ -199,7 +199,7 @@ class="thin mobile-grow" /> -
diff --git a/styles/styles.css b/styles/styles.css index dcc1cea72..cd0cb7ea1 100644 --- a/styles/styles.css +++ b/styles/styles.css @@ -846,13 +846,18 @@ header #avatar { .account-fixer .buttons, .account-categories .buttons, .account-notifications .buttons, -.admin-form .buttons { +.admin-form .buttons, +.account-2fa .buttons { display: flex; justify-content: flex-end; align-items: center; gap: 20px; } +.account-2fa .buttons { + justify-content: flex-start; +} + .admin-form hr { margin: 20px 0px; color: var(--main-color); From 34f933a85637be4a33e78b8cc9c8ac9d69624531 Mon Sep 17 00:00:00 2001 From: Miguel Ribeiro Date: Fri, 4 Oct 2024 17:28:30 +0200 Subject: [PATCH 7/7] bump version --- includes/version.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/version.php b/includes/version.php index cd3fb878d..a9b2e79eb 100644 --- a/includes/version.php +++ b/includes/version.php @@ -1,3 +1,3 @@ \ No newline at end of file