Spaces:
Running
Running
Update index.html
Browse files- index.html +10 -1
index.html
CHANGED
|
@@ -83,8 +83,13 @@
|
|
| 83 |
function tts(text,spk){
|
| 84 |
document.getElementById('textInput').value = text
|
| 85 |
document.getElementById('spks').value = spk
|
|
|
|
|
|
|
| 86 |
main()
|
| 87 |
}
|
|
|
|
|
|
|
|
|
|
| 88 |
window.onload = async function(){
|
| 89 |
document.getElementById('textInput').onchange = main;
|
| 90 |
document.getElementById('myButton').onclick = main;
|
|
@@ -218,7 +223,8 @@ Nice to meet you!
|
|
| 218 |
Good to see you!
|
| 219 |
`
|
| 220 |
const container = document.getElementById("buttons")
|
| 221 |
-
const words = word_text.trim().split("\n")
|
|
|
|
| 222 |
let number = 1
|
| 223 |
for (let word of words){
|
| 224 |
// ボタンを作成
|
|
@@ -239,6 +245,9 @@ Good to see you!
|
|
| 239 |
// ボタンとラベルをDOMに追加
|
| 240 |
container.appendChild(button);
|
| 241 |
number +=1
|
|
|
|
|
|
|
|
|
|
| 242 |
}
|
| 243 |
|
| 244 |
|
|
|
|
| 83 |
function tts(text,spk){
|
| 84 |
document.getElementById('textInput').value = text
|
| 85 |
document.getElementById('spks').value = spk
|
| 86 |
+
let formattedNumber = spk.toString().padStart(3, '0');
|
| 87 |
+
document.getElementById('spks_label').textContent = formattedNumber
|
| 88 |
main()
|
| 89 |
}
|
| 90 |
+
function shuffleArray(array) {
|
| 91 |
+
return array.slice().sort(() => Math.random() - 0.5);
|
| 92 |
+
}
|
| 93 |
window.onload = async function(){
|
| 94 |
document.getElementById('textInput').onchange = main;
|
| 95 |
document.getElementById('myButton').onclick = main;
|
|
|
|
| 223 |
Good to see you!
|
| 224 |
`
|
| 225 |
const container = document.getElementById("buttons")
|
| 226 |
+
const words = shuffleArray(word_text.trim().split("\n"))
|
| 227 |
+
|
| 228 |
let number = 1
|
| 229 |
for (let word of words){
|
| 230 |
// ボタンを作成
|
|
|
|
| 245 |
// ボタンとラベルをDOMに追加
|
| 246 |
container.appendChild(button);
|
| 247 |
number +=1
|
| 248 |
+
if (number>108){
|
| 249 |
+
break
|
| 250 |
+
}
|
| 251 |
}
|
| 252 |
|
| 253 |
|