Refactor: Remove inline styles and fix IDE warnings

This commit is contained in:
Marcos
2026-03-22 10:23:02 -03:00
parent f89793eb6b
commit 73fae4e294

View File

@@ -30,25 +30,16 @@
} }
/* Custom Scrollbar */ /* Custom Scrollbar */
::-webkit-scrollbar { ::-webkit-scrollbar { width: 8px; }
width: 8px; ::-webkit-scrollbar-track { background: var(--bg-base); }
}
::-webkit-scrollbar-track {
background: var(--bg-base);
}
::-webkit-scrollbar-thumb { ::-webkit-scrollbar-thumb {
background: var(--border); background: var(--border);
border-radius: 4px; border-radius: 4px;
border: 2px solid var(--bg-base); border: 2px solid var(--bg-base);
} }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }
::-webkit-scrollbar-thumb:hover { /* Scrollbar Fix for Firefox / Modern Browsers */
background: var(--accent);
}
/* Scrollbar Fix for Firefox */
* { * {
scrollbar-width: thin; scrollbar-width: thin;
scrollbar-color: var(--accent) transparent; scrollbar-color: var(--accent) transparent;
@@ -650,6 +641,30 @@
font-size: 1.1rem; font-size: 1.1rem;
letter-spacing: 0.2rem; letter-spacing: 0.2rem;
} }
/* Utilities */
.hidden { display: none !important; }
.w-full { width: 100%; }
.text-center { text-align: center; }
.mt-2 { margin-top: 0.5rem; }
.opacity-60 { opacity: 0.6; }
.theme-icon { width: 18px; height: 18px; }
.recording-dot {
width: 8px;
height: 8px;
background: var(--danger);
border-radius: 50%;
display: inline-block;
animation: pulse 1s infinite;
}
.mic-active { color: var(--danger) !important; border-color: var(--danger) !important; }
.fade-in { animation: fadeIn 0.4s ease-out; }
@keyframes fadeIn {
from { opacity: 0; transform: translateY(10px); }
to { opacity: 1; transform: translateY(0); }
}
</style> </style>
</head> </head>
@@ -662,7 +677,7 @@
<input type="password" id="web-pass-input" aria-label="Senha da VPS" autocomplete="current-password" <input type="password" id="web-pass-input" aria-label="Senha da VPS" autocomplete="current-password"
class="form-input login-input" placeholder="Senha da VPS" class="form-input login-input" placeholder="Senha da VPS"
onkeypress="if(event.key==='Enter') attemptLogin()"> onkeypress="if(event.key==='Enter') attemptLogin()">
<button type="button" class="btn btn-primary" style="width:100%; padding: 0.8rem;" <button type="button" class="btn btn-primary w-full" style="padding: 0.8rem;"
onclick="attemptLogin()">Entrar no Dashboard</button> onclick="attemptLogin()">Entrar no Dashboard</button>
<div id="login-error" style="color:var(--danger); font-size: 0.75rem; margin-top: 1rem; display: none;"> <div id="login-error" style="color:var(--danger); font-size: 0.75rem; margin-top: 1rem; display: none;">
Senha incorreta. Tente novamente.</div> Senha incorreta. Tente novamente.</div>
@@ -680,12 +695,11 @@
<div class="header-actions"> <div class="header-actions">
<div class="status-badge" id="bot-status">Online</div> <div class="status-badge" id="bot-status">Online</div>
<button type="button" class="theme-toggle" onclick="toggleTheme()" aria-label="Alternar tema"> <button type="button" class="theme-toggle" onclick="toggleTheme()" aria-label="Alternar tema">
<svg id="icon-sun" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" style="display: none;"> <svg id="icon-sun" class="theme-icon hidden" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
<circle cx="12" cy="12" r="5" /> <circle cx="12" cy="12" r="5" />
<path <path d="M12 1v2M12 21v2M4.22 4.22l1.42 1.42M18.36 18.36l1.42 1.42M1 12h2M21 12h2M4.22 19.78l1.42-1.42M18.36 5.64l1.42-1.42" />
d="M12 1v2M12 21v2M4.22 4.22l1.42 1.42M18.36 18.36l1.42 1.42M1 12h2M21 12h2M4.22 19.78l1.42-1.42M18.36 5.64l1.42-1.42" />
</svg> </svg>
<svg id="icon-moon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <svg id="icon-moon" class="theme-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
<path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z" /> <path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z" />
</svg> </svg>
</button> </button>
@@ -802,9 +816,7 @@
<path d="M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z" /> <path d="M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z" />
<path d="M19 10v2a7 7 0 0 1-14 0v-2M12 19v4M8 23h8" /> <path d="M19 10v2a7 7 0 0 1-14 0v-2M12 19v4M8 23h8" />
</svg> </svg>
<span id="recording-dot" <span id="recording-dot" class="recording-dot hidden"></span>
style="display:none; width:8px; height:8px; background:red; border-radius:50%; animation: pulse 1s infinite;">
</span>
</button> </button>
<button type="button" class="btn btn-primary" aria-label="Enviar" onclick="sendChat()"> <button type="button" class="btn btn-primary" aria-label="Enviar" onclick="sendChat()">
@@ -830,7 +842,7 @@
<div class="insights-placeholder"> <div class="insights-placeholder">
<div class="login-icon" role="img" aria-label="Gráfico de Insights">📊</div> <div class="login-icon" role="img" aria-label="Gráfico de Insights">📊</div>
<p>Aguardando dados estruturados...</p> <p>Aguardando dados estruturados...</p>
<small style="display:block; margin-top:0.5rem; opacity:0.6;">Peça algo como "status dos containers" para ver o refinamento aqui.</small> <small class="mt-2 opacity-60">Peça algo como "status dos containers" para ver o refinamento aqui.</small>
</div> </div>
</div> </div>
</div> </div>
@@ -895,9 +907,16 @@
updateThemeIcon(!isDark); updateThemeIcon(!isDark);
} }
function updateThemeIcon(isDark) { function updateThemeIcon(isLight) {
document.getElementById('icon-sun').style.display = isDark ? 'block' : 'none'; const sun = document.getElementById('icon-sun');
document.getElementById('icon-moon').style.display = isDark ? 'none' : 'block'; const moon = document.getElementById('icon-moon');
if (isLight) {
sun.classList.remove('hidden');
moon.classList.add('hidden');
} else {
sun.classList.add('hidden');
moon.classList.remove('hidden');
}
} }
const savedTheme = localStorage.getItem('theme'); const savedTheme = localStorage.getItem('theme');
@@ -1145,12 +1164,15 @@
function updateMicUI(active) { function updateMicUI(active) {
const dot = document.getElementById('recording-dot'); const dot = document.getElementById('recording-dot');
const icon = document.getElementById('mic-icon');
const btn = document.getElementById('audio-btn'); const btn = document.getElementById('audio-btn');
dot.style.display = active ? 'inline-block' : 'none'; if (active) {
icon.style.color = active ? 'red' : 'inherit'; dot.classList.remove('hidden');
btn.style.borderColor = active ? 'red' : 'var(--border)'; btn.classList.add('mic-active');
} else {
dot.classList.add('hidden');
btn.classList.remove('mic-active');
}
} }
async function uploadAudio(blob) { async function uploadAudio(blob) {