67 lines
2.0 KiB
C
67 lines
2.0 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>
|
|
<div>
|
|
<label for="brightness">Brightness: </label>
|
|
<input type="range" id="brightness" min="0" max="100" value="100" onchange="updateBrightness()">
|
|
<span id="brightnessValue">100</span>
|
|
</div>
|
|
<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);
|
|
}
|
|
|
|
function updateBrightness() {
|
|
var brightness = document.getElementById("brightness").value;
|
|
document.getElementById("brightnessValue").innerText = brightness;
|
|
var xhr = new XMLHttpRequest();
|
|
xhr.open("POST", "/brightness", true);
|
|
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
|
|
xhr.send("value=" + brightness);
|
|
}
|
|
</script>
|
|
</body>
|
|
</html>
|
|
)rawliteral"; |