<commit_before>#include <ESP8266WiFi.h>
#include <WiFiClient.h>
#include <ESP8266WebServer.h>
#include <EEPROM.h>
 
ESP8266WebServer server(80);
const int led = 2;

const char page[] PROGMEM = R"~(
<!DOCTYPE html>
<meta name="viewport" content="width=device-width, initial-scale=1">
<html>
<head>
<title>Logobot Blue</title>
<style>
body, button,input {font-family:sans-serif; font-size: 22px;}
body {
    padding: 5% 5%;
}
a, button {
    display:inline-block;
    width:45%;
    background-color:#337ab7;
    text-align:center;
    border:1px solid #2e6da4;
    border-radius:4px;
    text-decoration:none;
    color:#fff;
    vertical-align:middle;
    padding: 12px 0;
}
a+a, button+button {
    margin-left:5%;
}
a:hover, button:hover {
    background-color:#23527c;
}
input {
    display:inline-block;
    width: 30%;
    margin-bottom:12px;
}
.header-fixed {
    width:100%;
    position:fixed;
    top:0px;
    left:0px;
    background-color:#337ab7;
    color:#fff;
    padding: 5px;
}
.content {
    padding-top: 10px;
    text-align: center;
}
.button30 {
    width: 28%;
}
</style>
</head>
<body>
<div class="header-fixed">Logobot: <span id="state">ready!</span></div>

<div class="content">

<button onclick="l('BK', elv('dist'));">Backward</button>
<button onclick="l('FD', elv('dist'));">Forward</button><br />
Dist: <input type="number" id="dist" value="20" /> Ang: <input type="number" id="angle" value="90" /><br />
<button onclick="l('LT', elv('angle'));">Left</button>
<button onclick="l('RT', elv('angle'));">Right</button><br />
<hr />

<button onclick="l('PU');">Pen Up</button>
<button onclick="l('PD');">Pen Down</button>
<hr />

<button class="button30" onclick="l('ST');">Stop</button>
<button class="button30" onclick="l('BZ', 500);">Horn</button>
<button class="button30" onclick="l('SE');">E-Stop!</button>
<hr/>

<button onclick="l('TO', elv('x'), elv('y'));">Move To</button>
X:<input style="width: 40px" type="number" id="x" value="0"/>
Y:<input style="width: 40px" type="number" id="y" value="0"/>
<hr />


<button onclick="l('WT', elv('txt'));">Write text</button>
&nbsp;
<input type="text" id="txt" />
</div>

<script type="text/javascript">
    function el(id) { return document.getElementById(id); }
    function elv(id) { return el(id).value; }
    function l(cmd, p1, p2) {
        var xhReq = new XMLHttpRequest();
        var uri = '/cmd?action=' + cmd;
        if (p1) { uri += '&p1=' + p1; }
        if (p2) { uri += '&p2=' + p2; }
        xhReq.open('GET', uri, true);
  try {
          xhReq.send();
          xhReq.onload = function () {
            el('state').innerText = cmd + ': ' + this.responseText;
          }
  } catch(ex) {
    el('state').innerText = 'send error';
  }
    };
</script>
</body>
</html>

)~";

void handleRoot() {
  digitalWrite(led, 1);
  server.send(200, F("text/html"), page);<commit_msg>Minor web page enhancements post testing.<commit_after>#include <ESP8266WiFi.h>
#include <WiFiClient.h>
#include <ESP8266WebServer.h>
#include <EEPROM.h>
 
ESP8266WebServer server(80);
const int led = 2;

const char page[] PROGMEM = R"~(
<!DOCTYPE html>
<meta name="viewport" content="width=device-width, initial-scale=1">
<html>
<head>
<title>Logobot Blue</title>
<style>
body, button,input {font-family:sans-serif; font-size: 22px;}
body {
    padding: 5% 5%;
}
a, button {
    display:inline-block;
    width:45%;
    background-color:#337ab7;
    text-align:center;
    border:1px solid #2e6da4;
    border-radius:4px;
    text-decoration:none;
    color:#fff;
    vertical-align:middle;
    padding: 12px 0;
}
a+a, button+button {
    margin-left:5%;
}
a:hover, button:hover {
    background-color:#23527c;
}
input {
    display:inline-block;
    width: 30%;
    margin-bottom:12px;
}
.header-fixed {
    width:100%;
    position:fixed;
    top:0px;
    left:0px;
    background-color:#337ab7;
    color:#fff;
    padding: 5px;
}
.content {
    padding-top: 15px;
    text-align: center;
}
.button30 {
    width: 28%;
}
</style>
</head>
<body>
<div class="header-fixed">Logobot: <span id="state">ready!</span></div>

<div class="content">

<button onclick="l('BK', elv('dist'));">Backward</button>
<button onclick="l('FD', elv('dist'));">Forward</button><br />
Dist: <input type="number" id="dist" value="20" /> <br />
Ang: <input type="number" id="angle" value="90" /><br />
<button onclick="l('LT', elv('angle'));">Left</button>
<button onclick="l('RT', elv('angle'));">Right</button><br />
<hr />

<button onclick="l('PU');">Pen Up</button>
<button onclick="l('PD');">Pen Down</button>
<hr />

<button class="button30" onclick="l('ST');">Stop</button>
<button class="button30" onclick="l('BZ', 500);">Horn</button>
<button class="button30" onclick="l('SE');">E-Stop!</button>
<hr/>

X:<input style="width: 40px" type="number" id="x" value="0"/>
Y:<input style="width: 40px" type="number" id="y" value="0"/>
<br />
<button onclick="l('TO', elv('x'), elv('y'));">Move To</button>
<hr />


<button onclick="l('WT', elv('txt'));">Write text</button>
&nbsp;
<input type="text" id="txt" />
</div>

<script type="text/javascript">
    function el(id) { return document.getElementById(id); }
    function elv(id) { return el(id).value; }
    function l(cmd, p1, p2) {
        var xhReq = new XMLHttpRequest();
        var uri = '/cmd?action=' + cmd;
        if (p1) { uri += '&p1=' + p1; }
        if (p2) { uri += '&p2=' + p2; }
        xhReq.open('GET', uri, true);
  try {
          xhReq.send();
          xhReq.onload = function () {
            el('state').innerText = this.responseText;
          }
  } catch(ex) {
    el('state').innerText = 'send error';
  }
    };
</script>
</body>
</html>

)~";

void handleRoot() {
  digitalWrite(led, 1);
  server.send(200, F("text/html"), page);
{'fraction_non_alphanumeric': 0.21990620114643042, 'fraction_numerical': 0.03161368768455793, 'mean_word_length': 3.963793103448276, 'pattern_counts': {'":': 0, '<': 121, '<?xml version=': 0, '>': 121, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6340144', 'n_tokens_mistral': 2292, 'n_tokens_neox': 2151, 'n_words': 439}