This commit is contained in:
Ren Tatsumoto 2021-12-25 06:19:58 +03:00
parent 4594772fc1
commit 670986db1c
3 changed files with 70 additions and 70 deletions

View file

@ -1,48 +1,47 @@
<div class="wrap">
<div class="fside">{{FrontSide}}</div>
<div class="fside">{{FrontSide}}</div>
<div class="sent-center">
<div class="jpsentence" lang="ja">
{{edit:furigana:SentFurigana}}
{{^SentFurigana}}{{edit:furigana:SentKanji}}{{/SentFurigana}}
</div>
{{#SentEng}}
<div class="ensentence" lang="en">{{hint:SentEng}}</div>
{{/SentEng}}
</div>
<div class="sent-center">
<div class="jpsentence" lang="ja">
{{edit:furigana:SentFurigana}}
{{^SentFurigana}}{{edit:furigana:SentKanji}}{{/SentFurigana}}
</div>
{{#SentEng}}
<div class="ensentence" lang="en">
{{hint:SentEng}}
</div>
{{/SentEng}}
</div>
<div class="vocab">
{{VocabAudio}}{{SentAudio}}{{VocabPitchPattern}}
{{^VocabPitchPattern}}{{kana:VocabFurigana}}{{/VocabPitchPattern}}
{{#VocabPitchNum}}<span class="tags" id="pitchnum">{{VocabPitchNum}}</span>{{/VocabPitchNum}}
{{#VocabKanji}}【{{kanji:VocabKanji}}】{{/VocabKanji}}
</div>
<div class="vocab">
{{VocabAudio}}{{SentAudio}}
{{VocabPitchPattern}}{{^VocabPitchPattern}}{{kana:VocabFurigana}}{{/VocabPitchPattern}}
{{#VocabPitchNum}}<span class="tags"
id="pitchnum">{{VocabPitchNum}}</span>{{/VocabPitchNum}}{{#VocabKanji}}【{{kanji:VocabKanji}}】{{/VocabKanji}}
</div>
{{#VocabDef}}
<div class="definitions">{{edit:furigana:VocabDef}}</div>
{{/VocabDef}}
{{#Notes}}
<div class="notes">
<div class="tags">Notes</div>
<div>{{furigana:Notes}}</div>
</div>
{{/Notes}}
{{#Image}}
<div class="images">{{Image}}</div>
{{/Image}}
{{#VocabDef}}
<div class="definitions">{{edit:furigana:VocabDef}}</div>
{{/VocabDef}}
{{#Notes}}
<div class="notes">
<div class="tags">Notes</div>
<div>{{furigana:Notes}}</div>
</div>
{{/Notes}}
{{#Image}}<div class="images">{{Image}}</div>{{/Image}}
<hr>
<footer>{{#SentKanji}}<a title="Translate with SimplyTranslate" href="https://translate.metalune.xyz/?engine=google&text={{text:kanji:SentKanji}}&sl=ja&tl=en">Translate</a><a href="https://jisho.org/search?keyword={{text:kanji:SentKanji}}"
title="Sentence on Jisho">Jisho</a><a href="https://www.google.co.jp/search?q={{text:kanji:SentKanji}}&tbm=isch"
title="Search images">Images</a>{{/SentKanji}}{{#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>
<hr />
<footer>
{{#SentKanji}}<a title="Translate with SimplyTranslate"
href="https://translate.metalune.xyz/?engine=google&text={{text:kanji:SentKanji}}&sl=ja&tl=en">Translate</a><a
href="https://jisho.org/search?keyword={{text:kanji:SentKanji}}" title="Sentence on Jisho">Jisho</a><a
href="https://www.google.co.jp/search?q={{text:kanji:SentKanji}}&tbm=isch"
title="Search images">Images</a>{{/SentKanji}}{{#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>
</div> <!-- /wrap -->
<script>
@ -58,7 +57,7 @@
tags.innerHTML = tags.innerHTML.replace(/[\[\]]/g, "");
}
}
markPitch()
removePitchBrackets()
tweak_reveal_text()
markPitch();
removePitchBrackets();
tweak_reveal_text();
</script>

View file

@ -4,25 +4,23 @@ Sat Nov 27 11:10:04 AM UTC 2021
-->
<div class="wrap">
<header>
{{#MorphManFocus}}
<div class="tags">{{MorphManFocus}}</div>
{{/MorphManFocus}}
{{#Tags}}
<div class="tags">{{Tags}}</div>
{{/Tags}}
</header>
<header>
{{#MorphManFocus}}
<div class="tags">{{MorphManFocus}}</div>
{{/MorphManFocus}}
{{#Tags}}
<div class="tags">{{Tags}}</div>
{{/Tags}}
</header>
<div class="sent-center">
<div class="jpsentence" lang="ja">
{{edit:morphHighlight:furigana:SentKanji}}
{{^SentKanji}}
<nokana>{{edit:kanji:SentFurigana}}</nokana>
{{/SentKanji}}
</div>
</div>
<div class="sent-center">
<div class="jpsentence" lang="ja">
{{edit:morphHighlight:furigana:SentKanji}}
{{^SentKanji}}
<nokana>{{edit:kanji:SentFurigana}}</nokana>
{{/SentKanji}}
</div>
</div>
</div> <!-- /wrap -->
<div style="display:none;">
@ -83,7 +81,7 @@ Sat Nov 27 11:10:04 AM UTC 2021
return false;
}
// small っ is one mora; ゃゅょ are parts of single mora
const n_moras = vocab_kana.innerHTML.replace(/[ャュョゃゅょ]/g, '').length;
const n_moras = vocab_kana.innerHTML.replace(/[ャュョゃゅょ]/g, "").length;
if (n_moras == pitch_num) {
return true;
} else {
@ -95,13 +93,12 @@ Sat Nov 27 11:10:04 AM UTC 2021
function splitTagDiv() {
const header = document.querySelector("header");
if (!header) return;
const split = `{{MorphManFocus}} {{Tags}}`.split(' ');
const split = `{{MorphManFocus}} {{Tags}}`.split(" ");
header.innerHTML = "";
for (const tag of split) {
if (tag.length < 1)
continue;
if (tag.length < 1) continue;
const tag_elem = document.createElement("div");
tag_elem.className = "tags";
tag_elem.innerHTML = tag;
@ -109,6 +106,6 @@ Sat Nov 27 11:10:04 AM UTC 2021
}
}
markPitch()
splitTagDiv()
</script>
markPitch();
splitTagDiv();
</script>

View file

@ -46,7 +46,7 @@
@media screen and (min-width: 820px) {
.card {
background-color: #E5D7C9;
background-color: #e5d7c9;
display: flex;
justify-content: center;
}
@ -136,11 +136,15 @@ header > div:not(:last-child) {
/* Japanese sentence */
.jpsentence { font-size: 35px; }
.jpsentence {
font-size: 35px;
}
/* Hide front side when the back is shown. */
.fside .jpsentence { display: none; }
.fside .jpsentence {
display: none;
}
/* English */