From 7bf0984698e43b9aa2dd879f65951318ed410390 Mon Sep 17 00:00:00 2001 From: Maze <167211895+mazeincoding@users.noreply.github.com> Date: Sat, 31 Jan 2026 00:20:04 +0100 Subject: codebase overhaul (#697) --- .../editor/media-panel/views/settings.tsx | 332 --------------------- 1 file changed, 332 deletions(-) delete mode 100644 apps/web/src/components/editor/media-panel/views/settings.tsx (limited to 'apps/web/src/components/editor/media-panel/views/settings.tsx') diff --git a/apps/web/src/components/editor/media-panel/views/settings.tsx b/apps/web/src/components/editor/media-panel/views/settings.tsx deleted file mode 100644 index be54a9c4..00000000 --- a/apps/web/src/components/editor/media-panel/views/settings.tsx +++ /dev/null @@ -1,332 +0,0 @@ -"use client"; - -import { - Select, - SelectContent, - SelectItem, - SelectTrigger, - SelectValue, -} from "@/components/ui/select"; -import { PanelBaseView as BaseView } from "@/components/editor/panel-base-view"; -import { - PropertyItem, - PropertyItemLabel, - PropertyItemValue, - PropertyGroup, -} from "../../properties-panel/property-item"; -import { FPS_PRESETS } from "@/constants/timeline-constants"; -import { useProjectStore } from "@/stores/project-store"; -import type { BlurIntensity } from "@/types/project"; -import { useEditorStore } from "@/stores/editor-store"; -import { useAspectRatio } from "@/hooks/use-aspect-ratio"; -import Image from "next/image"; -import { cn } from "@/lib/utils"; -import { colors } from "@/data/colors/solid"; -import { patternCraftGradients } from "@/data/colors/pattern-craft"; -import { PipetteIcon, PlusIcon } from "lucide-react"; -import { useMemo, memo, useCallback } from "react"; -import { syntaxUIGradients } from "@/data/colors/syntax-ui"; -import { Button } from "@/components/ui/button"; -import { Separator } from "@/components/ui/separator"; - -export function SettingsView() { - return ; -} - -function ProjectSettingsTabs() { - return ( - - - - ), - }, - { - value: "background", - label: "Background", - content: ( -
-
- -
-
- - -
- - {/* Another UI, looks so beautiful i don't wanna remove it */} - {/*
- -
*/} -
- ), - }, - ]} - className="flex flex-col justify-between h-full p-0" - /> - ); -} - -function ProjectInfoView() { - const { activeProject, updateProjectFps, updateCanvasSize } = - useProjectStore(); - const { canvasPresets } = useEditorStore(); - const { getDisplayName } = useAspectRatio(); - - const handleAspectRatioChange = (value: string) => { - const preset = canvasPresets.find((p) => p.name === value); - if (preset) { - updateCanvasSize( - { width: preset.width, height: preset.height }, - "preset" - ); - } - }; - - const handleFpsChange = (value: string) => { - const fps = parseFloat(value); - updateProjectFps(fps); - }; - - return ( -
- - Name - - {activeProject?.name || "Untitled project"} - - - - - Aspect ratio - - - - - - - Frame rate - - - - -
- ); -} - -const BlurPreview = memo( - ({ - blur, - isSelected, - onSelect, - }: { - blur: { label: string; value: number }; - isSelected: boolean; - onSelect: () => void; - }) => ( -
- {`Blur -
- - {blur.label} - -
-
- ) -); - -BlurPreview.displayName = "BlurPreview"; - -const BackgroundPreviews = memo( - ({ - backgrounds, - currentBackgroundColor, - isColorBackground, - handleColorSelect, - useBackgroundColor = false, - }: { - backgrounds: string[]; - currentBackgroundColor: string; - isColorBackground: boolean; - handleColorSelect: (bg: string) => void; - useBackgroundColor?: boolean; - }) => { - return useMemo( - () => - backgrounds.map((bg, index) => ( -
handleColorSelect(bg)} - /> - )), - [ - backgrounds, - isColorBackground, - currentBackgroundColor, - handleColorSelect, - useBackgroundColor, - ] - ); - } -); - -BackgroundPreviews.displayName = "BackgroundPreviews"; - -function BackgroundView() { - const { activeProject, updateBackgroundType } = useProjectStore(); - - const blurLevels = useMemo>( - () => [ - { label: "Light", value: 4 }, - { label: "Medium", value: 8 }, - { label: "Heavy", value: 18 }, - ], - [] - ); - - const handleBlurSelect = useCallback( - async (blurIntensity: BlurIntensity) => { - await updateBackgroundType("blur", { blurIntensity }); - }, - [updateBackgroundType] - ); - - const handleColorSelect = useCallback( - async (color: string) => { - await updateBackgroundType("color", { backgroundColor: color }); - }, - [updateBackgroundType] - ); - - const currentBlurIntensity = activeProject?.blurIntensity || 8; - const isBlurBackground = activeProject?.backgroundType === "blur"; - const currentBackgroundColor = activeProject?.backgroundColor || "#000000"; - const isColorBackground = activeProject?.backgroundType === "color"; - - const blurPreviews = useMemo( - () => - blurLevels.map((blur) => ( - handleBlurSelect(blur.value)} - /> - )), - [blurLevels, isBlurBackground, currentBlurIntensity, handleBlurSelect] - ); - - return ( -
- -
{blurPreviews}
-
- - -
-
- -
- -
-
- - -
- -
-
- - -
- -
-
-
- ); -} -- cgit v1.3.1