feat: sistema de observação por voz - fase 1

- FAB flutuante para gravar observação
- Modal com timer + waveform animado
- Botão sair para desistir
- MediaRecorder API (webm/opus)
- Transcrição via OpenAI Whisper
- Relatório estruturado via GPT
- Salva em .md com frontmatter (data/hora/timestamp)
- Índice JSON para consulta posterior
- Rotas: transcrever, salvar, listar observações
- multer para upload de áudio
This commit is contained in:
2026-05-27 15:46:03 +00:00
parent d309b03b55
commit ea8e33c891
72 changed files with 8531 additions and 4 deletions
+272
View File
@@ -2533,6 +2533,278 @@ code {
color: #ef4444;
}
/* FAB: Floating Action Button para gravação */
.fab-record {
position: fixed;
bottom: 24px;
right: 24px;
width: 60px;
height: 60px;
border-radius: 50%;
background: var(--brand-green, #10a37f);
border: none;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
box-shadow: 0 4px 20px rgba(16, 163, 127, 0.4);
transition: all 0.3s;
z-index: 998;
color: white;
}
.fab-record svg {
width: 28px;
height: 28px;
}
.fab-record:hover {
transform: scale(1.08);
box-shadow: 0 6px 24px rgba(16, 163, 127, 0.5);
}
.fab-record:active {
transform: scale(0.95);
}
/* Modal de Gravação */
.record-modal-content {
max-width: 480px !important;
border-radius: 20px !important;
overflow: hidden;
}
.record-modal-header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 16px 20px;
border-bottom: 1px solid var(--border-light, #262626);
background: var(--bg-secondary, #1a1a1a);
}
.record-modal-header h3 {
margin: 0;
font-size: 1.1rem;
color: var(--text-primary, #ffffff);
font-family: 'Outfit', sans-serif;
}
.btn-exit-record {
display: flex;
align-items: center;
gap: 6px;
background: transparent;
border: 1px solid var(--border-light, #262626);
color: var(--text-secondary, #a3a3a3);
padding: 8px 14px;
border-radius: 8px;
font-size: 0.85rem;
cursor: pointer;
transition: all 0.2s;
}
.btn-exit-record:hover {
color: #ef4444;
border-color: #ef4444;
}
.btn-exit-record svg {
width: 16px;
height: 16px;
}
.record-modal-body {
padding: 30px 20px;
min-height: 320px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.record-state {
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
gap: 16px;
}
/* Timer */
.record-timer {
font-size: 3rem;
font-weight: 700;
color: var(--brand-green, #10a37f);
font-family: 'Inter', sans-serif;
letter-spacing: 2px;
}
/* Waveform */
.record-waveform {
display: flex;
align-items: center;
justify-content: center;
gap: 4px;
height: 60px;
}
.wave-bar {
width: 4px;
background: var(--brand-green, #10a37f);
border-radius: 2px;
animation: wave 1s ease-in-out infinite;
opacity: 0.7;
}
.wave-bar:nth-child(1) { animation-delay: 0s; height: 20px; }
.wave-bar:nth-child(2) { animation-delay: 0.1s; height: 35px; }
.wave-bar:nth-child(3) { animation-delay: 0.2s; height: 50px; }
.wave-bar:nth-child(4) { animation-delay: 0.3s; height: 40px; }
.wave-bar:nth-child(5) { animation-delay: 0.4s; height: 55px; }
.wave-bar:nth-child(6) { animation-delay: 0.5s; height: 30px; }
.wave-bar:nth-child(7) { animation-delay: 0.6s; height: 45px; }
.wave-bar:nth-child(8) { animation-delay: 0.7s; height: 25px; }
.wave-bar:nth-child(9) { animation-delay: 0.8s; height: 50px; }
.wave-bar:nth-child(10) { animation-delay: 0.9s; height: 35px; }
.wave-bar:nth-child(11) { animation-delay: 1.0s; height: 20px; }
.wave-bar:nth-child(12) { animation-delay: 1.1s; height: 40px; }
@keyframes wave {
0%, 100% { transform: scaleY(1); }
50% { transform: scaleY(0.5); }
}
.record-hint {
color: var(--text-secondary, #a3a3a3);
font-size: 0.95rem;
text-align: center;
}
.btn-stop-record {
display: flex;
flex-direction: column;
align-items: center;
gap: 10px;
background: #ef4444;
border: none;
color: white;
padding: 20px 36px;
border-radius: 50%;
cursor: pointer;
transition: all 0.2s;
margin-top: 10px;
}
.btn-stop-record:hover {
background: #dc2626;
transform: scale(1.05);
}
.stop-icon {
width: 24px;
height: 24px;
background: white;
border-radius: 4px;
}
.btn-stop-record span {
font-size: 0.85rem;
font-weight: 500;
}
/* Spinner */
.record-spinner {
width: 60px;
height: 60px;
border: 4px solid var(--border-light, #262626);
border-top-color: var(--brand-green, #10a37f);
border-radius: 50%;
animation: spin 1s linear infinite;
}
@keyframes spin {
to { transform: rotate(360deg); }
}
/* Prévia do relatório */
.preview-header {
width: 100%;
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 16px;
}
.preview-header h4 {
margin: 0;
color: var(--text-primary, #ffffff);
font-size: 1rem;
}
#previewDateTime {
font-size: 0.75rem;
color: var(--text-muted, #666);
}
.report-content {
width: 100%;
max-height: 300px;
overflow-y: auto;
background: var(--bg-secondary, #1a1a1a);
border: 1px solid var(--border-light, #262626);
border-radius: 12px;
padding: 16px;
font-size: 0.9rem;
color: var(--text-primary, #ffffff);
line-height: 1.6;
}
.report-content p { margin: 0 0 8px 0; }
.report-content strong { color: var(--brand-green, #10a37f); }
.preview-actions {
width: 100%;
display: flex;
gap: 12px;
margin-top: 16px;
}
.btn-discard {
flex: 1;
padding: 12px;
background: transparent;
border: 1px solid var(--border-light, #262626);
color: var(--text-secondary, #a3a3a3);
border-radius: 10px;
font-size: 0.9rem;
cursor: pointer;
transition: all 0.2s;
}
.btn-discard:hover {
border-color: #ef4444;
color: #ef4444;
}
.btn-save-report {
flex: 1;
padding: 12px;
background: var(--brand-green, #10a37f);
border: none;
color: white;
border-radius: 10px;
font-size: 0.9rem;
font-weight: 600;
cursor: pointer;
transition: all 0.2s;
}
.btn-save-report:hover {
opacity: 0.9;
}
/* Animação fadeIn global */
@keyframes fadeIn {
from { opacity: 0; }
to { opacity: 1; }