From ba9870a9080ac4bdcc6b291a8908d1790ab99b98 Mon Sep 17 00:00:00 2001 From: yassinehaimouch Date: Wed, 25 Jun 2025 15:00:35 +0100 Subject: update: landing-page --- apps/web/src/app/globals.css | 2 +- apps/web/src/app/page.tsx | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'apps/web/src/app') diff --git a/apps/web/src/app/globals.css b/apps/web/src/app/globals.css index 2169dbbc..1c8a7887 100644 --- a/apps/web/src/app/globals.css +++ b/apps/web/src/app/globals.css @@ -39,7 +39,7 @@ --sidebar-ring: 0 0% 3.9%; } .dark { - --background: 0 0% 8%; + --background: 0 0% 6%; --foreground: 0 0% 98%; --card: 0 0% 3.9%; --card-foreground: 0 0% 98%; diff --git a/apps/web/src/app/page.tsx b/apps/web/src/app/page.tsx index dcedab32..e9957e1b 100644 --- a/apps/web/src/app/page.tsx +++ b/apps/web/src/app/page.tsx @@ -1,6 +1,7 @@ import { Hero } from "@/components/landing/hero"; import { Header } from "@/components/header"; import { getWaitlistCount } from "@/lib/waitlist"; +import Image from "next/image"; // Force dynamic rendering so waitlist count updates in real-time export const dynamic = "force-dynamic"; @@ -10,6 +11,13 @@ export default async function Home() { return (
+ landing-page.bg
-- cgit v1.3.1 From e786d437a5b158fac22d47ad770d2a0d7e283668 Mon Sep 17 00:00:00 2001 From: muhammed sinan Date: Wed, 25 Jun 2025 19:57:35 +0530 Subject: made the project app PWA and moved metadata into a sperate file app folder --- apps/web/public/browserconfig.xml | 11 +++++ apps/web/public/favicon.ico | Bin 0 -> 1150 bytes apps/web/public/icons/android-icon-144x144.png | Bin 0 -> 1076 bytes apps/web/public/icons/android-icon-192x192.png | Bin 0 -> 741 bytes apps/web/public/icons/android-icon-36x36.png | Bin 0 -> 768 bytes apps/web/public/icons/android-icon-48x48.png | Bin 0 -> 802 bytes apps/web/public/icons/android-icon-72x72.png | Bin 0 -> 826 bytes apps/web/public/icons/android-icon-96x96.png | Bin 0 -> 906 bytes apps/web/public/icons/apple-icon-114x114.png | Bin 0 -> 985 bytes apps/web/public/icons/apple-icon-120x120.png | Bin 0 -> 998 bytes apps/web/public/icons/apple-icon-144x144.png | Bin 0 -> 1076 bytes apps/web/public/icons/apple-icon-152x152.png | Bin 0 -> 1163 bytes apps/web/public/icons/apple-icon-180x180.png | Bin 0 -> 1360 bytes apps/web/public/icons/apple-icon-57x57.png | Bin 0 -> 809 bytes apps/web/public/icons/apple-icon-60x60.png | Bin 0 -> 843 bytes apps/web/public/icons/apple-icon-72x72.png | Bin 0 -> 826 bytes apps/web/public/icons/apple-icon-76x76.png | Bin 0 -> 820 bytes apps/web/public/icons/favicon-16x16.png | Bin 0 -> 670 bytes apps/web/public/icons/favicon-32x32.png | Bin 0 -> 747 bytes apps/web/public/icons/favicon-96x96.png | Bin 0 -> 906 bytes apps/web/public/icons/ms-icon-144x144.png | Bin 0 -> 1076 bytes apps/web/public/icons/ms-icon-150x150.png | Bin 0 -> 1159 bytes apps/web/public/icons/ms-icon-310x310.png | Bin 0 -> 2749 bytes apps/web/public/icons/ms-icon-70x70.png | Bin 0 -> 814 bytes apps/web/public/manifest.json | 44 +++++++++++++++++ apps/web/src/app/favicon.ico | Bin 4286 -> 0 bytes apps/web/src/app/layout.tsx | 36 +------------- apps/web/src/app/metadata.ts | 64 +++++++++++++++++++++++++ 28 files changed, 120 insertions(+), 35 deletions(-) create mode 100644 apps/web/public/browserconfig.xml create mode 100644 apps/web/public/favicon.ico create mode 100644 apps/web/public/icons/android-icon-144x144.png create mode 100644 apps/web/public/icons/android-icon-192x192.png create mode 100644 apps/web/public/icons/android-icon-36x36.png create mode 100644 apps/web/public/icons/android-icon-48x48.png create mode 100644 apps/web/public/icons/android-icon-72x72.png create mode 100644 apps/web/public/icons/android-icon-96x96.png create mode 100644 apps/web/public/icons/apple-icon-114x114.png create mode 100644 apps/web/public/icons/apple-icon-120x120.png create mode 100644 apps/web/public/icons/apple-icon-144x144.png create mode 100644 apps/web/public/icons/apple-icon-152x152.png create mode 100644 apps/web/public/icons/apple-icon-180x180.png create mode 100644 apps/web/public/icons/apple-icon-57x57.png create mode 100644 apps/web/public/icons/apple-icon-60x60.png create mode 100644 apps/web/public/icons/apple-icon-72x72.png create mode 100644 apps/web/public/icons/apple-icon-76x76.png create mode 100644 apps/web/public/icons/favicon-16x16.png create mode 100644 apps/web/public/icons/favicon-32x32.png create mode 100644 apps/web/public/icons/favicon-96x96.png create mode 100644 apps/web/public/icons/ms-icon-144x144.png create mode 100644 apps/web/public/icons/ms-icon-150x150.png create mode 100644 apps/web/public/icons/ms-icon-310x310.png create mode 100644 apps/web/public/icons/ms-icon-70x70.png create mode 100644 apps/web/public/manifest.json delete mode 100644 apps/web/src/app/favicon.ico create mode 100644 apps/web/src/app/metadata.ts (limited to 'apps/web/src/app') diff --git a/apps/web/public/browserconfig.xml b/apps/web/public/browserconfig.xml new file mode 100644 index 00000000..39060b21 --- /dev/null +++ b/apps/web/public/browserconfig.xml @@ -0,0 +1,11 @@ + + + + + + + + #ffffff + + + \ No newline at end of file diff --git a/apps/web/public/favicon.ico b/apps/web/public/favicon.ico new file mode 100644 index 00000000..9b2cba8f Binary files /dev/null and b/apps/web/public/favicon.ico differ diff --git a/apps/web/public/icons/android-icon-144x144.png b/apps/web/public/icons/android-icon-144x144.png new file mode 100644 index 00000000..7320ece7 Binary files /dev/null and b/apps/web/public/icons/android-icon-144x144.png differ diff --git a/apps/web/public/icons/android-icon-192x192.png b/apps/web/public/icons/android-icon-192x192.png new file mode 100644 index 00000000..f534f429 Binary files /dev/null and b/apps/web/public/icons/android-icon-192x192.png differ diff --git a/apps/web/public/icons/android-icon-36x36.png b/apps/web/public/icons/android-icon-36x36.png new file mode 100644 index 00000000..6b8db020 Binary files /dev/null and b/apps/web/public/icons/android-icon-36x36.png differ diff --git a/apps/web/public/icons/android-icon-48x48.png b/apps/web/public/icons/android-icon-48x48.png new file mode 100644 index 00000000..30a68fa5 Binary files /dev/null and b/apps/web/public/icons/android-icon-48x48.png differ diff --git a/apps/web/public/icons/android-icon-72x72.png b/apps/web/public/icons/android-icon-72x72.png new file mode 100644 index 00000000..e4019c84 Binary files /dev/null and b/apps/web/public/icons/android-icon-72x72.png differ diff --git a/apps/web/public/icons/android-icon-96x96.png b/apps/web/public/icons/android-icon-96x96.png new file mode 100644 index 00000000..85591ab4 Binary files /dev/null and b/apps/web/public/icons/android-icon-96x96.png differ diff --git a/apps/web/public/icons/apple-icon-114x114.png b/apps/web/public/icons/apple-icon-114x114.png new file mode 100644 index 00000000..c776e3f9 Binary files /dev/null and b/apps/web/public/icons/apple-icon-114x114.png differ diff --git a/apps/web/public/icons/apple-icon-120x120.png b/apps/web/public/icons/apple-icon-120x120.png new file mode 100644 index 00000000..76604df8 Binary files /dev/null and b/apps/web/public/icons/apple-icon-120x120.png differ diff --git a/apps/web/public/icons/apple-icon-144x144.png b/apps/web/public/icons/apple-icon-144x144.png new file mode 100644 index 00000000..7320ece7 Binary files /dev/null and b/apps/web/public/icons/apple-icon-144x144.png differ diff --git a/apps/web/public/icons/apple-icon-152x152.png b/apps/web/public/icons/apple-icon-152x152.png new file mode 100644 index 00000000..eb5ef0df Binary files /dev/null and b/apps/web/public/icons/apple-icon-152x152.png differ diff --git a/apps/web/public/icons/apple-icon-180x180.png b/apps/web/public/icons/apple-icon-180x180.png new file mode 100644 index 00000000..b90e62fb Binary files /dev/null and b/apps/web/public/icons/apple-icon-180x180.png differ diff --git a/apps/web/public/icons/apple-icon-57x57.png b/apps/web/public/icons/apple-icon-57x57.png new file mode 100644 index 00000000..7cfb2e56 Binary files /dev/null and b/apps/web/public/icons/apple-icon-57x57.png differ diff --git a/apps/web/public/icons/apple-icon-60x60.png b/apps/web/public/icons/apple-icon-60x60.png new file mode 100644 index 00000000..1d90a370 Binary files /dev/null and b/apps/web/public/icons/apple-icon-60x60.png differ diff --git a/apps/web/public/icons/apple-icon-72x72.png b/apps/web/public/icons/apple-icon-72x72.png new file mode 100644 index 00000000..e4019c84 Binary files /dev/null and b/apps/web/public/icons/apple-icon-72x72.png differ diff --git a/apps/web/public/icons/apple-icon-76x76.png b/apps/web/public/icons/apple-icon-76x76.png new file mode 100644 index 00000000..34575f42 Binary files /dev/null and b/apps/web/public/icons/apple-icon-76x76.png differ diff --git a/apps/web/public/icons/favicon-16x16.png b/apps/web/public/icons/favicon-16x16.png new file mode 100644 index 00000000..96db3a2f Binary files /dev/null and b/apps/web/public/icons/favicon-16x16.png differ diff --git a/apps/web/public/icons/favicon-32x32.png b/apps/web/public/icons/favicon-32x32.png new file mode 100644 index 00000000..f8f589dc Binary files /dev/null and b/apps/web/public/icons/favicon-32x32.png differ diff --git a/apps/web/public/icons/favicon-96x96.png b/apps/web/public/icons/favicon-96x96.png new file mode 100644 index 00000000..85591ab4 Binary files /dev/null and b/apps/web/public/icons/favicon-96x96.png differ diff --git a/apps/web/public/icons/ms-icon-144x144.png b/apps/web/public/icons/ms-icon-144x144.png new file mode 100644 index 00000000..7320ece7 Binary files /dev/null and b/apps/web/public/icons/ms-icon-144x144.png differ diff --git a/apps/web/public/icons/ms-icon-150x150.png b/apps/web/public/icons/ms-icon-150x150.png new file mode 100644 index 00000000..248ef48a Binary files /dev/null and b/apps/web/public/icons/ms-icon-150x150.png differ diff --git a/apps/web/public/icons/ms-icon-310x310.png b/apps/web/public/icons/ms-icon-310x310.png new file mode 100644 index 00000000..950a3d6b Binary files /dev/null and b/apps/web/public/icons/ms-icon-310x310.png differ diff --git a/apps/web/public/icons/ms-icon-70x70.png b/apps/web/public/icons/ms-icon-70x70.png new file mode 100644 index 00000000..7b9c2694 Binary files /dev/null and b/apps/web/public/icons/ms-icon-70x70.png differ diff --git a/apps/web/public/manifest.json b/apps/web/public/manifest.json new file mode 100644 index 00000000..fcbfad59 --- /dev/null +++ b/apps/web/public/manifest.json @@ -0,0 +1,44 @@ +{ + "name": "OpenCut", + "description": "A simple but powerful video editor that gets the job done. In your browser.", + "display": "standalone", + "start_url": "/", + "icons": [ + { + "src": "/icons/android-icon-36x36.png", + "sizes": "36x36", + "type": "image\/png", + "density": "0.75" + }, + { + "src": "/icons/android-icon-48x48.png", + "sizes": "48x48", + "type": "image\/png", + "density": "1.0" + }, + { + "src": "/icons/android-icon-72x72.png", + "sizes": "72x72", + "type": "image\/png", + "density": "1.5" + }, + { + "src": "/icons/android-icon-96x96.png", + "sizes": "96x96", + "type": "image\/png", + "density": "2.0" + }, + { + "src": "/icons/android-icon-144x144.png", + "sizes": "144x144", + "type": "image\/png", + "density": "3.0" + }, + { + "src": "/icons/android-icon-192x192.png", + "sizes": "192x192", + "type": "image\/png", + "density": "4.0" + } + ] +} \ No newline at end of file diff --git a/apps/web/src/app/favicon.ico b/apps/web/src/app/favicon.ico deleted file mode 100644 index cb20127b..00000000 Binary files a/apps/web/src/app/favicon.ico and /dev/null differ diff --git a/apps/web/src/app/layout.tsx b/apps/web/src/app/layout.tsx index 5d33100d..c76dc451 100644 --- a/apps/web/src/app/layout.tsx +++ b/apps/web/src/app/layout.tsx @@ -1,4 +1,3 @@ -import type { Metadata } from "next"; import { Inter } from "next/font/google"; import { ThemeProvider } from "next-themes"; import { Analytics } from "@vercel/analytics/react"; @@ -12,40 +11,7 @@ const inter = Inter({ variable: "--font-inter", }); -export const metadata: Metadata = { - title: "OpenCut", - description: - "A simple but powerful video editor that gets the job done. In your browser.", - openGraph: { - title: "OpenCut", - description: - "A simple but powerful video editor that gets the job done. In your browser.", - url: "https://opencut.app", - siteName: "OpenCut", - locale: "en_US", - type: "website", - images: [ - { - url: "https://opencut.app/opengraph-image.jpg", - width: 1200, - height: 630, - alt: "OpenCut", - }, - ], - }, - twitter: { - card: "summary_large_image", - title: "OpenCut", - description: - "A simple but powerful video editor that gets the job done. In your browser.", - creator: "@opencutapp", - images: ["/opengraph-image.jpg"], - }, - robots: { - index: true, - follow: true, - }, -}; +export { metadata } from './metadata' export default function RootLayout({ children, diff --git a/apps/web/src/app/metadata.ts b/apps/web/src/app/metadata.ts new file mode 100644 index 00000000..4db2e8de --- /dev/null +++ b/apps/web/src/app/metadata.ts @@ -0,0 +1,64 @@ +import { Metadata } from "next"; + +export const metadata: Metadata = { + title: "OpenCut", + description: + "A simple but powerful video editor that gets the job done. In your browser.", + openGraph: { + title: "OpenCut", + description: + "A simple but powerful video editor that gets the job done. In your browser.", + url: "https://opencut.app", + siteName: "OpenCut", + locale: "en_US", + type: "website", + images: [ + { + url: "https://opencut.app/opengraph-image.jpg", + width: 1200, + height: 630, + alt: "OpenCut", + }, + ], + }, + twitter: { + card: "summary_large_image", + title: "OpenCut", + description: + "A simple but powerful video editor that gets the job done. In your browser.", + creator: "@opencutapp", + images: ["/opengraph-image.jpg"], + }, + robots: { + index: true, + follow: true, + }, + icons: { + icon: [ + { url: "/favicon.ico" }, + { url: "/icons/favicon-16x16.png", sizes: "16x16", type: "image/png" }, + { url: "/icons/favicon-32x32.png", sizes: "32x32", type: "image/png" }, + { url: "/icons/favicon-96x96.png", sizes: "96x96", type: "image/png" }, + ], + apple: [ + { url: "/icons/apple-icon-57x57.png", sizes: "57x57", type: "image/png" }, + { url: "/icons/apple-icon-60x60.png", sizes: "60x60", type: "image/png" }, + { url: "/icons/apple-icon-72x72.png", sizes: "72x72", type: "image/png" }, + { url: "/icons/apple-icon-76x76.png", sizes: "76x76", type: "image/png" }, + { url: "/icons/apple-icon-114x114.png", sizes: "114x114", type: "image/png" }, + { url: "/icons/apple-icon-120x120.png", sizes: "120x120", type: "image/png" }, + { url: "/icons/apple-icon-144x144.png", sizes: "144x144", type: "image/png" }, + { url: "/icons/apple-icon-152x152.png", sizes: "152x152", type: "image/png" }, + { url: "/icons/apple-icon-180x180.png", sizes: "180x180", type: "image/png" }, + ], + shortcut: ["/favicon.ico"] + }, + appleWebApp: { + capable: true, + title: "OpenCut", + }, + manifest: "/manifest.json", + other: { + "msapplication-config": "/browserconfig.xml" + } +}; \ No newline at end of file -- cgit v1.3.1 From 2e5b623d90ba250dd5c50b623bd8044fd6d62e2a Mon Sep 17 00:00:00 2001 From: muhammed sinan Date: Wed, 25 Jun 2025 20:14:55 +0530 Subject: metadata declared in layout file --- apps/web/src/app/layout.tsx | 3 ++- apps/web/src/app/metadata.ts | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'apps/web/src/app') diff --git a/apps/web/src/app/layout.tsx b/apps/web/src/app/layout.tsx index c76dc451..ee045647 100644 --- a/apps/web/src/app/layout.tsx +++ b/apps/web/src/app/layout.tsx @@ -5,13 +5,14 @@ import Script from "next/script"; import "./globals.css"; import { Toaster } from "../components/ui/sonner"; import { TooltipProvider } from "../components/ui/tooltip"; +import { baseMetaData } from "./metadata"; const inter = Inter({ subsets: ["latin"], variable: "--font-inter", }); -export { metadata } from './metadata' +export const metadata = baseMetaData; export default function RootLayout({ children, diff --git a/apps/web/src/app/metadata.ts b/apps/web/src/app/metadata.ts index 4db2e8de..fe674381 100644 --- a/apps/web/src/app/metadata.ts +++ b/apps/web/src/app/metadata.ts @@ -1,6 +1,6 @@ import { Metadata } from "next"; -export const metadata: Metadata = { +export const baseMetaData: Metadata = { title: "OpenCut", description: "A simple but powerful video editor that gets the job done. In your browser.", -- cgit v1.3.1 From cca25a61039b1d09c9ffaee2f42046c09ab72c3b Mon Sep 17 00:00:00 2001 From: muhammed sinan Date: Wed, 25 Jun 2025 20:22:17 +0530 Subject: Reduce code duplication by extracting common metadata values. --- apps/web/src/app/metadata.ts | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) (limited to 'apps/web/src/app') diff --git a/apps/web/src/app/metadata.ts b/apps/web/src/app/metadata.ts index fe674381..4e387014 100644 --- a/apps/web/src/app/metadata.ts +++ b/apps/web/src/app/metadata.ts @@ -1,20 +1,23 @@ import { Metadata } from "next"; +const title = "OpenCut"; +const description = "A simple but powerful video editor that gets the job done. In your browser."; +const openGraphImageUrl = "https://opencut.app/opengraph-image.jpg"; +const twitterImageUrl = "/opengraph-image.jpg"; + export const baseMetaData: Metadata = { - title: "OpenCut", - description: - "A simple but powerful video editor that gets the job done. In your browser.", + title: title, + description: description, openGraph: { - title: "OpenCut", - description: - "A simple but powerful video editor that gets the job done. In your browser.", + title: title, + description: description, url: "https://opencut.app", siteName: "OpenCut", locale: "en_US", type: "website", images: [ { - url: "https://opencut.app/opengraph-image.jpg", + url: openGraphImageUrl, width: 1200, height: 630, alt: "OpenCut", @@ -23,11 +26,10 @@ export const baseMetaData: Metadata = { }, twitter: { card: "summary_large_image", - title: "OpenCut", - description: - "A simple but powerful video editor that gets the job done. In your browser.", + title: title, + description: description, creator: "@opencutapp", - images: ["/opengraph-image.jpg"], + images: [twitterImageUrl], }, robots: { index: true, @@ -55,10 +57,10 @@ export const baseMetaData: Metadata = { }, appleWebApp: { capable: true, - title: "OpenCut", + title: title, }, manifest: "/manifest.json", other: { "msapplication-config": "/browserconfig.xml" } -}; \ No newline at end of file +}; -- cgit v1.3.1 From 777b0f700067d7ffde37fbe14ed320f2ef630330 Mon Sep 17 00:00:00 2001 From: Maze Winther Date: Wed, 25 Jun 2025 21:40:54 +0200 Subject: refactor: improved type-safety, removal of any from all instances --- apps/web/src/app/contributors/page.tsx | 2 +- apps/web/src/components/editor/media-panel.tsx | 6 ++-- apps/web/src/components/editor/preview-panel.tsx | 32 ++++++++++++---------- .../web/src/components/editor/properties-panel.tsx | 9 +++--- apps/web/src/components/editor/timeline.tsx | 18 ++++++++---- .../src/components/ui/image-timeline-treatment.tsx | 3 +- apps/web/src/stores/playback-store.ts | 2 +- apps/web/src/types/editor.ts | 1 + 8 files changed, 43 insertions(+), 30 deletions(-) create mode 100644 apps/web/src/types/editor.ts (limited to 'apps/web/src/app') diff --git a/apps/web/src/app/contributors/page.tsx b/apps/web/src/app/contributors/page.tsx index f5fa0755..38d6c0d8 100644 --- a/apps/web/src/app/contributors/page.tsx +++ b/apps/web/src/app/contributors/page.tsx @@ -49,7 +49,7 @@ async function getContributors(): Promise { const contributors = await response.json(); const filteredContributors = contributors.filter( - (contributor: any) => contributor.type === "User" + (contributor: Contributor) => contributor.type === "User" ); return filteredContributors; diff --git a/apps/web/src/components/editor/media-panel.tsx b/apps/web/src/components/editor/media-panel.tsx index cdd67a86..dfe08365 100644 --- a/apps/web/src/components/editor/media-panel.tsx +++ b/apps/web/src/components/editor/media-panel.tsx @@ -3,7 +3,7 @@ import { Button } from "../ui/button"; import { AspectRatio } from "../ui/aspect-ratio"; import { DragOverlay } from "../ui/drag-overlay"; -import { useMediaStore } from "@/stores/media-store"; +import { useMediaStore, type MediaItem } from "@/stores/media-store"; import { processMediaFiles } from "@/lib/media-processing"; import { Plus, Image, Video, Music, Trash2, Upload } from "lucide-react"; import { useDragDrop } from "@/hooks/use-drag-drop"; @@ -68,7 +68,7 @@ export function MediaPanel() { return `${min}:${sec.toString().padStart(2, "0")}`; }; - const startDrag = (e: React.DragEvent, item: any) => { + const startDrag = (e: React.DragEvent, item: MediaItem) => { // When dragging a media item, set drag data for timeline to read e.dataTransfer.setData( "application/x-media-item", @@ -102,7 +102,7 @@ export function MediaPanel() { setFilteredMediaItems(filtered); }, [mediaItems, mediaFilter, searchQuery]); - const renderPreview = (item: any) => { + const renderPreview = (item: MediaItem) => { // Render a preview for each media type (image, video, audio, unknown) // Each preview is draggable to the timeline const baseDragProps = { diff --git a/apps/web/src/components/editor/preview-panel.tsx b/apps/web/src/components/editor/preview-panel.tsx index 33bfe688..3850fa7e 100644 --- a/apps/web/src/components/editor/preview-panel.tsx +++ b/apps/web/src/components/editor/preview-panel.tsx @@ -1,7 +1,11 @@ "use client"; -import { useTimelineStore } from "@/stores/timeline-store"; -import { useMediaStore } from "@/stores/media-store"; +import { + useTimelineStore, + type TimelineClip, + type TimelineTrack, +} from "@/stores/timeline-store"; +import { useMediaStore, type MediaItem } from "@/stores/media-store"; import { usePlaybackStore } from "@/stores/playback-store"; import { VideoPlayer } from "@/components/ui/video-player"; import { Button } from "@/components/ui/button"; @@ -11,6 +15,12 @@ import { useState, useRef } from "react"; // Debug flag - set to false to hide active clips info const SHOW_DEBUG_INFO = process.env.NODE_ENV === "development"; +interface ActiveClip { + clip: TimelineClip; + track: TimelineTrack; + mediaItem: MediaItem | null; +} + export function PreviewPanel() { const { tracks } = useTimelineStore(); const { mediaItems } = useMediaStore(); @@ -21,12 +31,8 @@ export function PreviewPanel() { const previewRef = useRef(null); // Get active clips at current time - const getActiveClips = () => { - const activeClips: Array<{ - clip: any; - track: any; - mediaItem: any; - }> = []; + const getActiveClips = (): ActiveClip[] => { + const activeClips: ActiveClip[] = []; tracks.forEach((track) => { track.clips.forEach((clip) => { @@ -37,12 +43,10 @@ export function PreviewPanel() { if (currentTime >= clipStart && currentTime < clipEnd) { const mediaItem = clip.mediaId === "test" - ? { type: "test", name: clip.name, url: "", thumbnailUrl: "" } - : mediaItems.find((item) => item.id === clip.mediaId); + ? null // Test clips don't have a real media item + : mediaItems.find((item) => item.id === clip.mediaId) || null; - if (mediaItem || clip.mediaId === "test") { - activeClips.push({ clip, track, mediaItem }); - } + activeClips.push({ clip, track, mediaItem }); } }); }); @@ -54,7 +58,7 @@ export function PreviewPanel() { const aspectRatio = canvasSize.width / canvasSize.height; // Render a clip - const renderClip = (clipData: any, index: number) => { + const renderClip = (clipData: ActiveClip, index: number) => { const { clip, mediaItem } = clipData; // Test clips diff --git a/apps/web/src/components/editor/properties-panel.tsx b/apps/web/src/components/editor/properties-panel.tsx index c784dab8..96ef66e5 100644 --- a/apps/web/src/components/editor/properties-panel.tsx +++ b/apps/web/src/components/editor/properties-panel.tsx @@ -17,13 +17,12 @@ import { useMediaStore } from "@/stores/media-store"; import { ImageTimelineTreatment } from "@/components/ui/image-timeline-treatment"; import { useState } from "react"; import { SpeedControl } from "./speed-control"; +import type { BackgroundType } from "@/types/editor"; export function PropertiesPanel() { const { tracks } = useTimelineStore(); const { mediaItems } = useMediaStore(); - const [backgroundType, setBackgroundType] = useState< - "blur" | "mirror" | "color" - >("blur"); + const [backgroundType, setBackgroundType] = useState("blur"); const [backgroundColor, setBackgroundColor] = useState("#000000"); // Get the first video clip for preview (simplified) @@ -78,7 +77,9 @@ export function PropertiesPanel() {