Added support for changing the song timer bar color
This commit is contained in:
parent
211c5a043d
commit
fbdf432e0c
@ -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 {
|
||||||
|
Reference in New Issue
Block a user