Compare commits

..

2 Commits

Author SHA1 Message Date
3f20df7571 Fix ping pong scroll logic 2024-11-05 19:39:55 +01:00
fd3c54d517 Make password entry page pretty 2024-11-05 19:37:32 +01:00
2 changed files with 2 additions and 11 deletions

View File

@ -328,15 +328,6 @@ void netman::handleRemove() {
// Add SSID to config and save
void netman::handleSelect() {
String ssid = server->arg("ssid");
// Display prompt for password if network is secured
String selectPage = "<!DOCTYPE html><html lang='en'><head><title>Connect to " + ssid + "</title></head><body>";
selectPage += "<h2>Connect to " + ssid + "</h2>";
selectPage += "<form action='/add' method='get'>";
selectPage += "<input type='hidden' name='ssid' value='" + ssid + "'>";
selectPage += "<label>Password:</label><input type='password' name='pass'><br><br>";
selectPage += "<button type='submit'>Connect</button>";
selectPage += "</form></body></html>";
String selectPage = "<!DOCTYPE html><html lang='en'><head><meta charset='UTF-8'><meta name='viewport' content='width=device-width, initial-scale=1.0'><title>Connect to " + ssid + "</title><style>body{font-family:Arial,sans-serif;background-color:#f4f4f9;color:#333;display:flex;align-items:center;justify-content:center;height:100vh;margin:0}.container{width:100%;max-width:300px;padding:20px;background:#fff;border-radius:10px;box-shadow:0 4px 8px rgba(0,0,0,0.2);box-sizing:border-box}h2{margin-top:0;text-align:center;color:#0073e6}label{display:block;margin-bottom:5px;font-weight:bold}input[type='password']{width:100%;padding:8px;margin-bottom:15px;border:1px solid #ccc;border-radius:4px;box-sizing:border-box}button{width:100%;padding:10px;background-color:#0073e6;color:white;border:none;border-radius:4px;cursor:pointer;font-size:16px}button:hover{background-color:#005bb5}</style></head><body><div class='container'><h2>Connect to " + ssid + "</h2><form action='/add' method='get'><input type='hidden' name='ssid' value='" + ssid + "'><label for='pass'>Password:</label><input id='pass' type='password' name='pass' placeholder='Enter Password'><button type='submit'>Connect</button></form></div></body></html>";
server->send(200, "text/html", selectPage);
}

View File

@ -138,7 +138,7 @@ bool fetchPrintingStatus(Adafruit_SSD1306& display) {
display.fillRect(0, 26, displayWidth, 11, BLACK);
// Check if its time to scroll based on the delay
if(fileNameWidth > 22) {
if(fileNameWidth > displayWidth) {
if (millis() - lastScrollTime > scrollDelay) {
// Update scroll position based on the current direction
scrollPos += scrollDirection;