30 lines
909 B
JavaScript
30 lines
909 B
JavaScript
export function createPanel() {
|
|
const panel = document.createElement("div");
|
|
panel.style.cssText = `
|
|
position: fixed;
|
|
bottom: 24px;
|
|
right: 24px;
|
|
z-index: 999999;
|
|
background: white;
|
|
border-radius: 10px;
|
|
box-shadow: 0 4px 12px rgba(0,0,0,.15);
|
|
padding: 10px;
|
|
width: 220px;
|
|
font-size: 14px;
|
|
`;
|
|
panel.innerHTML = `
|
|
<div style="display:flex;gap:6px;">
|
|
<input id="voiceTextInput" placeholder="输入指令,如:添加设备"
|
|
style="flex:1;padding:6px;border:1px solid #dcdfe6;border-radius:4px;" />
|
|
<button id="voiceBtn"
|
|
style="padding:6px 10px;border:none;border-radius:4px;background:#409eff;color:#fff;cursor:pointer;">
|
|
🎤
|
|
</button>
|
|
</div>
|
|
<div style="margin-top:6px;color:#999;font-size:12px;">
|
|
支持语音 / 回车文字指令
|
|
</div>
|
|
`;
|
|
document.body.appendChild(panel);
|
|
return panel;
|
|
} |