File size: 4,690 Bytes
a9d9140
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
<!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>