Create professional demos and 3D mockups in seconds, directly in your browser
feat: update download file naming convention and improve mockup localization
CristianOlivera1cc116747e8ff
diff --git a/app/[locale]/(editor)/editor/page.tsx b/app/[locale]/(editor)/editor/page.tsxindex d935720..28ad1f5 100644--- a/app/[locale]/(editor)/editor/page.tsx+++ b/app/[locale]/(editor)/editor/page.tsx@@ -921,7 +921,7 @@ export default function Editor() {const url = URL.createObjectURL(blob);const link = document.createElement('a');- link.download = `openvidshot-${Date.now()}.${format}`;+ link.download = `openvid-${Date.now()}.${format}`;link.href = url;link.click();URL.revokeObjectURL(url);@@ -3119,10 +3119,19 @@ export default function Editor() {return () => document.removeEventListener("keydown", handleKeyDown);}, [selectedElementId, selectedZoomFragmentId, selectedAudioTrackId, selectedVideoClipId, deleteCanvasElement, handleDeleteZoomFragment, handleDeleteAudioTrack, handleDeleteVideoClip, copySelectedElement, pasteElement, isPhotoMode, copiedElement, textToolActive]);+ const wasMobileRef = useRef<boolean | null>(null);+useEffect(() => {const checkMobile = () => {- if (window.innerWidth < 768) {- setIsControlPanelOpen(false);+ const isMobile = window.innerWidth < 768;+ if (wasMobileRef.current === null) {+ wasMobileRef.current = isMobile;+ if (isMobile) setIsControlPanelOpen(false);+ return;+ }+ if (isMobile !== wasMobileRef.current) {+ wasMobileRef.current = isMobile;+ setIsControlPanelOpen(!isMobile);}};checkMobile();diff --git a/app/components/ui/editor/MockupMenu.tsx b/app/components/ui/editor/MockupMenu.tsxindex 921d1f2..3eb25ef 100644--- a/app/components/ui/editor/MockupMenu.tsx+++ b/app/components/ui/editor/MockupMenu.tsx@@ -407,7 +407,7 @@ export function MockupMenu({</div><div className="absolute inset-0 group-hover:bg-black/5 transition-colors pointer-events-none" /><div className="absolute bottom-0 left-0 bg-black/60 border-t border-r border-white/10 px-1 py-0.5 text-[11px] text-white/80 font-semibold tracking-tight rounded-tr-md rounded-bl-lg z-30">- {t(`mockups.${currentMockup?.id}`) || t("none")}+ {t(`mockups.${mockup?.id}`) || t("none")}</div>{isActive && (<div className="absolute top-2 right-2 rounded-full shadow-[0_0_10px_rgba(96,165,250,0.8)] z-30">@@ -448,7 +448,7 @@ export function MockupMenu({</div></div><div className="absolute bottom-0 left-0 bg-black/60 border-t border-r border-white/10 px-1 py-0.5 text-[9px] text-white/80 font-semibold tracking-tight rounded-tr-md rounded-bl-lg z-30">- {t(`mockups.${currentMockup?.id}`) || t("none")}+ {t(`mockups.${mockup?.id}`) || t("none")}</div>{isActive && (<div className="absolute top-1.5 right-1.5 rounded-full shadow-[0_0_8px_rgba(96,165,250,0.7)] z-30 flex items-center justify-center size-4">diff --git a/app/components/ui/editor/VideoCanvas.tsx b/app/components/ui/editor/VideoCanvas.tsxindex 5a6d30f..88f092d 100644--- a/app/components/ui/editor/VideoCanvas.tsx+++ b/app/components/ui/editor/VideoCanvas.tsx@@ -468,12 +468,19 @@ function VideoCanvasInner({environment: deviceDefaults.environment,});- useEffect(() => {- if (!canvasDimensions) return;+ const prevAspectKeyRef = useRef<string | null>(null);+ const pendingAspectRescaleRef = useRef(false);- const arKnown = aspectRatio !== "auto" || !!customAspectRatio;- if (!arKnown) return;+ useEffect(() => {+ const key = `${aspectRatio}:${customAspectRatio?.width ?? ""}x${customAspectRatio?.height ?? ""}`;+ if (prevAspectKeyRef.current !== null && prevAspectKeyRef.current !== key) {+ pendingAspectRescaleRef.current = true;+ }+ prevAspectKeyRef.current = key;+ }, [aspectRatio, customAspectRatio]);+ useEffect(() => {+ if (!canvasDimensions) return;if (isRestoringProjectRef?.current) return;if (imagePhoneRescaleTimerRef.current) {@@ -483,15 +490,27 @@ function VideoCanvasInner({imagePhoneRescaleTimerRef.current = setTimeout(() => {if (isRestoringProjectRef?.current) return;+ if (!pendingAspectRescaleRef.current) {+ // Resize incidental: NO fue un cambio deliberado de aspect ratio.+ // Solo resincronizamos el ancho base para no acumular drift,+ // sin tocar la posición ni la escala del overlay.+ if (imagePhoneRefWidth === 0 || Math.abs(canvasDimensions.width - imagePhoneRefWidth) > 0.5) {+ setImagePhoneRefWidth(canvasDimensions.width);+ }+ return;+ }++ // Cambio deliberado de aspect ratio: acá sí corresponde reescalar+ // proporcionalmente, porque el canvas de export realmente cambió+ // de tamaño por una acción del usuario.+ pendingAspectRescaleRef.current = false;if (imagePhoneRefWidth > 0 && Math.abs(canvasDimensions.width - imagePhoneRefWidth) > 0.5) {const ratio = canvasDimensions.width / imagePhoneRefWidth;setImagePhoneX(prev => prev * ratio);setImagePhoneY(prev => prev * ratio);setImagePhoneScale(prev => prev * ratio);- setImagePhoneRefWidth(canvasDimensions.width);- } else if (imagePhoneRefWidth === 0) {- setImagePhoneRefWidth(canvasDimensions.width);}+ setImagePhoneRefWidth(canvasDimensions.width);}, 300);return () => {@@ -499,7 +518,7 @@ function VideoCanvasInner({clearTimeout(imagePhoneRescaleTimerRef.current);}};- }, [canvasDimensions, imagePhoneRefWidth, aspectRatio, customAspectRatio, setImagePhoneX, setImagePhoneY, setImagePhoneScale, setImagePhoneRefWidth, isRestoringProjectRef]);+ }, [canvasDimensions, imagePhoneRefWidth, isRestoringProjectRef, setImagePhoneX, setImagePhoneY, setImagePhoneScale, setImagePhoneRefWidth]);const cameraDragRef = useRef<{pointerId: number;@@ -1868,11 +1887,14 @@ function VideoCanvasInner({const measure = () => {const boxRect = box.getBoundingClientRect();const contentRect = content.getBoundingClientRect();+ const scaleX = box.offsetWidth > 0 ? boxRect.width / box.offsetWidth : 1;+ const scaleY = box.offsetHeight > 0 ? boxRect.height / box.offsetHeight : 1;+setContentInsets({- top: contentRect.top - boxRect.top,- bottom: boxRect.bottom - contentRect.bottom,- left: contentRect.left - boxRect.left,- right: boxRect.right - contentRect.right,+ top: (contentRect.top - boxRect.top) / (scaleY || 1),+ bottom: (boxRect.bottom - contentRect.bottom) / (scaleY || 1),+ left: (contentRect.left - boxRect.left) / (scaleX || 1),+ right: (boxRect.right - contentRect.right) / (scaleX || 1),});};diff --git a/app/components/ui/editor/mockups-3d/IPhone13ProMax3DViewer.tsx b/app/components/ui/editor/mockups-3d/IPhone13ProMax3DViewer.tsxindex bbb5174..c9929c9 100644--- a/app/components/ui/editor/mockups-3d/IPhone13ProMax3DViewer.tsx+++ b/app/components/ui/editor/mockups-3d/IPhone13ProMax3DViewer.tsx@@ -12,6 +12,7 @@ import { EffectComposer } from "three/examples/jsm/postprocessing/EffectComposerimport { RenderPass } from "three/examples/jsm/postprocessing/RenderPass.js";import { OutlinePass } from "three/examples/jsm/postprocessing/OutlinePass.js";import { OutputPass } from "three/examples/jsm/postprocessing/OutputPass.js";+export interface IPhone13ProMax3DApi {renderAt: (width: number, height: number) => void;restorePreview: () => void;diff --git a/hooks/useVideoExport.ts b/hooks/useVideoExport.tsindex 9456580..774570c 100644--- a/hooks/useVideoExport.ts+++ b/hooks/useVideoExport.ts@@ -446,7 +446,7 @@ async function exportWithMediabunny(}const blob = new Blob([buffer], { type: "video/mp4" });- downloadBlob(blob, `video-export-${width}x${height}.mp4`);+ downloadBlob(blob, `openvid-${width}x${height}.mp4`);setProgress({status: "complete",@@ -648,7 +648,7 @@ async function exportWithMediabunnyAndAudio(const videoBlob = new Blob([buffer], { type: "video/mp4" });if (!needsAudioMixing) {- downloadBlob(videoBlob, `video-export-${width}x${height}.mp4`);+ downloadBlob(videoBlob, `openvid-${width}x${height}.mp4`);setProgress({ status: "complete", progress: 100, message: "¡Exportación completada!" });return;}@@ -667,7 +667,7 @@ async function exportWithMediabunnyAndAudio(const hasUsableAudioTracks = !!(settings.audioTracks && settings.audioTracks.some(t => t.audioUrl));if (!hasUsableSourceBlob && !hasUsableMultiClipAudio && !hasUsableAudioTracks) {- downloadBlob(videoBlob, `video-export-${width}x${height}.mp4`);+ downloadBlob(videoBlob, `openvid-${width}x${height}.mp4`);setProgress({ status: "complete", progress: 100, message: "¡Exportación completada!" });return;}@@ -816,7 +816,7 @@ async function exportWithMediabunnyAndAudio(const totalAudioInputs = audioInputs.length;if (totalAudioInputs === 0) {- downloadBlob(videoBlob, `video-export-${width}x${height}.mp4`);+ downloadBlob(videoBlob, `openvid-${width}x${height}.mp4`);setProgress({ status: "complete", progress: 100, message: "¡Exportación completada!" });return;} else if (audioInputs.length > 0) {@@ -843,7 +843,7 @@ async function exportWithMediabunnyAndAudio(await ffmpeg.exec(ffmpegArgs);} catch (e) {console.error("FFmpeg audio mixing failed:", e);- downloadBlob(videoBlob, `video-export-${width}x${height}.mp4`);+ downloadBlob(videoBlob, `openvid-${width}x${height}.mp4`);setProgress({status: "complete",progress: 100,@@ -873,7 +873,7 @@ async function exportWithMediabunnyAndAudio(}} catch { /* ignore cleanup errors */ }- downloadBlob(outputBlob, `video-export-${width}x${height}.mp4`);+ downloadBlob(outputBlob, `openvid-${width}x${height}.mp4`);setProgress({status: "complete",@@ -882,7 +882,7 @@ async function exportWithMediabunnyAndAudio(});} catch (ffmpegError) {console.warn("FFmpeg audio processing failed, exporting video only:", ffmpegError);- downloadBlob(videoBlob, `video-export-${width}x${height}.mp4`);+ downloadBlob(videoBlob, `openvid-${width}x${height}.mp4`);setProgress({status: "complete",progress: 100,diff --git a/lib/mockup-data.tsx b/lib/mockup-data.tsxindex 4eb8ff9..c103d9a 100644--- a/lib/mockup-data.tsx+++ b/lib/mockup-data.tsx@@ -409,7 +409,7 @@ export const MOCKUPS: Mockup[] = [},{id: "macos-dark-ide",- name: "VS CODE macos",+ name: "VSCODE macos",category: "ide",features: {hasDarkMode: true,diff --git a/messages/en.json b/messages/en.jsonindex 006ee2f..6b5f0dc 100644--- a/messages/en.json+++ b/messages/en.json@@ -650,35 +650,35 @@"ide": "Editor de Código"},"mockups": {- "none": "Ninguno",+ "none": "None","macos": "MacOS",- "macos-glass": "MacOS Cristal",- "outline": "Contorno",- "glass-ui-container": "Contenedor UI Cristal",- "macos-ghost": "MacOS Fantasma",- "macos-ghost-glass": "MacOS Fantasma Cristal",- "macos-container-glass": "Contenedor MacOS Cristal",+ "macos-glass": "MacOS Glass",+ "outline": "Outline",+ "glass-ui-container": "Glass UI Container",+ "macos-ghost": "MacOS Ghost",+ "macos-ghost-glass": "MacOS Ghost Glass",+ "macos-container-glass": "MacOS Container Glass","brave": "Brave",- "brave-glass": "Brave Cristal",- "browser-tab-glass": "Pestaña de Navegador Cristal",+ "brave-glass": "Brave Glass",+ "browser-tab-glass": "Browser Tab Glass","chrome": "Chrome",- "chrome-glass": "Chrome Cristal",- "iphone-slim": "iPhone Delgado",- "glass-curve": "Cristal Curvo",- "glass-full": "Cristal Completo",- "hard-shell": "Carcasa Dura",+ "chrome-glass": "Chrome Glass",+ "iphone-slim": "iPhone Slim",+ "glass-curve": "Glass Curve",+ "glass-full": "Glass Full",+ "hard-shell": "Hard Shell","s24-ultra": "S24 Ultra","vscode": "VS Code","macos-dark-ide": "VS Code MacOS",- "macos-ghost-ide": "MacOS Fantasma IDE"+ "macos-ghost-ide": "MacOS Ghost IDE"},"devices": {"iphone-13-pro-max": "iPhone 13 Pro",- "double_iphone_13_pro": "Doble iPhone 13 Pro",+ "double_iphone_13_pro": "Double iPhone 13 Pro","iphone-17-pro-max": "iPhone 17 Pro","iphone": "iPhone 15 Pro",- "phone": "Teléfono genérico",- "laptop": "Portátil macOS",+ "phone": "Generic phone",+ "laptop": "macOS Laptop","ipad_mini_6_2021": "iPad mini 6 (2021)"}},diff --git a/messages/es.json b/messages/es.jsonindex 52e9b9e..a48f6ff 100644--- a/messages/es.json+++ b/messages/es.json@@ -616,7 +616,7 @@"macos-container-glass": "Contenedor MacOS Cristal","brave": "Brave","brave-glass": "Brave Cristal",- "browser-tab-glass": "Pestaña de Navegador Cristal",+ "browser-tab-glass": "Pestaña de Cristal","chrome": "Chrome","chrome-glass": "Chrome Cristal","iphone-slim": "iPhone Delgado",diff --git a/messages/ru.json b/messages/ru.jsonindex 64364a4..647a811 100644--- a/messages/ru.json+++ b/messages/ru.json@@ -622,32 +622,32 @@"macos": "MacOS","macos-glass": "MacOS Стекло","outline": "Контур",- "glass-ui-container": "Стеклянный контейнер UI",- "macos-ghost": "MacOS Призрак",- "macos-ghost-glass": "MacOS Призрак Стекло",- "macos-container-glass": "MacOS Стеклянный контейнер",+ "glass-ui-container": "Стекло UI",+ "macos-ghost": "MacOS Фантом",+ "macos-ghost-glass": "MacOS Фантом Стекло",+ "macos-container-glass": "MacOS Стекло","brave": "Brave","brave-glass": "Brave Стекло",- "browser-tab-glass": "Вкладка браузера Стекло",+ "browser-tab-glass": "Вкладка Стекло","chrome": "Chrome","chrome-glass": "Chrome Стекло","iphone-slim": "iPhone Тонкий",- "glass-curve": "Стеклянная кривая",- "glass-full": "Полное стекло",- "hard-shell": "Жесткий корпус",+ "glass-curve": "Стекло Изгиб",+ "glass-full": "Все Стекло",+ "hard-shell": "Жесткий Чехол","s24-ultra": "S24 Ultra","vscode": "VS Code","macos-dark-ide": "VS Code MacOS",- "macos-ghost-ide": "MacOS Призрак IDE"+ "macos-ghost-ide": "MacOS Фантом IDE"},"devices": {"iphone-13-pro-max": "iPhone 13 Pro",- "double_iphone_13_pro": "Двойной iPhone 13 Pro",+ "double_iphone_13_pro": "2x iPhone 13 Pro","iphone-17-pro-max": "iPhone 17 Pro","iphone": "iPhone 15 Pro","phone": "Телефон",- "laptop": "Ноутбук macOS",- "ipad_mini_6_2021": "iPad mini 6 (2021)"+ "laptop": "Ноутбук Mac",+ "ipad_mini_6_2021": "iPad mini 6"}},"videosMenu": {