update html

This commit is contained in:
Shuanglei Tao
2025-07-01 14:34:17 +08:00
parent 03721f342f
commit 0bcf338bc7
3 changed files with 8 additions and 10 deletions

View File

@@ -193,7 +193,6 @@
<span class="links">
<a href="https://github.com/tsl0922/EPD-nRF5">Github</a>
<a href="https://qm.qq.com/q/SckzhfDxuu">交流群</a>
<a href="https://m.tb.cn/h.6HyQcD7?tk=RQvUVjGecdm">支持项目</a>
<a href="?debug=true" id="debug-toggle">开发模式</a>
</span>
</div>

File diff suppressed because one or more lines are too long

View File

@@ -289,14 +289,12 @@ function intToHex(intIn) {
}
async function update_image() {
let image = new Image();;
const image_file = document.getElementById('image_file');
if (image_file.files.length > 0) {
const file = image_file.files[0];
image.src = URL.createObjectURL(file);
} else {
image.src = document.getElementById('demo-img').src;
}
if (image_file.files.length == 0) return;
let image = new Image();;
const file = image_file.files[0];
image.src = URL.createObjectURL(file);
image.onload = function(event) {
URL.revokeObjectURL(this.src);
@@ -361,8 +359,10 @@ document.body.onload = () => {
canvas = document.getElementById('canvas');
ctx = canvas.getContext("2d");
ctx.fillStyle = 'white';
ctx.fillRect(0, 0, canvas.width, canvas.height);
updateButtonStatus();
update_image();
filterDitheringOptions();
checkDebugMode();