-
Notifications
You must be signed in to change notification settings - Fork 979
Expand file tree
/
Copy pathindex.html
More file actions
98 lines (91 loc) · 2.69 KB
/
Copy pathindex.html
File metadata and controls
98 lines (91 loc) · 2.69 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>ESP8266 WiFi Repeater Installer</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<script type="module" src="https://unpkg.com/esp-web-tools@10/dist/web/install-button.js?module"></script>
<style>
body {
font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
line-height: 1.6;
text-align: center;
padding: 40px 20px;
background: #eceff1;
color: #37474f;
}
.card {
background: white;
max-width: 450px;
margin: auto;
padding: 40px;
border-radius: 15px;
box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}
h1 { margin-top: 0; color: #1a237e; }
p { color: #546e7a; margin-bottom: 30px; }
select {
padding: 12px;
width: 100%;
margin-bottom: 25px;
border-radius: 8px;
border: 2px solid #cfd8dc;
font-size: 16px;
background-color: #fafafa;
}
select:focus {
outline: none;
border-color: #3f51b5;
}
/* Style for the actual button inside the web component */
button[slot="activate"] {
background: #3f51b5;
color: white;
padding: 12px 24px;
border: none;
border-radius: 8px;
font-size: 16px;
font-weight: bold;
cursor: pointer;
transition: background 0.3s;
}
button[slot="activate"]:hover {
background: #303f9f;
}
.footer {
margin-top: 30px;
font-size: 12px;
color: #90a4ae;
}
</style>
</head>
<body>
<div class="card">
<h1>Firmware Flasher</h1>
<p>Install the ESP8266 WiFi Repeater firmware directly to your device via USB.</p>
<label for="variant-select" style="display:block; text-align:left; font-weight:bold; margin-bottom:5px;">
Select Variant:
</label>
<select id="variant-select">
<option value="manifest.json">Standard NAT Router Firmware</option>
<option value="manifest_repeater.json">WiFi Repeater Firmware</option>
</select>
<esp-web-install-button id="install-button" manifest="manifest.json">
<button slot="activate">Connect & Install</button>
</esp-web-install-button>
<div class="footer">
Make sure to use Google Chrome, Microsoft Edge, or Opera.<br>
Your browser must support WebUSB.
</div>
</div>
<script>
// Dynamic manifest switching logic
const selectEl = document.querySelector("#variant-select");
const installEl = document.querySelector("#install-button");
selectEl.addEventListener("change", () => {
installEl.setAttribute("manifest", selectEl.value);
console.log("Switched manifest to: " + selectEl.value);
});
</script>
</body>
</html>