Universal Remote Code Finder //free\\ May 2026
<div class="info-msg" id="infoMessage"> 💡 Press <strong>POWER / VOL+ / MUTE</strong> after each code change.<br> If device responds → click <strong>SAVE WORKING CODE</strong>. </div> <footer> 🧠 Universal Code Finder • Simulates database of IR codes for testing </footer> </div>
.progress-fill background: linear-gradient(90deg, #3b82f6, #60a5fa); width: 0%; height: 100%; border-radius: 40px; transition: width 0.2s ease; universal remote code finder
// Current state let currentBrand = "samsung"; // default let currentCodeList = [...codeDatabase.samsung]; let currentIndex = 0; // index in currentCodeList let currentCode = currentCodeList[0] || "----"; // Auto-find state let autoFindInterval = null; let isAutoFinding = false; // saved working code storage let savedWorkingCode = null; // DOM elements const currentCodeDisplay = document.getElementById("currentCodeDisplay"); const progressFill = document.getElementById("progressFill"); const codeCounterSpan = document.getElementById("codeCounter"); const brandContainer = document.getElementById("brandButtonsContainer"); const powerBtn = document.getElementById("powerBtn"); const volUpBtn = document.getElementById("volUpBtn"); const muteBtn = document.getElementById("muteBtn"); const nextCodeBtn = document.getElementById("nextCodeBtn"); const autoFindBtn = document.getElementById("autoFindBtn"); const saveCodeBtn = document.getElementById("saveCodeBtn"); const infoMsgDiv = document.getElementById("infoMessage"); // Helper: update UI with current code & progress function updateUI() if (!currentCodeList.length) currentCodeDisplay.textContent = "----"; progressFill.style.width = "0%"; codeCounterSpan.textContent = `code 0 / 0`; return; currentCode = currentCodeList[currentIndex]; currentCodeDisplay.textContent = currentCode; const progressPercent = ((currentIndex + 1) / currentCodeList.length) * 100; progressFill.style.width = `$progressPercent%`; codeCounterSpan.textContent = `code $currentIndex+1 / $currentCodeList.length`; // Switch brand: reset index, update code list, stop auto-find, refresh UI function setBrand(brandKey) if (autoFindInterval) stopAutoFind(); currentBrand = brandKey; // fetch code list, fallback to empty array currentCodeList = codeDatabase[brandKey] ? [...codeDatabase[brandKey]] : []; if (currentCodeList.length === 0) // fallback: generate dummy codes (should not happen) currentCodeList = ["0000", "0001"]; currentIndex = 0; updateUI(); // reset saved working code hint savedWorkingCode = null; showTemporaryMessage(`🔁 Switched to $brandDisplayNames[brandKey]. Starting from first code.`, false); // Highlight active brand button document.querySelectorAll('.brand-btn').forEach(btn => if(btn.dataset.brand === brandKey) btn.classList.add('active'); else btn.classList.remove('active'); ); // Move to next code (manual) function nextCode() if (autoFindInterval) stopAutoFind(); if (!currentCodeList.length) return; currentIndex = (currentIndex + 1) % currentCodeList.length; updateUI(); playBeepSimulation(); showTemporaryMessage(`➡️ Testing code $currentCode — Press POWER/VOL+ to check response`, true); // Auto-find: iterate codes every 1.2 seconds function startAutoFind() if (autoFindInterval) stopAutoFind(); if (!currentCodeList.length) showTemporaryMessage("⚠️ No codes available for this brand.", false); return; isAutoFinding = true; autoFindBtn.textContent = "⏸️ STOP"; autoFindBtn.style.background = "#c2410c"; showTemporaryMessage("🔎 AUTO-FIND ACTIVE: cycling codes every 1.2s. Press POWER/VOL+ on remote to test. Click STOP when device responds.", false); autoFindInterval = setInterval(() => // cycle to next code if (currentCodeList.length) currentIndex = (currentIndex + 1) % currentCodeList.length; updateUI(); // subtle visual flash currentCodeDisplay.style.transform = "scale(1.02)"; setTimeout(() => if(currentCodeDisplay) currentCodeDisplay.style.transform = ""; , 150); , 1200); function stopAutoFind() if (autoFindInterval) clearInterval(autoFindInterval); autoFindInterval = null; isAutoFinding = false; autoFindBtn.textContent = "🔄 AUTO-FIND"; autoFindBtn.style.background = ""; showTemporaryMessage("⏹️ Auto-find stopped. You can manually test codes.", true); // toggle auto-find function toggleAutoFind() if (isAutoFinding) stopAutoFind(); else startAutoFind(); // Simulate sending IR command (just UI feedback) function sendIRCommand(commandName) currentCode === "----") showTemporaryMessage(`❌ No valid code selected. Please pick a brand first.`, false); return false; // Visual feedback: button flash const activeMsg = `📡 Sending $commandName via code $currentCode ...`; showTemporaryMessage(activeMsg, true); // ADDITIONAL: Simulate device response probability (for fun/demo only) // In a real remote, you would test physical device. But we add a "fake" easter egg: // If saved working code exists and it matches current code, we give positive reinforcement. if (savedWorkingCode === currentCode) showTemporaryMessage(`✅ MATCH! Device SHOULD respond (working code $currentCode saved).`, false); else if (savedWorkingCode) showTemporaryMessage(`⚠️ Current code $currentCode differs from your saved working code. Try next codes.`, true); else // just a reminder if (Math.random() < 0.15) // playful hint but not misleading showTemporaryMessage(`💡 Tip: Keep pressing NEXT CODE until device reacts.`, true); return true; // Save current code as working code function saveWorkingCode() if (!currentCode // Helper to show transient message in info box without overwriting permanently let msgTimeout = null; function showTemporaryMessage(message, keepInstructionStyle = false) if (msgTimeout) clearTimeout(msgTimeout); const originalHTML = infoMsgDiv.innerHTML; infoMsgDiv.style.transition = "0.1s"; infoMsgDiv.innerHTML = `<span>✨ $message</span>`; if (!keepInstructionStyle) // but we will revert after delay msgTimeout = setTimeout(() => if (infoMsgDiv) if (savedWorkingCode) infoMsgDiv.innerHTML = `✅ WORKING CODE: $savedWorkingCode ($brandDisplayNames[currentBrand]) — Use POWER to confirm.`; else infoMsgDiv.innerHTML = `💡 Press <strong>POWER / VOL+ / MUTE</strong> after each code change.<br> If device responds → click <strong>SAVE WORKING CODE</strong>.`; , 2800); // Simulate beep-like subtle feedback on next code function playBeepSimulation() // just a visual flick on the code display currentCodeDisplay.style.opacity = "0.6"; setTimeout(() => if(currentCodeDisplay) currentCodeDisplay.style.opacity = "1"; , 80); // Reset to initial state when brand changes via buttons function buildBrandButtons() brandContainer.innerHTML = ""; brandList.forEach(brandKey => const btn = document.createElement("button"); btn.className = "brand-btn"; if (brandKey === currentBrand) btn.classList.add("active"); btn.textContent = brandDisplayNames[brandKey]; btn.dataset.brand = brandKey; btn.addEventListener("click", () => if (isAutoFinding) stopAutoFind(); setBrand(brandKey); ); brandContainer.appendChild(btn); ); // Additional button to reset message if needed function refreshMessageDefault() if (!msgTimeout) if (savedWorkingCode) infoMsgDiv.innerHTML = `✅ WORKING CODE: $savedWorkingCode ($brandDisplayNames[currentBrand]) — Use POWER to confirm.`; else infoMsgDiv.innerHTML = `💡 Press <strong>POWER / VOL+ / MUTE</strong> after each code change.<br> If device responds → click <strong>SAVE WORKING CODE</strong>.`; // Event listeners powerBtn.addEventListener("click", () => sendIRCommand("POWER"); refreshMessageDefault(); ); volUpBtn.addEventListener("click", () => sendIRCommand("VOL+"); refreshMessageDefault(); ); muteBtn.addEventListener("click", () => sendIRCommand("MUTE"); refreshMessageDefault(); ); nextCodeBtn.addEventListener("click", () => nextCode(); refreshMessageDefault(); ); autoFindBtn.addEventListener("click", () => toggleAutoFind(); refreshMessageDefault(); ); saveCodeBtn.addEventListener("click", () => saveWorkingCode(); refreshMessageDefault(); ); // initial load buildBrandButtons(); // set default samsung codes setBrand("samsung"); refreshMessageDefault(); // Additional guard: if brand list somehow empty, reload window.addEventListener("load", () => if (currentCodeList.length) updateUI(); showTemporaryMessage("🔌 Ready: select brand, test codes with POWER button.", true); setTimeout(() => refreshMessageDefault(), 2000); ); </script> </body> </html> Starting from first code
// List of brands (order as shown) const brandList = ["samsung", "lg", "sony", "hisense", "toshiba", "panasonic", "sharp", "vizio"]; // Display names mapping const brandDisplayNames = samsung: "Samsung", lg: "LG", sony: "Sony", hisense: "Hisense", toshiba: "Toshiba", panasonic: "Panasonic", sharp: "Sharp", vizio: "Vizio" ; You can manually test codes
.sub color: #8e9ab3; font-size: 0.8rem; margin-bottom: 1.5rem; border-left: 3px solid #3b82f6; padding-left: 10px; margin-top: 4px;
.remote-btn:active transform: translateY(2px); box-shadow: 0 2px 0 #0a0e14;
body background: linear-gradient(145deg, #101418 0%, #1a1f2c 100%); font-family: 'Segoe UI', 'Roboto', 'Inter', system-ui, -apple-system, sans-serif; display: flex; justify-content: center; align-items: center; min-height: 100vh; margin: 0; padding: 20px;