From 29e566ee59ce5a204ea0f5dbfb5e27ef2f944d80 Mon Sep 17 00:00:00 2001 From: Ren Tatsumoto Date: Sat, 15 Oct 2022 00:22:13 +0300 Subject: [PATCH] update jp sentences template --- .../Japanese sentences/Recognition/back.html | 35 +++++---- .../Japanese sentences/Recognition/front.html | 4 +- templates/Japanese sentences/template.css | 73 ++++++++++++++----- 3 files changed, 78 insertions(+), 34 deletions(-) diff --git a/templates/Japanese sentences/Recognition/back.html b/templates/Japanese sentences/Recognition/back.html index 3b4c485..49c95a1 100644 --- a/templates/Japanese sentences/Recognition/back.html +++ b/templates/Japanese sentences/Recognition/back.html @@ -3,8 +3,8 @@
- {{edit:furigana:SentFurigana}} - {{^SentFurigana}}{{edit:furigana:SentKanji}}{{/SentFurigana}} +
{{furigana:SentFurigana}}{{^SentFurigana}}{{furigana:SentKanji}}{{/SentFurigana}}
+
{{edit:furigana:SentFurigana}}{{^SentFurigana}}{{edit:furigana:SentKanji}}{{/SentFurigana}}
{{#SentEng}}
{{hint:SentEng}}
@@ -12,35 +12,39 @@
- {{VocabAudio}}{{SentAudio}}{{VocabPitchPattern}} - {{^VocabPitchPattern}}{{text:kana:VocabFurigana}}{{/VocabPitchPattern}} - {{#VocabPitchNum}}{{VocabPitchNum}}{{/VocabPitchNum}} - {{#VocabKanji}}【{{text:kanji:VocabKanji}}】{{/VocabKanji}} + {{VocabAudio}}{{SentAudio}} +
{{VocabPitchPattern}}{{^VocabPitchPattern}}{{text:kana:VocabFurigana}}{{/VocabPitchPattern}}
+ {{#VocabPitchNum}}{{text:VocabPitchNum}}{{/VocabPitchNum}} + {{#VocabKanji}}
{{text:kanji:VocabKanji}}
{{/VocabKanji}}
{{#VocabDef}}
{{edit:furigana:VocabDef}}
{{/VocabDef}} + {{#Notes}}
Notes
{{furigana:Notes}}
{{/Notes}} + {{#Image}}
{{Image}}
{{/Image}} -
+
@@ -51,6 +55,7 @@ elem.innerText = "Reveal English translation"; } } + function removePitchBrackets() { const tags = document.getElementById("pitchnum"); if (tags !== null) { @@ -60,4 +65,4 @@ markPitch(); removePitchBrackets(); tweak_reveal_text(); - \ No newline at end of file + diff --git a/templates/Japanese sentences/Recognition/front.html b/templates/Japanese sentences/Recognition/front.html index 34bc51b..2b9ab94 100644 --- a/templates/Japanese sentences/Recognition/front.html +++ b/templates/Japanese sentences/Recognition/front.html @@ -1,6 +1,6 @@
diff --git a/templates/Japanese sentences/template.css b/templates/Japanese sentences/template.css index 5019d7a..2906064 100644 --- a/templates/Japanese sentences/template.css +++ b/templates/Japanese sentences/template.css @@ -19,7 +19,8 @@ font-weight: 600; } - b, strong { + b, + strong { font-weight: 600; } } @@ -33,8 +34,7 @@ .card { background-color: #fffaf0; color: #2a1b0a; - font-family: "Noto Serif", "Noto Serif CJK JP", Yu Mincho, "Liberation Serif", "Times New Roman", Times, Georgia, - Serif; + font-family: "Noto Serif", "Noto Serif CJK JP", Yu Mincho, "Liberation Serif", "Times New Roman", Times, Georgia, Serif; font-size: 24px; text-align: left; line-height: 1.4; @@ -78,7 +78,7 @@ } hr { - margin: 2px 0; + margin: 8px 0; clear: both; border: 0; border-top: 1px solid #c9bcbc; @@ -184,13 +184,13 @@ div.ensentence>a.hint:hover { border-radius: 3px; font-size: 12px; line-height: 14px; + user-select: none; } /* AnkiDroid replay button */ .replaybutton { margin: 0; - margin-right: 3px; text-decoration: none; } @@ -214,11 +214,14 @@ a.replay-button { top: -0.125em; position: relative; margin: 0; + user-select: none; + cursor: pointer; } a.replay-button svg { height: 1em; width: 1em; + user-select: none; } a.replay-button svg path { @@ -233,29 +236,47 @@ a.replay-button svg circle { footer { font-size: 16px; + word-break: keep-all; text-align: center; + display: flex; + flex-flow: row wrap; + justify-content: center; + align-items: center; } footer>a { text-decoration: none; + cursor: pointer; } -footer>a:after { +footer>a:not(:last-child)::after { content: "·"; color: brown; display: inline-block; - width: 6px; -} - -footer>a:last-child:after { - content: ""; - width: 0; + padding: 0 2px; } /* Vocab */ .vocab { + display: flex; + flex-flow: row wrap; margin-top: 16px; + align-items: center; + gap: 5px; +} + +.vocab > .reading, +.vocab > .target_word { + word-break: keep-all; +} + +.vocab > .target_word::before { + content: "【"; +} + +.vocab > .target_word::after { + content: "】"; } .vocab div { @@ -266,11 +287,12 @@ footer>a:last-child:after { display: none; } -.vocab>.tags { +.vocab .tags { + align-self: flex-start; vertical-align: top; } -.notes>.tags { +.notes .tags { vertical-align: bottom; } @@ -287,9 +309,12 @@ footer>a:last-child:after { grid-auto-columns: minmax(100px, 1fr); grid-auto-rows: minmax(100px, auto); } -.images br, .images > * { + +.images br, +.images>* { display: none; } + .images img { display: block; border-radius: 4px; @@ -437,8 +462,22 @@ ol { background-color: rgba(0, 0, 0, 0.20); } -/* Don't select furigana */ +/* Fix: Don't select furigana */ -.jpsentence ruby rt { +ruby rt { user-select: none; } +.jpsentence { + position: relative; +} +.jpsentence>.overlay { + position: absolute; + inset: 0; +} +.jpsentence>.background, +.jpsentence>.overlay ruby rt { + visibility: hidden; +} +.jpsentence>.background ruby rt { + visibility: visible; +} \ No newline at end of file