AnkiNoteTemplate/templates/Japanese sentences/template.css

686 lines
11 KiB
CSS
Raw Normal View History

2021-11-27 14:58:45 +00:00
@charset "utf-8";
2022-12-26 18:18:31 +00:00
@font-face {
font-family: "KanjiStrokeOrders";
src:
local("KanjiStrokeOrders"),
url("_kso.woff2") format("woff2");
2022-12-26 18:18:31 +00:00
}
2022-03-25 05:12:23 +00:00
2022-12-26 18:18:31 +00:00
@font-face {
font-family: "Local Mincho";
src:
local("Yu Mincho"),
local("游明朝"),
local("Noto Serif CJK JP"),
local("IPAexMincho"),
local("IPAex明朝"),
local("IPAMincho"),
local("IPA明朝"),
local("IPAPMincho"),
local("IPA P明朝"),
local("TakaoExMincho"),
local("TakaoEx明朝"),
url("_yumin.woff2") format("woff2");
2022-12-26 18:18:31 +00:00
font-weight: normal;
}
2021-11-27 14:58:45 +00:00
2022-12-26 18:18:31 +00:00
@font-face {
font-family: "Local Mincho";
src:
local("Noto Serif CJK JP SemiBold"),
local("Noto Serif CJK JP DemiLight"),
local("Yu Mincho Demibold"),
local("游明朝 Demibold"),
url("_yumindb.woff2") format("woff2");
2022-12-26 18:18:31 +00:00
font-weight: 600;
2021-11-27 14:58:45 +00:00
}
2022-12-26 18:18:31 +00:00
*,
*::before,
*::after {
2021-11-27 14:58:45 +00:00
box-sizing: border-box;
padding: 0;
margin: 0;
}
2022-12-26 18:18:31 +00:00
b,
strong {
font-weight: 600;
}
2023-07-26 19:44:37 +00:00
2023-05-18 17:05:25 +00:00
.jpsentence b,
.jpsentence strong {
color: #f026cb;
}
2022-12-26 18:18:31 +00:00
2021-11-27 14:58:45 +00:00
.card {
background-color: #fffaf0;
color: #2a1b0a;
font-family:
"Noto Serif",
"Noto Serif CJK JP",
"IPAexMincho",
"Yu Mincho",
"Local Mincho",
"Liberation Serif",
"Times New Roman",
Times,
Georgia,
Serif;
2021-11-27 14:58:45 +00:00
font-size: 24px;
text-align: left;
line-height: 1.4;
margin: 0 auto;
}
.card1 {
color: inherit;
}
.card2 .jpsentence ruby rt {
opacity: 0;
}
2022-03-26 11:47:09 +00:00
2021-11-28 08:44:26 +00:00
.card2 .jpsentence:hover ruby rt {
opacity: 1;
}
2021-11-27 14:58:45 +00:00
@media screen and (min-width: 820px) {
.card {
2021-12-25 03:19:58 +00:00
background-color: #e5d7c9;
2021-11-27 14:58:45 +00:00
display: flex;
justify-content: center;
}
2022-03-26 11:47:09 +00:00
2021-11-27 14:58:45 +00:00
.wrap {
width: 800px;
padding: 0 5px 0;
background-color: #fffaf0;
border-left: 1px solid #c9bcbc;
border-right: 1px solid #c9bcbc;
min-height: 100vh;
}
2022-03-26 11:47:09 +00:00
2021-11-27 14:58:45 +00:00
.wrap .wrap {
width: auto;
padding: 0;
min-height: 0;
border: 0;
}
}
hr {
2022-10-14 21:22:13 +00:00
margin: 8px 0;
2021-11-27 14:58:45 +00:00
clear: both;
border: 0;
border-top: 1px solid #c9bcbc;
}
/* links */
a {
color: #532f2f;
}
a:hover {
color: #722a2a;
}
a.hint {
text-decoration: none;
text-align: center;
display: block;
}
/* Hide furigana on front */
nokana ruby rt {
opacity: 0;
font-size: 0;
display: none;
}
notext b,
notext strong {
2021-11-27 14:58:45 +00:00
background-color: black;
color: transparent;
}
/* Top */
header {
display: flex;
clear: both;
2022-10-23 21:26:12 +00:00
margin: 0 0 8px;
2021-11-27 14:58:45 +00:00
}
header .tags {
border-radius: 0px 0px 3px 3px;
}
2022-03-26 11:47:09 +00:00
header>div:not(:last-child) {
2021-11-27 14:58:45 +00:00
margin-right: 3px;
}
/* Space between elements */
2021-12-18 23:12:13 +00:00
.sent-center {
2021-11-27 14:58:45 +00:00
display: flex;
2021-12-18 23:12:13 +00:00
align-items: center;
2021-11-27 14:58:45 +00:00
justify-content: center;
2021-12-18 23:12:13 +00:00
flex-flow: column nowrap;
2021-11-27 14:58:45 +00:00
}
2024-03-29 10:49:57 +00:00
.sent-center:where(#tsc, #jp1k-tsc):not([visible="true"]) {
/* toggles between JP1K mode and regular TSC mode. */
display: none;
}
2021-12-18 23:12:13 +00:00
/* Japanese sentence */
2021-12-25 03:19:58 +00:00
.jpsentence {
font-size: 35px;
}
2022-12-19 17:29:03 +00:00
2022-10-11 18:54:01 +00:00
.jpsentence b {
display: inline-block;
}
2021-12-20 19:47:56 +00:00
/* Hide front side when the back is shown. */
2022-09-12 16:58:13 +00:00
.fside .jpsentence,
2023-07-26 19:44:37 +00:00
.fside .sent-center,
.fside .images,
.fside .images-details {
2021-12-25 03:19:58 +00:00
display: none;
}
2021-11-27 14:58:45 +00:00
2021-12-25 03:12:08 +00:00
/* English */
2022-03-26 11:47:09 +00:00
div.ensentence>a.hint {
2021-12-25 03:12:08 +00:00
color: #555;
font-size: 14px;
display: block;
2023-07-26 19:44:37 +00:00
border: 1px solid hsl(0deg 80% 50% / 15%);
2021-12-25 03:12:08 +00:00
border-radius: 2.2px;
padding: 2px 10px;
2023-07-26 19:44:37 +00:00
margin: 0.4rem 0;
2021-12-25 03:12:08 +00:00
}
2022-03-26 11:47:09 +00:00
div.ensentence>a.hint:hover {
2023-07-26 19:44:37 +00:00
color: hsl(20deg 100% 20% / 80%);
background-color: hsl(0deg 80% 50% / 3%);
2021-12-25 03:12:08 +00:00
}
2022-12-26 18:19:04 +00:00
/* Definition */
.definitions,
.notes {
font-weight: 300;
}
2021-12-20 19:47:56 +00:00
/* Tags */
2023-03-07 08:14:31 +00:00
.pitch_number,
2021-11-27 14:58:45 +00:00
.tags {
font-family:
"Noto Sans",
"Droid Sans",
"DejaVu Sans",
"Liberation Sans",
Roboto,
Cantarell,
"Segoe UI",
Arial,
Meiryo,
Oxygen,
Ubuntu,
"Helvetica Neue",
Helvetica,
"Noto Color Emoji",
"Noto Sans CJK JP",
Sans,
sans-serif;
2021-11-27 14:58:45 +00:00
text-align: center;
display: inline-block;
text-transform: lowercase;
background-color: #333;
color: #fffaf0;
font-weight: bold;
padding: 1px 3px;
margin: 0;
cursor: pointer;
border-radius: 3px;
font-size: 12px;
line-height: 14px;
2022-10-14 21:22:13 +00:00
user-select: none;
2021-11-27 14:58:45 +00:00
}
/* AnkiDroid replay button */
2022-12-25 06:54:27 +00:00
/* a.replaybutton > span > svg */
2021-12-20 19:47:56 +00:00
2021-11-27 14:58:45 +00:00
.replaybutton {
margin: 0;
text-decoration: none;
}
.replaybutton span {
padding: 0;
font-size: 16px;
}
.replaybutton span svg {
fill: #fffaf0;
background: #333;
border-radius: 3px;
vertical-align: top;
min-width: 16px;
min-height: 16px;
}
/* PC replay button */
2022-12-25 06:54:27 +00:00
/* a.replay-button > svg */
2021-12-20 19:47:56 +00:00
2021-11-27 14:58:45 +00:00
a.replay-button {
top: -0.125em;
position: relative;
margin: 0;
2022-10-14 21:22:13 +00:00
user-select: none;
cursor: pointer;
2021-11-27 14:58:45 +00:00
}
a.replay-button svg {
height: 1em;
width: 1em;
2022-10-14 21:22:13 +00:00
user-select: none;
2021-11-27 14:58:45 +00:00
}
a.replay-button svg path {
fill: #fffaf0;
}
a.replay-button svg circle {
fill: #333;
}
/* Footer and links */
2021-12-20 19:47:56 +00:00
2021-11-27 14:58:45 +00:00
footer {
font-size: 16px;
2022-10-14 21:22:13 +00:00
word-break: keep-all;
2021-11-27 14:58:45 +00:00
text-align: center;
2022-10-14 21:22:13 +00:00
display: flex;
flex-flow: row wrap;
justify-content: center;
align-items: center;
2021-11-27 14:58:45 +00:00
}
2022-03-26 11:47:09 +00:00
footer>a {
2021-11-27 14:58:45 +00:00
text-decoration: none;
2022-10-14 21:22:13 +00:00
cursor: pointer;
2021-11-27 14:58:45 +00:00
}
2022-10-14 21:22:13 +00:00
footer>a:not(:last-child)::after {
2021-11-27 14:58:45 +00:00
content: "·";
color: brown;
display: inline-block;
2022-10-14 21:22:13 +00:00
padding: 0 2px;
2021-11-27 14:58:45 +00:00
}
/* Vocab */
2021-12-20 19:47:56 +00:00
2021-11-27 14:58:45 +00:00
.vocab {
2022-10-14 21:22:13 +00:00
display: flex;
flex-flow: row wrap;
2023-07-26 19:44:37 +00:00
margin-top: 2px;
2022-10-14 21:22:13 +00:00
align-items: center;
gap: 5px;
}
2022-12-19 17:29:03 +00:00
.vocab>.reading,
.vocab>.target_word {
2022-10-14 21:22:13 +00:00
word-break: keep-all;
}
2022-12-19 17:29:03 +00:00
.vocab>.target_word::before {
2022-10-14 21:22:13 +00:00
content: "【";
}
2022-12-19 17:29:03 +00:00
.vocab>.target_word::after {
2022-10-14 21:22:13 +00:00
content: "】";
2021-11-27 14:58:45 +00:00
}
.vocab div {
display: inline-block;
}
.vocab br {
display: none;
}
2023-03-07 08:14:31 +00:00
.vocab .pitch_number,
2022-10-14 21:22:13 +00:00
.vocab .tags {
align-self: flex-start;
2021-11-27 14:58:45 +00:00
vertical-align: top;
}
2022-10-14 21:22:13 +00:00
.notes .tags {
2021-11-27 14:58:45 +00:00
vertical-align: bottom;
}
/* Images */
2021-12-20 19:47:56 +00:00
2021-11-27 14:58:45 +00:00
.images {
2022-03-26 16:11:28 +00:00
margin: 10px 0;
display: grid;
justify-items: center;
align-items: start;
align-content: start;
justify-content: space-around;
gap: 5px;
grid-auto-columns: minmax(100px, 1fr);
grid-auto-rows: minmax(100px, auto);
grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
2022-03-26 16:11:28 +00:00
}
2022-10-14 21:22:13 +00:00
.images br,
.images> :not(img) {
2022-03-26 16:11:28 +00:00
display: none;
visibility: hidden;
2021-11-27 14:58:45 +00:00
}
2024-02-24 18:59:02 +00:00
.images div { /* some unfortunate apps insert divs in cards */
display: contents;
visibility: visible;
}
2022-10-14 21:22:13 +00:00
2022-03-26 16:11:28 +00:00
.images img {
display: block;
2021-11-27 14:58:45 +00:00
border-radius: 4px;
filter: sepia(33%);
2022-03-26 16:11:28 +00:00
max-height: 95vh;
width: 100%;
object-fit: contain;
2022-03-26 16:11:28 +00:00
}
.images img:only-of-type {
width: auto;
2022-09-12 16:58:13 +00:00
}
/* Images on front, toggled by JavaScript if "imageonfront" tag is set. */
2023-07-26 19:44:37 +00:00
.images-on-front:not([visible="true"]) {
2022-09-12 16:58:13 +00:00
display: none;
2021-11-27 14:58:45 +00:00
}
/* Production cards */
2021-12-20 19:47:56 +00:00
.production b,
.production strong {
2021-11-27 14:58:45 +00:00
visibility: hidden;
}
.strokeorder {
text-align: center;
font-size: 150px;
font-family: KanjiStrokeOrders;
}
/* Morphman coloring */
2021-12-20 19:47:56 +00:00
2021-11-27 14:58:45 +00:00
.fside .jpsentence:hover [mtype="unknown"] {
background-color: #ffff99;
}
.fside .jpsentence:hover [mtype="seen"] {
background-color: #ffd1b3;
}
.fside .jpsentence:hover [mtype="known"] {
background-color: #b3e6cc;
}
.fside .jpsentence:hover [mtype="mature"] {
background-color: transparent;
}
.fside .jpsentence:hover [priority="true"] {
color: inherit;
}
.fside .jpsentence:hover [frequency="true"] {
color: inherit;
}
del.MorphManHide,
del.morphmanhide {
display: none;
}
/* Fix for Yomichan defs */
2021-12-20 19:47:56 +00:00
2021-11-27 14:58:45 +00:00
ul,
ol {
list-style-type: none;
display: inline;
margin: 0px;
padding: 0px;
}
/* Fix for Yomichan pitch accents */
2021-12-20 19:47:56 +00:00
2022-03-26 11:47:09 +00:00
.vocab ol>li {
2021-11-27 14:58:45 +00:00
display: inline;
}
2022-03-26 11:47:09 +00:00
.vocab ol>li:after {
2021-11-27 14:58:45 +00:00
content: "・";
}
2022-03-26 11:47:09 +00:00
.vocab ol>li:last-child:after {
2021-11-27 14:58:45 +00:00
content: "";
}
2023-07-26 19:44:37 +00:00
/* Fix: Don't select furigana */
ruby rt {
user-select: none;
}
.jpsentence {
position: relative;
}
.jpsentence>.overlay {
position: absolute;
/* Some versions of Anki don't understand inset. */
top: 0;
right: 0;
bottom: 0;
left: 0;
}
.jpsentence>.background,
.jpsentence>.overlay ruby rt {
visibility: hidden;
}
.jpsentence>.background ruby rt {
visibility: visible;
}
/* Outline editable fields */
div[contenteditable="true"] {
background-color: white;
border: 1px solid gray;
padding: 3px;
box-shadow: 10px 5px 5px gray;
}
/* Details */
details,
.headword_section {
background-color: hsl(0deg 80% 50% / 3%);
border-radius: 4px;
padding: 3px;
margin-block-end: 0.4rem;
border: 1px solid hsl(0deg 80% 50% / 15%);
;
}
summary {
font-size: 18px;
color: hsl(0 80% 10% / 70%);
font-weight: 500;
2023-08-21 04:55:57 +00:00
user-select: none;
2023-07-26 19:44:37 +00:00
}
2021-11-27 14:58:45 +00:00
/* Night Mode */
2021-12-20 19:47:56 +00:00
2022-03-25 05:12:23 +00:00
.nightMode.card {
2022-12-19 17:29:03 +00:00
background-color: #2f2f31;
2022-03-25 05:12:23 +00:00
}
2022-01-10 01:10:21 +00:00
.nightMode .wrap {
2022-12-19 17:29:03 +00:00
color: #ffffff;
2022-03-25 05:12:23 +00:00
background-color: inherit;
2023-07-26 19:44:37 +00:00
border-color: #6d6868;
2022-01-10 01:10:21 +00:00
}
2021-11-27 14:58:45 +00:00
.nightMode .tags {
2022-12-19 17:29:03 +00:00
background-color: #ffffff;
color: #2f2f31;
2021-11-27 14:58:45 +00:00
}
.nightMode a.replay-button svg path {
2022-12-19 17:29:03 +00:00
fill: #2f2f31;
2021-11-27 14:58:45 +00:00
}
.nightMode a.replay-button svg circle {
2022-12-19 17:29:03 +00:00
fill: #ffffff;
2021-11-27 14:58:45 +00:00
}
.nightMode .replaybutton span svg {
2022-12-19 17:29:03 +00:00
fill: #2f2f31;
background: #ffffff;
2021-11-27 14:58:45 +00:00
}
.nightMode a {
2022-01-10 01:10:21 +00:00
color: #c7493a;
2021-11-27 14:58:45 +00:00
}
.nightMode a:hover {
2022-01-10 01:10:21 +00:00
color: #a33327;
2021-11-27 14:58:45 +00:00
}
.nightMode .jpsentence b,
.nightMode .jpsentence strong {
2021-11-27 14:58:45 +00:00
color: gray;
}
2022-03-26 11:47:09 +00:00
.nightMode .images>img {
2022-01-01 21:54:07 +00:00
filter: sepia(0%);
2021-11-27 14:58:45 +00:00
}
2021-12-21 04:03:49 +00:00
2022-03-26 11:47:09 +00:00
.nightMode div.ensentence>a.hint {
2022-12-19 17:29:03 +00:00
color: #ffffff;
border: 1px solid #ffffff;
2022-01-01 21:54:07 +00:00
}
2021-12-21 04:03:49 +00:00
2022-03-26 11:47:09 +00:00
.nightMode div.ensentence>a.hint:hover {
2022-01-01 21:54:07 +00:00
color: gray;
2022-12-19 17:29:03 +00:00
background-color: rgba(0, 0, 0, 0.2);
2021-12-21 04:03:49 +00:00
}
2023-07-26 19:44:37 +00:00
.nightMode summary {
color: hsl(0 80% 100% / 70%);
}
2022-12-19 17:29:03 +00:00
2023-07-26 19:44:37 +00:00
/* Tooltips */
.tooltip {
2022-10-14 21:22:13 +00:00
position: relative;
2023-07-26 19:44:37 +00:00
display: inline-block;
2022-10-14 21:22:13 +00:00
}
2022-12-19 17:29:03 +00:00
2023-07-26 19:44:37 +00:00
.tooltip::after {
content: "";
display: block;
2022-10-14 21:22:13 +00:00
position: absolute;
2023-07-26 19:44:37 +00:00
bottom: 5px;
right: 0;
left: 0;
2023-07-26 19:44:37 +00:00
border-bottom: 2px dotted hsl(0 80% 40% / 20%);
2022-10-14 21:22:13 +00:00
}
2022-12-19 17:29:03 +00:00
2023-07-26 19:44:37 +00:00
.tooltip>.tooltip-text {
font-weight: 500;
font-size: 18px;
2022-10-14 21:22:13 +00:00
visibility: hidden;
2023-07-26 19:44:37 +00:00
width: 120px;
background-color: black;
color: #fff;
text-align: left;
border-radius: 6px;
padding: 0 2px;
position: absolute;
z-index: 999;
top: calc(100% + 6px);
left: 50%;
margin-left: -60px;
word-break: keep-all;
2022-10-14 21:22:13 +00:00
}
2022-12-19 17:29:03 +00:00
2023-07-26 19:44:37 +00:00
.tooltip .tooltip-text::after {
content: "";
position: absolute;
bottom: 100%;
left: 50%;
margin-left: -5px;
border-width: 5px;
border-style: solid;
border-color: transparent transparent black transparent;
}
.tooltip:hover .tooltip-text {
2022-10-14 21:22:13 +00:00
visibility: visible;
2022-12-19 17:29:03 +00:00
}
2023-07-26 19:44:37 +00:00
.tooltip>.tags {
position: absolute;
top: 0px;
right: -9px;
}
2022-12-19 17:29:03 +00:00
2023-07-26 19:44:37 +00:00
.tooltip-text>.tooltip-reading:not(:last-child)::after {
content: "; ";
color: #f6a192;
}
2024-03-29 10:49:57 +00:00
/* Toggle furigana button - JP1K mode */
.toggle_furigana_button {
font-size: 14px;
font-weight: bold;
cursor: pointer;
padding: 8px 4px;
border-radius: 4px;
background-color: #333;
color: #fffaf0;
border: 0;
outline: 0;
margin: 0 0 6px;
}
.toggle_furigana_button:hover,
.toggle_furigana_button:active {
background-color: #4f4f4f;
background: #4f4f4f;
border: none;
}
/* Hidden furigana on front - JP1K mode */
#jp1k-tsc ruby rt {
visibility: hidden;
}
#jp1k-tsc ruby:hover rt {
visibility: visible;
}