feat(ui): add Remove background toggle to effects panel

This commit is contained in:
webadderall
2026-03-17 10:54:16 +11:00
parent c27e43d255
commit 97ebb0de11
5 changed files with 22 additions and 3 deletions
@@ -139,6 +139,7 @@ interface SettingsPanelProps {
cropRegion?: CropRegion;
onCropChange?: (region: CropRegion) => void;
aspectRatio: AspectRatio;
onAspectRatioChange?: (ratio: AspectRatio) => void;
videoElement?: HTMLVideoElement | null;
exportQuality?: ExportQuality;
onExportQualityChange?: (quality: ExportQuality) => void;
@@ -217,6 +218,7 @@ export function SettingsPanel({
cropRegion,
onCropChange,
aspectRatio,
onAspectRatioChange,
videoElement,
exportQuality = "good",
onExportQualityChange,
@@ -744,6 +746,19 @@ export function SettingsPanel({
parseInput={(t) => parseFloat(t.replace(/%$/, ""))}
/>
</div>
<div className="col-span-2 flex items-center justify-between p-2 rounded-lg bg-white/5 border border-white/5">
<div className="text-[10px] font-medium text-slate-300">{tSettings("effects.removeBackground")}</div>
<Switch
checked={aspectRatio === 'native' && padding === 0}
onCheckedChange={(checked) => {
if (checked) {
onAspectRatioChange?.('native');
onPaddingChange?.(0);
}
}}
className="data-[state=checked]:bg-[#2563EB] scale-90"
/>
</div>
</div>
<Button
@@ -2172,6 +2172,7 @@ export default function VideoEditor() {
cropRegion={cropRegion}
onCropChange={setCropRegion}
aspectRatio={aspectRatio}
onAspectRatioChange={setAspectRatio}
videoElement={videoPlaybackRef.current?.video || null}
exportQuality={exportQuality}
onExportQualityChange={setExportQuality}
+2 -1
View File
@@ -27,7 +27,8 @@
"cursorSway": "Cursor Sway",
"shadow": "Shadow",
"roundness": "Roundness",
"padding": "Padding"
"padding": "Padding",
"removeBackground": "Remove background"
},
"crop": {
"title": "Crop Video",
+2 -1
View File
@@ -27,7 +27,8 @@
"cursorSway": "Balanceo del cursor",
"shadow": "Sombra",
"roundness": "Redondez",
"padding": "Relleno"
"padding": "Relleno",
"removeBackground": "Quitar fondo"
},
"crop": {
"title": "Recortar video",
+2 -1
View File
@@ -27,7 +27,8 @@
"cursorSway": "光标摆动",
"shadow": "阴影",
"roundness": "圆角",
"padding": "内边距"
"padding": "内边距",
"removeBackground": "移除背景"
},
"crop": {
"title": "裁剪视频",