diff --git a/src/components/video-editor/SettingsPanel.tsx b/src/components/video-editor/SettingsPanel.tsx
index 34333206..fb441bf4 100644
--- a/src/components/video-editor/SettingsPanel.tsx
+++ b/src/components/video-editor/SettingsPanel.tsx
@@ -78,6 +78,7 @@ import {
DEFAULT_CURSOR_CLICK_BOUNCE,
DEFAULT_CURSOR_CLICK_BOUNCE_DURATION,
DEFAULT_CURSOR_CLICK_EFFECT,
+ DEFAULT_CURSOR_CLICK_EFFECT_COLOR,
DEFAULT_CURSOR_CLICK_EFFECT_DURATION_MS,
DEFAULT_CURSOR_CLICK_EFFECT_OPACITY,
DEFAULT_CURSOR_CLICK_EFFECT_SCALE,
@@ -158,11 +159,34 @@ const CAPTION_ANIMATION_OPTIONS: Array<{ value: AutoCaptionAnimation; label: str
{ value: "pop", label: "Pop" },
];
+const CLICK_EFFECT_COLOR_OPTIONS = [
+ "#2563EB",
+ "#EF4444",
+ "#F59E0B",
+ "#22C55E",
+ "#A855F7",
+ "#EC4899",
+ "#14B8A6",
+ "#F97316",
+] as const;
+
type BackgroundTab = "image" | "video" | "color" | "gradient";
function isHexWallpaper(value: string): boolean {
return /^#(?:[0-9a-f]{3}){1,2}$/i.test(value);
}
+function hexToRgba(hex: string, alpha: number) {
+ const normalized = isHexWallpaper(hex) ? hex : DEFAULT_CURSOR_CLICK_EFFECT_COLOR;
+ const value = normalized.length === 4
+ ? `#${normalized[1]}${normalized[1]}${normalized[2]}${normalized[2]}${normalized[3]}${normalized[3]}`
+ : normalized;
+ const color = Number.parseInt(value.slice(1), 16);
+ const red = (color >> 16) & 255;
+ const green = (color >> 8) & 255;
+ const blue = color & 255;
+ return `rgba(${red}, ${green}, ${blue}, ${alpha})`;
+}
+
function getBackgroundTabForWallpaper(value: string): BackgroundTab {
if (GRADIENTS.includes(value)) {
return "gradient";
@@ -407,20 +431,20 @@ const CURSOR_CLICK_EFFECT_OPTIONS: Array<{
label: "Off",
description: "No click animation. Keeps the pointer steady on every tap.",
},
- {
- id: "ripple",
- label: "Ripple",
- description: "Concentric rings that expand from the click point.",
- },
{
id: "spotlight",
label: "Spotlight",
description: "A soft pulse that blooms behind the cursor on click.",
},
{
- id: "burst",
- label: "Burst",
- description: "A sharper burst with sparks for more energetic demos.",
+ id: "ripple",
+ label: "Ripple",
+ description: "Concentric rings that expand from the click point.",
+ },
+ {
+ id: "echo",
+ label: "Echo",
+ description: "A pair of soft rings that spread outward with a cleaner pulse.",
},
];
@@ -482,7 +506,13 @@ function MotionPresetCards({
);
}
-function CursorClickEffectPreview({ effect }: { effect: CursorClickEffectStyle }) {
+function CursorClickEffectPreview({
+ effect,
+ color = DEFAULT_CURSOR_CLICK_EFFECT_COLOR,
+}: {
+ effect: CursorClickEffectStyle;
+ color?: string;
+}) {
return (
{effect === "none" ? (
-
-
-
-
+
) : null}
{effect === "ripple" ? (