feat: Implement Performance Monitor, Settings Manager, UI Manager, Voice Manager, and Utility Functions

- Added PerformanceMonitor class for tracking application performance metrics including FPS, memory usage, and response times.
- Introduced SettingsManager class to handle application settings, configuration, and persistence with local storage.
- Created UIManager class to manage UI state, updates, and user interactions, including theme toggling and loading indicators.
- Developed VoiceManager class for voice recognition and speech synthesis functionalities, including voice input and output controls.
- Added utility functions for common operations such as debouncing, throttling, UUID generation, data formatting, and local storage management.
This commit is contained in:
Krikorios
2025-05-25 04:07:31 +03:00
parent 2cb54d6cad
commit 64cb55722b
19 changed files with 4986 additions and 0 deletions
+402
View File
@@ -0,0 +1,402 @@
/* Chat Section Base */
.chat-section {
display: flex;
flex-direction: column;
background: var(--bg-secondary);
position: relative;
border-radius: 0 24px 24px 0;
}
/* Chat Header */
.chat-header {
background: var(--bg-primary);
padding: 24px;
border-bottom: 2px solid var(--border-color);
display: flex;
justify-content: space-between;
align-items: center;
border-radius: 0 24px 0 0;
}
.chat-title {
display: flex;
flex-direction: column;
}
.chat-title h2 {
color: var(--text-primary);
margin-bottom: 6px;
font-size: 22px;
font-weight: 700;
background: var(--primary-gradient);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
}
.chat-title p {
color: var(--text-secondary);
font-size: 13px;
font-weight: 500;
}
.chat-controls {
display: flex;
gap: 10px;
}
.header-btn {
background: var(--bg-secondary);
border: 2px solid var(--border-color);
color: var(--text-secondary);
padding: 10px 16px;
border-radius: 12px;
cursor: pointer;
font-size: 14px;
font-weight: 600;
transition: all 0.3s ease;
display: flex;
align-items: center;
gap: 6px;
}
.header-btn:hover {
background: var(--primary-gradient);
color: white;
border-color: transparent;
transform: translateY(-1px);
box-shadow: var(--shadow-medium);
}
/* Messages Container */
.messages-container {
flex: 1;
overflow-y: auto;
padding: 24px;
display: flex;
flex-direction: column;
gap: 20px;
scroll-behavior: smooth;
}
/* Message Bubbles */
.message {
max-width: 85%;
padding: 16px 20px;
border-radius: 24px;
font-size: 14px;
line-height: 1.6;
animation: slideIn 0.4s ease;
word-wrap: break-word;
position: relative;
}
.message.user {
background: var(--primary-gradient);
color: white;
align-self: flex-end;
border-bottom-right-radius: 8px;
box-shadow: var(--shadow-medium);
}
.message.assistant {
background: var(--bg-primary);
color: var(--text-primary);
align-self: flex-start;
border: 2px solid var(--border-color);
border-bottom-left-radius: 8px;
box-shadow: var(--shadow-light);
}
.message.system {
background: var(--message-warning-gradient);
color: var(--message-warning-text);
align-self: center;
font-size: 13px;
border: 2px solid var(--message-warning-border);
text-align: center;
max-width: 90%;
font-weight: 600;
}
.message.error {
background: var(--message-error-gradient);
color: var(--message-error-text);
border: 2px solid var(--message-error-border);
align-self: center;
max-width: 90%;
font-weight: 600;
}
.message.success {
background: var(--message-success-gradient);
color: var(--message-success-text);
border: 2px solid var(--message-success-border);
align-self: center;
max-width: 90%;
font-weight: 600;
}
.message-time {
font-size: 11px;
opacity: 0.6;
margin-top: 6px;
font-weight: 500;
}
.message-actions {
position: absolute;
top: -10px;
right: 10px;
display: none;
background: rgba(0, 0, 0, 0.8);
border-radius: 8px;
padding: 4px;
gap: 4px;
}
.message:hover .message-actions {
display: flex;
}
.message-action-btn {
background: none;
border: none;
color: white;
padding: 4px 8px;
border-radius: 4px;
cursor: pointer;
font-size: 12px;
transition: all 0.2s ease;
}
.message-action-btn:hover {
background: rgba(255, 255, 255, 0.2);
}
/* Typing Indicator */
.typing-indicator {
display: none;
padding: 16px 20px;
background: var(--bg-primary);
border-radius: 24px;
border-bottom-left-radius: 8px;
align-self: flex-start;
border: 2px solid var(--border-color);
box-shadow: var(--shadow-light);
}
.typing-indicator.show {
display: block;
}
.typing-dots {
display: flex;
gap: 6px;
align-items: center;
}
.typing-dot {
width: 10px;
height: 10px;
border-radius: 50%;
background: var(--text-secondary);
animation: typingPulse 1.4s infinite ease-in-out;
}
.typing-dot:nth-child(1) {
animation-delay: -0.32s;
}
.typing-dot:nth-child(2) {
animation-delay: -0.16s;
}
/* Input Section */
.input-container {
padding: 24px;
background: var(--bg-primary);
border-top: 2px solid var(--border-color);
display: flex;
flex-direction: column;
gap: 16px;
border-radius: 0 0 24px 0;
}
.quick-actions {
display: flex;
gap: 10px;
flex-wrap: wrap;
}
.quick-action {
background: var(--bg-secondary);
border: 2px solid var(--border-color);
color: var(--text-secondary);
padding: 8px 14px;
border-radius: 20px;
font-size: 12px;
cursor: pointer;
transition: all 0.3s ease;
font-weight: 600;
display: flex;
align-items: center;
gap: 6px;
}
.quick-action:hover {
background: var(--primary-gradient);
color: white;
border-color: transparent;
transform: translateY(-2px);
box-shadow: var(--shadow-medium);
}
.input-row {
display: flex;
gap: 16px;
align-items: flex-end;
}
.input-wrapper {
flex: 1;
position: relative;
}
#messageInput {
width: 100%;
padding: 16px 60px 16px 20px;
border: 2px solid var(--border-color);
border-radius: 20px;
font-size: 14px;
resize: none;
max-height: 140px;
min-height: 52px;
background: var(--bg-primary);
color: var(--text-primary);
transition: all 0.3s ease;
font-family: inherit;
line-height: 1.5;
}
#messageInput:focus {
outline: none;
border-color: #667eea;
box-shadow: var(--glow-blue);
background: var(--bg-secondary);
}
.input-actions {
position: absolute;
right: 10px;
bottom: 10px;
display: flex;
gap: 6px;
}
.input-btn {
background: rgba(102, 126, 234, 0.1);
border: none;
color: var(--text-secondary);
padding: 8px;
border-radius: 8px;
cursor: pointer;
font-size: 16px;
transition: all 0.3s ease;
}
.input-btn:hover {
background: var(--primary-gradient);
color: white;
transform: scale(1.1);
}
.send-btn {
background: var(--primary-gradient);
border: none;
color: white;
padding: 16px 24px;
border-radius: 20px;
cursor: pointer;
font-weight: 700;
font-size: 14px;
transition: all 0.3s ease;
white-space: nowrap;
display: flex;
align-items: center;
gap: 10px;
box-shadow: var(--shadow-medium);
}
.send-btn:hover:not(:disabled) {
transform: translateY(-2px);
box-shadow: var(--glow-blue);
}
.send-btn:disabled {
opacity: 0.6;
cursor: not-allowed;
transform: none;
}
/* Animations */
@keyframes slideIn {
from {
opacity: 0;
transform: translateY(20px) scale(0.95);
}
to {
opacity: 1;
transform: translateY(0) scale(1);
}
}
@keyframes typingPulse {
0%, 80%, 100% {
opacity: 0.3;
transform: scale(0.8);
}
40% {
opacity: 1;
transform: scale(1.2);
}
}
/* Responsive Design */
@media (max-width: 1200px) {
.chat-section {
border-radius: 0 0 24px 24px;
}
.chat-header {
border-radius: 0;
}
.input-container {
border-radius: 0 0 24px 24px;
}
}
@media (max-width: 768px) {
.chat-header {
padding: 20px;
}
.messages-container {
padding: 20px;
}
.input-container {
padding: 20px;
}
.quick-actions {
flex-direction: column;
align-items: stretch;
}
.quick-action {
justify-content: center;
}
}