hackheld-web-flasher / index.html
S-Dreamer's picture
Add 3 files
a9d9140 verified
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>Hackheld Web Flasher</title>
<script src="https://cdn.tailwindcss.com"></script>
<style>
body {
background-color: #0d0d0d;
font-family: 'Courier New', Courier, monospace;
}
.log {
height: 300px;
overflow-y: auto;
background-color: #1a1a1a;
color: #00ff00;
padding: 1rem;
font-size: 0.85rem;
border: 1px solid #333;
white-space: pre-wrap;
}
.flash-pulse {
animation: pulse 1s infinite;
}
@keyframes pulse {
0% { opacity: 1; }
50% { opacity: 0.4; }
100% { opacity: 1; }
}
</style>
</head>
<body class="text-white">
<div class="container mx-auto p-6 max-w-2xl">
<h1 class="text-3xl font-bold mb-4 text-center text-green-400">Hackheld Web Flasher</h1>
<div class="flex justify-center mb-4 space-x-4">
<button id="startBtn" class="bg-green-600 hover:bg-green-700 text-white px-4 py-2 rounded">Start Flash</button>
<button id="stopBtn" class="bg-red-600 hover:bg-red-700 text-white px-4 py-2 rounded">Stop</button>
<button id="resetBtn" class="bg-gray-600 hover:bg-gray-700 text-white px-4 py-2 rounded">Reset</button>
</div>
<div class="log border mb-4" id="logBox">
[INFO] Hackheld Web Flasher v1.0 initialized.<br/>
[READY] Connect device and click Start Flash.
</div>
<div class="flex justify-center items-center">
<div id="statusLight" class="w-6 h-6 rounded-full bg-gray-400"></div>
<span id="statusText" class="ml-2 text-gray-400">Status: Idle</span>
</div>
</div>
<script>
const logBox = document.getElementById('logBox');
const startBtn = document.getElementById('startBtn');
const stopBtn = document.getElementById('stopBtn');
const resetBtn = document.getElementById('resetBtn');
const statusLight = document.getElementById('statusLight');
const statusText = document.getElementById('statusText');
let flashInterval = null;
let logCount = 0;
function appendLog(message) {
logBox.innerHTML += `\n[LOG] ${message}`;
logBox.scrollTop = logBox.scrollHeight;
}
function startFlash() {
if (flashInterval) return;
statusLight.classList.remove('bg-gray-400');
statusLight.classList.add('bg-green-500', 'flash-pulse');
statusText.textContent = 'Status: Flashing';
statusText.classList.remove('text-gray-400');
statusText.classList.add('text-green-400');
appendLog('Starting flash process...');
let step = 1;
flashInterval = setInterval(() => {
if (step <= 5) {
appendLog(`Flashing sector ${step}... OK`);
step++;
} else {
appendLog('Flashing complete. Device is now booting.');
stopFlash();
}
}, 1000);
}
function stopFlash() {
if (flashInterval) {
clearInterval(flashInterval);
flashInterval = null;
}
statusLight.classList.remove('bg-green-500', 'flash-pulse');
statusLight.classList.add('bg-red-500');
statusText.textContent = 'Status: Stopped';
statusText.classList.remove('text-green-400');
statusText.classList.add('text-red-400');
appendLog('Flashing stopped.');
}
function resetLog() {
logBox.innerHTML = '[INFO] Hackheld Web Flasher v1.0 initialized.\n[READY] Connect device and click Start Flash.';
stopFlash();
statusLight.classList.remove('bg-red-500');
statusLight.classList.add('bg-gray-400');
statusText.textContent = 'Status: Idle';
statusText.classList.remove('text-red-400');
statusText.classList.add('text-gray-400');
}
startBtn.addEventListener('click', startFlash);
stopBtn.addEventListener('click', stopFlash);
resetBtn.addEventListener('click', resetLog);
</script>
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-qwensite.hf.space/logo.svg" alt="qwensite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-qwensite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >QwenSite</a> - 🧬 <a href="https://enzostvs-qwensite.hf.space?remix=S-Dreamer/hackheld-web-flasher" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
</html>