feat: add SFX volume control and improve audio feedback
- Implemented separate sound effects volume control in settings. - Updated backend to handle new `sfx_volume` parameter. - Enhanced UI to include sound effects volume slider in admin panel. - Integrated sound effects for various user interactions (clicks, navigation, alerts). - Added a new global sound engine to manage audio synthesis without external files. - Updated documentation for Docker deployment and Windows packaging. - Refactored audio context management to ensure sound effects are available post user interaction.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { useEffect } from 'react';
|
||||
import { useNavigate, useLocation } from 'react-router-dom';
|
||||
import { Sfx } from './sounds';
|
||||
|
||||
/* =========================================================
|
||||
页面循环导航 —— 左右方向键切换大屏页面
|
||||
@@ -34,8 +35,10 @@ export function usePageNav() {
|
||||
if (idx === -1) return;
|
||||
const n = PAGE_ORDER.length;
|
||||
if (e.key === 'ArrowRight') {
|
||||
Sfx.page();
|
||||
navigate(PAGE_ORDER[(idx + 1) % n].path);
|
||||
} else if (e.key === 'ArrowLeft') {
|
||||
Sfx.page();
|
||||
navigate(PAGE_ORDER[(idx - 1 + n) % n].path);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user