diff --git a/src/components/translation-block.css b/src/components/translation-block.css index c36a50ec..891703de 100644 --- a/src/components/translation-block.css +++ b/src/components/translation-block.css @@ -82,13 +82,26 @@ } .status-translation-block .translated-block output { display: block; - margin-top: 1em; + margin-top: 0.75em; } .status-translation-block .translated-block output.translated-pronunciation-content { opacity: 0.75; - padding-bottom: 1em; - border-top: var(--hairline-width) solid var(--bg-color); - border-bottom: var(--hairline-width) solid var(--outline-color); + padding-top: 0.75em; + border-top: var(--hairline-width) solid var(--outline-color); + display: -webkit-box; + -webkit-line-clamp: 3; + -webkit-box-orient: vertical; + overflow: hidden; + mask-image: linear-gradient(to top, transparent, black 16px); +} +.status-translation-block + .translated-block + output.translated-pronunciation-content:is(:active, :focus) { + display: block; + -webkit-line-clamp: unset; + -webkit-box-orient: unset; + overflow: visible; + mask-image: none; } diff --git a/src/components/translation-block.jsx b/src/components/translation-block.jsx index 161b778e..91b231ad 100644 --- a/src/components/translation-block.jsx +++ b/src/components/translation-block.jsx @@ -139,14 +139,17 @@ function TranslationBlock({ ) : ( !!translatedContent && ( <> - {!!pronunciationContent && ( - - {pronunciationContent} - - )} {translatedContent} + {!!pronunciationContent && ( + + {pronunciationContent} + + )} ) )}