diff --git a/layouts/v7/resources/css/ai-drawer.css b/layouts/v7/resources/css/ai-drawer.css index 6c896844..533666e9 100644 --- a/layouts/v7/resources/css/ai-drawer.css +++ b/layouts/v7/resources/css/ai-drawer.css @@ -4,6 +4,8 @@ right: -400px; /* Начально скрыт */ top: 0; width: 400px; + min-width: 300px; /* Минимальная ширина */ + max-width: 50vw; /* Максимальная ширина - половина экрана */ height: 100vh; background: #ffffff; /* Чистый белый фон */ box-shadow: -2px 0 15px rgba(0,0,0,0.1); @@ -15,6 +17,38 @@ border-left: 1px solid #e9ecef; } +/* Полоска для изменения ширины */ +.ai-drawer-resize-handle { + position: absolute; + left: 0; + top: 0; + width: 4px; + height: 100%; + cursor: ew-resize; + background: transparent; + z-index: 1000000; + transition: background 0.2s ease; +} + +.ai-drawer-resize-handle:hover { + background: #007bff; +} + +.ai-drawer-resize-handle:active { + background: #0056b3; +} + +/* Визуальная индикация при перетаскивании */ +.ai-drawer.resizing { + transition: none !important; + user-select: none; +} + +.ai-drawer.resizing .ai-drawer-resize-handle { + background: #007bff; + width: 4px; +} + .ai-drawer.open { right: 0; } @@ -192,6 +226,11 @@ body.ai-drawer-open .ai-drawer-toggle { margin-right: 400px; } +/* Динамический margin для main-container при изменении ширины drawer */ +.main-container.drawer-open[data-drawer-width] { + margin-right: var(--drawer-width, 400px); +} + /* Плавающий индикатор загрузки */ .ai-loading-overlay { position: fixed; @@ -476,6 +515,13 @@ body.ai-drawer-open .ai-drawer-toggle { height: 100dvh; /* Динамическая высота viewport для мобильных */ display: flex; flex-direction: column; + min-width: 100%; + max-width: 100%; + } + + /* Скрываем resize handle на мобильных */ + .ai-drawer-resize-handle { + display: none; } .main-container.drawer-open { @@ -683,6 +729,8 @@ body.ai-drawer-open .ai-drawer-toggle { /* Десктопная версия drawer */ .ai-drawer { width: 400px; + min-width: 300px; + max-width: 50vw; right: -400px; height: 100vh; display: flex; diff --git a/layouts/v7/resources/js/ai-drawer-simple.js b/layouts/v7/resources/js/ai-drawer-simple.js index 7c559d6d..612f9bf7 100644 --- a/layouts/v7/resources/js/ai-drawer-simple.js +++ b/layouts/v7/resources/js/ai-drawer-simple.js @@ -5,6 +5,8 @@ class AIDrawer { this.avatarType = 'default'; this.sessionId = null; this.currentEventSource = null; // Для SSE соединения + this.drawerWidth = 400; // Текущая ширина drawer + this.isResizing = false; // Флаг перетаскивания this.init(); // Загружаем историю сразу при инициализации (при загрузке страницы) @@ -21,6 +23,7 @@ class AIDrawer { const drawerHTML = '' + '