Spaces:
Sleeping
Sleeping
Antigravity Agent commited on
Commit ·
af67257
1
Parent(s): 362dca5
Final: Fix mobile scrolling and voice status logic
Browse files
script.js
CHANGED
|
@@ -124,11 +124,28 @@ class GenesisAUI {
|
|
| 124 |
};
|
| 125 |
|
| 126 |
this.recognition.onend = () => {
|
| 127 |
-
this.
|
|
|
|
|
|
|
| 128 |
};
|
|
|
|
| 129 |
} else {
|
| 130 |
console.warn("Speech Recognition not supported in this browser.");
|
| 131 |
-
this.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 132 |
}
|
| 133 |
}
|
| 134 |
|
|
|
|
| 124 |
};
|
| 125 |
|
| 126 |
this.recognition.onend = () => {
|
| 127 |
+
this.isListening = false;
|
| 128 |
+
this.listenBtn.classList.remove('listening');
|
| 129 |
+
this.updateStatus();
|
| 130 |
};
|
| 131 |
+
this.speechSupported = true;
|
| 132 |
} else {
|
| 133 |
console.warn("Speech Recognition not supported in this browser.");
|
| 134 |
+
this.speechSupported = false;
|
| 135 |
+
this.statusText.innerText = "建议使用 Chrome/Safari 开启全息语音";
|
| 136 |
+
}
|
| 137 |
+
}
|
| 138 |
+
|
| 139 |
+
updateStatus(message) {
|
| 140 |
+
if (message) {
|
| 141 |
+
this.statusText.innerText = message;
|
| 142 |
+
return;
|
| 143 |
+
}
|
| 144 |
+
|
| 145 |
+
if (this.speechSupported) {
|
| 146 |
+
this.statusText.innerText = `${this.currentActor.name} 已就绪`;
|
| 147 |
+
} else {
|
| 148 |
+
this.statusText.innerText = "建议使用 Chrome/Safari 开启全息语音";
|
| 149 |
}
|
| 150 |
}
|
| 151 |
|