diff options
author | lonkaars <loek@pipeframe.xyz> | 2023-01-20 23:02:31 +0100 |
---|---|---|
committer | lonkaars <loek@pipeframe.xyz> | 2023-01-20 23:02:31 +0100 |
commit | d55da1c130a1bc6087f28644608f5837847b7b75 (patch) | |
tree | e20cfb6662397a89f7afa2e1d26035f5cdb606ec | |
parent | f6680b19af0ec0caffc579a003d3d52b1c042a9f (diff) |
fix note1.3.0
-rw-r--r-- | anki-card-template/card.css | 19 | ||||
-rw-r--r-- | anki-card-template/card.js | 6 |
2 files changed, 14 insertions, 11 deletions
diff --git a/anki-card-template/card.css b/anki-card-template/card.css index 0f76b82..35c99ec 100644 --- a/anki-card-template/card.css +++ b/anki-card-template/card.css @@ -184,17 +184,20 @@ body { .mobile #card.vertical-layout #back #target-word-reading .reading .syllable { white-space: nowrap; } /* word note style */ -#card #target-word-reading { - display: inline-block; - position: relative; -} -.mobile #card #target-word-reading .note { left: 0.5em; } +#card #target-word-reading .kanji { position: relative; } #card #target-word-reading .note { position: absolute; - left: 1em; - top: 50%; - transform: translate(-100%, -50%); font-style: italic; opacity: 50%; font-size: 0.75em; } +#card #target-word-reading .note { + left: -0.25em; + top: 50%; + transform: translate(-100%, -50%); +} +.mobile #card.vertical-layout #target-word-reading .note { + top: -0.25em; + left: 50%; + transform: translate(-50%, -100%); +} diff --git a/anki-card-template/card.js b/anki-card-template/card.js index 7e44b2e..18c8cb9 100644 --- a/anki-card-template/card.js +++ b/anki-card-template/card.js @@ -55,6 +55,9 @@ HTMLElement.prototype.parse = function() { if (this.classList.contains("parse-brackets")) { if (i == 0) { + // start kanji reading + out += `<span class="kanji">`; + var match = input.match(/\((.+?)\)/); // display "(note)" before kanji if (match) { @@ -62,9 +65,6 @@ HTMLElement.prototype.parse = function() { note_head = match.index; note_tail = note_head + match[0].length; } - // start kanji reading - out += `<span class="kanji">`; - continue; } // ignore note if parsed if (i == note_head) { i += note_tail - 1; continue; } |