images can be send but are not drawn correctly
This commit is contained in:
@@ -16,17 +16,35 @@ const char index_html[] PROGMEM = R"rawliteral(
|
||||
margin: 4px 2px;
|
||||
cursor: pointer;
|
||||
}
|
||||
textarea {
|
||||
width: 80%;
|
||||
height: 200px;
|
||||
margin-top: 20px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h1>LED Panel Control</h1>
|
||||
<button class="button" onclick="showPixels()">Show Pixels</button>
|
||||
<button class="button" onclick="showSavedPixels()">Show Saved Pixels</button>
|
||||
<br>
|
||||
<textarea id="jsonInput" placeholder="Paste your JSON image data here..."></textarea>
|
||||
<br>
|
||||
<button class="button" onclick="uploadAndDraw()">Upload and Draw</button>
|
||||
|
||||
<script>
|
||||
function showPixels() {
|
||||
function showSavedPixels() {
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.open("GET", "/show", true);
|
||||
xhr.open("GET", "/show-saved", true);
|
||||
xhr.send();
|
||||
}
|
||||
|
||||
function uploadAndDraw() {
|
||||
var jsonData = document.getElementById("jsonInput").value;
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.open("POST", "/upload", true);
|
||||
xhr.setRequestHeader("Content-Type", "application/json");
|
||||
xhr.send(jsonData);
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user