mirror of
https://github.com/antebudimir/feishin.git
synced 2025-12-31 18:13:31 +00:00
remove unused length in visualizer
This commit is contained in:
parent
dbf840b185
commit
9f5b4e5410
1 changed files with 0 additions and 24 deletions
|
|
@ -12,8 +12,6 @@ export const Visualizer = () => {
|
||||||
const accent = useSettingsStore((store) => store.general.accent);
|
const accent = useSettingsStore((store) => store.general.accent);
|
||||||
const [motion, setMotion] = useState<AudioMotionAnalyzer>();
|
const [motion, setMotion] = useState<AudioMotionAnalyzer>();
|
||||||
|
|
||||||
const [, setLength] = useState(500);
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const { context, gain } = webAudio || {};
|
const { context, gain } = webAudio || {};
|
||||||
if (gain && context && canvasRef.current && !motion) {
|
if (gain && context && canvasRef.current && !motion) {
|
||||||
|
|
@ -35,28 +33,6 @@ export const Visualizer = () => {
|
||||||
return () => {};
|
return () => {};
|
||||||
}, [accent, canvasRef, motion, webAudio]);
|
}, [accent, canvasRef, motion, webAudio]);
|
||||||
|
|
||||||
const resize = useCallback(() => {
|
|
||||||
const body = document.querySelector('.full-screen-player-queue-container');
|
|
||||||
const header = document.querySelector('.full-screen-player-queue-header');
|
|
||||||
|
|
||||||
if (body && header) {
|
|
||||||
const width = body.clientWidth - 30;
|
|
||||||
const height = body.clientHeight - header.clientHeight - 30;
|
|
||||||
|
|
||||||
setLength(Math.min(width, height));
|
|
||||||
}
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
resize();
|
|
||||||
|
|
||||||
window.addEventListener('resize', resize);
|
|
||||||
|
|
||||||
return () => {
|
|
||||||
window.removeEventListener('resize', resize);
|
|
||||||
};
|
|
||||||
}, [resize]);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className={styles.container}
|
className={styles.container}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue