From ed7b76394ca4014ee1a82e8a490ee553c4460897 Mon Sep 17 00:00:00 2001 From: 230419 <230419@epvc.pt> Date: Tue, 14 Apr 2026 16:23:16 +0100 Subject: [PATCH] idioma 2 --- src/App.jsx | 121 ++++++++++++++++++++++++++------------------- src/index.css | 73 +++++++++++++++++++++++++++ src/lib/i18n.js | 21 +++++--- tailwind.config.js | 18 ++++++- 4 files changed, 176 insertions(+), 57 deletions(-) diff --git a/src/App.jsx b/src/App.jsx index 86a52bb..a95d0fd 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -46,9 +46,16 @@ export default function App() { const [notificationsEnabled, setNotificationsEnabled] = useState(true); const [weatherAlerts, setWeatherAlerts] = useState(true); const [language, setLanguage] = useState('PT'); + const [theme, setTheme] = useState(() => localStorage.getItem('app-theme') || 'theme-indigo'); const t = (key) => translations[language]?.[key] || translations['PT'][key] || key; + useEffect(() => { + document.documentElement.classList.remove('theme-indigo', 'theme-rose', 'theme-emerald', 'theme-amber', 'theme-slate'); + document.documentElement.classList.add(theme); + localStorage.setItem('app-theme', theme); + }, [theme]); + // 1. Inicializar Autenticação useEffect(() => { const initAuth = async () => { @@ -224,14 +231,14 @@ export default function App() { finally { setLoading(false); } }; - if (loading && !user) return
; + if (loading && !user) return
; if (view === 'auth') { return ( -
+
-
+

MyCloset

@@ -241,15 +248,15 @@ export default function App() { {authError &&
{authError}
}
- - -
-
@@ -269,7 +276,7 @@ export default function App() { `}>
-
+
MyCloset @@ -286,7 +293,7 @@ export default function App() { - + +
-
@@ -348,13 +355,13 @@ export default function App() {
{[ - { label: t('readyClothes'), val: activeClothes.length, icon: Shirt, col: 'indigo' }, + { label: t('readyClothes'), val: activeClothes.length, icon: Shirt, col: 'primary' }, { label: t('inLaundry'), val: laundryClothes.length, icon: Droplets, col: 'blue' }, { label: t('myLooks'), val: looks.length, icon: Sparkles, col: 'purple' }, { label: t('favorites'), val: activeClothes.filter(c => c.favorite).length, icon: Heart, col: 'rose' }, ].map((s, i) => ( -
+

{s.label}

@@ -364,21 +371,21 @@ export default function App() {
- +
- + {t('todayIn')}

{t('weatherUpdate')}

-

+

{t('weatherMsg')}

{activeClothes.filter(c => c.category === 'Tops').slice(0, 2).map(c => ( -
+
))} @@ -400,7 +407,7 @@ export default function App() { {Math.floor(Math.random() * 40 + 20)}%
-
+
))} @@ -418,7 +425,7 @@ export default function App() { setSearchTerm(e.target.value)} />
@@ -428,7 +435,7 @@ export default function App() { @@ -444,7 +451,7 @@ export default function App() {
- +
@@ -507,8 +514,8 @@ export default function App() {
- -

{t('createNewLook')}

+ +

{t('createNewLook')}

@@ -518,7 +525,7 @@ export default function App() { const item = clothes.find(c => c.id === id); return (
- +
); @@ -526,7 +533,7 @@ export default function App() { {selectedForLook.length === 0 &&

{t('selectPieces')}

}
- @@ -536,9 +543,9 @@ export default function App() {

{t('closetLabel')}

{activeClothes.map(c => ( - ))}
@@ -599,7 +606,7 @@ export default function App() {
-
@@ -609,7 +616,7 @@ export default function App() {
-
@@ -622,9 +629,9 @@ export default function App() { {/* DEFINIÇÕES */} {view === 'settings' && (
- +
-
+
{user?.email?.[0]?.toUpperCase() || 'U'}
@@ -637,23 +644,47 @@ export default function App() { {/* Preferências */}
-

{t('preferences')}

+

{t('preferences')}

{t('darkMode')}

{t('interfaceAppearance')}

-
+
+
+

{t('themeColor') || 'Cor do Tema'}

+

{t('personalizeColor') || 'Personalize a cor'}

+
+
+ {[ + { id: 'theme-indigo', color: '#4f46e5' }, + { id: 'theme-rose', color: '#e11d48' }, + { id: 'theme-emerald', color: '#10b981' }, + { id: 'theme-amber', color: '#f59e0b' }, + { id: 'theme-slate', color: '#64748b' } + ].map(tObj => ( + + ))} +
+

{t('notifications')}

{t('lookReminders')}

-
@@ -662,7 +693,7 @@ export default function App() {

{t('weatherAlerts')}

{t('weatherSuggestions')}

-
@@ -670,11 +701,11 @@ export default function App() { -

{t('systemAndData')}

+

{t('systemAndData')}

- setLanguage(e.target.value)} className={`w-full p-4 rounded-xl border-none outline-none focus:ring-2 focus:ring-primary-500 font-bold ${darkMode ? 'bg-gray-800 text-white' : 'bg-gray-50'}`}> @@ -682,16 +713,6 @@ export default function App() {
-
- -
-
- -
@@ -710,7 +731,7 @@ export default function App() {

{t('deleted')}

- +
diff --git a/src/index.css b/src/index.css index 208af95..5a5bfa6 100644 --- a/src/index.css +++ b/src/index.css @@ -2,6 +2,79 @@ @tailwind components; @tailwind utilities; +@layer base { + :root { + /* Default Theme: Indigo */ + --primary-50: 226 100% 97%; + --primary-100: 226 100% 94%; + --primary-200: 228 98% 87%; + --primary-300: 230 94% 78%; + --primary-400: 234 89% 68%; + --primary-500: 239 84% 61%; + --primary-600: 243 75% 59%; + --primary-700: 245 58% 51%; + --primary-800: 243 57% 42%; + --primary-900: 241 54% 35%; + --primary-950: 241 54% 20%; + } + + .theme-rose { + --primary-50: 356 100% 97%; + --primary-100: 356 100% 94%; + --primary-200: 351 98% 87%; + --primary-300: 349 97% 76%; + --primary-400: 348 95% 64%; + --primary-500: 346 87% 53%; + --primary-600: 343 79% 46%; + --primary-700: 341 73% 38%; + --primary-800: 339 67% 33%; + --primary-900: 338 61% 29%; + --primary-950: 339 62% 16%; + } + + .theme-emerald { + --primary-50: 152 81% 96%; + --primary-100: 149 80% 90%; + --primary-200: 152 76% 80%; + --primary-300: 156 73% 67%; + --primary-400: 158 64% 52%; + --primary-500: 160 84% 39%; + --primary-600: 161 94% 30%; + --primary-700: 163 94% 24%; + --primary-800: 164 86% 21%; + --primary-900: 164 80% 18%; + --primary-950: 164 85% 10%; + } + + .theme-amber { + --primary-50: 45 100% 96%; + --primary-100: 48 100% 90%; + --primary-200: 46 100% 80%; + --primary-300: 42 100% 68%; + --primary-400: 38 92% 56%; + --primary-500: 35 92% 48%; + --primary-600: 30 87% 40%; + --primary-700: 25 81% 33%; + --primary-800: 22 76% 28%; + --primary-900: 20 73% 24%; + --primary-950: 19 80% 12%; + } + + .theme-slate { + --primary-50: 210 40% 98%; + --primary-100: 210 40% 96%; + --primary-200: 214 32% 91%; + --primary-300: 213 27% 84%; + --primary-400: 215 20% 65%; + --primary-500: 215 16% 47%; + --primary-600: 215 19% 35%; + --primary-700: 215 21% 27%; + --primary-800: 215 25% 22%; + --primary-900: 215 28% 17%; + --primary-950: 215 31% 11%; + } +} + .custom-scrollbar::-webkit-scrollbar { height: 6px; width: 6px; diff --git a/src/lib/i18n.js b/src/lib/i18n.js index dc90f7a..e70a230 100644 --- a/src/lib/i18n.js +++ b/src/lib/i18n.js @@ -90,7 +90,9 @@ export const translations = { colorBlack: "Preto", colorWhite: "Branco", colorBlue: "Azul", - userTitle: "Utilizador" + userTitle: "Utilizador", + themeColor: "Cor do Tema", + personalizeColor: "Personalizar a cor" }, EN: { loginModeIntro: "The Future of Your Style", @@ -183,8 +185,9 @@ export const translations = { colorBlack: "Black", colorWhite: "White", colorBlue: "Blue", - userTitle: "User" - + userTitle: "User", + themeColor: "Theme Color", + personalizeColor: "Personalize the color" }, ES: { loginModeIntro: "El Futuro de Tu Estilo", @@ -277,7 +280,9 @@ export const translations = { colorBlack: "Negro", colorWhite: "Blanco", colorBlue: "Azul", - userTitle: "Usuario" + userTitle: "Usuario", + themeColor: "Color del Tema", + personalizeColor: "Personaliza el color" }, FR: { loginModeIntro: "Le Futur de Ton Style", @@ -370,7 +375,9 @@ export const translations = { colorBlack: "Noir", colorWhite: "Blanc", colorBlue: "Bleu", - userTitle: "Utilisateur" + userTitle: "Utilisateur", + themeColor: "Couleur du Thème", + personalizeColor: "Personnaliser la couleur" }, DE: { loginModeIntro: "Die Zukunft deines Stils", @@ -463,6 +470,8 @@ export const translations = { colorBlack: "Schwarz", colorWhite: "Weiß", colorBlue: "Blau", - userTitle: "Benutzer" + userTitle: "Benutzer", + themeColor: "Themenfarbe", + personalizeColor: "Farbe anpassen" } }; diff --git a/tailwind.config.js b/tailwind.config.js index 93ddb03..46f9ad1 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -6,7 +6,23 @@ export default { ], darkMode: 'class', theme: { - extend: {}, + extend: { + colors: { + primary: { + 50: 'hsl(var(--primary-50) / )', + 100: 'hsl(var(--primary-100) / )', + 200: 'hsl(var(--primary-200) / )', + 300: 'hsl(var(--primary-300) / )', + 400: 'hsl(var(--primary-400) / )', + 500: 'hsl(var(--primary-500) / )', + 600: 'hsl(var(--primary-600) / )', + 700: 'hsl(var(--primary-700) / )', + 800: 'hsl(var(--primary-800) / )', + 900: 'hsl(var(--primary-900) / )', + 950: 'hsl(var(--primary-950) / )', + } + } + }, }, plugins: [], }