Correct blur-smblur

This commit is contained in:
Brandon McConnell
2025-07-30 15:05:03 -04:00
parent dbc1d2e1a3
commit e3ecf4855a
6 changed files with 16 additions and 16 deletions
@@ -7,7 +7,7 @@ import { colors } from "@/data/colors";
import { useProjectStore } from "@/stores/project-store"; import { useProjectStore } from "@/stores/project-store";
import { PipetteIcon } from "lucide-react"; import { PipetteIcon } from "lucide-react";
type BackgroundTab = "color" | "blur-sm"; type BackgroundTab = "color" | "blur";
export function BackgroundSettings() { export function BackgroundSettings() {
const { activeProject, updateBackgroundType } = useProjectStore(); const { activeProject, updateBackgroundType } = useProjectStore();
@@ -20,7 +20,7 @@ export function BackgroundSettings() {
}; };
const handleBlurSelect = (blurIntensity: number) => { const handleBlurSelect = (blurIntensity: number) => {
updateBackgroundType("blur-sm", { blurIntensity }); updateBackgroundType("blur", { blurIntensity });
}; };
const tabs = [ const tabs = [
@@ -30,7 +30,7 @@ export function BackgroundSettings() {
}, },
{ {
label: "Blur", label: "Blur",
value: "blur-sm", value: "blur",
}, },
]; ];
@@ -60,7 +60,7 @@ export function BackgroundSettings() {
activeProject?.backgroundColor || "#000000", activeProject?.backgroundColor || "#000000",
}); });
} else { } else {
updateBackgroundType("blur-sm", { updateBackgroundType("blur", {
blurIntensity: activeProject?.blurIntensity || 8, blurIntensity: activeProject?.blurIntensity || 8,
}); });
} }
@@ -211,7 +211,7 @@ export function PreviewPanel() {
setDragState({ setDragState({
isDragging: true, isDragging: true,
elementId: element.id, elementId: element.id,
trackId: trackId, trackId,
startX: e.clientX, startX: e.clientX,
startY: e.clientY, startY: e.clientY,
initialElementX: element.x, initialElementX: element.x,
@@ -274,7 +274,7 @@ export function PreviewPanel() {
const renderBlurBackground = () => { const renderBlurBackground = () => {
if ( if (
!activeProject?.backgroundType || !activeProject?.backgroundType ||
activeProject.backgroundType !== "blur-sm" || activeProject.backgroundType !== "blur" ||
blurBackgroundElements.length === 0 blurBackgroundElements.length === 0
) { ) {
return null; return null;
@@ -474,7 +474,7 @@ export function PreviewPanel() {
width: previewDimensions.width, width: previewDimensions.width,
height: previewDimensions.height, height: previewDimensions.height,
backgroundColor: backgroundColor:
activeProject?.backgroundType === "blur-sm" activeProject?.backgroundType === "blur"
? "transparent" ? "transparent"
: activeProject?.backgroundColor || "#000000", : activeProject?.backgroundColor || "#000000",
}} }}
@@ -489,7 +489,7 @@ export function PreviewPanel() {
renderElement(elementData, index) renderElement(elementData, index)
) )
)} )}
{activeProject?.backgroundType === "blur-sm" && {activeProject?.backgroundType === "blur" &&
blurBackgroundElements.length === 0 && blurBackgroundElements.length === 0 &&
activeElements.length > 0 && ( activeElements.length > 0 && (
<div className="absolute bottom-2 left-2 right-2 bg-black/70 text-white text-xs p-2 rounded"> <div className="absolute bottom-2 left-2 right-2 bg-black/70 text-white text-xs p-2 rounded">
@@ -730,7 +730,7 @@ function FullscreenPreview({
width: previewDimensions.width, width: previewDimensions.width,
height: previewDimensions.height, height: previewDimensions.height,
backgroundColor: backgroundColor:
activeProject?.backgroundType === "blur-sm" activeProject?.backgroundType === "blur"
? "#1a1a1a" ? "#1a1a1a"
: activeProject?.backgroundColor || "#1a1a1a", : activeProject?.backgroundColor || "#1a1a1a",
}} }}
@@ -745,7 +745,7 @@ function FullscreenPreview({
renderElement(elementData, index) renderElement(elementData, index)
) )
)} )}
{activeProject?.backgroundType === "blur-sm" && {activeProject?.backgroundType === "blur" &&
blurBackgroundElements.length === 0 && blurBackgroundElements.length === 0 &&
activeElements.length > 0 && ( activeElements.length > 0 && (
<div className="absolute bottom-2 left-2 right-2 bg-black/70 text-white text-xs p-2 rounded"> <div className="absolute bottom-2 left-2 right-2 bg-black/70 text-white text-xs p-2 rounded">
@@ -18,7 +18,7 @@ export function ImageTimelineTreatment({
alt, alt,
targetAspectRatio = 16 / 9, targetAspectRatio = 16 / 9,
className, className,
backgroundType = "blur-sm", backgroundType = "blur",
backgroundColor = "#000000", backgroundColor = "#000000",
}: ImageTimelineTreatmentProps) { }: ImageTimelineTreatmentProps) {
const [imageLoaded, setImageLoaded] = useState(false); const [imageLoaded, setImageLoaded] = useState(false);
@@ -50,7 +50,7 @@ export function ImageTimelineTreatment({
{/* Background Layer */} {/* Background Layer */}
{needsAspectRatioTreatment && imageLoaded && ( {needsAspectRatioTreatment && imageLoaded && (
<> <>
{backgroundType === "blur-sm" && ( {backgroundType === "blur" && (
<div className="absolute inset-0"> <div className="absolute inset-0">
<img <img
src={src} src={src}
+2 -2
View File
@@ -23,7 +23,7 @@ interface ProjectStore {
duplicateProject: (projectId: string) => Promise<string>; duplicateProject: (projectId: string) => Promise<string>;
updateProjectBackground: (backgroundColor: string) => Promise<void>; updateProjectBackground: (backgroundColor: string) => Promise<void>;
updateBackgroundType: ( updateBackgroundType: (
type: "color" | "blur-sm", type: "color" | "blur",
options?: { backgroundColor?: string; blurIntensity?: number } options?: { backgroundColor?: string; blurIntensity?: number }
) => Promise<void>; ) => Promise<void>;
updateProjectFps: (fps: number) => Promise<void>; updateProjectFps: (fps: number) => Promise<void>;
@@ -273,7 +273,7 @@ export const useProjectStore = create<ProjectStore>((set, get) => ({
}, },
updateBackgroundType: async ( updateBackgroundType: async (
type: "color" | "blur-sm", type: "color" | "blur",
options?: { backgroundColor?: string; blurIntensity?: number } options?: { backgroundColor?: string; blurIntensity?: number }
) => { ) => {
const { activeProject } = get(); const { activeProject } = get();
+1 -1
View File
@@ -1,4 +1,4 @@
export type BackgroundType = "blur-sm" | "mirror" | "color"; export type BackgroundType = "blur" | "mirror" | "color";
export interface CanvasSize { export interface CanvasSize {
width: number; width: number;
+1 -1
View File
@@ -6,7 +6,7 @@ export interface TProject {
updatedAt: Date; updatedAt: Date;
mediaItems?: string[]; mediaItems?: string[];
backgroundColor?: string; backgroundColor?: string;
backgroundType?: "color" | "blur-sm"; backgroundType?: "color" | "blur";
blurIntensity?: number; // in pixels (4, 8, 18) blurIntensity?: number; // in pixels (4, 8, 18)
fps?: number; fps?: number;
} }