/
bytevalue
/
optimal
Обзор
Документация
Войти
/
bytevalue
/
optimal
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
src/main/resources/static/css/mobile.css
482 строки
9 KB
Ivan Srdbt
Bugfixes
13 дек 2025, 11:37
13 дек 2025, 11:37
1fa7f8f
Код
Авторство
О чём код?
/* ===== MOBILE-FIRST РЕСПОНСИВ ===== */ /* Базовые стили уже для мобильных, медиа-запросы для больших экранов */ /* 1. Общие улучшения для мобильных устройств */ @media (max-width: 768px) { /* Улучшаем touch targets (минимальный размер 44x44px) */ .btn, .btn-icon, .mobile-menu-btn, .sidebar-toggle-btn, .btn-settings { min-height: 44px; min-width: 44px; } .chat-item { min-height: 44px; padding: 12px; } /* Улучшаем визуальную иерархию для мобильных */ .chat-header { position: sticky; top: 0; z-index: 100; background: rgba(18, 18, 24, 0.98); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-bottom: 1px solid rgba(255, 255, 255, 0.1); } .chat-input-container { position: sticky; bottom: 0; background: var(--bg-primary); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-top: 1px solid rgba(255, 255, 255, 0.1); border-radius: 0; margin: 0; width: 100%; padding: var(--spacing-md); box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.2); } /* Адаптация сообщений для мобильных */ .message { max-width: 95%; gap: 8px; } .message-avatar { width: 28px; height: 28px; font-size: 12px; } .message-bubble { padding: 10px 14px; border-radius: 14px; } .message-text { font-size: 15px; /* Чуть больше для читаемости */ } /* Улучшаем навигацию */ .sidebar { width: 100% !important; max-width: 320px; transform: translateX(-100%); transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); box-shadow: 4px 0 40px rgba(0, 0, 0, 0.5); } .sidebar.sidebar-mobile-active { transform: translateX(0); } .sidebar-backdrop { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, 0.7); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); z-index: 999; opacity: 0; visibility: hidden; transition: opacity 0.3s ease; } .sidebar-backdrop.active { opacity: 1; visibility: visible; } /* Адаптируем приветственный экран */ .welcome-container { padding: var(--spacing-lg); } .welcome-title { font-size: 32px; line-height: 1.2; } .welcome-subtitle { font-size: 16px; } .welcome-icon { width: 80px; height: 80px; font-size: 36px; } /* Улучшаем карточки действий */ .actions-grid { grid-template-columns: 1fr; gap: var(--spacing-sm); } .action-card { padding: var(--spacing-md); } .action-icon { width: 40px; height: 40px; font-size: 18px; } /* Адаптация графиков */ .chart-container { margin: var(--spacing-sm); padding: var(--spacing-md); border-radius: var(--radius-md); } .bar-chart-wrapper, .line-chart-wrapper, .pie-chart-wrapper { height: 280px; } .pie-chart-svg { width: 200px; height: 200px; } /* Улучшаем таблицы */ .chart-container table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; } .chart-container th, .chart-container td { padding: 10px 12px; font-size: 13px; } /* Адаптация карты районов */ .district-map-container { margin: var(--spacing-md) 0; border-radius: var(--radius-md); } .district-svg-wrapper { padding-bottom: 100%; } /* Улучшаем тултипы */ .chart-tooltip { max-width: 280px; padding: var(--spacing-sm); font-size: 13px; } .tooltip-value { font-size: 20px; } /* Улучшаем скролл на мобильных */ .messages-container { padding-bottom: 80px; /* Отступ для поля ввода */ } /* Скрываем неважные элементы на мобильных */ .chat-header-actions .btn-icon:not(.mobile-menu-btn) { display: none; } .section-title { font-size: 12px; } } /* 2. Очень маленькие экраны (до 480px) */ @media (max-width: 480px) { .chat-header { padding: 12px; } .messages-container { padding: 12px; } .welcome-title { font-size: 28px; } .welcome-icon { width: 70px; height: 70px; font-size: 32px; } .message-bubble { padding: 8px 12px; } .message-text { font-size: 14px; } .btn-sm { padding: 8px 12px; font-size: 13px; } .btn-icon { width: 40px; height: 40px; } /* Компактные графики */ .bar-chart-wrapper, .line-chart-wrapper, .pie-chart-wrapper { height: 240px; } .pie-chart-svg { width: 160px; height: 160px; } .pie-legend { flex-direction: column; gap: 8px; } .pie-legend-item { min-width: 100%; } /* Компактные карточки */ .action-card { flex-direction: column; text-align: center; align-items: center; } .action-icon { margin-bottom: var(--spacing-sm); } } /* 3. Ландшафтная ориентация на мобильных */ @media (max-width: 768px) and (orientation: landscape) { .chat-header { min-height: 60px; padding: 10px 16px; } .messages-container { padding-bottom: 70px; } .chat-input-container { flex-direction: row; padding: 10px; } .input-wrapper { flex: 1; } .welcome-container { padding: var(--spacing-md); } .welcome-title { font-size: 28px; } /* Графики в ландшафте */ .chart-container { margin: var(--spacing-xs); } .bar-chart-wrapper, .line-chart-wrapper { height: 200px; } } /* 4. Планшеты (от 769px до 1024px) */ @media (min-width: 769px) and (max-width: 1024px) { .sidebar:not(.sidebar-collapsed) { width: 220px; } .sidebar:not(.sidebar-collapsed) ~ .chat-main { margin-left: 220px; width: calc(100% - 220px); } .welcome-title { font-size: 40px; } .actions-grid { grid-template-columns: repeat(2, 1fr); } /* Графики на планшетах */ .chart-container { padding: var(--spacing-lg); } .bar-chart-wrapper, .line-chart-wrapper, .pie-chart-wrapper { height: 320px; } .pie-chart-svg { width: 220px; height: 220px; } } /* 5. БОЛЬШИЕ ЭКРАНЫ (min-width: 1025px) */ @media (min-width: 1025px) { .mobile-menu-btn { display: none !important; } } /* 6. ОЧЕНЬ БОЛЬШИЕ ЭКРАНЫ (min-width: 1440px) */ @media (min-width: 1440px) { .sidebar:not(.sidebar-collapsed) { width: 300px; } .sidebar:not(.sidebar-collapsed) ~ .chat-main { margin-left: 300px; width: calc(100% - 300px); } .welcome-container { max-width: 1000px; } .actions-grid { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); } /* Графики на больших экранах */ .chart-container { padding: var(--spacing-xl); } .bar-chart-wrapper, .line-chart-wrapper { height: 400px; } .pie-chart-wrapper { height: 400px; flex-direction: row; justify-content: space-around; } .pie-chart-svg { width: 280px; height: 280px; } } /* 7. ПОДДЕРЖКА НОТЧЕЙ И БЕЗОПАСНЫХ ОБЛАСТЕЙ */ @supports (padding: max(0px)) { .chat-header, .messages-container, .chat-input-container { padding-left: max(var(--spacing-md), env(safe-area-inset-left)); padding-right: max(var(--spacing-md), env(safe-area-inset-right)); } .chat-header { padding-top: max(var(--spacing-md), env(safe-area-inset-top)); } .chat-input-container { padding-bottom: max(var(--spacing-md), env(safe-area-inset-bottom)); } } /* 8. УЛУЧШЕНИЯ ДЛЯ ТАЧ-УСТРОЙСТВ */ @media (hover: none) and (pointer: coarse) { /* Увеличиваем hit area для touch */ .btn, .btn-icon, .action-card, .chat-item, .recent-chat-item { -webkit-tap-highlight-color: transparent; } /* Убираем hover-эффекты, заменяем на active */ .btn:hover:not(:disabled), .btn-icon:hover, .action-card:hover, .chat-item:hover { transform: none; } .btn:active:not(:disabled), .btn-icon:active, .action-card:active, .chat-item:active { transform: translateY(-1px); background: rgba(255, 255, 255, 0.1); } /* Улучшаем скролл на iOS */ .messages-container, .sidebar-content { -webkit-overflow-scrolling: touch; } /* Увеличиваем область клика для интерактивных элементов */ .message-bubble { cursor: default; } } /* 9. РЕДУКЦИЯ ДВИЖЕНИЙ (для пользователей с чувствительностью) */ @media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; } } /* 10. ВЫСОКИЙ КОНТРАСТ (для доступности) */ @media (prefers-contrast: high) { .chat-header { border-bottom: 2px solid var(--text-primary); } .chat-input-container { border: 2px solid var(--text-primary); } .message-bubble { border: 1px solid var(--text-primary); } .btn { border: 1px solid var(--text-primary); } }