mirror of
https://github.com/jeffvli/feishin.git
synced 2026-08-08 05:12:57 +02:00
fix: f11 fullscreen was completely broken on linux/windows; feat: butterchurn preset expansion + randomized preset arrows (#2280)
* added a ton of visualizers * added f11 toggle functionality, f11 makes visualizer cover entire screen when pressed while visualizer is maximized Bundling the additional butterchurn preset packs (extra, md1) pushed renderer build memory past the default ~2GB Node heap on the macOS CI runner, causing OOM crashes during the build. --------- Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
import { motion, Variants } from 'motion/react';
|
||||
import { lazy, memo, ReactNode, Suspense, useLayoutEffect, useRef } from 'react';
|
||||
import { lazy, memo, ReactNode, Suspense, useEffect, useLayoutEffect, useRef } from 'react';
|
||||
import { useLocation } from 'react-router';
|
||||
|
||||
import styles from './full-screen-visualizer.module.css';
|
||||
|
||||
import { FullScreenVisualizerSongInfo } from '/@/renderer/features/player/components/full-screen-visualizer-song-info';
|
||||
import { VISUALIZER_FULLSCREEN_TARGET_ID } from '/@/renderer/hooks/use-fullscreen-toggle';
|
||||
import { useHotkeys } from '/@/renderer/hooks/use-hotkeys';
|
||||
import { useIsMobile } from '/@/renderer/hooks/use-is-mobile';
|
||||
import { useFullScreenPlayerStoreActions } from '/@/renderer/store/full-screen-player.store';
|
||||
@@ -139,11 +140,25 @@ export const FullScreenVisualizer = () => {
|
||||
const isOpenedRef = useRef<boolean | null>(null);
|
||||
|
||||
const handleCloseVisualizer = () => {
|
||||
// While fullscreen, Escape is the browser's own "leave fullscreen" gesture.
|
||||
// Let it drop back to the expanded-but-windowed visualizer instead of closing.
|
||||
if (document.fullscreenElement) return;
|
||||
|
||||
setStore({ visualizerExpanded: false });
|
||||
};
|
||||
|
||||
useHotkeys([['Escape', handleCloseVisualizer]]);
|
||||
|
||||
// Never leave the window stuck in fullscreen if the visualizer goes away while
|
||||
// fullscreened (route change, close button, etc.).
|
||||
useEffect(() => {
|
||||
return () => {
|
||||
if (document.fullscreenElement) {
|
||||
document.exitFullscreen().catch(() => {});
|
||||
}
|
||||
};
|
||||
}, []);
|
||||
|
||||
useLayoutEffect(() => {
|
||||
if (isOpenedRef.current !== null) {
|
||||
setStore({ visualizerExpanded: false });
|
||||
@@ -154,7 +169,7 @@ export const FullScreenVisualizer = () => {
|
||||
|
||||
return (
|
||||
<VisualizerContainer isMobile={isMobile} windowBarStyle={windowBarStyle}>
|
||||
<div className={styles.visualizerContainer}>
|
||||
<div className={styles.visualizerContainer} id={VISUALIZER_FULLSCREEN_TARGET_ID}>
|
||||
{webAudio ? (
|
||||
<Suspense fallback={<></>}>
|
||||
{visualizerType === 'butterchurn' ? (
|
||||
|
||||
Reference in New Issue
Block a user