Files
pti-ledy/index.h
T

52 lines
1.4 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;
}
textarea {
width: 80%;
height: 200px;
margin-top: 20px;
}
</style>
</head>
<body>
<h1>LED Panel Control</h1>
<button class="button" onclick="showSavedPixels()">Show Saved Pixels</button>
<button class="button" onclick="location.href='/upload-page'">Upload Image</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 showSavedPixels() {
var xhr = new XMLHttpRequest();
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>
)rawliteral";