From 73fae4e294dd58a7331f7a869cc001005a78ba97 Mon Sep 17 00:00:00 2001 From: Marcos Date: Sun, 22 Mar 2026 10:23:02 -0300 Subject: [PATCH] Refactor: Remove inline styles and fix IDE warnings --- templates/index.html | 88 +++++++++++++++++++++++++++----------------- 1 file changed, 55 insertions(+), 33 deletions(-) diff --git a/templates/index.html b/templates/index.html index 4ab40d8..fd482b7 100644 --- a/templates/index.html +++ b/templates/index.html @@ -30,25 +30,16 @@ } /* Custom Scrollbar */ - ::-webkit-scrollbar { - width: 8px; + ::-webkit-scrollbar { width: 8px; } + ::-webkit-scrollbar-track { background: var(--bg-base); } + ::-webkit-scrollbar-thumb { + background: var(--border); + border-radius: 4px; + border: 2px solid var(--bg-base); } + ::-webkit-scrollbar-thumb:hover { background: var(--accent); } - ::-webkit-scrollbar-track { - background: var(--bg-base); - } - - ::-webkit-scrollbar-thumb { - background: var(--border); - border-radius: 4px; - border: 2px solid var(--bg-base); - } - - ::-webkit-scrollbar-thumb:hover { - background: var(--accent); - } - - /* Scrollbar Fix for Firefox */ + /* Scrollbar Fix for Firefox / Modern Browsers */ * { scrollbar-width: thin; scrollbar-color: var(--accent) transparent; @@ -650,6 +641,30 @@ font-size: 1.1rem; 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); } + } @@ -662,7 +677,7 @@ - @@ -680,12 +695,11 @@
Online
@@ -802,9 +816,7 @@ - +
@@ -895,9 +907,16 @@ updateThemeIcon(!isDark); } - function updateThemeIcon(isDark) { - document.getElementById('icon-sun').style.display = isDark ? 'block' : 'none'; - document.getElementById('icon-moon').style.display = isDark ? 'none' : 'block'; + function updateThemeIcon(isLight) { + const sun = document.getElementById('icon-sun'); + 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'); @@ -1145,12 +1164,15 @@ function updateMicUI(active) { const dot = document.getElementById('recording-dot'); - const icon = document.getElementById('mic-icon'); const btn = document.getElementById('audio-btn'); - dot.style.display = active ? 'inline-block' : 'none'; - icon.style.color = active ? 'red' : 'inherit'; - btn.style.borderColor = active ? 'red' : 'var(--border)'; + if (active) { + dot.classList.remove('hidden'); + btn.classList.add('mic-active'); + } else { + dot.classList.add('hidden'); + btn.classList.remove('mic-active'); + } } async function uploadAudio(blob) {