feat(frontend): адаптация под мобильные устройства
- Мобильная навигация: hamburger-меню и drawer вместо фиксированного sidebar - Модальные окна на весь экран при ширине < 480px - Адаптивные заголовки страниц и фильтры (touch-friendly) - Card view для таблицы операций при ширине < 600px - Горизонтальный скролл вкладок настроек - Увеличенные touch-targets (44px) для пагинации и кнопок - Уменьшенная высота графиков на мобильных - Поддержка safe-area-inset для устройств с вырезами - theme-color в index.html Made-with: Cursor
This commit is contained in:
@@ -598,6 +598,75 @@ textarea {
|
||||
border-radius: var(--radius-lg);
|
||||
box-shadow: var(--shadow-sm);
|
||||
overflow-x: auto;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
}
|
||||
|
||||
/* Transaction cards (mobile view) */
|
||||
.transaction-cards {
|
||||
display: none;
|
||||
flex-direction: column;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.transaction-card {
|
||||
background: var(--color-surface);
|
||||
border-radius: var(--radius-lg);
|
||||
padding: 14px 16px;
|
||||
box-shadow: var(--shadow-sm);
|
||||
border-left: 4px solid var(--color-border);
|
||||
}
|
||||
|
||||
.transaction-card.row-unconfirmed {
|
||||
border-left-color: var(--color-warning);
|
||||
}
|
||||
|
||||
.transaction-card-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: baseline;
|
||||
margin-bottom: 6px;
|
||||
}
|
||||
|
||||
.transaction-card-date {
|
||||
font-size: 12px;
|
||||
color: var(--color-text-secondary);
|
||||
}
|
||||
|
||||
.transaction-card-amount {
|
||||
font-variant-numeric: tabular-nums;
|
||||
font-weight: 600;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.transaction-card-body {
|
||||
font-size: 14px;
|
||||
word-break: break-word;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.transaction-card-footer {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 8px;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.transaction-card-meta {
|
||||
font-size: 12px;
|
||||
color: var(--color-text-muted);
|
||||
}
|
||||
|
||||
.transaction-card-actions {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
}
|
||||
|
||||
.btn-icon-touch {
|
||||
min-width: 44px;
|
||||
min-height: 44px;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.data-table {
|
||||
@@ -758,8 +827,9 @@ textarea {
|
||||
|
||||
.pagination-size {
|
||||
width: auto;
|
||||
padding: 4px 8px;
|
||||
padding: 8px 12px;
|
||||
font-size: 13px;
|
||||
min-height: 44px;
|
||||
}
|
||||
|
||||
.btn-page {
|
||||
@@ -771,6 +841,11 @@ textarea {
|
||||
font-size: 14px;
|
||||
transition: all var(--transition);
|
||||
font-family: inherit;
|
||||
min-width: 44px;
|
||||
min-height: 44px;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.btn-page:hover:not(:disabled) {
|
||||
@@ -837,6 +912,12 @@ textarea {
|
||||
color: var(--color-text-secondary);
|
||||
padding: 0;
|
||||
line-height: 1;
|
||||
min-width: 44px;
|
||||
min-height: 44px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin: -8px -8px -8px 0;
|
||||
}
|
||||
|
||||
.btn-close:hover {
|
||||
@@ -986,6 +1067,13 @@ textarea {
|
||||
gap: 0;
|
||||
border-bottom: 2px solid var(--color-border);
|
||||
margin-bottom: 0;
|
||||
overflow-x: auto;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
scrollbar-width: none;
|
||||
}
|
||||
|
||||
.tabs::-webkit-scrollbar {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.tab {
|
||||
@@ -1000,6 +1088,8 @@ textarea {
|
||||
cursor: pointer;
|
||||
transition: all var(--transition);
|
||||
font-family: inherit;
|
||||
flex-shrink: 0;
|
||||
min-height: 44px;
|
||||
}
|
||||
|
||||
.tab:hover {
|
||||
@@ -1311,6 +1401,61 @@ textarea {
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
/* ================================================================
|
||||
Burger button (mobile)
|
||||
================================================================ */
|
||||
|
||||
.burger-btn {
|
||||
display: none;
|
||||
position: fixed;
|
||||
top: 12px;
|
||||
left: 12px;
|
||||
z-index: 101;
|
||||
width: 44px;
|
||||
height: 44px;
|
||||
padding: 0;
|
||||
background: var(--color-sidebar);
|
||||
color: #fff;
|
||||
border: none;
|
||||
border-radius: var(--radius);
|
||||
cursor: pointer;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
box-shadow: var(--shadow);
|
||||
transition: all var(--transition);
|
||||
}
|
||||
|
||||
.burger-btn:hover {
|
||||
background: var(--color-sidebar-hover);
|
||||
}
|
||||
|
||||
.sidebar-overlay {
|
||||
display: none;
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
background: rgba(0, 0, 0, 0.5);
|
||||
z-index: 99;
|
||||
animation: overlay-fade-in 0.2s ease;
|
||||
}
|
||||
|
||||
@keyframes overlay-fade-in {
|
||||
from {
|
||||
opacity: 0;
|
||||
}
|
||||
to {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes drawer-slide-in {
|
||||
from {
|
||||
transform: translateX(-100%);
|
||||
}
|
||||
to {
|
||||
transform: translateX(0);
|
||||
}
|
||||
}
|
||||
|
||||
/* ================================================================
|
||||
Responsive
|
||||
================================================================ */
|
||||
@@ -1322,13 +1467,29 @@ textarea {
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.burger-btn {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.sidebar-overlay {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.sidebar {
|
||||
width: 200px;
|
||||
width: min(280px, 85vw);
|
||||
transform: translateX(-100%);
|
||||
transition: transform 0.25s ease;
|
||||
box-shadow: var(--shadow-lg);
|
||||
}
|
||||
|
||||
.sidebar.sidebar-open {
|
||||
transform: translateX(0);
|
||||
animation: drawer-slide-in 0.25s ease;
|
||||
}
|
||||
|
||||
.main-content {
|
||||
margin-left: 200px;
|
||||
padding: 16px;
|
||||
margin-left: 0;
|
||||
padding: 16px 16px 16px 60px;
|
||||
}
|
||||
|
||||
.filters-row {
|
||||
@@ -1342,4 +1503,114 @@ textarea {
|
||||
.summary-cards {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
.page-header {
|
||||
flex-direction: column;
|
||||
align-items: stretch;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.page-header .btn {
|
||||
min-height: 44px;
|
||||
}
|
||||
|
||||
.filter-dates-wrap .btn-page {
|
||||
min-width: 44px;
|
||||
min-height: 44px;
|
||||
padding: 8px;
|
||||
}
|
||||
|
||||
.filter-presets {
|
||||
overflow-x: auto;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
flex-wrap: nowrap;
|
||||
padding-bottom: 4px;
|
||||
}
|
||||
|
||||
.btn-preset {
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.filter-sort .btn-sort-order {
|
||||
min-width: 44px;
|
||||
min-height: 44px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 600px) {
|
||||
.table-desktop {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.transaction-mobile {
|
||||
display: flex !important;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 480px) {
|
||||
.modal-overlay {
|
||||
padding: 0;
|
||||
align-items: stretch;
|
||||
}
|
||||
|
||||
.modal {
|
||||
max-width: none;
|
||||
max-height: none;
|
||||
height: 100%;
|
||||
min-height: 100dvh;
|
||||
border-radius: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.modal-header {
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.modal-body {
|
||||
overflow-y: auto;
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
}
|
||||
|
||||
.modal-footer {
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.modal-footer .btn {
|
||||
min-height: 44px;
|
||||
min-width: 44px;
|
||||
padding: 12px 20px;
|
||||
}
|
||||
|
||||
.page-header h1 {
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
.pagination {
|
||||
flex-direction: column;
|
||||
align-items: stretch;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.pagination-controls {
|
||||
justify-content: center;
|
||||
}
|
||||
}
|
||||
|
||||
/* Safe area for devices with notches */
|
||||
@supports (padding: env(safe-area-inset-bottom)) {
|
||||
.burger-btn {
|
||||
top: calc(12px + env(safe-area-inset-top));
|
||||
left: calc(12px + env(safe-area-inset-left));
|
||||
}
|
||||
|
||||
.main-content {
|
||||
padding-bottom: calc(16px + env(safe-area-inset-bottom));
|
||||
}
|
||||
|
||||
.modal-footer {
|
||||
padding-bottom: calc(20px + env(safe-area-inset-bottom));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user