mirror of
https://github.com/antebudimir/feishin.git
synced 2026-01-02 02:43:33 +00:00
parent
e3946a9413
commit
31492fa9ef
13 changed files with 243 additions and 46 deletions
|
|
@ -55,6 +55,7 @@ const SynchronizedLyricsContainer = styled.div<{ $gap: number }>`
|
|||
|
||||
export interface SynchronizedLyricsProps extends Omit<FullLyricsMetadata, 'lyrics'> {
|
||||
lyrics: SynchronizedLyricsArray;
|
||||
translatedLyrics?: string | null;
|
||||
}
|
||||
|
||||
export const SynchronizedLyrics = ({
|
||||
|
|
@ -63,6 +64,7 @@ export const SynchronizedLyrics = ({
|
|||
name,
|
||||
remote,
|
||||
source,
|
||||
translatedLyrics,
|
||||
}: SynchronizedLyricsProps) => {
|
||||
const playersRef = PlayersRef;
|
||||
const status = useCurrentStatus();
|
||||
|
|
@ -364,15 +366,25 @@ export const SynchronizedLyrics = ({
|
|||
/>
|
||||
)}
|
||||
{lyrics.map(([time, text], idx) => (
|
||||
<LyricLine
|
||||
key={idx}
|
||||
alignment={settings.alignment}
|
||||
className="lyric-line synchronized"
|
||||
fontSize={settings.fontSize}
|
||||
id={`lyric-${idx}`}
|
||||
text={text}
|
||||
onClick={() => handleSeek(time / 1000)}
|
||||
/>
|
||||
<div key={idx}>
|
||||
<LyricLine
|
||||
alignment={settings.alignment}
|
||||
className="lyric-line synchronized"
|
||||
fontSize={settings.fontSize}
|
||||
id={`lyric-${idx}`}
|
||||
text={text}
|
||||
onClick={() => handleSeek(time / 1000)}
|
||||
/>
|
||||
{translatedLyrics && (
|
||||
<LyricLine
|
||||
alignment={settings.alignment}
|
||||
className="lyric-line synchronized translation"
|
||||
fontSize={settings.fontSize * 0.8}
|
||||
text={translatedLyrics.split('\n')[idx]}
|
||||
onClick={() => handleSeek(time / 1000)}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
))}
|
||||
</SynchronizedLyricsContainer>
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue