Update "Japanese sentences (nb)" template

This commit merges changes from the original "Japanese sentences"
template.
This commit is contained in:
Nikolay Belikov 2022-04-18 22:06:37 +03:00
parent 8cfd53c20b
commit ef49995162
2 changed files with 78 additions and 62 deletions

View file

@ -15,14 +15,11 @@
<script> <script>
function threeDots() { function threeDots() {
const sent = document.getElementsByClassName("production")[0]; for (const hidden of document.querySelectorAll(".production b, .production strong")) {
if (sent) {
for (const hidden of sent.getElementsByTagName("b")) {
hidden.style.visibility = "visible"; hidden.style.visibility = "visible";
hidden.innerText = "【" + hidden.innerText.replace(/[^ぁ-んァ-ン]/g, "") + "】"; hidden.innerText = "【" + hidden.innerText.replace(/[^ぁ-んァ-ン]/g, "") + "】";
} }
} }
}
/* Splits tags into separate divs */ /* Splits tags into separate divs */
function splitTagDiv() { function splitTagDiv() {
const header = document.querySelector("header"); const header = document.querySelector("header");

View file

@ -1,5 +1,8 @@
@charset "utf-8"; @charset "utf-8";
@media screen and (min-width: 900px) {
/* Limit font loading to wide screens to avoid performance hits on mobile. */
@font-face { @font-face {
font-family: "KanjiStrokeOrders"; font-family: "KanjiStrokeOrders";
src: local("KanjiStrokeOrders"), url("_kso.ttf"); src: local("KanjiStrokeOrders"), url("_kso.ttf");
@ -16,6 +19,11 @@
font-weight: 600; font-weight: 600;
} }
b, strong {
font-weight: 600;
}
}
* { * {
box-sizing: border-box; box-sizing: border-box;
padding: 0; padding: 0;
@ -40,6 +48,7 @@
.card2 .jpsentence ruby rt { .card2 .jpsentence ruby rt {
opacity: 0; opacity: 0;
} }
.card2 .jpsentence:hover ruby rt { .card2 .jpsentence:hover ruby rt {
opacity: 1; opacity: 1;
} }
@ -50,6 +59,7 @@
display: flex; display: flex;
justify-content: center; justify-content: center;
} }
.wrap { .wrap {
width: 800px; width: 800px;
padding: 0 5px 0; padding: 0 5px 0;
@ -58,6 +68,7 @@
border-right: 1px solid #c9bcbc; border-right: 1px solid #c9bcbc;
min-height: 100vh; min-height: 100vh;
} }
.wrap .wrap { .wrap .wrap {
width: auto; width: auto;
padding: 0; padding: 0;
@ -73,10 +84,6 @@ hr {
border-top: 1px solid #c9bcbc; border-top: 1px solid #c9bcbc;
} }
b {
font-weight: 600;
}
/* links */ /* links */
a { a {
color: #532f2f; color: #532f2f;
@ -99,7 +106,8 @@ nokana ruby rt {
display: none; display: none;
} }
notext b { notext b,
notext strong {
background-color: black; background-color: black;
color: transparent; color: transparent;
} }
@ -119,13 +127,6 @@ header > div:not(:last-child) {
} }
/* Space between elements */ /* Space between elements */
.images {
margin-top: 16px;
}
.images > img {
margin-bottom: 16px;
}
.sent-center { .sent-center {
display: flex; display: flex;
@ -140,7 +141,10 @@ header > div:not(:last-child) {
font-size: 35px; font-size: 35px;
} }
.jpsentence b { color: Maroon; } .jpsentence b,
.jpsentence strong {
color: Maroon;
}
/* Hide front side when the back is shown. */ /* Hide front side when the back is shown. */
@ -159,6 +163,7 @@ div.ensentence > a.hint {
padding: 2px 10px; padding: 2px 10px;
margin: 4px 0; margin: 4px 0;
} }
div.ensentence>a.hint:hover { div.ensentence>a.hint:hover {
color: #111; color: #111;
background-color: rgba(0, 0, 0, 0.03); background-color: rgba(0, 0, 0, 0.03);
@ -279,27 +284,40 @@ footer > a:last-child:after {
/* Images */ /* Images */
.images { .images {
display: flex; margin: 10px 0;
flex-wrap: wrap; display: grid;
flex-direction: row; justify-items: center;
align-items: flex-start; align-items: start;
align-content: space-between; align-content: start;
justify-content: space-evenly; justify-content: space-around;
gap: 5px;
grid-auto-columns: minmax(100px, 1fr);
grid-auto-rows: minmax(100px, auto);
} }
.images br, .images > * {
.images > img { display: none;
max-width: 47%; }
.images img {
display: block;
border-radius: 4px; border-radius: 4px;
filter: sepia(33%); filter: sepia(33%);
}
.images > img:only-child {
max-width: 100%; max-width: 100%;
max-height: 95vh;
}
.images img:nth-child(3n+1) {
grid-column: 1;
}
.images img:nth-child(3n+2) {
grid-column: 2;
}
.images img:nth-child(3n+3) {
grid-column: 3;
} }
/* Production cards */ /* Production cards */
.production b { .production b,
.production strong {
visibility: hidden; visibility: hidden;
} }
@ -336,12 +354,12 @@ ol {
/* Night Mode */ /* Night Mode */
.nightMode.card { .nightMode.card {
color: #FFFFFF; background-color: #2F2F31;
background-color: #212121;
} }
.nightMode .wrap { .nightMode .wrap {
background-color: #2F2F31; color: #FFFFFF;
background-color: inherit;
} }
.nightMode .tags { .nightMode .tags {
@ -370,7 +388,8 @@ ol {
color: #a33327; color: #a33327;
} }
.nightMode .jpsentence b { .nightMode .jpsentence b,
.nightMode .jpsentence strong {
color: NavajoWhite; color: NavajoWhite;
} }