diff --git a/client-web/index.html b/client-web/index.html index 0d9e5fb..3e3b4e3 100644 --- a/client-web/index.html +++ b/client-web/index.html @@ -5,7 +5,8 @@ Knot Messenger - + +
diff --git a/client-web/src/App.tsx b/client-web/src/App.tsx index 28644b5..fb82327 100644 --- a/client-web/src/App.tsx +++ b/client-web/src/App.tsx @@ -15,10 +15,10 @@ export default function App() { if (isLoading) { return ( -
-
+
+
-

Загрузка...

+

Knot Loading

); @@ -45,14 +45,14 @@ export default function App() { function AppLoader() { return ( -
-
+
+
diff --git a/client-web/src/core/infrastructure/i18n.ts b/client-web/src/core/infrastructure/i18n.ts index 562999c..6a2bc7f 100644 --- a/client-web/src/core/infrastructure/i18n.ts +++ b/client-web/src/core/infrastructure/i18n.ts @@ -14,6 +14,10 @@ const translations = { // Profile name: 'Имя', username: 'Имя пользователя', + chats: 'Чаты', + calls: 'Звонки', + contacts: 'Контакты', + archive: 'Архив', aboutMe: 'О себе', birthday: 'Дата рождения', enterName: 'Введите имя', @@ -300,6 +304,10 @@ const translations = { tellAboutYourself: 'Tell about yourself', removePhoto: 'Remove photo', language: 'Language', + chats: 'Chats', + calls: 'Calls', + contacts: 'Contacts', + archive: 'Archive', interfaceLang: 'Interface language', theme: 'Theme', russian: 'Русский', diff --git a/client-web/src/core/presentation/components/ui/Avatar.tsx b/client-web/src/core/presentation/components/ui/Avatar.tsx index 10b66f7..164a6f2 100644 --- a/client-web/src/core/presentation/components/ui/Avatar.tsx +++ b/client-web/src/core/presentation/components/ui/Avatar.tsx @@ -31,7 +31,7 @@ function AvatarInner({ src, name, size = 'md', className = '', online }: AvatarP const gradientClass = generateAvatarColor(name || ''); return ( -
+
{src ? ( ) : (
{initials}
)} {online !== undefined && (
)} diff --git a/client-web/src/core/presentation/layouts/GlobalNavBar.tsx b/client-web/src/core/presentation/layouts/GlobalNavBar.tsx new file mode 100644 index 0000000..df81ea6 --- /dev/null +++ b/client-web/src/core/presentation/layouts/GlobalNavBar.tsx @@ -0,0 +1,59 @@ +import { useAuthStore } from '../../../modules/auth/application/authStore'; +import { useLang } from '../../infrastructure/i18n'; + +interface GlobalNavBarProps { + activeTab: string; + onTabChange: (tab: string) => void; +} + +export default function GlobalNavBar({ activeTab, onTabChange }: GlobalNavBarProps) { + const { user } = useAuthStore(); + const { t } = useLang(); + + const menuItems = [ + { id: 'chats', icon: 'chat', label: t('chats') }, + { id: 'calls', icon: 'call', label: t('calls') }, + { id: 'contacts', icon: 'contacts', label: t('contacts') }, + { id: 'archive', icon: 'archive', label: t('archive') }, + { id: 'settings', icon: 'settings', label: t('settings') }, + ]; + + return ( + + ); +} diff --git a/client-web/src/core/presentation/layouts/Sidebar.tsx b/client-web/src/core/presentation/layouts/Sidebar.tsx index fd9a7dd..44a17ab 100644 --- a/client-web/src/core/presentation/layouts/Sidebar.tsx +++ b/client-web/src/core/presentation/layouts/Sidebar.tsx @@ -98,59 +98,29 @@ export default function Sidebar() { return ( <> -
- {/* Шапка */} -
-
- -
-
- -
-

Knot Messenger

-
-
- +
+ {/* Title Section (Minimal) */} +
+

{t('chats')}

- {/* Поиск */} -
+ {/* Search */} +
- + search setSearchQuery(e.target.value)} - className="w-full pl-9 pr-8 py-1.5 rounded-[10px] bg-surface-tertiary text-[14px] text-white placeholder-zinc-500 border border-transparent focus:border-accent/50 hover:bg-surface-hover transition-all outline-none" + className="w-full pl-12 pr-4 py-3 rounded-xl bg-surface-container-highest text-sm text-on-surface placeholder-on-surface-variant/30 border-none focus:ring-2 focus:ring-primary/20 hover:bg-surface-bright transition-all outline-none" /> - {searchQuery && ( - - )}
{/* Story circles */} {(storyGroups.length > 0 || true) && ( -
+
{/* Add story circle */}
{/* Модалки */} diff --git a/client-web/src/index.css b/client-web/src/index.css index ec74c9d..d0448d4 100644 --- a/client-web/src/index.css +++ b/client-web/src/index.css @@ -1,340 +1,234 @@ @import "tailwindcss"; +:root { + color-scheme: dark; + --primary: #9acbff; + --primary-container: #3096e5; + --on-primary: #003355; + --on-primary-container: #e0f2ff; + + --secondary: #c7c6ca; + --secondary-container: #48494c; + --on-secondary: #2f3033; + --on-secondary-container: #e3e2e6; + + --tertiary: #53e16f; + --tertiary-container: #006e25; + --on-tertiary: #00390a; + --on-tertiary-container: #affca0; + + --error: #ffb4ab; + --error-container: #93000a; + --on-error: #690005; + --on-error-container: #ffdad6; + + --surface: #131313; + --surface-container-lowest: #0b0b0b; + --surface-container-low: #1b1b1b; + --surface-container: #201f1f; + --surface-container-high: #2a2a2a; + --surface-container-highest: #353535; + + --on-surface: #f5f5fa; + --on-surface-variant: #b4b4c3; + --outline: #3c3c4b; + --outline-variant: #2d2d37; + + --ease-ice: cubic-bezier(0.4, 0, 0.2, 1); + --shadow-ambient: 0 40px 80px -20px rgba(0, 0, 0, 0.5); +} + @theme { --font-sans: 'Inter', system-ui, -apple-system, sans-serif; + --font-headline: 'Inter', sans-serif; + --font-body: 'Inter', sans-serif; - --color-knot-50: #eef2ff; - --color-knot-100: #e0e7ff; - --color-knot-200: #c7d2fe; - --color-knot-300: #a5b4fc; - --color-knot-400: #818cf8; - --color-knot-500: #6366f1; - --color-knot-600: #4f46e5; - --color-knot-700: #4338ca; - --color-knot-800: #3730a3; - --color-knot-900: #312e81; - --color-knot-950: #1e1b4b; + --color-primary: var(--primary); + --color-primary-container: var(--primary-container); + --color-on-primary: var(--on-primary); + --color-on-primary-container: var(--on-primary-container); - --color-surface: #09090b; - --color-surface-secondary: #111113; - --color-surface-tertiary: #1a1a1e; - --color-surface-hover: #222226; - --color-border: rgba(255, 255, 255, 0.08); - --color-border-light: rgba(255, 255, 255, 0.12); + --color-secondary: var(--secondary); + --color-secondary-container: var(--secondary-container); + --color-on-secondary: var(--on-secondary); + --color-on-secondary-container: var(--on-secondary-container); - --color-accent: #6366f1; - --color-accent-hover: #818cf8; - --color-accent-light: rgba(99, 102, 241, 0.15); + --color-tertiary: var(--tertiary); + --color-tertiary-container: var(--tertiary-container); + --color-on-tertiary: var(--on-tertiary); + --color-on-tertiary-container: var(--on-tertiary-container); + + --color-error: var(--error); + --color-error-container: var(--error-container); + --color-on-error: var(--on-error); + --color-on-error-container: var(--on-error-container); + + --color-surface: var(--surface); + --color-surface-container-lowest: var(--surface-container-lowest); + --color-surface-container-low: var(--surface-container-low); + --color-surface-container: var(--surface-container); + --color-surface-container-high: var(--surface-container-high); + --color-surface-container-highest: var(--surface-container-highest); + + --color-on-surface: var(--on-surface); + --color-on-surface-variant: var(--on-surface-variant); + --color-outline: var(--outline); + --color-outline-variant: var(--outline-variant); + + --animate-kinetic-in: slideInUp 0.6s var(--ease-ice) forwards; } -* { - scrollbar-width: thin; - scrollbar-color: rgba(255, 255, 255, 0.1) transparent; -} - -*::-webkit-scrollbar { - width: 6px; -} - -*::-webkit-scrollbar-track { - background: transparent; -} - -*::-webkit-scrollbar-thumb { - background-color: rgba(255, 255, 255, 0.1); - border-radius: 3px; -} - -*::-webkit-scrollbar-thumb:hover { - background-color: rgba(255, 255, 255, 0.2); -} - -html, body, #root { +/* Global resets and base styles */ +html, +body, +#root { height: 100%; margin: 0; padding: 0; overflow: hidden; -} - -.scrollbar-hide { - -ms-overflow-style: none; - scrollbar-width: none; -} -.scrollbar-hide::-webkit-scrollbar { - display: none; -} - -body { - font-family: var(--font-sans, -apple-system, BlinkMacSystemFont, 'Roboto', 'Helvetica Neue', Arial, sans-serif); - background-color: var(--color-surface, #17212b); - color: #fafafa; + background-color: #131313 !important; + /* Force to Obsidian surface */ + color: #f5f5fa !important; + /* Force to high-contrast white */ + font-family: var(--font-sans); -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; } -@keyframes slideIn { - from { opacity: 0; transform: translateY(8px); } - to { opacity: 1; transform: translateY(0); } +/* Base style for all elements if they inherit color incorrectly */ +* { + box-sizing: border-box; } -@keyframes fadeIn { - from { opacity: 0; } - to { opacity: 1; } +/* Kinetic Core Components */ +.knot-card { + background-color: var(--surface-container-low) !important; + border-radius: 2rem; + /* 32px */ + transition: all 0.4s var(--ease-ice); + overflow: hidden; } -@keyframes pulse-soft { - 0%, 100% { opacity: 1; } - 50% { opacity: 0.5; } +.knot-card-active { + background-color: var(--surface-container) !important; } -.animate-slide-in { - animation: slideIn 0.2s ease-out; +.knot-input-group { + background-color: rgba(53, 53, 53, 0.4) !important; + border-radius: 1.75rem; + padding: 1.25rem 1.6rem; + border: 1px solid rgba(154, 203, 255, 0.1); + transition: all 0.4s var(--ease-ice); + display: flex; + flex-direction: column; + backdrop-filter: blur(10px); } -.animate-fade-in { - animation: fadeIn 0.15s ease-out; +.knot-input-group:focus-within { + background-color: rgba(53, 53, 53, 0.6) !important; + border-color: #9acbff !important; + box-shadow: 0 0 0 1px #9acbff, 0 0 40px rgba(154, 203, 255, 0.1); } -.glass { - background: rgba(255, 255, 255, 0.03); +.knot-input-group input { + background: transparent !important; + border: none !important; + outline: none !important; + width: 100%; + color: #f5f5fa !important; +} + +.knot-button-primary { + background: linear-gradient(135deg, #9acbff, #3096e5) !important; + color: #e0f2ff !important; + border-radius: 1.5rem; + font-weight: 900; + letter-spacing: 0.05em; + transition: all 0.4s var(--ease-ice); +} + +.knot-button-primary:hover { + transform: translateY(-2px); + filter: brightness(1.1); + box-shadow: 0 24px 32px -12px rgba(48, 150, 229, 0.4); +} + +/* Utilities */ +.glass-effect { backdrop-filter: blur(20px); - -webkit-backdrop-filter: blur(20px); - border: 1px solid rgba(255, 255, 255, 0.06); + background: rgba(19, 19, 19, 0.6); } -.glass-strong { - background: rgba(17, 17, 19, 0.85); - backdrop-filter: blur(40px); - -webkit-backdrop-filter: blur(40px); - border: 1px solid rgba(255, 255, 255, 0.1); +.slide-on-ice { + transition: all 0.4s var(--ease-ice); } -.gradient-text { - background: linear-gradient(135deg, #6366f1, #8b5cf6, #a855f7); - -webkit-background-clip: text; - -webkit-text-fill-color: transparent; - background-clip: text; +.animate-kinetic { + animation: var(--animate-kinetic-in); } +.custom-scrollbar::-webkit-scrollbar { + width: 4px; +} + +.custom-scrollbar::-webkit-scrollbar-thumb { + background: var(--outline-variant); + border-radius: 10px; +} + +/* Overrides for legacy code */ +.bg-surface { + background-color: var(--surface) !important; +} + +.bg-surface-container-low { + background-color: var(--surface-container-low) !important; +} + +.bg-surface-container-lowest { + background-color: var(--surface-container-lowest) !important; +} + +.bg-surface-container-high { + background-color: var(--surface-container-high) !important; +} + +.text-on-surface { + color: var(--on-surface) !important; +} + +.text-on-surface-variant { + color: var(--on-surface-variant) !important; +} + +.text-primary { + color: var(--primary) !important; +} + +.text-accent { + color: #9acbff !important; +} + +/* Bubble overrides */ .bubble-sent { - background: #3b82f6; + background: linear-gradient(135deg, #9acbff, #3096e5) !important; + color: #e0f2ff !important; + border-radius: 1.5rem; + border-bottom-right-radius: 0.25rem; } .bubble-received { - background: rgba(255, 255, 255, 0.06); - border: 1px solid rgba(255, 255, 255, 0.08); + background: var(--surface-container-highest) !important; + color: var(--on-surface) !important; + border-radius: 1.5rem; + border-bottom-left-radius: 0.25rem; } -.bubble-sent ::selection { - background: rgba(255, 255, 255, 0.35); -} - -/* ==================== */ -/* Animation Keyframes */ -/* ==================== */ - -@keyframes float { - 0%, 100% { transform: translateY(0px); } - 50% { transform: translateY(-20px); } -} - -@keyframes call-wave { - 0% { transform: scale(1); opacity: 0.6; } - 100% { transform: scale(2.5); opacity: 0; } -} - -.animate-float { - animation: float 6s ease-in-out infinite; -} - -.animate-float-delayed { - animation: float 6s ease-in-out 3s infinite; -} - -.animate-call-wave { - animation: call-wave 2s ease-out infinite; -} - -.animate-call-wave-delayed { - animation: call-wave 2s ease-out 1s infinite; -} - -/* ==================== */ -/* Chat Themes */ -/* ==================== */ - -.chat-theme-midnight { - background-color: #0f0f13; - background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3z' fill='%23ffffff' fill-opacity='0.02' fill-rule='evenodd'/%3E%3C/svg%3E"); -} - -.chat-theme-ocean { - background-color: #0b172a; - background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%233b82f6' fill-opacity='0.05' fill-rule='evenodd'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/svg%3E"); -} - -.chat-theme-forest { - background-color: #0f1c15; - background-image: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%2310b981' fill-opacity='0.04' fill-rule='evenodd'%3E%3Ccircle cx='3' cy='3' r='3'/%3E%3Ccircle cx='13' cy='13' r='3'/%3E%3C/g%3E%3C/svg%3E"); -} - -.chat-theme-sunset { - background: linear-gradient(#1f111a, #150a0f); - position: relative; -} -.chat-theme-sunset::after { - content: ''; - position: absolute; - top: 0; right: 0; bottom: 0; left: 0; - pointer-events: none; - background-image: radial-gradient(circle at 50% 150%, rgba(236, 72, 153, 0.1), transparent 60%); -} - -.chat-theme-classic { - background-color: #121215; -} - -.chat-theme-neon { - background-color: #0b0f19; - position: relative; -} -.chat-theme-neon::before { - content: ''; - position: absolute; - top: 0; right: 0; bottom: 0; left: 0; - pointer-events: none; - background: radial-gradient(circle 400px at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(139, 92, 246, 0.15), transparent 80%); - transition: background 0.15s ease-out; -} - -.chat-theme-aurora { - background: linear-gradient(135deg, #022c22, #064e3b); - position: relative; -} -.chat-theme-aurora::before { - content: ''; - position: absolute; - top: 0; right: 0; bottom: 0; left: 0; - pointer-events: none; - background: radial-gradient(circle 600px at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(16, 185, 129, 0.2), transparent 70%); - transition: background 0.15s ease-out; -} - -.chat-theme-cyber { - background-color: #000; - background-image: - linear-gradient(rgba(245, 158, 11, 0.03) 1px, transparent 1px), - linear-gradient(90deg, rgba(245, 158, 11, 0.03) 1px, transparent 1px); - background-size: 20px 20px; - position: relative; -} -.chat-theme-cyber::before { - content: ''; - position: absolute; - top: 0; right: 0; bottom: 0; left: 0; - pointer-events: none; - background: radial-gradient(circle 300px at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(245, 158, 11, 0.15), transparent); - transition: background 0.15s ease-out; -} - -.chat-theme-glass { - background-color: #0d1117; - position: relative; - overflow: hidden; -} -.chat-theme-glass::before { - content: ''; - position: absolute; - width: 50vw; - height: 50vh; - left: var(--mouse-x, 50%); - top: var(--mouse-y, 50%); - transform: translate(-50%, -50%); - pointer-events: none; - background: radial-gradient(circle, rgba(59, 130, 246, 0.2), transparent 60%); - filter: blur(80px); - transition: left 0.5s cubic-bezier(0.2, 0.8, 0.2, 1), top 0.5s cubic-bezier(0.2, 0.8, 0.2, 1); -} - -.chat-theme-void { - background-color: #000; - position: relative; -} -.chat-theme-void::before { - content: ''; - position: absolute; - top: 0; right: 0; bottom: 0; left: 0; - pointer-events: none; - background: radial-gradient(circle 120px at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(255, 255, 255, 0.05), transparent); - transition: background 0.1s; -} - -.chat-bg { - background-color: #09090b; - background-image: - radial-gradient(ellipse at 20% 50%, rgba(99, 102, 241, 0.06) 0%, transparent 50%), - radial-gradient(ellipse at 80% 20%, rgba(139, 92, 246, 0.05) 0%, transparent 50%), - radial-gradient(ellipse at 60% 80%, rgba(168, 85, 247, 0.04) 0%, transparent 50%), - url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%236366f1' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E"); -} - -::selection { - background: rgba(99, 102, 241, 0.3); - text-shadow: 0 0 8px rgba(99, 102, 241, 0.4); -} - -input:focus, textarea:focus { - outline: none; -} - -/* Focus-visible ring for keyboard navigation accessibility */ -:focus-visible { - outline: 2px solid rgba(99, 102, 241, 0.6); - outline-offset: 2px; -} - -button:focus:not(:focus-visible), -a:focus:not(:focus-visible) { - outline: none; -} - -/* emoji-mart dark theme overrides */ -em-emoji-picker { - --em-rgb-background: 23, 33, 43; /* Telegram surface color */ - --em-rgb-input: 30, 44, 58; - --em-rgb-color: 240, 240, 240; - --border-radius: 0 0 16px 16px; - border: none !important; - - /* Overrides for category navigation to remove blue line and add soft bg */ - --category-icon-active-border-color: transparent !important; - --category-icon-active-color: #5288c1 !important; -} - -em-emoji-picker::part(category-icons) { - padding-top: 4px; -} - -em-emoji-picker::part(category-icon) { - border-radius: 6px; - transition: background 0.2s ease; -} - -em-emoji-picker::part(category-icon):hover { - background-color: rgba(255, 255, 255, 0.05); -} - -em-emoji-picker::part(category-icon-active) { - background-color: rgba(82, 136, 193, 0.15); /* Accent light bg */ -} - -/* Highlight for quoted messages */ -@keyframes highlight-glow { - 0% { box-shadow: 0 0 0 3px rgba(82, 136, 193, 0.8), 0 0 20px rgba(82, 136, 193, 0.6); } - 20% { box-shadow: 0 0 0 4px rgba(82, 136, 193, 1), 0 0 30px rgba(82, 136, 193, 0.8); } - 100% { box-shadow: 0 0 0 0 rgba(82, 136, 193, 0), 0 0 0 rgba(82, 136, 193, 0); } -} - -.highlight-message { - animation: highlight-glow 3s ease-out forwards; -} +/* Autofill fix - prevent browser blue background on dark theme */ +input:-webkit-autofill, +input:-webkit-autofill:hover, +input:-webkit-autofill:focus, +input:-webkit-autofill:active { + -webkit-box-shadow: 0 0 0 1000px #0b0b0b inset !important; + -webkit-text-fill-color: #f5f5fa !important; + transition: background-color 5000s ease-in-out 0s; +} \ No newline at end of file diff --git a/client-web/src/modules/admin/presentation/pages/AdminPage.tsx b/client-web/src/modules/admin/presentation/pages/AdminPage.tsx index 5fab256..d0d4eaa 100644 --- a/client-web/src/modules/admin/presentation/pages/AdminPage.tsx +++ b/client-web/src/modules/admin/presentation/pages/AdminPage.tsx @@ -800,7 +800,7 @@ export default function AdminPage() { } }; - const fetchUserDetails = async (id: string) => { + const fetchUserStats = async (id: string) => { try { const res = await httpClient.request(`/admin/users/${id}`); setSelectedUser(res); @@ -838,73 +838,112 @@ export default function AdminPage() { if (!authenticated) { return ( -
-
-
-

{t.loginTitle}

-
- - +
+ +
+ hub +
+ +
+

{t.loginTitle}

+

Administrator

+
+ +
+
+ +
+ person + setCreds({ ...creds, user: e.target.value })} + autoComplete="off" + /> +
+
+ +
+ +
+ lock + setCreds({ ...creds, pass: e.target.value })} + autoComplete="current-password" + /> +
- setCreds({ ...creds, user: e.target.value })} - /> - setCreds({ ...creds, pass: e.target.value })} - /> - + +
+ + +
); } return ( -
+
{/* Sidebar */} -