[Update] Add transliteration position navigator when hiragana and romaji is both enabled and mouse hovered.

This commit is contained in:
Sakamoto Shiina
2025-09-18 00:06:09 +09:00
parent 17e450310e
commit 56af62029a
2 changed files with 13 additions and 6 deletions

View File

@@ -94,17 +94,17 @@ const MessageWithTransliteration = ({ item }) => {
const hira = token.hira ?? "";
const hepburn = token.hepburn ?? "";
if ((hira && orig === hira)) {
if (hira && hira === orig && hepburn) {
return (
<span key={key} title={hepburn} className={styles.token}>
<span key={key} title={hepburn} className={styles.with_hepburn}>
{orig}
</span>
);
}
if (hira && hira !== orig) {
if (hira && hira !== orig && hepburn) {
return (
<ruby key={key} title={hepburn} className={styles.tokenRuby}>
<ruby key={key} title={hepburn} className={styles.with_hepburn}>
{orig}
<rt>{hira}</rt>
</ruby>
@@ -113,7 +113,7 @@ const MessageWithTransliteration = ({ item }) => {
if (hepburn && hepburn !== orig) {
return (
<ruby key={key} className={styles.tokenRuby}>
<ruby key={key} className={styles.ruby}>
{orig}
<rt>{hepburn}</rt>
</ruby>
@@ -121,7 +121,7 @@ const MessageWithTransliteration = ({ item }) => {
}
return (
<span key={key} className={styles.token}>
<span key={key} className={styles.original_only}>
{orig}
</span>
);

View File

@@ -113,3 +113,10 @@
color: var(--dark_500_color);
}
}
// For ruby
.with_hepburn {
&:hover {
color: var(--dark_500_color);
}
}