AnkiNoteTemplate/templates/Japanese fallback/Production/front.html

45 lines
1.2 KiB
HTML
Raw Normal View History

2021-11-27 14:47:23 +00:00
{{#MakeProductionCard}}
{{#SentKanji}}
2022-01-02 16:32:46 +00:00
<div class="wrap">
2021-11-27 14:47:23 +00:00
<header>{{#Tags}}<div class="tags">{{Tags}}</div>{{/Tags}}</header>
2022-01-02 16:32:46 +00:00
{{#Image}}<div class="images">{{Image}}</div>{{/Image}}
<div class="sent-center">
<div class="jpsentence production">{{edit:furigana:SentFurigana}}</div>
<div>{{VocabAudio}}{{SentAudio}}</div>
</div>
</div> <!-- /wrap -->
2021-11-27 14:47:23 +00:00
<script>
2022-01-02 16:32:46 +00:00
function threeDots() {
for (const hidden of document.querySelectorAll(".production b, .production strong")) {
hidden.style.visibility = "visible";
hidden.innerText = "【" + hidden.innerText.replace(/[^ぁ-んァ-ン]/g, "") + "】";
2022-01-02 16:32:46 +00:00
}
}
/* Splits tags into separate divs */
function splitTagDiv() {
const header = document.querySelector("header");
if (!header) return;
const split = `{{MorphManFocus}} {{Tags}}`.split(' ');
header.innerHTML = "";
for (const tag of split) {
if (tag.length < 1)
continue;
const tag_elem = document.createElement("div");
tag_elem.className = "tags";
tag_elem.innerHTML = tag;
header.appendChild(tag_elem);
}
}
2021-11-27 14:47:23 +00:00
2022-01-02 16:32:46 +00:00
threeDots()
splitTagDiv()
2021-11-27 14:47:23 +00:00
</script>
{{/SentKanji}}
2022-01-02 16:32:46 +00:00
{{/MakeProductionCard}}