Skip to content
Snippets Groups Projects
Commit 91c1d810 authored by Philipp Pospischil's avatar Philipp Pospischil
Browse files

fix: AnkiDroid compatibility with class instead of ID

parent e82d988e
No related branches found
No related tags found
No related merge requests found
import HanziWriter from "hanzi-writer" import HanziWriter from "hanzi-writer"
const kanji = document.getElementById("kanji").innerText for (const kanjiContainer of document.getElementsByClassName("kanji")) {
const kanjiText = kanjiContainer.textContent
const hanziWriterContainer = document.getElementById("kanji-animation") const hanziWriterContainer = document.createElement("div")
kanjiContainer.append(hanziWriterContainer)
HanziWriter.create(hanziWriterContainer, kanji).animateCharacter() HanziWriter.create(hanziWriterContainer, kanjiText).animateCharacter()
}
{{FrontSide}} {{FrontSide}}
<hr id="answer"><hr id="answer"><hr id="answer"><hr id="answer"> <hr id="answer">
<hr id="answer">
<hr id="answer">
<hr id="answer">
<div id="kanji">{{Back}}</div> <div class="kanji">{{Back}}</div>
<div id="kanji-animation"></div>
<script type="module"> <script type="module">
import "./animation.js" import "./animation.js"
</script> </script>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment