From 29e9168efb841fec4a8ee6902407471445ea3ed7 Mon Sep 17 00:00:00 2001 From: Anastasia <95341361+Anleo1@users.noreply.github.com> Date: Fri, 10 Apr 2026 16:15:41 +0300 Subject: [PATCH 1/6] Update style.css --- frontend/css/style.css | 284 ----------------------------------------- 1 file changed, 284 deletions(-) diff --git a/frontend/css/style.css b/frontend/css/style.css index 97d06f6..0d15384 100644 --- a/frontend/css/style.css +++ b/frontend/css/style.css @@ -211,287 +211,3 @@ button { .trainer-actions { margin-top: 16px; } -/* Дополнительные стили для главной страницы */ -.container { - max-width: 1000px; - margin: 0 auto; -} - -.chat-container { - background: white; - border-radius: 16px; - box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08); - overflow: hidden; -} - -.chat-messages { - height: 400px; - overflow-y: auto; - padding: 20px; - display: flex; - flex-direction: column; - gap: 16px; - background: #f9fafb; -} - -.message { - display: flex; - gap: 12px; - max-width: 80%; -} - -.message.user { - align-self: flex-end; - flex-direction: row-reverse; -} - -.message.bot { - align-self: flex-start; -} - -.message-avatar { - width: 36px; - height: 36px; - border-radius: 50%; - background: #e5e7eb; - display: flex; - align-items: center; - justify-content: center; - font-size: 20px; -} - -.message-content { - background: white; - padding: 12px 16px; - border-radius: 12px; - box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); -} - -.message.user .message-content { - background: #2563eb; - color: white; -} - -.message-content p { - margin: 0; - line-height: 1.5; -} - -.message-meta { - margin-top: 8px; - font-size: 12px; - color: #6b7280; -} - -.chat-input-form { - padding: 16px; - background: white; - border-top: 1px solid #e5e7eb; -} - -.input-group { - display: flex; - gap: 12px; -} - -.input-group textarea { - flex: 1; - padding: 12px; - border: 1px solid #e5e7eb; - border-radius: 8px; - font-family: inherit; - font-size: 14px; - resize: vertical; -} - -.input-group textarea:focus { - outline: none; - border-color: #2563eb; -} - -.input-group button { - padding: 0 24px; - background: #2563eb; - color: white; - border: none; - border-radius: 8px; - cursor: pointer; - font-weight: 500; -} - -.input-group button:hover { - background: #1d4ed8; -} - -.trainer-container { - background: white; - border-radius: 16px; - padding: 24px; - box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08); -} - -.question-header { - display: flex; - justify-content: space-between; - align-items: center; - margin-bottom: 16px; -} - -.question-badge { - background: #e5e7eb; - padding: 4px 12px; - border-radius: 20px; - font-size: 12px; - font-weight: 500; -} - -.card-number { - font-size: 12px; - color: #6b7280; -} - -.answer-form { - margin: 24px 0; -} - -.form-label { - display: block; - margin-bottom: 8px; - font-weight: 500; -} - -.answer-form textarea { - width: 100%; - padding: 12px; - border: 1px solid #e5e7eb; - border-radius: 8px; - font-family: inherit; - font-size: 14px; - resize: vertical; -} - -.answer-form textarea:focus { - outline: none; - border-color: #2563eb; -} - -.btn-primary { - margin-top: 12px; - padding: 10px 20px; - background: #2563eb; - color: white; - border: none; - border-radius: 8px; - cursor: pointer; - font-weight: 500; -} - -.btn-primary:hover:not(:disabled) { - background: #1d4ed8; -} - -.btn-primary:disabled { - background: #9ca3af; - cursor: not-allowed; -} - -.btn-secondary { - padding: 10px 20px; - background: #e5e7eb; - color: #1f2937; - border: none; - border-radius: 8px; - cursor: pointer; - font-weight: 500; -} - -.btn-secondary:hover { - background: #d1d5db; -} - -.result-header { - margin-bottom: 16px; -} - -.result-header h3 { - margin: 0; - font-size: 18px; -} - -.result-similarity { - margin-bottom: 16px; -} - -.similarity-label { - font-size: 14px; - font-weight: 500; -} - -.similarity-value { - font-size: 24px; - font-weight: 700; - margin-left: 8px; -} - -.similarity-bar { - margin-top: 8px; - height: 8px; - background: #e5e7eb; - border-radius: 4px; - overflow: hidden; -} - -.similarity-fill { - height: 100%; - background: #2563eb; - transition: width 0.3s ease; -} - -.explanation-label { - font-weight: 500; - margin-bottom: 8px; -} - -.explanation-text { - line-height: 1.6; - color: #4b5563; -} - -.loading-overlay { - position: fixed; - top: 0; - left: 0; - right: 0; - bottom: 0; - background: rgba(0, 0, 0, 0.5); - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; - z-index: 1000; -} - -.spinner { - width: 40px; - height: 40px; - border: 4px solid rgba(255, 255, 255, 0.3); - border-top-color: white; - border-radius: 50%; - animation: spin 0.8s linear infinite; -} - -@keyframes spin { - to { transform: rotate(360deg); } -} - -.loading-overlay p { - margin-top: 16px; - color: white; -} - -/* Переменные цветов */ -:root { - --success: #10b981; - --warning: #f59e0b; - --error: #ef4444; -} \ No newline at end of file From 45cfc78de70fccb0c235112f9fa93e9e0097f95d Mon Sep 17 00:00:00 2001 From: Anastasia <95341361+Anleo1@users.noreply.github.com> Date: Fri, 10 Apr 2026 16:35:51 +0300 Subject: [PATCH 2/6] Update main.js --- frontend/js/main.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/frontend/js/main.js b/frontend/js/main.js index cb72fb8..f1991e1 100644 --- a/frontend/js/main.js +++ b/frontend/js/main.js @@ -202,7 +202,6 @@ function displayResult(similarity) { const resultBlock = document.getElementById('result-block'); const similarityValue = document.getElementById('similarity-value'); const similarityFill = document.getElementById('similarity-fill'); - // Убрана переменная resultIcon const resultTitle = document.getElementById('result-title'); const explanationText = document.getElementById('explanation-text'); @@ -288,4 +287,4 @@ function escapeHtml(text) { const div = document.createElement('div'); div.textContent = text; return div.innerHTML; -} \ No newline at end of file +} From d2288a692b90af8721c1a7121d610366d6fdbc5c Mon Sep 17 00:00:00 2001 From: Gellert Ilya Date: Fri, 10 Apr 2026 18:27:26 +0300 Subject: [PATCH 3/6] feat(frontend): add css colors for result line --- frontend/css/style.css | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/frontend/css/style.css b/frontend/css/style.css index 0d15384..c6bcff0 100644 --- a/frontend/css/style.css +++ b/frontend/css/style.css @@ -1,3 +1,9 @@ +:root { + --success: #22c55e; + --warning: #f59e0b; + --error: #ef4444; +} + * { box-sizing: border-box; } From 76cb986e8ac54846e7e7727346567f3d3833993d Mon Sep 17 00:00:00 2001 From: Gellert Ilya Date: Fri, 10 Apr 2026 18:27:59 +0300 Subject: [PATCH 4/6] fix(frontend): replace API_BASE --- frontend/js/api.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/js/api.js b/frontend/js/api.js index e3e0c21..3a1a637 100644 --- a/frontend/js/api.js +++ b/frontend/js/api.js @@ -1,5 +1,5 @@ // API Base URL (relative path for container compatibility) -const API_BASE = 'api/v1'; +const API_BASE = '/api/v1'; // Helper function for API calls with error handling async function apiCall(url, options = {}) { From c396ada012614d237fe740fcea6332a3fe554ddd Mon Sep 17 00:00:00 2001 From: Gellert Ilya Date: Fri, 10 Apr 2026 19:01:39 +0300 Subject: [PATCH 5/6] feat(frontend): add css styles for groups --- frontend/css/style.css | 62 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) diff --git a/frontend/css/style.css b/frontend/css/style.css index c6bcff0..274fbbc 100644 --- a/frontend/css/style.css +++ b/frontend/css/style.css @@ -217,3 +217,65 @@ button { .trainer-actions { margin-top: 16px; } + +.similarity-bar { + width: 100%; + height: 12px; + background-color: #e5e7eb; + border-radius: 999px; + overflow: hidden; + margin-top: 10px; +} + +.similarity-fill { + height: 100%; + background-color: var(--success); + transition: width 0.4s ease, background-color 0.4s ease; +} + +.similarity-label { + font-weight: 600; + margin-right: 8px; +} + +.similarity-value { + font-weight: 700; + color: #374151; +} + +.chat-container { + display: flex; + flex-direction: column; + gap: 16px; +} + +.chat-messages { + min-height: 250px; + max-height: 400px; + overflow-y: auto; + background: #f9fafb; + border: 1px solid #e5e7eb; + border-radius: 12px; + padding: 16px; + display: flex; + flex-direction: column; + gap: 12px; +} + +.input-group { + display: flex; + gap: 12px; +} + +.input-group textarea { + flex-grow: 1; + border: 1px solid #d1d5db; + border-radius: 10px; + padding: 12px; + font-family: inherit; +} + +.input-group button { + white-space: nowrap; + padding: 0 24px; +} \ No newline at end of file From 4c41a2006f79d60ebf0dc30a4dbd280d98b4ff41 Mon Sep 17 00:00:00 2001 From: Anastasia <95341361+Anleo1@users.noreply.github.com> Date: Fri, 10 Apr 2026 19:52:05 +0300 Subject: [PATCH 6/6] Remove avatar from chat message Removed the bot avatar from the chat message. --- frontend/index.html | 1 - 1 file changed, 1 deletion(-) diff --git a/frontend/index.html b/frontend/index.html index 48a1cb4..48629ba 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -33,7 +33,6 @@

RAG по дискретной математике

-
🤖

Привет! Я помогу найти нужную информацию в учебнике по дискретной математике. Задай свой вопрос в поле ниже.