mirror of
https://github.com/socatlolmeow/drift.git
synced 2026-11-03 19:27:19 +00:00
feat: add synced lyrics panel and fullscreen view
- fetch lyrics from lrclib in the background, only while visible - L toggles side panel, F opens fullscreen, :lyrics as a command - highlight current line with a progress fill, fade surrounding lines - fall back to scrollable plain lyrics when no synced version exists
This commit is contained in:
parent
bf11685a03
commit
8f650f8820
6 changed files with 497 additions and 43 deletions
|
|
@ -36,6 +36,7 @@ pub enum Command {
|
|||
AddTo(String),
|
||||
Import(String),
|
||||
Artist,
|
||||
Lyrics,
|
||||
Help,
|
||||
}
|
||||
|
||||
|
|
@ -68,6 +69,7 @@ pub const COMMAND_NAMES: &[&str] = &[
|
|||
"addto",
|
||||
"import",
|
||||
"artist",
|
||||
"lyrics",
|
||||
"help",
|
||||
];
|
||||
|
||||
|
|
@ -175,6 +177,7 @@ pub fn parse(line: &str) -> Result<Option<Command>, String> {
|
|||
Import(arg.to_string())
|
||||
}
|
||||
"artist" | "ar" => Artist,
|
||||
"lyrics" | "ly" => Lyrics,
|
||||
"help" | "h" => Help,
|
||||
other => return Err(format!("unknown command: :{other} (try :help)")),
|
||||
};
|
||||
|
|
@ -238,6 +241,7 @@ mod tests {
|
|||
fn artist_command() {
|
||||
assert_eq!(parse("artist"), Ok(Some(Command::Artist)));
|
||||
assert_eq!(parse(":ar"), Ok(Some(Command::Artist)));
|
||||
assert_eq!(parse("lyrics"), Ok(Some(Command::Lyrics)));
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
|
|||
Loading…
Reference in a new issue