This commit is contained in:
恍兮惚兮 2024-05-16 23:16:24 +08:00
parent f7ede00f4b
commit bd04bd443b
2 changed files with 12 additions and 12 deletions

View File

@ -2,25 +2,25 @@
<div id="audio">{{audio}}</div>
<div id="audio_sentence">{{audio_sentence}}</div>
</div>
<div class="centerdiv">
<div id="rubyword" class="ruby-div" onclick='playAudio("audio")'></div>
<div class="centerdiv" onclick='playAudio("audio")'>
<div class="ruby-div" id="word">{{ word }}</div>
<div id="rubyword" class="ruby-div"></div>
</div>
<script>
ruby = {{ rubytext }}
word = '{{ word }}'
html = ''
if (ruby.length) {
for (i = 0; i < ruby.length; i++) {
html += ruby[i]['orig'] + '<rt>' + ruby[i]['hira'] + '</rt>';
}
html = '<ruby>' + html + '</ruby>'
document.getElementById('rubyword').innerHTML = html
document.getElementById('word').classList.add("hide-style");
}
else {
html = word
document.getElementById('rubyword').classList.add("hide-style");
}
document.getElementById('rubyword').innerHTML = html
</script>

View File

@ -2,25 +2,25 @@
<div id="audio">{{audio}}</div>
<div id="audio_sentence">{{audio_sentence}}</div>
</div>
<div class="centerdiv">
<div id="rubyword" class="ruby-div" onclick='playAudio("audio")'></div>
<div class="centerdiv" onclick='playAudio("audio")'>
<div class="ruby-div" id="word">{{ word }}</div>
<div id="rubyword" class="ruby-div"></div>
</div>
<script>
ruby = {{ rubytext }}
word = '{{ word }}'
html = ''
if (ruby.length) {
for (i = 0; i < ruby.length; i++) {
html += ruby[i]['orig'] + '<rt>' + ruby[i]['hira'] + '</rt>';
}
html = '<ruby>' + html + '</ruby>'
document.getElementById('rubyword').innerHTML = html
document.getElementById('word').classList.add("hide-style");
}
else {
html = word
document.getElementById('rubyword').classList.add("hide-style");
}
document.getElementById('rubyword').innerHTML = html
</script>