Cat-Printer/www/custom-print.html
2021-09-08 16:51:48 +08:00

92 lines
3.3 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Custom Print</title>
<link rel="stylesheet" href="main.css" />
<link rel="stylesheet" href="skin.css" />
</head>
<body>
<main>
<p id="notice" style="height: 2em; border: 1px dotted gray;">
<noscript>Javascript should be enabled</noscript>
</p>
<h2>Custom Print</h2>
<p>
<input style="display: none;" type="text" id="bt_mac" value="" />
<span>Select device:</span><select id="device_selection"></select><button id="refresh_device">Refresh</button>
</p>
<p>
<span>
<span>Operate directly on the box canvas</span>
<button id="preview_button">Preview</button>
<button id="print_button">Print</button>
<br />
<span>Canvas Height:</span>
<input type="number" value="400" min="0" max="114514" step="50" id="canvas_height" />
<br />
<span>Threshold:</span>
<input type="range" min="0" max="2.0" step="0.05" value="0.6" id="filter_threshold" />
</span>
<br />
<span>
<span>Insert:</span>
<button id="action_insert_text">Text</button>
<button id="action_insert_image">Image</button>
<button id="action_insert_qr">QRCode</button>
<br />
<span>Action:</span>
<button id="action_make_bold">Bold</button>
<button id="action_make_italic">Italic</button>
<button id="action_make_underline">Underline</button>
<button id="action_switch_paint">Switch Paint</button>
<button id="action_delete">Delete</button>
</span>
</p>
<div style="margin: auto; width: 386px;">
<canvas id="work_canvas" style="border: 1px solid currentColor; width: 384px; min-height: 3em;" width="384" height="384"></canvas>
</div>
<p>
<span>Preview</span><br />
<canvas id="image_preview" style="width: 384px;" width="384" height="0"></canvas>
</p>
</main>
<textarea id="i18-N" style="display: none;">
[zh-CN]
Custom Print=自定义打印
Javascript should be enabled=需启用 Javascript
Select device:=选择设备:
Refresh=刷新
Operate directly on the box canvas=直接在框内画布操作
Preview=预览
Print=打印
Threshold:=阈值:
Please select a device=请选择一个设备
Printing, please wait.=打印中,请稍候。
Please preview image first=请先预览图像
Searching devices. Please wait for 5 seconds.=正在查找设备。请等候 5 秒。
OK=完成
Insert:=插入:
Text=文本
Image=图像
QRCode=二维码
Double click to edit=双击以修改
Action:=操作:
Bold=粗体
Italic=斜体
Underline=下划线
Delete=删除
Switch Paint=切换绘画
Canvas Height:=画布高度:
Content of QRCode:=二维码的内容:
</textarea>
<script src="i18n.js"></script>
<script src="qrcode.min.js"></script>
<script src="fabric.min.js"></script>
<script src="main.js"></script>
<script src="custom-print.js"></script>
</body>
</html>