Create professional demos and 3D mockups in seconds, directly in your browser
feat: add Outline mockup component and integrate into mockup rendering; update constants and previews
CristianOlivera17534c032567c
diff --git a/app/components/ui/editor/MockupMenu.tsx b/app/components/ui/editor/MockupMenu.tsxindex 31a7e4c..f4f33bc 100644--- a/app/components/ui/editor/MockupMenu.tsx+++ b/app/components/ui/editor/MockupMenu.tsx@@ -406,7 +406,7 @@ export function MockupMenu({</div></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-2 py-1 text-[9px] 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-[10px] 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/mockups/MockupWrapper.tsx b/app/components/ui/editor/mockups/MockupWrapper.tsxindex 4a8951b..c0562d2 100644--- a/app/components/ui/editor/mockups/MockupWrapper.tsx+++ b/app/components/ui/editor/mockups/MockupWrapper.tsx@@ -21,6 +21,7 @@ import { GlassCurveMockup } from "./GlassCurveMockup";import { GlassFullMockup } from "./GlassFullMockup";import { HardShellMockup } from "./HardShellMockup";import { S24UltraMockup } from "./S24UltraMockup";+import { OutlineMockup } from "./OutlineMockup";interface MockupWrapperProps {mockupId: string;@@ -76,6 +77,18 @@ export function MockupWrapper({</MacosGlassMockup>);+ case "outline":+ return (+ <OutlineMockup+ config={config}+ roundedCorners={roundedCorners}+ shadows={shadows}+ className={className}+ >+ {children}+ </OutlineMockup>+ );+case "glass-ui-container":return (<GlassUIContainerMockupdiff --git a/app/components/ui/editor/mockups/OutlineMockup.tsx b/app/components/ui/editor/mockups/OutlineMockup.tsxnew file mode 100644index 0000000..fbc9f15--- /dev/null+++ b/app/components/ui/editor/mockups/OutlineMockup.tsx@@ -0,0 +1,56 @@+"use client";++import type { MockupRenderProps } from "@/types/mockup.types";++interface OutlineMockupProps extends MockupRenderProps {+ shadows?: number;+ roundedCorners?: number;+}++export function OutlineMockup({+ children,+ config,+ className = "",+ shadows = 30,+ roundedCorners,+}: OutlineMockupProps) {+ const isDark = config.darkMode;+ const cornerRadius = roundedCorners ?? config.cornerRadius;++ const screenBg = isDark ? "#0a0a0a" : "#ffffff";++ 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 outerRadius = innerRadius + offset;++ return (+ <div className={`relative flex flex-col ${className}`}>++ <div+ className="relative flex flex-col"+ style={{+ padding: `${offset}px`,+ borderRadius: `${outerRadius}px`,+ border: `1px solid ${frameColor}`,+ }}+ >++ <div+ className="relative w-full h-full overflow-hidden shadow-inner"+ style={{+ backgroundColor: screenBg,+ borderRadius: `${innerRadius}px`,+ boxShadow: shadows > 0 ? `0 ${shadows}px ${shadows * 2}px rgba(0,0,0,0.12)` : 'none',+ }}+ >+ <div className="relative z-10 w-full h-full">+ {children}+ </div>+ </div>++ </div>+ </div>+ );+}\ No newline at end of filediff --git a/lib/constants.ts b/lib/constants.tsindex 740c7e0..d0aad62 100644--- a/lib/constants.ts+++ b/lib/constants.ts@@ -54,7 +54,7 @@ export const TIMELINE_ZOOM_SCALE: Record<number, number> = {export const BOTTOM_ONLY_RADIUS_MOCKUPS = ["macos", "macos-glass", "macos-ghost", "macos-ghost-glass", "vscode", "macos-dark-ide", "macos-ghost-ide", "brave", "brave-glass", "browser-tab-glass", "chrome", "chrome-glass", "s24-ultra", "glass-curve", "glass-full"];// Glass mockups → handle their own shadow, do not need the solid rect underneath-export const SELF_SHADOWING_MOCKUPS = ["macos-glass", "macos-ghost-glass", "glass-ui-container", "macos-container-glass", "brave-glass", "browser-tab-glass", "chrome-glass", "iphone-slim", "glass-curve", "glass-full", "s24-ultra", "hard-shell"];+export const SELF_SHADOWING_MOCKUPS = ["macos-glass", "outline", "macos-ghost-glass", "glass-ui-container", "macos-container-glass", "brave-glass", "browser-tab-glass", "chrome-glass", "iphone-slim", "glass-curve", "glass-full", "s24-ultra", "hard-shell"];// Video z-index: elements with zIndex < VIDEO_Z_INDEX render behind the videoexport const VIDEO_Z_INDEX = 1000;diff --git a/lib/mockup-canvas.utils.ts b/lib/mockup-canvas.utils.tsindex 26e6b78..a8cadc4 100644--- a/lib/mockup-canvas.utils.ts+++ b/lib/mockup-canvas.utils.ts@@ -21,6 +21,7 @@ import { drawGlassCurveMockup } from "./mockup-canvas/glass-curve";import { drawGlassFullMockup } from "./mockup-canvas/glass-full";import { drawHardShellMockup } from "./mockup-canvas/hard-shell";import { drawS24UltraMockup } from "./mockup-canvas/s24-ultra";+import { drawOutlineMockup } from "./mockup-canvas/outline";interface MockupCanvasContext {ctx: CanvasRenderingContext2D;@@ -72,6 +73,9 @@ export function drawMockupToCanvas(case "macos-glass":rawResult = drawMacosGlassMockup(context);break;+ case "outline":+ rawResult = drawOutlineMockup(context);+ break;case "glass-ui-container":rawResult = drawGlassUIContainerMockup(context);break;diff --git a/lib/mockup-canvas/outline.ts b/lib/mockup-canvas/outline.tsnew file mode 100644index 0000000..5e6ef05--- /dev/null+++ b/lib/mockup-canvas/outline.ts@@ -0,0 +1,42 @@+import type { MockupCanvasContext, MockupDrawResult } from "./types";+import { drawRoundedRectPath, drawMockupShadow } from "./shared";++export function drawOutlineMockup(context: MockupCanvasContext): MockupDrawResult {+ const { ctx, x, y, width, height, config, cornerRadius, shadowBlur } = context;++ const isDark = config.darkMode;+ const screenBg = isDark ? "#0a0a0a" : "#ffffff";++ 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 outerRadius = innerRadius + offset;++ ctx.save();+ drawRoundedRectPath(ctx, x, y, width, height, outerRadius);+ ctx.strokeStyle = frameColor;+ ctx.lineWidth = 1;+ ctx.stroke();+ ctx.restore();++ const screenX = x + offset;+ const screenY = y + offset;+ const screenWidth = width - offset * 2;+ const screenHeight = height - offset * 2;++ drawMockupShadow(ctx, screenX, screenY, screenWidth, screenHeight, innerRadius, shadowBlur);++ ctx.save();+ drawRoundedRectPath(ctx, screenX, screenY, screenWidth, screenHeight, innerRadius);+ ctx.fillStyle = screenBg;+ ctx.fill();+ ctx.restore();++ return {+ contentX: screenX,+ contentY: screenY,+ contentWidth: screenWidth,+ contentHeight: screenHeight,+ };+}\ No newline at end of filediff --git a/lib/mockup-data.tsx b/lib/mockup-data.tsxindex 2ceaa1f..f0992c9 100644--- a/lib/mockup-data.tsx+++ b/lib/mockup-data.tsx@@ -1,5 +1,5 @@import { Mockup, DEFAULT_MOCKUP_FEATURES } from "@/types/mockup.types";-import { BraveGlassPreview, BravePreview, BrowserTabGlassPreview, ChromeGlassPreview, ChromePreview, GlassCurvePreview, GlassFullPreview, GlassUIContainerPreview, HardShellPreview, IphoneSlimPreview, MacosContainerGlassPreview, MacosDarkPreview, MacosGhostGlassPreview, MacosGhostIdePreview, MacosGhostPreview, MacosGlassPreview, MacosPreview, NonePreview, S24UltraPreview, VSCodePreview } from "./mockup-previews";+import { BraveGlassPreview, BravePreview, BrowserTabGlassPreview, ChromeGlassPreview, ChromePreview, GlassCurvePreview, GlassFullPreview, GlassUIContainerPreview, HardShellPreview, IphoneSlimPreview, MacosContainerGlassPreview, MacosDarkPreview, MacosGhostGlassPreview, MacosGhostIdePreview, MacosGhostPreview, MacosGlassPreview, MacosPreview, NonePreview, OutlinePreview, S24UltraPreview, VSCodePreview } from "./mockup-previews";export const MOCKUPS: Mockup[] = [{@@ -59,6 +59,26 @@ export const MOCKUPS: Mockup[] = [<MacosGlassPreview />),},+ {+ id: "outline",+ name: "Outline",+ category: "browser",+ features: {+ hasDarkMode: true,+ hasFrameColor: true,+ hasUrl: false,+ hasHeaderScale: false,+ hasCornerRadius: true,+ hasHeaderOpacity: false,+ },+ defaultConfig: {+ darkMode: false,+ cornerRadius: 12,+ },+ preview: (+ <OutlinePreview />+ ),+ },{id: "glass-ui-container",name: "Glass UI Container",diff --git a/lib/mockup-previews.tsx b/lib/mockup-previews.tsxindex fb36f5f..979e7c0 100644--- a/lib/mockup-previews.tsx+++ b/lib/mockup-previews.tsx@@ -39,6 +39,16 @@ export function MacosPreview() {);}+export function OutlinePreview() {+ return (+ <div className="absolute top-6 left-5 w-[160%] h-[155%] bg-[#f9f9f9] rounded-tl-xl shadow-[0_10px_40px_rgba(0,0,0,0.12)] flex flex-col overflow-hidden outline-1 outline-gray-300 outline-offset-7">++ <div className="flex-1 bg-[#f9f9f9] relative"></div>++ </div>+ );+}+export function MacosGlassPreview() {return (<div className="absolute top-3 left-3 w-[165%] h-[165%] rounded-tl-xl flex flex-col glass-border">