diff --git a/public/index.html b/public/index.html index db05cef..4c64cbe 100644 --- a/public/index.html +++ b/public/index.html @@ -375,6 +375,7 @@ + \ No newline at end of file diff --git a/public/openTaskChat.js b/public/openTaskChat.js new file mode 100644 index 0000000..faebb52 --- /dev/null +++ b/public/openTaskChat.js @@ -0,0 +1,105 @@ +function openTaskChat(taskId) { + // Находим задачу + const task = tasks.find(t => t.id === taskId); + if (!task) { + alert('Задача не найдена'); + return; + } + + // Создаем модальное окно чата + const modalHtml = ` + + `; + + // Добавляем модальное окно в DOM + const modalContainer = document.createElement('div'); + modalContainer.innerHTML = modalHtml; + document.body.appendChild(modalContainer); + + // Показываем модальное окно + setTimeout(() => { + const modal = document.getElementById('task-chat-modal'); + modal.style.display = 'block'; + + // Добавляем CSS для анимации (опционально) + const style = document.createElement('style'); + style.textContent = ` + #task-chat-modal { + display: none; + position: fixed; + z-index: 1000; + left: 0; + top: 0; + width: 100%; + height: 100%; + background-color: rgba(0,0,0,0.5); + animation: fadeIn 0.3s; + } + + #task-chat-modal .modal-content { + animation: slideIn 0.3s ease-out; + background-color: #fefefe; + margin: 5% auto; + border-radius: 10px; + box-shadow: 0 4px 20px rgba(0,0,0,0.2); + overflow: hidden; + } + + @keyframes fadeIn { + from { opacity: 0; } + to { opacity: 1; } + } + + @keyframes slideIn { + from { transform: translateY(-50px); opacity: 0; } + to { transform: translateY(0); opacity: 1; } + } + `; + document.head.appendChild(style); + }, 10); +} + +// Функция для закрытия чата +function closeTaskChat() { + const modal = document.getElementById('task-chat-modal'); + if (modal) { + modal.style.display = 'none'; + // Удаляем модальное окно из DOM через некоторое время + setTimeout(() => { + modal.parentElement.remove(); + }, 300); + } +} diff --git a/public/style.css b/public/style.css index ccce0ab..3b287ef 100644 --- a/public/style.css +++ b/public/style.css @@ -2953,4 +2953,25 @@ small { .drag-over { background-color: #e7f3ff !important; border: 2px dashed #007bff !important; +} +.chat-btn { + background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); + color: white; + border: none; + border-radius: 6px; + padding: 8px 12px; + cursor: pointer; + font-size: 16px; + margin-right: 5px; + transition: all 0.3s ease; + box-shadow: 0 2px 5px rgba(102, 126, 234, 0.3); +} + +.chat-btn:hover { + transform: translateY(-2px); + box-shadow: 0 4px 10px rgba(102, 126, 234, 0.4); +} + +.chat-btn:active { + transform: translateY(0); } \ No newline at end of file diff --git a/public/ui.js b/public/ui.js index d41eea4..8127be5 100644 --- a/public/ui.js +++ b/public/ui.js @@ -82,6 +82,7 @@ function renderTasks() {
${!isDeleted && !isClosed ? ` + ${currentUser && currentUser.login === 'kalugin.o' ? `` : ''} ${currentUser && currentUser.login === 'kalugin.o' ? `` : ''}