Added support for changing the song timer bar color

This commit is contained in:
Lee 2022-12-23 15:41:35 +00:00
parent 211c5a043d
commit fbdf432e0c
No known key found for this signature in database
GPG Key ID: 6EA25896ECCB3121
3 changed files with 12 additions and 5 deletions

@ -42,9 +42,12 @@ function formatDiff(diff) {
} }
export default function SongInfo() { export default function SongInfo() {
const [showSongInfo, shouldReplacePlayerInfoWithScore] = useSettingsStore( const [showSongInfo, shouldReplacePlayerInfoWithScore, songTimeHex] =
(store) => [store.showSongInfo, store.shouldReplacePlayerInfoWithScore] useSettingsStore((store) => [
); store.showSongInfo,
store.shouldReplacePlayerInfoWithScore,
store.songTimeHex,
]);
const [ const [
isLoading, isLoading,
bsr, bsr,
@ -117,7 +120,10 @@ export default function SongInfo() {
<div className={styles.songTimeBackground} /> <div className={styles.songTimeBackground} />
<div <div
className={styles.songTime} className={styles.songTime}
style={{ width: songTimerPercentage + "%" }} style={{
width: songTimerPercentage + "%",
backgroundColor: "#" + songTimeHex,
}}
/> />
</div> </div>
</div> </div>

@ -11,6 +11,7 @@ interface SettingsState {
showSongInfo: boolean; showSongInfo: boolean;
showCutStats: boolean; showCutStats: boolean;
shouldReplacePlayerInfoWithScore: boolean; shouldReplacePlayerInfoWithScore: boolean;
songTimeHex: string;
setMounted: (isMounted: boolean) => void; setMounted: (isMounted: boolean) => void;
setOverlaySettings: (params: string) => void; setOverlaySettings: (params: string) => void;
} }
@ -25,6 +26,7 @@ export const useSettingsStore = create<SettingsState>()((set) => ({
showSongInfo: false, showSongInfo: false,
showCutStats: false, showCutStats: false,
shouldReplacePlayerInfoWithScore: false, shouldReplacePlayerInfoWithScore: false,
songTimeHex: "FF0000",
setMounted: (isMounted: boolean) => set(() => ({ mounted: isMounted })), setMounted: (isMounted: boolean) => set(() => ({ mounted: isMounted })),
setOverlaySettings: (params: any) => setOverlaySettings: (params: any) =>

@ -68,7 +68,6 @@
grid-row: 1; grid-row: 1;
z-index: 2; z-index: 2;
padding: 3px; padding: 3px;
background-color: red !important;
} }
.songTimeText { .songTimeText {