Files
filwordspl-frontend/src/pages/LanguageSelectPage.tsx
T
2026-09-20 15:08:32 +03:00

109 lines
3.9 KiB
TypeScript

import { useNavigate } from 'react-router-dom';
import { useLanguage } from '../i18n/LanguageContext';
import { fonts, radius } from '../styles/theme';
const languages = [
{ code: 'pl', name: 'Polski', flag: '🇵🇱' },
{ code: 'ru', name: 'Русский', flag: '🇷🇺' },
{ code: 'uk', name: 'Українська', flag: '🇺🇦' },
{ code: 'en', name: 'English', flag: '🇬🇧' },
];
const LanguageSelectPage: React.FC = () => {
const navigate = useNavigate();
const { setLang } = useLanguage();
const handleSelect = (code: string) => {
setLang(code);
navigate('/menu');
};
return (
<div style={{
minHeight: '100vh',
background: '#F4F5F7',
color: '#1A1A2E',
fontFamily: fonts.main,
display: 'flex',
flexDirection: 'column',
alignItems: 'center',
justifyContent: 'center',
padding: '24px',
position: 'relative',
overflow: 'hidden',
}}>
<div style={{ position: 'fixed', top: '-120px', left: '-90px', width: '320px', height: '320px', borderRadius: '50%', background: '#2ECC71', opacity: 0.25, filter: 'blur(90px)', pointerEvents: 'none', zIndex: 0 }} />
<div style={{ position: 'fixed', bottom: '-80px', right: '-60px', width: '280px', height: '280px', borderRadius: '50%', background: '#4FA9E8', opacity: 0.20, filter: 'blur(90px)', pointerEvents: 'none', zIndex: 0 }} />
<style>{`
@keyframes fadeInUp {
0% { transform: translateY(15px); opacity: 0; }
100% { transform: translateY(0); opacity: 1; }
}
`}</style>
<div style={{ position: 'relative', zIndex: 1, display: 'flex', flexDirection: 'column', alignItems: 'center', width: '100%', maxWidth: '340px' }}>
<div style={{ fontSize: '56px', marginBottom: '16px', animation: 'fadeInUp 0.3s ease' }}>🌍</div>
<h1 style={{
fontSize: '24px',
fontWeight: 800,
marginBottom: '8px',
textAlign: 'center',
color: '#1A1A2E',
animation: 'fadeInUp 0.3s ease 0.05s both',
}}>
Wybierz język
</h1>
<p style={{
fontSize: '14px',
color: '#6B7280',
marginBottom: '28px',
textAlign: 'center',
animation: 'fadeInUp 0.3s ease 0.1s both',
}}>
Choose your language / Выберите язык / Оберіть мову
</p>
<div style={{
display: 'flex',
flexDirection: 'column',
gap: '12px',
width: '100%',
animation: 'fadeInUp 0.3s ease 0.15s both',
}}>
{languages.map((lang) => (
<button
key={lang.code}
onClick={() => handleSelect(lang.code)}
style={{
padding: '16px 20px',
borderRadius: radius.lg,
border: '1px solid rgba(255,255,255,0.7)',
background: 'rgba(255,255,255,0.55)',
backdropFilter: 'blur(24px) saturate(180%)',
WebkitBackdropFilter: 'blur(24px) saturate(180%)',
color: '#1A1A2E',
fontSize: '17px',
fontWeight: 600,
cursor: 'pointer',
display: 'flex',
alignItems: 'center',
gap: '14px',
boxShadow: '0 6px 20px rgba(31,38,73,0.08), inset 0 1px 0 rgba(255,255,255,0.85)',
transition: 'all 0.2s ease',
}}
onTouchStart={(e) => { e.currentTarget.style.transform = 'scale(0.96)'; }}
onTouchEnd={(e) => { e.currentTarget.style.transform = 'scale(1)'; }}
>
<span style={{ fontSize: '28px' }}>{lang.flag}</span>
<span>{lang.name}</span>
<span style={{ marginLeft: 'auto', fontSize: '18px', color: '#2ECC71', fontWeight: 800 }}>→</span>
</button>
))}
</div>
</div>
</div>
);
};
export default LanguageSelectPage;