update jp sentences template

This commit is contained in:
Ren Tatsumoto 2022-10-15 00:22:13 +03:00
parent 103775e1e5
commit 29e566ee59
3 changed files with 78 additions and 34 deletions

View file

@ -3,8 +3,8 @@
<div class="sent-center"> <div class="sent-center">
<div class="jpsentence" lang="ja"> <div class="jpsentence" lang="ja">
{{edit:furigana:SentFurigana}} <div class="background">{{furigana:SentFurigana}}{{^SentFurigana}}{{furigana:SentKanji}}{{/SentFurigana}}</div>
{{^SentFurigana}}{{edit:furigana:SentKanji}}{{/SentFurigana}} <div class="overlay">{{edit:furigana:SentFurigana}}{{^SentFurigana}}{{edit:furigana:SentKanji}}{{/SentFurigana}}</div>
</div> </div>
{{#SentEng}} {{#SentEng}}
<div class="ensentence" lang="en">{{hint:SentEng}}</div> <div class="ensentence" lang="en">{{hint:SentEng}}</div>
@ -12,35 +12,39 @@
</div> </div>
<div class="vocab"> <div class="vocab">
{{VocabAudio}}{{SentAudio}}{{VocabPitchPattern}} {{VocabAudio}}{{SentAudio}}
{{^VocabPitchPattern}}{{text:kana:VocabFurigana}}{{/VocabPitchPattern}} <div class="reading">{{VocabPitchPattern}}{{^VocabPitchPattern}}{{text:kana:VocabFurigana}}{{/VocabPitchPattern}}</div>
{{#VocabPitchNum}}<span class="tags" id="pitchnum">{{VocabPitchNum}}</span>{{/VocabPitchNum}} {{#VocabPitchNum}}<span class="tags" id="pitchnum">{{text:VocabPitchNum}}</span>{{/VocabPitchNum}}
{{#VocabKanji}}【{{text:kanji:VocabKanji}}】{{/VocabKanji}} {{#VocabKanji}}<div class="target_word">{{text:kanji:VocabKanji}}</div>{{/VocabKanji}}
</div> </div>
{{#VocabDef}} {{#VocabDef}}
<div class="definitions">{{edit:furigana:VocabDef}}</div> <div class="definitions">{{edit:furigana:VocabDef}}</div>
{{/VocabDef}} {{/VocabDef}}
{{#Notes}} {{#Notes}}
<div class="notes"> <div class="notes">
<div class="tags">Notes</div> <div class="tags">Notes</div>
<div>{{furigana:Notes}}</div> <div>{{furigana:Notes}}</div>
</div> </div>
{{/Notes}} {{/Notes}}
{{#Image}} {{#Image}}
<div class="images">{{Image}}</div> <div class="images">{{Image}}</div>
{{/Image}} {{/Image}}
<hr /> <hr>
<footer> <footer>
{{#SentKanji}}<a title="Translate with SimplyTranslate" {{#SentKanji}}
href="https://simplytranslate.org/?engine=google&text={{text:kanji:SentKanji}}&sl=ja&tl=en">Translate</a><a <a href="https://simplytranslate.org/?engine=google&text={{text:kanji:SentKanji}}&sl=ja&tl=en" title="Translate with SimplyTranslate">Translate</a>
href="https://jisho.org/search?keyword={{text:kanji:SentKanji}}" title="Sentence on Jisho">Jisho</a><a <a href="https://jisho.org/search?keyword={{text:kanji:SentKanji}}" title="Sentence on Jisho">Jisho</a>
href="https://www.google.co.jp/search?q={{text:kanji:SentKanji}}&tbm=isch" <a href="https://www.google.co.jp/search?q={{text:kanji:SentKanji}}&tbm=isch" title="Search images">Images</a>
title="Search images">Images</a>{{/SentKanji}}{{#VocabKanji}}<a {{/SentKanji}}
href="http://www.weblio.jp/content/{{text:VocabKanji}}" title="Vocab on Weblio">Weblio</a><a {{#VocabKanji}}
href="https://wadoku.de/search/?q={{text:VocabKanji}}" title="Vocab on Wadoku">Wadoku</a>{{/VocabKanji}} <a href="http://www.weblio.jp/content/{{text:VocabKanji}}" title="Vocab on Weblio">Weblio</a>
<a href="https://wadoku.de/search/?q={{text:VocabKanji}}" title="Vocab on Wadoku">Wadoku</a>
{{/VocabKanji}}
</footer> </footer>
</div> <!-- /wrap --> </div> <!-- /wrap -->
@ -51,6 +55,7 @@
elem.innerText = "Reveal English translation"; elem.innerText = "Reveal English translation";
} }
} }
function removePitchBrackets() { function removePitchBrackets() {
const tags = document.getElementById("pitchnum"); const tags = document.getElementById("pitchnum");
if (tags !== null) { if (tags !== null) {
@ -60,4 +65,4 @@
markPitch(); markPitch();
removePitchBrackets(); removePitchBrackets();
tweak_reveal_text(); tweak_reveal_text();
</script> </script>

View file

@ -1,6 +1,6 @@
<!-- <!--
mpvacious cards, version 13.0 mpvacious cards, version 14.0
Sat Nov 27 11:10:04 AM UTC 2021 Thu Oct 20 02:37:35 PM UTC 2022
--> -->
<div class="wrap"> <div class="wrap">

View file

@ -19,7 +19,8 @@
font-weight: 600; font-weight: 600;
} }
b, strong { b,
strong {
font-weight: 600; font-weight: 600;
} }
} }
@ -33,8 +34,7 @@
.card { .card {
background-color: #fffaf0; background-color: #fffaf0;
color: #2a1b0a; color: #2a1b0a;
font-family: "Noto Serif", "Noto Serif CJK JP", Yu Mincho, "Liberation Serif", "Times New Roman", Times, Georgia, font-family: "Noto Serif", "Noto Serif CJK JP", Yu Mincho, "Liberation Serif", "Times New Roman", Times, Georgia, Serif;
Serif;
font-size: 24px; font-size: 24px;
text-align: left; text-align: left;
line-height: 1.4; line-height: 1.4;
@ -78,7 +78,7 @@
} }
hr { hr {
margin: 2px 0; margin: 8px 0;
clear: both; clear: both;
border: 0; border: 0;
border-top: 1px solid #c9bcbc; border-top: 1px solid #c9bcbc;
@ -184,13 +184,13 @@ div.ensentence>a.hint:hover {
border-radius: 3px; border-radius: 3px;
font-size: 12px; font-size: 12px;
line-height: 14px; line-height: 14px;
user-select: none;
} }
/* AnkiDroid replay button */ /* AnkiDroid replay button */
.replaybutton { .replaybutton {
margin: 0; margin: 0;
margin-right: 3px;
text-decoration: none; text-decoration: none;
} }
@ -214,11 +214,14 @@ a.replay-button {
top: -0.125em; top: -0.125em;
position: relative; position: relative;
margin: 0; margin: 0;
user-select: none;
cursor: pointer;
} }
a.replay-button svg { a.replay-button svg {
height: 1em; height: 1em;
width: 1em; width: 1em;
user-select: none;
} }
a.replay-button svg path { a.replay-button svg path {
@ -233,29 +236,47 @@ a.replay-button svg circle {
footer { footer {
font-size: 16px; font-size: 16px;
word-break: keep-all;
text-align: center; text-align: center;
display: flex;
flex-flow: row wrap;
justify-content: center;
align-items: center;
} }
footer>a { footer>a {
text-decoration: none; text-decoration: none;
cursor: pointer;
} }
footer>a:after { footer>a:not(:last-child)::after {
content: "·"; content: "·";
color: brown; color: brown;
display: inline-block; display: inline-block;
width: 6px; padding: 0 2px;
}
footer>a:last-child:after {
content: "";
width: 0;
} }
/* Vocab */ /* Vocab */
.vocab { .vocab {
display: flex;
flex-flow: row wrap;
margin-top: 16px; 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 { .vocab div {
@ -266,11 +287,12 @@ footer>a:last-child:after {
display: none; display: none;
} }
.vocab>.tags { .vocab .tags {
align-self: flex-start;
vertical-align: top; vertical-align: top;
} }
.notes>.tags { .notes .tags {
vertical-align: bottom; vertical-align: bottom;
} }
@ -287,9 +309,12 @@ footer>a:last-child:after {
grid-auto-columns: minmax(100px, 1fr); grid-auto-columns: minmax(100px, 1fr);
grid-auto-rows: minmax(100px, auto); grid-auto-rows: minmax(100px, auto);
} }
.images br, .images > * {
.images br,
.images>* {
display: none; display: none;
} }
.images img { .images img {
display: block; display: block;
border-radius: 4px; border-radius: 4px;
@ -437,8 +462,22 @@ ol {
background-color: rgba(0, 0, 0, 0.20); 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; 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;
}