feat: add themes and custom color options

feat: add italian translation
This commit is contained in:
Miguel Ribeiro
2024-04-19 14:22:07 +02:00
committed by GitHub
parent 2c186b4818
commit 70e42349ca
91 changed files with 751 additions and 98 deletions
+9
View File
@@ -7,9 +7,18 @@ if ($settings) {
$cookieExpire = time() + (30 * 24 * 60 * 60);
setcookie('theme', $settings['dark_theme'] ? 'dark': 'light', $cookieExpire);
$settings['theme'] = $settings['dark_theme'] ? 'dark': 'light';
$settings['color_theme'] = $settings['color_theme'] ? $settings['color_theme'] : "blue";
$settings['showMonthlyPrice'] = $settings['monthly_price'] ? 'true': 'false';
$settings['convertCurrency'] = $settings['convert_currency'] ? 'true': 'false';
$settings['removeBackground'] = $settings['remove_background'] ? 'true': 'false';
}
$query = "SELECT * FROM custom_colors";
$result = $db->query($query);
$customColors = $result->fetchArray(SQLITE3_ASSOC);
if ($customColors) {
$settings['customColors'] = $customColors;
}
?>
+29 -1
View File
@@ -23,6 +23,10 @@
$theme = $settings['theme'];
}
$colorTheme = "blue";
if (isset($settings['color_theme'])) {
$colorTheme = $settings['color_theme'];
}
?>
<!DOCTYPE html>
<html>
@@ -34,8 +38,12 @@
<link rel="icon" type="image/png" href="images/icon/favicon.ico" sizes="16x16">
<link rel="apple-touch-icon" sizes="180x180" href="images/icon/apple-touch-icon.png">
<link rel="manifest" href="manifest.json" crossorigin="use-credentials">
<link rel="stylesheet" href="styles/theme.css?<?= $version ?>">
<link rel="stylesheet" href="styles/styles.css?<?= $version ?>">
<link rel="stylesheet" href="styles/dark-theme.css?<?= $version ?>" id="dark-theme" <?= $theme == "light" ? "disabled" : "" ?>>
<link rel="stylesheet" href="styles/themes/red.css?<?= $version ?>" id="red-theme" <?= $colorTheme != "red" ? "disabled" : "" ?>>
<link rel="stylesheet" href="styles/themes/green.css?<?= $version ?>" id="green-theme" <?= $colorTheme != "green" ? "disabled" : "" ?>>
<link rel="stylesheet" href="styles/themes/yellow.css?<?= $version ?>" id="yellow-theme" <?= $colorTheme != "yellow" ? "disabled" : "" ?>>
<link rel="stylesheet" href="styles/barlow.css">
<link rel="stylesheet" href="styles/font-awesome.min.css">
<script type="text/javascript" src="scripts/all.js?<?= $version ?>"></script>
@@ -43,11 +51,31 @@
<script type="text/javascript">
window.theme = "<?= $theme ?>";
window.lang = "<?=$lang ?>";
window.colorTheme = "<?= $colorTheme ?>";
</script>
<?php
if (isset($settings['customColors'])) {
?>
<style id="custom_theme_colors">
:root {
<?php if (isset($settings['customColors']['main_color']) && !empty($settings['customColors']['main_color'])): ?>
--main-color: <?= $settings['customColors']['main_color'] ?>;
<?php endif; ?>
<?php if (isset($settings['customColors']['accent_color']) && !empty($settings['customColors']['accent_color'])): ?>
--accent-color: <?= $settings['customColors']['accent_color'] ?>;
<?php endif; ?>
<?php if (isset($settings['customColors']['hover_color']) && !empty($settings['customColors']['hover_color'])): ?>
--hover-color: <?= $settings['customColors']['hover_color'] ?>;
<?php endif; ?>
}
</style>
<?php
}
?>
<script type="text/javascript" src="scripts/i18n/<?= $lang ?>.js?<?= $version ?>"></script>
<script type="text/javascript" src="scripts/i18n/getlang.js?<?= $version ?>"></script>
</head>
<body>
<body class="<?= $theme ?>">
<header>
<div class="contain">
<div class="logo">
+4
View File
@@ -139,6 +139,9 @@ $i18n = [
"get_free_fixer_api_key" => "Erhalte deinen kostenfreien Fixer API Key",
"get_key_alternative" => "Alternativ können Sie einen kostenlosen Fixer-Api-Schlüssel erhalten von",
"display_settings" => "Display-Einstellungen",
"theme_settings" => "Themen-Einstellungen",
"custom_colors" => "Benutzerdefinierte Farben",
"dark_theme" => "Dark Theme",
"switch_theme" => "Light / Dark Theme umschalten",
"calculate_monthly_price" => "Berechne und zeige monatlichen Preis für alle Abonnements an",
"convert_prices" => "Preise immer in meine Hauptwährung umrechnen und darin anzeigen (langsamer)",
@@ -161,6 +164,7 @@ $i18n = [
"test" => "Test",
"add" => "Hinzufügen",
"save" => "Speichern",
"reset" => "Zurücksetzen",
"export_subscriptions" => "Abonnements exportieren",
"export_to_json" => "Nach JSON exportieren",
// Filters menu
+4
View File
@@ -139,6 +139,9 @@ $i18n = [
"get_free_fixer_api_key" => "Απόκτησε ΔΩΡΕΑΝ Fixer API κλειδί",
"get_key_alternative" => "Εναλλακτικά, μπορείτε να λάβετε ένα δωρεάν κλειδί api fixer από το",
"display_settings" => "Ρυθμίσεις εμφάνισης",
"theme_settings" => "Ρυθμίσεις θέματος",
"custom_colors" => "Προσαρμοσμένα χρώματα",
"dark_theme" => "Dark Theme",
"switch_theme" => "Διακόπτης Light / Dark Theme",
"calculate_monthly_price" => "Υπολογισμός και εμφάνιση της μηνιαίας τιμής για όλες τις συνδρομές",
"convert_prices" => "Πάντα να μετατρέπει και να εμφανίζει τις τιμές στο κύριο νόμισμά μου (πιο αργό)",
@@ -161,6 +164,7 @@ $i18n = [
"test" => "Δοκιμή",
"add" => "Προσθήκη",
"save" => "Αποθήκευση",
"reset" => "Επαναφορά",
"export_subscriptions" => "Εξαγωγή συνδρομών",
"export_to_json" => "Εξαγωγή σε JSON",
// Filters menu
+4
View File
@@ -139,6 +139,9 @@ $i18n = [
"get_free_fixer_api_key" => "Get free Fixer API Key",
"get_key_alternative" => "Alternatively, you can get a free fixer api key from",
"display_settings" => "Display Settings",
"theme_settings" => "Theme Settings",
"custom_colors" => "Custom Colors",
"dark_theme" => "Dark Theme",
"switch_theme" => "Switch Light / Dark Theme",
"calculate_monthly_price" => "Calculate and show monthly price for all subscriptions",
"convert_prices" => "Always convert and show prices on my main currency (slower)",
@@ -161,6 +164,7 @@ $i18n = [
"test" => "Test",
"add" => "Add",
"save" => "Save",
"reset" => "Reset",
"export_subscriptions" => "Export Subscriptions",
"export_to_json" => "Export to JSON",
// Filters menu
+4
View File
@@ -139,6 +139,9 @@ $i18n = [
"get_free_fixer_api_key" => "Obtén una API Key de Fixer gratuita",
"get_key_alternative" => "También puede obtener una clave api gratuita de Fixer en",
"display_settings" => "Configuración de Pantalla",
"theme_settings" => "Configuración de Tema",
"custom_collors" => "Colores Personalizados",
"dark_theme" => "Tema Oscuro",
"switch_theme" => "Cambiar entre Tema Claro / Oscuro",
"calculate_monthly_price" => "Calcular y mostrar el precio mensual de todas las suscripciones",
"convert_prices" => "Convertir y mostrar siempre los precios en mi moneda principal (más lento)",
@@ -161,6 +164,7 @@ $i18n = [
"test" => "Probar",
"add" => "Agregar",
"save" => "Guardar",
"reset" => "Restablecer",
"export_subscriptions" => "Exportar suscripciones",
"export_to_json" => "Exportar a JSON",
// Filters menu
+4
View File
@@ -139,6 +139,9 @@ $i18n = [
"get_free_fixer_api_key" => "Obtenez une clé API Fixer gratuite",
"get_key_alternative" => "Vous pouvez également obtenir une clé api de fixation gratuite auprès de",
"display_settings" => "Paramètres d'affichage",
"theme_settings" => "Paramètres de thème",
"custom_colors" => "Couleurs personnalisées",
"dark_theme" => "Thème sombre",
"switch_theme" => "Basculer entre le thème clair et sombre",
"calculate_monthly_price" => "Calculer et afficher le prix mensuel pour tous les abonnements",
"convert_prices" => "Convertir toujours et afficher les prix dans ma devise principale (plus lent)",
@@ -161,6 +164,7 @@ $i18n = [
"test" => "Test",
"add" => "Ajouter",
"save" => "Enregistrer",
"reset" => "Réinitialiser",
"export_subscriptions" => "Exporter les abonnements",
"export_to_json" => "Exporter en JSON",
// Menu des filtes
+4
View File
@@ -144,6 +144,9 @@ $i18n = [
'get_free_fixer_api_key' => 'Ottieni gratuitamente la chiave API di Fixer',
'get_key_alternative' => 'In alternativa, puoi ottenere gratuitamente una chiave API di Fixer da',
'display_settings' => 'Impostazioni di visualizzazione',
"theme_settings" => 'Impostazioni del tema',
"custom_colors" => 'Colori personalizzati',
"dark_theme" => 'Tema scuro',
'switch_theme' => 'Cambia tema chiaro/scuro',
'calculate_monthly_price' => 'Calcola e mostra il prezzo mensile per tutti gli abbonamenti',
'convert_prices' => 'Converti sempre e mostra i prezzi nella mia valuta principale (più lento)',
@@ -166,6 +169,7 @@ $i18n = [
'test' => 'Test',
'add' => 'Aggiungi',
'save' => 'Salva',
"reset" => 'Ripristina',
'export_subscriptions' => 'Esporta abbonamenti',
'export_to_json' => 'Esporta in JSON',
+4
View File
@@ -139,6 +139,9 @@ $i18n = [
"get_free_fixer_api_key" => "無料のFixer APIキーを取得",
"get_key_alternative" => "または、以下のサイトから無料のフィクサーapiキーを入手することもできます。",
"display_settings" => "表示設定",
"theme_settings" => "テーマ設定",
"custom_colors" => "カスタムカラー",
"dark_theme" => "ダークテーマ",
"switch_theme" => "ライト/ダーク テーマの切り替え",
"calculate_monthly_price" => "すべての定期購入の月額料金を計算して表示する",
"convert_prices" => "常にメイン通貨で価格を換算して表示する (遅い)",
@@ -161,6 +164,7 @@ $i18n = [
"test" => "テスト",
"add" => "追加",
"save" => "保存",
"reset" => "リセット",
"export_subscriptions" => "購読をエクスポート",
"export_to_json" => "JSONにエクスポート",
// Filters menu
+1 -1
View File
@@ -12,8 +12,8 @@
"it" => "Italiano",
"jp" => "日本語",
"pl" => "Polski",
"pt_br" => "Português Brasileiro",
"pt" => "Português",
"pt_br" => "Português Brasileiro",
"sr_lat" => "Srpski",
"sr" => "Српски",
"tr" => "Türkçe",
+4
View File
@@ -139,6 +139,9 @@ $i18n = [
"get_free_fixer_api_key" => "Uzyskaj bezpłatny klucz API Fixer'a",
"get_key_alternative" => "Alternatywnie, możesz uzyskać darmowy klucz api fixer'a od",
"display_settings" => "Ustawienia wyświetlania",
"theme_settings" => "Ustawienia motywu",
"custom_colors" => "Kolory niestandardowe",
"dark_theme" => "Przełącz na jasny/ciemny motyw",
"switch_theme" => "Przełącz na jasny/ciemny motyw",
"calculate_monthly_price" => "Oblicz i pokaż miesięczną cenę wszystkich subskrypcji",
"convert_prices" => "Zawsze przeliczaj i pokazuj ceny w mojej głównej walucie (wolniej)",
@@ -161,6 +164,7 @@ $i18n = [
"test" => "Test",
"add" => "Dodaj",
"save" => "Zapisz",
"reset" => "Resetuj",
"export_subscriptions" => "Eksportuj subskrypcje",
"export_to_json" => "Eksportuj do JSON",
// Filters menu
+4
View File
@@ -139,6 +139,9 @@ $i18n = [
"get_free_fixer_api_key" => "Obtenha a sua API Key grátis do Fixer",
"get_key_alternative" => "Como alternativa obtenha a sua API Key em",
"display_settings" => "Definições de visualização",
"theme_settings" => "Definições de Tema",
"custom_colors" => "Cores Personalizadas",
"dark_theme" => "Tema Escuro",
"switch_theme" => "Trocar Tema Claro / Escuro",
"calculate_monthly_price" => "Calcular e mostrar preço mensal para todas as subscrições",
"convert_prices" => "Converter e mostrar todas as subscrições na moeda principal (mais lento)",
@@ -161,6 +164,7 @@ $i18n = [
"test" => "Testar",
"add" => "Adicionar",
"save" => "Guardar",
"reset" => "Repor",
"export_subscriptions" => "Exportar Subscrições",
"export_to_json" => "Exportar para JSON",
// Filters menu
+4
View File
@@ -137,6 +137,9 @@ $i18n = [
"get_free_fixer_api_key" => "Obtenha a sua chave API do Fixer gratuitamente",
"get_key_alternative" => "Como alternativa, você pode obter uma chave de API grátis em",
"display_settings" => "Configurações de visualização",
"theme_settings" => "Configurações de tema",
"custom_colors" => "Cores personalizadas",
"dark_theme" => "Tema Escuro",
"switch_theme" => "Alternar entre tema Claro / Escuro",
"calculate_monthly_price" => "Calcular e exibir o custo mensal para todas as assinaturas",
"convert_prices" => "Sempre converter e exibir preços na moeda principal (mais lento)",
@@ -159,6 +162,7 @@ $i18n = [
"test" => "Testar",
"add" => "Adicionar",
"save" => "Salvar",
"reset" => "Redefinir",
"export_subscriptions" => "Exportar assinaturas",
"export_to_json" => "Exportar para JSON",
// Filters menu
+4
View File
@@ -139,6 +139,9 @@ $i18n = [
"get_free_fixer_api_key" => "Добијте бесплатни Fixer API кључ",
"get_key_alternative" => "Алтернативно, можете добити бесплатни Fixer API кључ са",
"display_settings" => "Подешавања приказа",
"theme_settings" => "Подешавања теме",
"custom_colors" => "Прилагођене боје",
"dark_theme" => "Тамна тема",
"switch_theme" => "Промени светлу / тамну тему",
"calculate_monthly_price" => "Израчунајте и прикажите месечну цену за све претплате",
"convert_prices" => "Увек конвертујте и прикажите цене на мојој главној валути (спорије)",
@@ -161,6 +164,7 @@ $i18n = [
"test" => "Тест",
"add" => "Додај",
"save" => "Сачувај",
"reset" => "Ресетуј",
"export_subscriptions" => "Извоз претплата",
"export_to_json" => "Извоз у JSON формат",
// Мени са филтерима
+4
View File
@@ -139,6 +139,9 @@ $i18n = [
"get_free_fixer_api_key" => "Pronađite besplatni Fixer API ključ",
"get_key_alternative" => "Alternativno, možete dobiti besplatni Fixer API ključ na",
"display_settings" => "Podešavanja prikaza",
"theme_settings" => "Podešavanja teme",
"custom_colors" => "Prilagođene boje",
"dark_theme" => "Tamna tema",
"switch_theme" => "Promeni svetli / tamni temu",
"calculate_monthly_price" => "Izračunaj i prikaži mesečnu cenu za sve pretplate",
"convert_prices" => "Uvek konvertuj i prikaži cene u mojoj glavnoj valuti (sporije)",
@@ -161,6 +164,7 @@ $i18n = [
"test" => "Test",
"add" => "Dodaj",
"save" => "Sačuvaj",
"reset" => "Resetuj",
"export_subscriptions" => "Izvezi pretplate",
"export_to_json" => "Izvezi u JSON format",
// Meni sa filterima
+4
View File
@@ -139,6 +139,9 @@ $i18n = [
"get_free_fixer_api_key" => "Ücretsiz Fixer API Anahtarı alın",
"get_key_alternative" => "Alternatif olarak, şu adresten ücretsiz bir fixer api anahtarı edinebilirsiniz",
"display_settings" => "Görüntüleme Ayarları",
"theme_settings" => "Tema Ayarları",
"custom_colors" => "Özel Renkler",
"dark_theme" => "Koyu Temayı",
"switch_theme" => "Açık / Koyu Temayı Değiştir",
"calculate_monthly_price" => "Tüm aboneliklerin aylık fiyatını hesaplayın ve gösterin",
"convert_prices" => "Fiyatları her zaman ana para birimimde dönüştürün ve gösterin (daha yavaş)",
@@ -161,6 +164,7 @@ $i18n = [
"test" => "Test Et",
"add" => "Ekle",
"save" => "Kaydet",
"reset" => "Sıfırla",
"export_subscriptions" => "Abonelikleri Dışa Aktar",
"export_to_json" => "JSON'a dışa aktar",
// Filters menu
+4
View File
@@ -146,6 +146,9 @@ $i18n = [
"get_free_fixer_api_key" => "申请免费 Fixer API 密钥",
"get_key_alternative" => "或者,您也可以从以下网站获取免费的修复程序 api 密钥",
"display_settings" => "显示设置",
"theme_settings" => "主题设置",
"custom_colors" => "自定义颜色",
"dark_theme" => "深色主题",
"switch_theme" => "切换浅色/深色主题",
"calculate_monthly_price" => "计算并显示所有订阅的月价格",
"convert_prices" => "始终按我的主要货币转换和显示价格(较慢)",
@@ -168,6 +171,7 @@ $i18n = [
"test" => "测试",
"add" => "添加",
"save" => "保存",
"reset" => "重置",
"export_subscriptions" => "导出订阅",
"export_to_json" => "导出为 JSON",
+4
View File
@@ -139,6 +139,9 @@ $i18n = [
"get_free_fixer_api_key" => "申請免費的 Fixer API 金鑰",
"get_key_alternative" => "或者,您可以從以下網址取得一個免費的修復 api 金鑰",
"display_settings" => "顯示設定",
"theme_settings" => "主題設定",
"custom_colors" => "自訂顏色",
"dark_theme" => "深色主題",
"switch_theme" => "切換淺色/深色主題",
"calculate_monthly_price" => "計算並顯示所有訂閱的每月價格",
"convert_prices" => "始終按照我的主要貨幣單位轉換和顯示價格(較慢)",
@@ -161,6 +164,7 @@ $i18n = [
"test" => "測試",
"add" => "新增",
"save" => "儲存",
"reset" => "重設",
"export_subscriptions" => "匯出訂閱",
"export_to_json" => "匯出為 JSON 檔案",
// Filters menu
+7 -7
View File
@@ -56,7 +56,7 @@
}
}
function printSubscriptions($subscriptions, $sort, $categories, $members, $i18n) {
function printSubscriptions($subscriptions, $sort, $categories, $members, $i18n, $colorTheme) {
if ($sort === "price") {
usort($subscriptions, function($a, $b) {
return $a['price'] < $b['price'] ? 1 : -1;
@@ -110,14 +110,14 @@
</span>
<span class="actions">
<button class="image-button medium" onClick="openEditSubscription(event, <?= $subscription['id'] ?>)" name="edit">
<img src="images/siteicons/edit.png" title="<?= translate('edit_subscription', $i18n) ?>">
<img src="images/siteicons/<?= $colorTheme ?>/edit.png" title="<?= translate('edit_subscription', $i18n) ?>">
</button>
</span>
</div>
<div class="subscription-secondary">
<span class="name"><img src="images/siteicons/subscription.png" alt="<?= translate('subscription', $i18n) ?>" /><?= $subscription['name'] ?></span>
<span class="payer_user" title="<?= translate('paid_by', $i18n) ?>"><img src="images/siteicons/payment.png" alt="<?= translate('paid_by', $i18n) ?>" /><?= $members[$subscription['payer_user_id']]['name'] ?></span>
<span class="category" title="<?= translate('category', $i18n) ?>" ><img src="images/siteicons/category.png" alt="<?= translate('category', $i18n) ?>" /><?= $categories[$subscription['category_id']]['name'] ?></span>
<span class="name"><img src="images/siteicons/<?= $colorTheme ?>/subscription.png" alt="<?= translate('subscription', $i18n) ?>" /><?= $subscription['name'] ?></span>
<span class="payer_user" title="<?= translate('paid_by', $i18n) ?>"><img src="images/siteicons/<?= $colorTheme ?>/payment.png" alt="<?= translate('paid_by', $i18n) ?>" /><?= $members[$subscription['payer_user_id']]['name'] ?></span>
<span class="category" title="<?= translate('category', $i18n) ?>" ><img src="images/siteicons/<?= $colorTheme ?>/category.png" alt="<?= translate('category', $i18n) ?>" /><?= $categories[$subscription['category_id']]['name'] ?></span>
<?php
if ($subscription['url'] != "") {
$url = $subscription['url'];
@@ -125,7 +125,7 @@
$url = "https://" . $url;
}
?>
<span class="url" title="<?= translate('external_url', $i18n) ?>"><a href="<?= $url ?>" target="_blank"><img src="images/siteicons/web.png" alt="<?= translate('url', $i18n) ?>" /></a></span>
<span class="url" title="<?= translate('external_url', $i18n) ?>"><a href="<?= $url ?>" target="_blank"><img src="images/siteicons/<?= $colorTheme ?>/web.png" alt="<?= translate('url', $i18n) ?>" /></a></span>
<?php
}
?>
@@ -135,7 +135,7 @@
?>
<div class="subscription-notes">
<span class="notes">
<img src="images/siteicons/notes.png" alt="<?= translate('notes', $i18n) ?>" />
<img src="images/siteicons/<?= $colorTheme ?>/notes.png" alt="<?= translate('notes', $i18n) ?>" />
<?= $subscription['notes'] ?>
</span>
</div>
+1 -1
View File
@@ -1,3 +1,3 @@
<?php
$version = "v1.20.2";
$version = "v1.21.0";
?>