diff --git a/src/equicordplugins/musicControls/settings.tsx b/src/equicordplugins/musicControls/settings.tsx index 6b3c3cae5..4ac213139 100644 --- a/src/equicordplugins/musicControls/settings.tsx +++ b/src/equicordplugins/musicControls/settings.tsx @@ -159,16 +159,6 @@ export const settings = definePluginSettings({ default: 0, ...sliderOptions }, - SyncMode: { - description: "Lyrics sync mode", - type: OptionType.SELECT, - options: [ - { value: "line", label: "Line" }, - { value: "word", label: "Word", default: true }, - { value: "character", label: "Character" }, - ], - default: "word", - }, PurgeLyricsCache: { description: "Purge the lyrics cache", type: OptionType.COMPONENT, diff --git a/src/equicordplugins/musicControls/styles.css b/src/equicordplugins/musicControls/styles.css index b0a42927f..d8e671fbf 100644 --- a/src/equicordplugins/musicControls/styles.css +++ b/src/equicordplugins/musicControls/styles.css @@ -158,90 +158,4 @@ .eq-tidal-lyrics-modal-no-lyrics { text-align: center; padding: 1rem; -} - -/* Character sync styles */ -.eq-tidal-lyrics-char { - color: var(--text-muted); - padding: 0 1px; - display: inline-block; - transition: color .15s ease, opacity .15s ease, transform .15s ease, text-shadow .15s ease; - will-change: transform, color, opacity, text-shadow; -} - -.eq-tidal-lyrics-char-active { - color: var(--brand-experiment); - font-weight: 600; - text-shadow: 0 0 .25em currentcolor; -} - -.eq-tidal-lyrics-word { - color: var(--text-muted); - border-radius: 4px; - padding: 0 1px; - margin-right: 2px; - border: 1px solid transparent; - display: inline-block; - transition: color .15s ease, opacity .15s ease, background-color .15s ease, box-shadow .15s ease, transform .15s ease; - will-change: transform, color, opacity, background-color, box-shadow; -} - -.eq-tidal-lyrics-word:last-child { - margin-right: 0; -} - -.eq-tidal-lyrics-word-active { - color: var(--brand-experiment); - background: none; - box-shadow: none; - text-shadow: 0 0 .25em currentcolor; -} - -.eq-tidal-lyrics-current, -.eq-tidal-lyrics-next, -.eq-tidal-lyrics-prev { - transition: color .2s ease, opacity .2s ease, transform .2s ease, text-shadow .2s ease; -} - -.eq-tidal-lyrics-current { - font-weight: 600; - text-shadow: 0 0 .35em rgb(0 0 0 / 15%); -} - -.eq-tidal-lyrics-next { - opacity: .85; -} - -.eq-tidal-lyrics-prev { - opacity: .65; -} - -.eq-tidal-lyrics-current .eq-tidal-lyrics-char, -.eq-tidal-lyrics-current .eq-tidal-lyrics-word { - color: var(--text-normal); -} - -.eq-tidal-lyrics-next .eq-tidal-lyrics-char, -.eq-tidal-lyrics-prev .eq-tidal-lyrics-char, -.eq-tidal-lyrics-next .eq-tidal-lyrics-word, -.eq-tidal-lyrics-prev .eq-tidal-lyrics-word { - color: var(--text-muted); -} - - -@media (prefers-reduced-motion: reduce) { - - .eq-tidal-lyrics-current, - .eq-tidal-lyrics-next, - .eq-tidal-lyrics-prev, - .eq-tidal-lyrics-char, - .eq-tidal-lyrics-word { - transition: none; - text-shadow: none; - } - - .eq-tidal-lyrics-char-active, - .eq-tidal-lyrics-word-active { - transform: none; - } } \ No newline at end of file diff --git a/src/equicordplugins/musicControls/tidal/TidalStore.ts b/src/equicordplugins/musicControls/tidal/TidalStore.ts index a5e1b1ec4..37503be81 100644 --- a/src/equicordplugins/musicControls/tidal/TidalStore.ts +++ b/src/equicordplugins/musicControls/tidal/TidalStore.ts @@ -149,7 +149,7 @@ export const TidalStore = proxyLazyWebpack(() => { public repeat: Repeat = 0; public shuffle = false; public volume = 100; - private playerElement: HTMLElement | null = null; + public playerElement: HTMLElement | null = null; public socket = new TidalSocket((message: Message) => { if (message.type === "update" && message.all && message.fields) { const apiData = message.fields; diff --git a/src/equicordplugins/musicControls/tidal/lyrics/components/lyrics.tsx b/src/equicordplugins/musicControls/tidal/lyrics/components/lyrics.tsx index a07f270a7..414448927 100644 --- a/src/equicordplugins/musicControls/tidal/lyrics/components/lyrics.tsx +++ b/src/equicordplugins/musicControls/tidal/lyrics/components/lyrics.tsx @@ -15,11 +15,10 @@ import { LyricsModal } from "./modal"; import { cl, NoteSvg, useLyrics } from "./util"; function LyricsDisplay({ scroll = true }: { scroll?: boolean; }) { - const { ShowMusicNoteOnNoLyrics, SyncMode } = settings.use(["ShowMusicNoteOnNoLyrics", "SyncMode"]); + const { ShowMusicNoteOnNoLyrics } = settings.use(["ShowMusicNoteOnNoLyrics"]); const { lyrics, lyricRefs, currLrcIndex, nextLyric } = useLyrics({ scroll }); const currentLyrics = lyrics || null; const NoteElement = NoteSvg(cl("music-note")); - const position = useStateFromStores([TidalStore], () => TidalStore.mPosition); const makeClassName = (index: number): string => { if (currLrcIndex === null) return ""; @@ -52,53 +51,7 @@ function LyricsDisplay({ scroll = true }: { scroll?: boolean; }) { variant={currLrcIndex === i ? "text-sm/normal" : "text-xs/normal"} className={makeClassName(i)} > - {SyncMode === "character" && line.characters && line.characters.length > 0 && line.words && line.words.length > 0 ? ( - line.words.map((word, wIdx) => ( - - {word.characters.map((char, j) => { - const charActive = position / 1000 >= char.time && position / 1000 < char.endTime; - return ( - - {char.char} - - ); - })} - {wIdx < line.words.length - 1 && } - - )) - ) : SyncMode === "character" && line.characters && line.characters.length > 0 ? ( - line.characters.map((char, j) => { - const charActive = position / 1000 >= char.time && position / 1000 < char.endTime; - return ( - - {char.char} - - ); - }) - ) : SyncMode === "word" && line.words && line.words.length > 0 ? ( - line.words.map((word, j) => { - const wordActive = position / 1000 >= word.time && position / 1000 < word.endTime; - return ( - - {word.word} - - ); - }) - ) : ( - line.text || NoteElement - )} + {line.text || NoteElement} ))} diff --git a/src/equicordplugins/musicControls/tidal/lyrics/components/modal.tsx b/src/equicordplugins/musicControls/tidal/lyrics/components/modal.tsx index 940e24de1..6016bd5b7 100644 --- a/src/equicordplugins/musicControls/tidal/lyrics/components/modal.tsx +++ b/src/equicordplugins/musicControls/tidal/lyrics/components/modal.tsx @@ -7,7 +7,6 @@ import { ModalContent, ModalHeader, ModalProps, ModalRoot } from "@utils/modal"; import { Text } from "@webpack/common"; -import { settings } from "../../../settings"; import { TidalStore, Track } from "../../TidalStore"; import { cl, NoteSvg, scrollClasses, useLyrics } from "./util"; @@ -41,8 +40,6 @@ function ModalHeaderContent({ track }: { track: Track; }) { export function LyricsModal({ rootProps }: { rootProps: ModalProps; }) { const { track, lyrics, currLrcIndex } = useLyrics({ scroll: false }); const currentLyrics = lyrics || null; - const position = track ? TidalStore.mPosition : 0; - const { SyncMode } = settings.use(["SyncMode"]); return ( @@ -61,54 +58,7 @@ export function LyricsModal({ rootProps }: { rootProps: ModalProps; }) { onClick={() => TidalStore.seek(line.time * 1000)} > {formatTime(line.time)} - - {SyncMode === "character" && line.characters && line.characters.length > 0 && line.words && line.words.length > 0 ? ( - line.words.map((word, wIdx) => ( - - {word.characters.map((char, j) => { - const charActive = position / 1000 >= char.time && position / 1000 < char.endTime; - return ( - - {char.char} - - ); - })} - {wIdx < line.words.length - 1 && } - - )) - ) : SyncMode === "character" && line.characters && line.characters.length > 0 ? ( - line.characters.map((char, j) => { - const charActive = position / 1000 >= char.time && position / 1000 < char.endTime; - return ( - - {char.char} - - ); - }) - ) : SyncMode === "word" && line.words && line.words.length > 0 ? ( - line.words.map((word, j) => { - const wordActive = position / 1000 >= word.time && position / 1000 < word.endTime; - return ( - - {word.word} - - ); - }) - ) : ( - line.text || NoteSvg(cl("modal-note")) - )} + {line.text || NoteSvg(cl("modal-note"))} )) ) : (