Working towards adding icons

This commit is contained in:
FromTheLOLAshes committed 2024-03-25 22:21:41 +07:00
1 parent f3d7fe6ea5
commit 45ae2999ae
6 files changed
+20 -6

No files matched your search

@@ -38,6 +38,8 @@ export const TrackContext = createContext<{
}) => void;
selectClip: (clipId: string) => void;
updateCurrentTime: (time: number) => void;
toggleLipSyncMute: (characterId: string) => void;
toggleAudioMute: () => void;
}>({
characters: [],
camera: null,
@@ -53,4 +55,6 @@ export const TrackContext = createContext<{
updateObject: () => {},
selectClip: () => {},
updateCurrentTime: () => {},
toggleLipSyncMute: () => {},
toggleAudioMute: () => {},
});
+7 -2
View File
@@ -10,9 +10,10 @@ interface Props {
}
export const TrackProvider = ({ children }: Props) => {
const { characters, updateCharacters } = useUpdateCharacters();
const { characters, updateCharacters, toggleLipSyncMute } =
useUpdateCharacters();
const { camera, updateCamera } = useUpdateCamera();
const { audio, updateAudio } = useUpdateAudio();
const { audio, updateAudio, toggleAudioMute } = useUpdateAudio();
const { objects, updateObject } = useUpdateObject();
const [selectedClip, setSelectedClip] = useState<string | null>(null);
const [time, setTime] = useState(0);
@@ -41,6 +42,8 @@ export const TrackProvider = ({ children }: Props) => {
selectClip,
selectedClip,
updateCurrentTime,
toggleLipSyncMute,
toggleAudioMute,
};
}, [
characters,
@@ -55,6 +58,8 @@ export const TrackProvider = ({ children }: Props) => {
updateObject,
time,
updateCurrentTime,
toggleLipSyncMute,
toggleAudioMute,
]);
return (
<TrackContext.Provider value={values}>{children}</TrackContext.Provider>
@@ -120,7 +120,7 @@ export default function useUpdateCharacters() {
[],
);
const toggleAudioMute = useCallback((characterId: string) => {
const toggleLipSyncMute = useCallback((characterId: string) => {
setCharacters((oldCharacters) => {
return oldCharacters.map((character) => ({
...character,
@@ -133,6 +133,6 @@ export default function useUpdateCharacters() {
return {
characters,
updateCharacters,
toggleAudioMute,
toggleLipSyncMute,
};
}
@@ -114,6 +114,12 @@ export const Character = ({ characterId }: Props) => {
>
Lipsync Audio Track
</div>
<button
className="absolute text-xs text-white"
style={{ top: 6, left: -20 }}
>
<i className="fas fa-volume-mute"></i>
</button>
</div>
</div>
</div>
@@ -8,7 +8,7 @@ export const Objects = () => {
return (
<div
className="block rounded-lg bg-character-groupBg pl-2 pr-4"
className="bg-objects-groupBg block rounded-lg pl-2 pr-4"
style={{ width: fullWidth + 90 }}
>
<div className="mb-2 text-sm text-white">Objects</div>
@@ -9,7 +9,6 @@ interface Props {
style: "character" | "camera" | "audio" | "objects";
clip: BaseClip;
updateClip: (options: { id: string; offset: number; length: number }) => void;
selected?: boolean;
}
export const TrackClip = ({ clip, min, max, style, updateClip }: Props) => {