Skip to content

Create professional demos and 3D mockups in seconds, directly in your browser

feat: update mockup configurations and improve rendering logic; adjust corner radius calculations and enhance mockup menu interactions

CristianOlivera1c49afd48822f
diff --git a/app/[locale]/(editor)/editor/page.tsx b/app/[locale]/(editor)/editor/page.tsx
index 045bea9..126d387 100644
--- a/app/[locale]/(editor)/editor/page.tsx
+++ b/app/[locale]/(editor)/editor/page.tsx
@@ -151,7 +151,7 @@ export default function Editor() {
// Active tool: lee `?m=<tool>` de la URL en mount. setActiveTool
// actualiza la URL con replaceState (preserva mode y otros params).
const [activeTool, setActiveTool] = useActiveTool();
- const [elementsTextTabTrigger, setElementsTextTabTrigger] = useState(0);
+ const [elementsTextTabTrigger] = useState(0);
const [backgroundTab, setBackgroundTab] = useState<BackgroundTab>("wallpaper");
const [selectedWallpaper, setSelectedWallpaper] = useState(0);
const [backgroundBlur, setBackgroundBlur] = useState(0);
@@ -1245,9 +1245,8 @@ export default function Editor() {
setIsControlPanelOpen(true);
}, [setActiveTool]);
- // Handler para cambiar las esquinas redondeadas (sincroniza ambos valores)
const handleRoundedCornersChange = useCallback((value: number) => {
- setRoundedCorners(value); // Para NoneMockup y canvas general
+ setRoundedCorners(value);
setMockupConfig(prev => ({ ...prev, cornerRadius: value }));
}, []);
diff --git a/app/components/ui/editor/Mockup2dMenu.tsx b/app/components/ui/editor/Mockup2dMenu.tsx
index 4749217..61984c8 100644
--- a/app/components/ui/editor/Mockup2dMenu.tsx
+++ b/app/components/ui/editor/Mockup2dMenu.tsx
@@ -44,7 +44,10 @@ export function Mockup2dMenu({
const handleHeaderScaleChange = (headerScale: number) => onMockupConfigChange?.({ headerScale });
const handleHeaderOpacityChange = (headerOpacity: number) => onMockupConfigChange?.({ headerOpacity });
- const handleRemove = () => onMockupChange?.("none");
+ const handleRemove = () => {
+ onMockupChange?.("none");
+ onBack();
+ };
return (
<>
diff --git a/app/components/ui/editor/MockupMenu.tsx b/app/components/ui/editor/MockupMenu.tsx
index f4f33bc..2343abe 100644
--- a/app/components/ui/editor/MockupMenu.tsx
+++ b/app/components/ui/editor/MockupMenu.tsx
@@ -253,7 +253,7 @@ export function MockupMenu({
}, [page, restoreDevicesScroll, updateDevicesScrollState]);
- if (page === "detail-2d") {
+ if (page === "detail-2d" && mockupId !== "none") {
return (
<Mockup2dMenu
mockupId={mockupId}
@@ -447,7 +447,7 @@ export function MockupMenu({
{mockup.preview}
</div>
</div>
- <div className="absolute bottom-0 left-0 bg-black/60 border-t border-r border-white/10 px-2 py-0.5 text-[8px] text-white/80 font-bold tracking-tighter rounded-tr-md rounded-bl-lg z-30">
+ <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">
{mockup.name}
</div>
{isActive && (
diff --git a/app/components/ui/editor/VideoCanvas.tsx b/app/components/ui/editor/VideoCanvas.tsx
index 298d11a..8c4b88f 100644
--- a/app/components/ui/editor/VideoCanvas.tsx
+++ b/app/components/ui/editor/VideoCanvas.tsx
@@ -1185,7 +1185,11 @@ const VideoCanvasInner = forwardRef<VideoCanvasHandle, VideoCanvasProps>(functio
vY = mr.contentY;
vW = mr.contentWidth;
vH = mr.contentHeight;
- vR = (mockupId === "iphone-slim" || mockupId === "glass-curve" || mockupId === "glass-full") ? scaledRadius * 6 : scaledRadius;
+ vR = mockupId === "outline"
+ ? scaledRadius * 1.6
+ : (mockupId === "iphone-slim" || mockupId === "glass-curve" || mockupId === "glass-full")
+ ? scaledRadius * 6
+ : scaledRadius;
}
c.save();
diff --git a/lib/mockup-canvas/outline.ts b/lib/mockup-canvas/outline.ts
index 5e6ef05..6c0fbf0 100644
--- a/lib/mockup-canvas/outline.ts
+++ b/lib/mockup-canvas/outline.ts
@@ -10,7 +10,7 @@ export function drawOutlineMockup(context: MockupCanvasContext): MockupDrawResul
const frameColor = config.frameColor || (isDark ? "rgba(255, 255, 255, 0.2)" : "rgba(0, 0, 0, 0.15)");
const offset = 12;
- const innerRadius = cornerRadius * 2.5;
+ const innerRadius = cornerRadius * 1.5;
const outerRadius = innerRadius + offset;
ctx.save();
diff --git a/lib/mockup-data.tsx b/lib/mockup-data.tsx
index f0992c9..d3e3e91 100644
--- a/lib/mockup-data.tsx
+++ b/lib/mockup-data.tsx
@@ -38,7 +38,7 @@ export const MOCKUPS: Mockup[] = [
},
{
id: "macos-glass",
- name: "Macos glass",
+ name: "Macos Glass",
category: "browser",
features: {
hasDarkMode: true,
@@ -96,7 +96,7 @@ export const MOCKUPS: Mockup[] = [
},
{
id: "macos-ghost",
- name: "Macos ghost",
+ name: "Macos Ghost",
category: "browser",
features: {
hasDarkMode: true,
@@ -119,7 +119,7 @@ export const MOCKUPS: Mockup[] = [
},
{
id: "macos-ghost-glass",
- name: "Macos ghost glass",
+ name: "Macos Ghost Glass",
category: "browser",
features: {
hasDarkMode: true,
@@ -142,7 +142,7 @@ export const MOCKUPS: Mockup[] = [
},
{
id: "macos-container-glass",
- name: "Macos container glass",
+ name: "Macos Container Glass",
category: "browser",
features: {
...DEFAULT_MOCKUP_FEATURES,
@@ -301,7 +301,7 @@ export const MOCKUPS: Mockup[] = [
category: "mobile",
features: {
hasDarkMode: true,
- hasFrameColor: true,
+ hasFrameColor: false,
hasUrl: false,
hasHeaderScale: true,
hasCornerRadius: true,
@@ -309,7 +309,6 @@ export const MOCKUPS: Mockup[] = [
},
defaultConfig: {
darkMode: false,
- frameColor: "#262626",
headerScale: 60,
cornerRadius: 28,
headerOpacity: 30,
@@ -324,7 +323,7 @@ export const MOCKUPS: Mockup[] = [
category: "mobile",
features: {
hasDarkMode: true,
- hasFrameColor: true,
+ hasFrameColor: false,
hasUrl: false,
hasHeaderScale: true,
hasCornerRadius: true,
@@ -332,7 +331,6 @@ export const MOCKUPS: Mockup[] = [
},
defaultConfig: {
darkMode: false,
- frameColor: "#262626",
headerScale: 60,
cornerRadius: 28,
headerOpacity: 30,
@@ -347,7 +345,7 @@ export const MOCKUPS: Mockup[] = [
category: "mobile",
features: {
hasDarkMode: true,
- hasFrameColor: true,
+ hasFrameColor: false,
hasUrl: false,
hasHeaderScale: true,
hasCornerRadius: true,
@@ -355,7 +353,6 @@ export const MOCKUPS: Mockup[] = [
},
defaultConfig: {
darkMode: false,
- frameColor: "#262626",
headerScale: 60,
cornerRadius: 28,
headerOpacity: 30,
@@ -414,7 +411,7 @@ export const MOCKUPS: Mockup[] = [
},
{
id: "macos-dark-ide",
- name: "Macos dark",
+ name: "VS CODE Dark",
category: "ide",
features: {
hasDarkMode: true,