Antigravity Agent commited on
Commit
af67257
·
1 Parent(s): 362dca5

Final: Fix mobile scrolling and voice status logic

Browse files
Files changed (1) hide show
  1. script.js +19 -2
script.js CHANGED
@@ -124,11 +124,28 @@ class GenesisAUI {
124
  };
125
 
126
  this.recognition.onend = () => {
127
- this.stopListening();
 
 
128
  };
 
129
  } else {
130
  console.warn("Speech Recognition not supported in this browser.");
131
- this.statusText.innerText = "浏览器不支持语音识别";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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