[Update] Add transliteration position navigator when hiragana and romaji is both enabled and mouse hovered.
This commit is contained in:
@@ -94,17 +94,17 @@ const MessageWithTransliteration = ({ item }) => {
|
|||||||
const hira = token.hira ?? "";
|
const hira = token.hira ?? "";
|
||||||
const hepburn = token.hepburn ?? "";
|
const hepburn = token.hepburn ?? "";
|
||||||
|
|
||||||
if ((hira && orig === hira)) {
|
if (hira && hira === orig && hepburn) {
|
||||||
return (
|
return (
|
||||||
<span key={key} title={hepburn} className={styles.token}>
|
<span key={key} title={hepburn} className={styles.with_hepburn}>
|
||||||
{orig}
|
{orig}
|
||||||
</span>
|
</span>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hira && hira !== orig) {
|
if (hira && hira !== orig && hepburn) {
|
||||||
return (
|
return (
|
||||||
<ruby key={key} title={hepburn} className={styles.tokenRuby}>
|
<ruby key={key} title={hepburn} className={styles.with_hepburn}>
|
||||||
{orig}
|
{orig}
|
||||||
<rt>{hira}</rt>
|
<rt>{hira}</rt>
|
||||||
</ruby>
|
</ruby>
|
||||||
@@ -113,7 +113,7 @@ const MessageWithTransliteration = ({ item }) => {
|
|||||||
|
|
||||||
if (hepburn && hepburn !== orig) {
|
if (hepburn && hepburn !== orig) {
|
||||||
return (
|
return (
|
||||||
<ruby key={key} className={styles.tokenRuby}>
|
<ruby key={key} className={styles.ruby}>
|
||||||
{orig}
|
{orig}
|
||||||
<rt>{hepburn}</rt>
|
<rt>{hepburn}</rt>
|
||||||
</ruby>
|
</ruby>
|
||||||
@@ -121,7 +121,7 @@ const MessageWithTransliteration = ({ item }) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<span key={key} className={styles.token}>
|
<span key={key} className={styles.original_only}>
|
||||||
{orig}
|
{orig}
|
||||||
</span>
|
</span>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -112,4 +112,11 @@
|
|||||||
font-size: 1.2rem;
|
font-size: 1.2rem;
|
||||||
color: var(--dark_500_color);
|
color: var(--dark_500_color);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// For ruby
|
||||||
|
.with_hepburn {
|
||||||
|
&:hover {
|
||||||
|
color: var(--dark_500_color);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user