AnkiNoteTemplate/templates/Japanese sentences/template.json

32 lines
12 KiB
JSON
Raw Normal View History

2021-04-20 11:17:30 +00:00
{
"modelName": "Japanese sentences",
"inOrderFields": [
"SentKanji",
"SentFurigana",
"SentEng",
"SentAudio",
"MorphManFocus",
"VocabKanji",
"VocabFurigana",
"VocabPitchPattern",
"VocabPitchNum",
"VocabDef",
"VocabAudio",
"Image",
"Notes",
"MakeProductionCard"
],
"css": "@charset \"utf-8\";\n@font-face {\n\tfont-family: \"KanjiStrokeOrders\";\n\tsrc:\n\t\tlocal(\"KanjiStrokeOrders\"),\n\t\turl(\"_kso.ttf\");\n}\n@font-face {\n\tfont-family: \"Yu Mincho\";\n\tsrc:\n\t\tlocal(\"Yu Mincho\"),\n\t\tlocal(\"\u6e38\u660e\u671d\"),\n\t\turl(\"_yumin.ttf\");\n}\n@font-face {\n\tfont-family: \"Yu Mincho\";\n\tsrc:\n\t\tlocal(\"Yu Mincho Demibold\"),\n\t\tlocal(\"\u6e38\u660e\u671d Demibold\"),\n\t\turl(\"_yumindb.ttf\");\n\tfont-weight: 600;\n}\n\n* { box-sizing: border-box; padding: 0; margin: 0; }\n.card {\n\tbackground-color: #FFFAF0;\n\tcolor: #2A1B0A;\n\tfont-family:\t\"Noto Serif\",\n\t\t\t\t\t\t\t\t\t\"Noto Serif CJK JP\",\n\t\t\t\t\t\t\t\t\tYu Mincho,\n\t\t\t\t\t\t\t\t\t\"Liberation Serif\",\n\t\t\t\t\t\t\t\t\t\"Times New Roman\",\n\t\t\t\t\t\t\t\t\tTimes,\n\t\t\t\t\t\t\t\t\tGeorgia,\n\t\t\t\t\t\t\t\t\tSerif;\n\tfont-size: 24px;\n\ttext-align: left;\n\tline-height: 1.4;\n\tmax-width: 800px;\n\tmargin: 0 auto;\n}\n.card1 { }\n.card2 .jpsentence ruby rt { opacity: 0; }\n.card2 .jpsentence:hover ruby rt { opacity: 1; }\n\nhr { margin: 2px 0; clear: both; }\nb { font-weight: 600; }\n\n/* links */\na { color: #532f2f; }\na:hover { color: #722a2a ; }\na.hint { text-decoration: none; text-align: center; display: block; }\n\n/* Hide furigana on front */\nnokana ruby rt { opacity:0.0; font-size:0; display: none; }\nnotext b { background-color: black; color:transparent; }\n\n/* Top */\nheader { font-size: 14px; line-height: 18px; clear: both; }\nheader > div:not(:last-child) { margin-right: 3px; }\n\n/* Space between elements */\n.images { margin-top: 16px; }\n.images > img { margin-bottom: 16px; }\n\n/* Japanese sentence */\n.jpsentence { font-size: 35px; }\n\n.tags {\n\tfont-family: \"Noto Sans\", \"Noto Sans CJK JP\", \"Liberation Sans\", Arial, Sans, sans-serif;\n\ttext-align: center;\n\tdisplay: inline-block;\n\ttext-transform: lowercase;\n\tbackground-color: #333;\n\tcolor: #FFFAF0;\n\tfont-weight: bold;\n\tpadding: 1px 3px;\n\tmargin: 0;\n\tcursor: pointer;\n\tborder-radius: 3px;\n\tfont-size: 12px;\n\tline-height: 14px;\n}\n\n/* AnkiDroid peplay button */\n.replaybutton { margin: 0; margin-right: 3px; text-decoration: none; }\n.replaybutton span { padding: 0; font-size: 16px; }\n.replaybutton span svg {\n\tfill: #FFFAF0;\n\tbackground: #333;\n\tborder-radius: 3px;\n\tvertical-align: top; \n\tmin-width: 16px;\n\tmin-height: 16px;\n}\n\n/* PC peplay button */\na.replay-button { top: -.125em; position: relative; }\na.replay-button svg {\n\theight: 1em;\n\twidth: 1em;\n}\na.replay-button svg path { fill: #FFFAF0; }\na.replay-button svg circle { fill: #333; }\n\n/* Footer and links */\nfooter {font-size: 16px; text-align: center; }\nfooter>a { text-decoration: none; }\nfooter > a:after {content:\"\u00b7\"; color: brown; display: inline-block; width: 6px; }\nfooter > a:last-child:after {content:\"\"; width: 0; }\n\n/* Vocab */\n.vocab { margin-top: 16px; }\n.vocab div { display: inline-block; }\n.vocab br { display: none; }\n.vocab > .tags { vertical-align: top; }\n.notes > .tags { vertical-align: bottom; }\n\n/* Images */\n.images {\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\tflex-direction: row;\n\talign-items: flex-start;\n\talign-content: space-between;\n\tjustify-content: space-evenly;\n}\n.images > img {\n\tmax-width: 47%;\n\tborder-radius: 4px;\n\tfilter: sepia(33%);\n}\n.images>img:only-child {\n max-width: 100%;\n}\n\n/* Production cards */\n.production b { visibility: hidden; }\n.strokeorder {\n\ttext-align: center;\n\tfont-size: 150px;\n\tfont-family: KanjiStrokeOrders;\n}\n\n/* Morphman coloring */\n.fside .jpsentence:hover [mtype=unknown] { background-color: #ffff99; }\n.fside .jpsentence:hover [mtype=seen] { background-color: #ffd1b3; }\n.fside .jpsentence:hover [mtype=known] { background-color: #b3e6cc; }\n.fside .jpsentence:hover [mtype=mature] { background-color: transparent; }\n.fside .jpsentence:hover [priority=true] { }\n.fside .jpsentence:hover [frequency=true] { }\n\ndel.MorphManHide, del.morphmanhide {display:none;}\n\n/* Fix for Yomichan defs */\nul, ol {
"cardTemplates": [
{
"Name": "Recognition",
2021-08-20 05:21:41 +00:00
"Front": "<!--\nmpvacious cards, version 12.0\nFri Aug 20 05:56:36 AM UTC 2021\n-->\n\n<header>\n\t{{#MorphManFocus}}\n\t\t<div class=\"tags\">{{MorphManFocus}}</div>\n\t{{/MorphManFocus}}\n\t{{#Tags}}\n\t\t<div class=\"tags\">{{Tags}}</div>\n\t{{/Tags}}\n</header>\n\n<div class=\"jpsentence\" lang=\"ja\">\n\t{{morphHighlight:furigana:SentKanji}}\n\t{{^SentKanji}}\n\t\t<nokana>{{kanji:SentFurigana}}</nokana>\n\t{{/SentKanji}}\n</div>\n\n<div style=\"display:none;\">\n\t<div id=\"pitchnum_hidden\">{{VocabPitchNum}}</div>\n\t<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>",
2021-08-11 03:48:24 +00:00
"Back": "<div class=\"fside\">{{FrontSide}}</div>\n<hr id=\"answer\">\n<div class=\"jpsentence\" lang=\"ja\">\n\t{{edit:furigana:SentFurigana}}\n\t{{^SentFurigana}}{{furigana:SentKanji}}{{/SentFurigana}}\n</div>\n\n{{#SentEng}}\n\t<div lang=\"en\">\n\t\t{{hint:SentEng}}\n\t</div>\n{{/SentEng}}\n\n<div class=\"vocab\">\n{{VocabAudio}}{{SentAudio}}\n{{VocabPitchPattern}}{{^VocabPitchPattern}}{{kana:VocabFurigana}}{{/VocabPitchPattern}}\n{{#VocabPitchNum}}<span class=\"tags\" id=\"pitchnum\">{{VocabPitchNum}}</span>{{/VocabPitchNum}}{{#VocabKanji}}\u3010{{VocabKanji}}\u3011{{/VocabKanji}}\n</div>\n\n{{#VocabDef}}\t\n<div class=\"definitions\">{{edit:furigana:VocabDef}}</div>\n{{/VocabDef}}\n\n{{#Notes}}\t\n<div class=\"notes\">\n\t<div class=\"tags\">Notes</div>\n\t<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 \n\thref=\"https://jisho.org/search?keyword={{kanji:text:SentKanji}}\" title=\"Sentence on Jisho\">Jisho</a><a\n\thref=\"https://www.google.co.jp/search?q={{kanji:text:SentKanji}}&tbm=isch\" title=\"Search images\">Images</a\n\t>{{/SentKanji}}{{#VocabKanji}}<a\n\thref=\"http://www.weblio.jp/content/{{text:VocabKanji}}\" title=\"Vocab on Weblio\">Weblio</a><a\n\thref=\"https://wadoku.de/search/?q={{text:VocabKanji}}\" title=\"Vocab on Wadoku\">Wadoku</a>{{/VocabKanji}}</footer\n>\n\n<script>\n\tfunction removePitchBrackets() {\n\t\tconst tags = document.getElementById(\"pitchnum\");\n\t\tif (tags !== null) {\n\t\t\ttags.innerHTML = tags.innerHTML.replace(/[\\[\\]]/g, \"\");\n\t\t}\n\t}\n\tmarkPitch()\n\tremovePitchBrackets()\n</script>"
2021-04-20 11:17:30 +00:00
},
{
"Name": "Production",
2021-08-20 05:21:41 +00:00
"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\">{{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",
2021-04-20 11:17:30 +00:00
"Back": "{{FrontSide}}\n\n<hr>\n\n<div lang=\"en\" >{{SentEng}}</div>\n<div class=\"strokeorder\">{{VocabKanji}}</div>\n\n{{#VocabKanji}}\n\t<div class=\"vocab\">\n\t\t{{VocabPitchPattern}}\n\t\t{{^VocabPitchPattern}}{{kana:VocabFurigana}}{{/VocabPitchPattern}}\n\t\t{{#VocabPitchNum}}\n\t\t\t<span class=\"tags\">{{VocabPitchNum}}</span>\n\t\t{{/VocabPitchNum}}\n\t\t\u3010{{VocabKanji}}\u3011\n\t</div>\n{{/VocabKanji}}\n\n{{#VocabDef}}\t\n\t<div class=\"definitions\">\n\t\t{{furigana:VocabDef}}\n\t</div>\n{{/VocabDef}}\n\n{{#Notes}}\t\n\t<div class=\"notes\">\n\t\t<div class=\"tags\">Notes</div>\n\t\t<div>{{furigana:Notes}}</div>\n\t</div>\n{{/Notes}}\n\n<hr>\n\n<footer>{{#SentKanji}}<a href=\"https://jisho.org/search?keyword={{text:SentKanji}}\" title=\"Sentence on Jisho\">Jisho</a><a href=\"https://www.google.co.jp/search?q={{text:SentKanji}}&tbm=isch\" title=\"Search images\">Images</a>{{/SentKanji}}{{#VocabKanji}}<a href=\"http://tangorin.com/dict.php?dict=general&s={{text:VocabKanji}}\">Tangorin</a><a href=\"http://www.weblio.jp/content/{{text:VocabKanji}}\">Weblio</a><a href=\"https://wadoku.de/search/?q={{text:VocabKanji}}\">Wadoku</a>\t{{/VocabKanji}}</footer>"
}
]
}