46 lines
1.2 KiB
C
46 lines
1.2 KiB
C
const char index_html[] PROGMEM = R"rawliteral(
|
|
<!DOCTYPE HTML><html>
|
|
<head>
|
|
<title>LED Panel Control</title>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<style>
|
|
body { font-family: Arial; text-align: center; margin:0px auto; padding-top: 30px;}
|
|
.button {
|
|
background-color: #4CAF50;
|
|
color: white;
|
|
padding: 10px 20px;
|
|
text-align: center;
|
|
text-decoration: none;
|
|
display: inline-block;
|
|
font-size: 16px;
|
|
margin: 4px 2px;
|
|
cursor: pointer;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<h1>LED Panel Control</h1>
|
|
<input type="file" id="imageFile" accept=".json">
|
|
<button class="button" onclick="uploadImage()">Upload Image</button>
|
|
<script>
|
|
function uploadImage() {
|
|
var file = document.getElementById('imageFile').files[0];
|
|
if (!file) {
|
|
alert("Please select a file!");
|
|
return;
|
|
}
|
|
var reader = new FileReader();
|
|
reader.onload = function(e) {
|
|
var contents = e.target.result;
|
|
var xhr = new XMLHttpRequest();
|
|
xhr.open("POST", "/upload", true);
|
|
xhr.setRequestHeader("Content-Type", "application/json");
|
|
xhr.send(contents);
|
|
};
|
|
reader.readAsText(file);
|
|
}
|
|
</script>
|
|
</body>
|
|
</html>
|
|
)rawliteral";
|