AnkiNoteTemplate/templates/Japanese sentences/template.json
2021-11-27 14:20:36 +03:00

32 lines
14 KiB
JSON

{
"modelName": "Japanese sentences",
"inOrderFields": [
"SentKanji",
"SentFurigana",
"SentEng",
"SentAudio",
"MorphManFocus",
"VocabKanji",
"VocabFurigana",
"VocabPitchPattern",
"VocabPitchNum",
"VocabDef",
"VocabAudio",
"Image",
"Notes",
"MakeProductionCard"
],
"css": "@charset \"utf-8\";\n\n@font-face {\n font-family: \"KanjiStrokeOrders\";\n src: local(\"KanjiStrokeOrders\"), url(\"_kso.ttf\");\n}\n\n@font-face {\n font-family: \"Yu Mincho\";\n src: local(\"Yu Mincho\"), local(\"\u6e38\u660e\u671d\"), url(\"_yumin.ttf\");\n}\n\n@font-face {\n font-family: \"Yu Mincho\";\n src: local(\"Yu Mincho Demibold\"), local(\"\u6e38\u660e\u671d Demibold\"), url(\"_yumindb.ttf\");\n font-weight: 600;\n}\n\n* {\n box-sizing: border-box;\n padding: 0;\n margin: 0;\n}\n\n.card {\n background-color: #fffaf0;\n color: #2a1b0a;\n font-family: \"Noto Serif\", \"Noto Serif CJK JP\", Yu Mincho, \"Liberation Serif\", \"Times New Roman\", Times, Georgia,\n Serif;\n font-size: 24px;\n text-align: left;\n line-height: 1.4;\n margin: 0 auto;\n}\n\n.card1 {\n color: inherit;\n}\n\n.card2 .jpsentence ruby rt {\n opacity: 0;\n}\n\n@media screen and (min-width: 820px) {\n .card {\n background-color: #E5D7C9;\n display: flex;\n justify-content: center;\n }\n .wrap {\n width: 800px;\n padding: 0 5px 0;\n background-color: #fffaf0;\n border-left: 1px solid #c9bcbc;\n border-right: 1px solid #c9bcbc;\n min-height: 100vh;\n }\n .wrap .wrap {\n width: auto;\n padding: 0;\n min-height: 0;\n border: 0;\n }\n}\n\n.card2 .jpsentence:hover ruby rt {\n opacity: 1;\n}\n\nhr {\n margin: 2px 0;\n clear: both;\n border: 0;\n border-top: 1px solid #c9bcbc;\n}\n\nb {\n font-weight: 600;\n}\n\n/* links */\na {\n color: #532f2f;\n}\n\na:hover {\n color: #722a2a;\n}\n\na.hint {\n text-decoration: none;\n text-align: center;\n display: block;\n}\n\n/* Hide furigana on front */\nnokana ruby rt {\n opacity: 0;\n font-size: 0;\n display: none;\n}\n\nnotext b {\n background-color: black;\n color: transparent;\n}\n\n/* Top */\nheader {\n display: flex;\n clear: both;\n}\n\nheader .tags {\n border-radius: 0px 0px 3px 3px;\n}\n\nheader > div:not(:last-child) {\n margin-right: 3px;\n}\n\n/* Space between elements */\n.images {\n margin-top: 16px;\n}\n\n.images > img {\n margin-bottom: 16px;\n}\n\n/* Japanese sentence */\n\n.jpsentence {\n display: flex;\n justify-content: center;\n font-size: 35px;\n}\n.fside .jpsentence { display: none; }\n\n.tags {\n font-family: \"Noto Sans\", \"Noto Sans CJK JP\", \"Liberation Sans\", Arial, Sans, sans-serif;\n text-align: center;\n display: inline-block;\n text-transform: lowercase;\n background-color: #333;\n color: #fffaf0;\n font-weight: bold;\n padding: 1px 3px;\n margin: 0;\n cursor: pointer;\n border-radius: 3px;\n font-size: 12px;\n line-height: 14px;\n}\n\n/* AnkiDroid replay button */\n.replaybutton {\n margin: 0;\n margin-right: 3px;\n text-decoration: none;\n}\n\n.replaybutton span {\n padding: 0;\n font-size: 16px;\n}\n\n.replaybutton span svg {\n fill: #fffaf0;\n background: #333;\n border-radius: 3px;\n vertical-align: top;\n min-width: 16px;\n min-height: 16px;\n}\n\n/* PC replay button */\na.replay-button {\n top: -0.125em;\n position: relative;\n margin: 0;\n}\n\na.replay-button svg {\n height: 1em;\n width: 1em;\n}\n\na.replay-button svg path {\n fill: #fffaf0;\n}\n\na.replay-button svg circle {\n fill: #333;\n}\n\n/* Footer and links */\nfooter {\n font-size: 16px;\n text-align: center;\n}\n\nfooter > a {\n text-decoration: none;\n}\n\nfooter > a:after {\n content: \"\u00b7\";\n color: brown;\n display: inline-block;\n width: 6px;\n}\n\nfooter > a:last-child:after {\n content: \"\";\n width: 0;\n}\n\n/* Vocab */\n.vocab {\n margin-top: 16px;\n}\n\n.vocab div {\n display: inline-block;\n}\n\n.vocab br {\n display: none;\n}\n\n.vocab > .tags {\n vertical-align: top;\n}\n\n.notes > .tags {\n vertical-align: bottom;\n}\n\n/* Images */\n.images {\n display: flex;\n flex-wrap: wrap;\n flex-direction: row;\n align-items: flex-start;\n align-content: space-between;\n justify-content: space-evenly;\n}\n\n.images > img {\n max-width: 47%;\n border-radius: 4px;\n filter: sepia(33%);\n}\n\n.images > img:only-child {\n max-width: 100%;\n}\n\n/* Production cards */\n.production b {\n visibility: hidden;\n}\n\n.strokeorder {\n text-align: center;\n font-size: 150px;\n font-family: KanjiStrokeOrders;\n}\n\n/* Morphman coloring */\n.fside .jpsentence:hover [mtype=\"unknown\"] {\n background-color: #ffff99;\n}\n\n.fside .jpsentence:hover [mtype=\"seen\"] {\n background-color: #ffd1b3;\n}\n\n.fside .jpsentence:hover [mtype=\"known\"] {\n background-color: #b3e6cc;\n}\n\n.fside .jpsentence:hover [mtype=\"mature\"] {\n background-color: transparent;\n}\n\n.fside .jpsentence:hover [priority=\"true\"] {\n color: inherit;\n}\n\n.fside .jpsentence:hover [frequency=\"true\"] {\n color: inherit;\n}\n\ndel.MorphManHide,\ndel.morphmanhide {\n display: none;\n}\n\n/* Fix for Yomichan defs */\nul,\nol {\n list-style-type: none;\n display: inline;\n margin: 0px;\n padding: 0px;\n}\n\n/* Fix for Yomichan pitch accents */\n.vocab ol > li {\n display: inline;\n}\n\n.vocab ol > li:after {\n content: \"\u30fb\";\n}\n\n.vocab ol > li:last-child:after {\n content: \"\";\n}\n\n/* Night Mode */\n.nightMode .jpsentence b {\n color: gray;\n}\n\n.nightMode .tags {\n background-color: #f0f0f0;\n color: #333;\n}\n\n.nightMode a.replay-button svg path {\n fill: #2f2f31;\n}\n\n.nightMode a.replay-button svg circle {\n fill: white;\n}\n\n.nightMode .replaybutton span svg {\n fill: #2f2f31;\n background: white;\n}\n\n.nightMode.card {\n color: #f0f0f0;\n}\n\n.nightMode a {\n color: #ccc;\n}\n\n.nightMode a:hover {\n color: #eee;\n}\n\n.nightMode .jpsentence b {\n color: gray;\n}\n\n.nightMode footer > a:after {\n color: white;\n}\n",
"cardTemplates": [
{
"Name": "Recognition",
"Front": "<!--\nmpvacious cards, version 13.0\nSat Nov 27 11:10:04 AM UTC 2021\n-->\n\n<div class=\"wrap\">\n\n<header>\n {{#MorphManFocus}}\n <div class=\"tags\">{{MorphManFocus}}</div>\n {{/MorphManFocus}}\n {{#Tags}}\n <div class=\"tags\">{{Tags}}</div>\n {{/Tags}}\n</header>\n\n<div class=\"jpsentence\" lang=\"ja\">\n<p>\n {{edit:morphHighlight:furigana:SentKanji}}\n {{^SentKanji}}\n <nokana>{{edit:kanji:SentFurigana}}</nokana>\n {{/SentKanji}}\n</p>\n</div>\n\n</div> <!-- /wrap -->\n\n<div style=\"display:none;\">\n <div id=\"pitchnum_hidden\">{{VocabPitchNum}}</div>\n <div id=\"kanaword_hidden\">{{kana:VocabFurigana}}</div>\n</div>\n\n<script>\n /* Paints the question word according to its Pitch Accent number.\n * blue for \u5e73\u677f\n * red for \u982d\u9ad8\n * orange for \u4e2d\u9ad8\n * green for \u5c3e\u9ad8\n */\n function markPitch() {\n let pitchNumber = document.getElementById(\"pitchnum_hidden\");\n if (pitchNumber === null) {\n return;\n } else {\n pitchNumber = pitchNumber.innerHTML.match(/\\d/);\n }\n if (pitchNumber === null) {\n return;\n } else {\n pitchNumber = Number(pitchNumber);\n }\n\n /* Then decide what color to use and change font color accordingly. */\n if (pitchNumber == 0) {\n // use blue for \u5e73\u677f\n paintTargetWord(\"#3366CC\");\n } else if (pitchNumber == 1) {\n // use red for \u982d\u9ad8\n paintTargetWord(\"red\");\n } else if (pitchNumber > 1) {\n if (odaka(pitchNumber)) {\n // use green for \u5c3e\u9ad8\n paintTargetWord(\"green\");\n } else {\n // use orange for \u4e2d\u9ad8\n paintTargetWord(\"#ff6207\");\n }\n }\n }\n\n function paintTargetWord(color) {\n for (sentence of document.getElementsByClassName(\"jpsentence\")) {\n for (word of sentence.getElementsByTagName(\"b\")) {\n word.style.color = color;\n }\n }\n }\n\n function odaka(pitch_num) {\n // word is odaka if number of moras is equal to pitch accent position\n const vocab_kana = document.getElementById(\"kanaword_hidden\");\n if (vocab_kana === null) {\n return false;\n }\n // small \u3063 is one mora; \u3083\u3085\u3087 are parts of single mora\n const n_moras = vocab_kana.innerHTML.replace(/[\u30e3\u30e5\u30e7\u3083\u3085\u3087]/g, '').length;\n if (n_moras == pitch_num) {\n return true;\n } else {\n return false;\n }\n }\n\n /* Splits tags into separate divs */\n function splitTagDiv() {\n const header = document.querySelector(\"header\");\n if (!header) return;\n const split = `{{MorphManFocus}} {{Tags}}`.split(' ');\n\n header.innerHTML = \"\";\n\n for (const tag of split) {\n if (tag.length < 1)\n continue;\n const tag_elem = document.createElement(\"div\");\n tag_elem.className = \"tags\";\n tag_elem.innerHTML = tag;\n header.appendChild(tag_elem);\n }\n }\n\n markPitch()\n splitTagDiv()\n</script>",
"Back": "<div class=\"wrap\">\n\n<div class=\"fside\">{{FrontSide}}</div>\n\n<div class=\"jpsentence\" lang=\"ja\">\n<p>\n {{edit:furigana:SentFurigana}}\n {{^SentFurigana}}{{edit:furigana:SentKanji}}{{/SentFurigana}}\n</p>\n</div>\n\n{{#SentEng}}\n<div lang=\"en\">\n {{hint:SentEng}}\n</div>\n{{/SentEng}}\n\n<div class=\"vocab\">\n {{VocabAudio}}{{SentAudio}}\n {{VocabPitchPattern}}{{^VocabPitchPattern}}{{kana:VocabFurigana}}{{/VocabPitchPattern}}\n {{#VocabPitchNum}}<span class=\"tags\"\n id=\"pitchnum\">{{VocabPitchNum}}</span>{{/VocabPitchNum}}{{#VocabKanji}}\u3010{{kanji:VocabKanji}}\u3011{{/VocabKanji}}\n</div>\n\n{{#VocabDef}}\n<div class=\"definitions\">{{edit:furigana:VocabDef}}</div>\n{{/VocabDef}}\n\n{{#Notes}}\n<div class=\"notes\">\n <div class=\"tags\">Notes</div>\n <div>{{furigana:Notes}}</div>\n</div>\n{{/Notes}}\n\n{{#Image}}<div class=\"images\">{{Image}}</div>{{/Image}}\n\n<hr>\n\n<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}}\"\n title=\"Sentence on Jisho\">Jisho</a><a href=\"https://www.google.co.jp/search?q={{text:kanji:SentKanji}}&tbm=isch\"\n title=\"Search images\">Images</a>{{/SentKanji}}{{#VocabKanji}}<a\n href=\"http://www.weblio.jp/content/{{text:VocabKanji}}\" title=\"Vocab on Weblio\">Weblio</a><a\n href=\"https://wadoku.de/search/?q={{text:VocabKanji}}\" title=\"Vocab on Wadoku\">Wadoku</a>{{/VocabKanji}}\n</footer>\n\n</div> <!-- /wrap -->\n\n<script>\n function removePitchBrackets() {\n const tags = document.getElementById(\"pitchnum\");\n if (tags !== null) {\n tags.innerHTML = tags.innerHTML.replace(/[\\[\\]]/g, \"\");\n }\n }\n markPitch()\n removePitchBrackets()\n</script>\n"
},
{
"Name": "Production",
"Front": "{{#MakeProductionCard}}\n{{#SentKanji}}\n\n<header>{{#Tags}}<div class=\"tags\">{{Tags}}</div>{{/Tags}}</header>\n{{#Image}}<div class=\"images\">{{Image}}</div>{{/Image}}\n<div class=\"jpsentence production\">{{edit:furigana:SentFurigana}}</div>\n<div style=\"text-align: center;\">{{VocabAudio}}{{SentAudio}}</div>\n<script>\n function threeDots() {\n const sent = document.getElementsByClassName(\"production\")[0];\n if (sent) {\n for (const hidden of sent.getElementsByTagName(\"b\")) {\n hidden.style.visibility = \"visible\";\n hidden.innerText = \"\u3010\" + hidden.innerText.replace(/[^\u3041-\u3093\u30a1-\u30f3]/g, \"\") + \"\u3011\";\n }\n }\n }\n /* Splits tags into separate divs */\n function splitTagDiv() {\n const header = document.querySelector(\"header\");\n if (!header) return;\n const split = `{{MorphManFocus}} {{Tags}}`.split(' ');\n\n header.innerHTML = \"\";\n\n for (const tag of split) {\n if (tag.length < 1)\n continue;\n const tag_elem = document.createElement(\"div\");\n tag_elem.className = \"tags\";\n tag_elem.innerHTML = tag;\n header.appendChild(tag_elem);\n }\n }\n\n threeDots()\n splitTagDiv()\n</script>\n\n{{/SentKanji}}\n{{/MakeProductionCard}}\n",
"Back": "{{FrontSide}}\n\n<hr>\n\n<div lang=\"en\">{{SentEng}}</div>\n<div class=\"strokeorder\">{{VocabKanji}}</div>\n\n{{#VocabKanji}}\n<div class=\"vocab\">\n {{VocabPitchPattern}}\n {{^VocabPitchPattern}}{{kana:VocabFurigana}}{{/VocabPitchPattern}}\n {{#VocabPitchNum}}\n <span class=\"tags\">{{VocabPitchNum}}</span>\n {{/VocabPitchNum}}\n \u3010{{VocabKanji}}\u3011\n</div>\n{{/VocabKanji}}\n\n{{#VocabDef}}\n<div class=\"definitions\">\n {{edit:furigana:VocabDef}}\n</div>\n{{/VocabDef}}\n\n{{#Notes}}\n<div class=\"notes\">\n <div class=\"tags\">Notes</div>\n <div>{{furigana:Notes}}</div>\n</div>\n{{/Notes}}\n\n<hr>\n\n<footer>{{#SentKanji}}<a href=\"https://jisho.org/search?keyword={{edit:text:SentKanji}}\"\n title=\"Sentence on Jisho\">Jisho</a><a href=\"https://www.google.co.jp/search?q={{edit:text:SentKanji}}&tbm=isch\"\n title=\"Search images\">Images</a>{{/SentKanji}}{{#VocabKanji}}<a\n href=\"http://tangorin.com/dict.php?dict=general&s={{text:VocabKanji}}\">Tangorin</a><a\n href=\"http://www.weblio.jp/content/{{text:VocabKanji}}\">Weblio</a><a\n href=\"https://wadoku.de/search/?q={{text:VocabKanji}}\">Wadoku</a> {{/VocabKanji}}</footer>\n"
}
]
}