首页音量旋钮,不允许用户主动调节音量

This commit is contained in:
eafonyang
2026-07-23 17:40:29 +08:00
parent a32ec980b2
commit 56f8db3e75
2 changed files with 6 additions and 15 deletions
+3 -2
View File
@@ -523,7 +523,7 @@ export function readBootSoundFromState(state: DeviceState | null | undefined): n
// Mock data for demo/offline mode // Mock data for demo/offline mode
// ============================================================ // ============================================================
export const MOCK_DEVICE_STATE: DeviceState = { export const MOCK_DEVICE_STATE: DeviceState = {
device: "Luxsin-X9", device: "Luxsin-B9",
version: "1.2.3", version: "1.2.3",
mac: "AA:BB:CC:DD:EE:FF", mac: "AA:BB:CC:DD:EE:FF",
language: 0, language: 0,
@@ -760,7 +760,7 @@ export async function fetchLuxsinAudioCurve(
// Share Code API — shareCreate / shareList / shareQuery / shareAccept // Share Code API — shareCreate / shareList / shareQuery / shareAccept
// ============================================================ // ============================================================
const SHARE_DEVICE_MODELS = ["Luxsin-X9", "Luxsin-X8"] as const; const SHARE_DEVICE_MODELS = ["Luxsin-X9", "Luxsin-X8", "Luxsin-B9"] as const;
export type ShareDeviceModel = (typeof SHARE_DEVICE_MODELS)[number]; export type ShareDeviceModel = (typeof SHARE_DEVICE_MODELS)[number];
@@ -777,6 +777,7 @@ export function resolveShareDeviceModel(device: string): ShareDeviceModel | null
const lower = trimmed.toLowerCase(); const lower = trimmed.toLowerCase();
if (lower.includes("x9")) return "Luxsin-X9"; if (lower.includes("x9")) return "Luxsin-X9";
if (lower.includes("x8")) return "Luxsin-X8"; if (lower.includes("x8")) return "Luxsin-X8";
if (lower.includes("b9")) return "Luxsin-B9";
return null; return null;
} }
+3 -13
View File
@@ -608,25 +608,15 @@ export default function Home() {
{/* Right knob */} {/* Right knob */}
<div className={cn("pr-4", volumePassthroughActive && "opacity-40 pointer-events-none")}> <div className={cn("pr-4", volumePassthroughActive && "opacity-40 pointer-events-none")}>
<div <div
className="w-12 h-12 rounded-full flex items-center justify-center touch-none select-none" className="w-12 h-12 rounded-full flex items-center justify-center select-none pointer-events-none"
style={{ style={{
background: "radial-gradient(circle at 35% 35%, #4a4a4e, #1a1a1c)", background: "radial-gradient(circle at 35% 35%, #4a4a4e, #1a1a1c)",
border: "2px solid rgba(255,255,255,0.12)", border: "2px solid rgba(255,255,255,0.12)",
boxShadow: "inset 0 2px 4px rgba(0,0,0,0.5)", boxShadow: "inset 0 2px 4px rgba(0,0,0,0.5)",
transform: `rotate(${knobAngle}deg)`, transform: `rotate(${knobAngle}deg)`,
transition: knobDraggingRef.current ? "none" : "transform 120ms ease-out", transition: "transform 120ms ease-out",
}} }}
role="slider" aria-hidden="true"
aria-label="Volume"
aria-valuemin={0}
aria-valuemax={200}
aria-valuenow={localVol}
aria-disabled={volumePassthroughActive}
onPointerDown={beginKnobDrag}
onPointerMove={moveKnobDrag}
onPointerUp={endKnobDrag}
onPointerCancel={endKnobDrag}
onLostPointerCapture={lostKnobPointerCapture}
> >
<div className="w-1 h-4 rounded-full bg-white/40" style={{ transform: "rotate(-30deg)", transformOrigin: "bottom center" }} /> <div className="w-1 h-4 rounded-full bg-white/40" style={{ transform: "rotate(-30deg)", transformOrigin: "bottom center" }} />
</div> </div>