Improved lyric syncing, fetch

- uses a somewhat more sane way to parse lyrics and teardown timeouts
- adds 'seeked' to setCurrentTime to make detecting seeks in lyric much easier
- adds ability to fetch lyrics from genius/netease (desktop only)
This commit is contained in:
Kendall Garner 2023-05-28 14:31:49 -07:00 committed by Jeff
parent 23f9bd4e9f
commit 85d2576bdc
25 changed files with 907 additions and 118 deletions

View file

@ -1,20 +1,24 @@
import { ComponentPropsWithoutRef } from 'react';
import { TextTitle } from '/@/renderer/components/text-title';
import styled from 'styled-components';
interface LyricLineProps extends ComponentPropsWithoutRef<'div'> {
active: boolean;
lyric: string;
text: string;
}
export const LyricLine = ({ lyric: text, active, ...props }: LyricLineProps) => {
return (
<TextTitle
lh={active ? '4rem' : '3.5rem'}
sx={{ fontSize: active ? '2.5rem' : '2rem' }}
weight={active ? 800 : 100}
{...props}
>
{text}
</TextTitle>
);
const StyledText = styled(TextTitle)`
font-size: 2rem;
font-weight: 100;
line-height: 3.5rem;
&.active,
&.credit {
font-size: 2.5rem;
font-weight: 800;
line-height: 4rem;
}
`;
export const LyricLine = ({ text, ...props }: LyricLineProps) => {
return <StyledText {...props}>{text}</StyledText>;
};