|
1 | 1 | //An array for storing web pages |
2 | 2 |
|
3 | | - |
4 | | - |
5 | 3 | const char index_html[] PROGMEM = R"rawliteral( |
6 | 4 | <!DOCTYPE HTML> |
7 | 5 | <html> |
@@ -30,20 +28,20 @@ const char index_html[] PROGMEM = R"rawliteral( |
30 | 28 | // document.getElementById("inputFileAgent").value = document.getElementById("avatar").value; |
31 | 29 | var filePath = file.value; |
32 | 30 | if (filePath) { |
33 | | - var filePic = file.files[0]; //选择的文件内容--图片 |
34 | | - var fileType = filePath.slice(filePath.indexOf(".")); //选择文件的格式 |
35 | | - var fileSize = file.files[0].size; //选择文件的大 |
| 31 | + var filePic = file.files[0]; //Selected file content - images |
| 32 | + var fileType = filePath.slice(filePath.indexOf(".")); //Choose the format of the file |
| 33 | + var fileSize = file.files[0].size; //Choose the size of the file |
36 | 34 | var reader = new FileReader(); |
37 | 35 | reader.readAsDataURL(filePic); |
38 | 36 | reader.onload = function (e) { |
39 | 37 | var data = e.target.result; |
40 | | - //加载图片获取图片真实宽度和高度 |
| 38 | + //Load image to obtain the true width and height of the image |
41 | 39 | var image = new Image(); |
42 | 40 | image.onload = function () { |
43 | 41 | var width = image.width; |
44 | 42 | var height = image.height; |
45 | | - if (width == 255 || height == 122) { //判断文件像素 |
46 | | - //上传图片 |
| 43 | + if (width == 255 || height == 122) { //Determine file pixels |
| 44 | + //upload pictures |
47 | 45 | document.getElementById("inputFileAgent").value = document.getElementById("avatar").value; |
48 | 46 | bmpToXbm(255); |
49 | 47 | } else { |
@@ -146,7 +144,7 @@ const char index_html[] PROGMEM = R"rawliteral( |
146 | 144 | document.getElementById("dht").innerHTML = this.responseText; |
147 | 145 | } |
148 | 146 | }; |
149 | | - // 使用GET的方式请求 /dht |
| 147 | + // Request using GET /dht |
150 | 148 | xhttp.open("GET", "/dht", true); |
151 | 149 | xhttp.send(); |
152 | 150 | }, 1000) |
|
0 commit comments