Files
spacedrive/packages/interface/src/FloatingControls.tsx
2025-11-14 21:31:21 -08:00

42 lines
1.4 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { usePlatform } from "./platform";
/**
* Floating controls overlay - demonstrates Cap-style tiny floating windows
* Transparent background, rounded, always on top
*/
export function FloatingControls() {
const platform = usePlatform();
const handleClose = () => {
if (platform.closeWindow) {
platform.closeWindow("floating-controls");
}
};
return (
<div className="h-full w-full flex items-center justify-center p-2">
<div
className="bg-black/80 backdrop-blur-xl rounded-full px-4 py-3 shadow-2xl border border-white/10"
style={{ WebkitAppRegion: "drag" } as any}
>
<div className="flex items-center gap-3">
<button
className="w-8 h-8 rounded-full bg-red-500 hover:bg-red-600 transition-colors flex items-center justify-center"
style={{ WebkitAppRegion: "no-drag" } as any}
onClick={() => alert("Stop!")}
>
<div className="w-3 h-3 bg-white rounded-sm" />
</button>
<button
className="w-8 h-8 rounded-full bg-gray-600 hover:bg-gray-500 transition-colors flex items-center justify-center"
style={{ WebkitAppRegion: "no-drag" } as any}
onClick={handleClose}
>
<span className="text-white text-xl leading-none">×</span>
</button>
</div>
</div>
</div>
);
}