"You can just paste with the keyboard onto the canvas. Baller." Jeff Schmetsky, Mockstar
Create stunning device mockups in seconds. Drop in your designs, download pixel-perfect PNGs. No accounts, no watermarks, no BS.
Tired of bloated mockup tools that require subscriptions, watermark your work, or limit exports? This app is 100% free, open source, and yours to hack on. Fork it, customize it, add your own devices, or integrate it into your workflow. Built with vanilla JavaScript and modern web APIs—no frameworks to wrestle with.
Perfect for:
- 🎨 Designers showcasing UI work
- 📱 Product teams creating marketing materials
- 🛠️ Developers building custom mockup generators
- 🎓 Students learning 3D web graphics
- 🚀 Anyone who needs quick, professional mockups
A web application for creating professional device mockups with 2D canvas rendering and 3D model viewer support.
- 📱 Multiple device support (iPhone, iPad, iMac)
- 🎨 Drag & drop image upload
- 🔄 2D and 3D view modes
- 🎯 Pixel-perfect mockup generation
- 💾 PNG export
- 🎭 Customizable device colors and materials
- ⌨️ Paste support for quick workflows
mocker/
├── index.html # Main HTML file
├── README.md # This file
├── css/ # Stylesheets
│ ├── README.md # CSS documentation
│ ├── base.css # Foundation styles
│ ├── layout.css # Layout and responsive design
│ └── components.css # UI components
├── js/ # JavaScript modules
│ ├── README.md # JavaScript documentation
│ ├── devices.js # Device configuration library
│ ├── materials.js # Material management
│ ├── textures.js # Texture handling
│ ├── canvas.js # 2D rendering
│ └── app.js # Main application
└── devices/ # Device assets
├── iPhone 17 Pro/
├── iPad/
└── iMac/
-
Open the application:
open index.html
-
Select a device from the dropdown
-
Upload an image by:
- Clicking "Upload image"
- Dragging and dropping
- Pasting (Cmd/Ctrl + V)
-
Toggle view mode (2D/3D) if available
-
Download your mockup as PNG
For 2D Support:
{device-name}_bg.png- Device background with transparent screen{device-name}_screenmask.png- White mask defining screen area
For 3D Support:
{device-name}.glb- 3D model file
- Create device folder in
devices/ - Add assets to the folder
- Edit
js/devices.jsand add toDEVICE_LIBRARY:
{
id: "device-id",
name: "Device Name",
folder: "devices/DeviceFolder",
assetPrefix: "device-name",
screenWidth: 1920,
screenHeight: 1080,
has2DAssets: true, // false if 3D-only
modelPath: "devices/DeviceFolder/model.glb", // optional
bodyMaterials: [
{
name: "MaterialName", // From GLB file
color: [0.5, 0.5, 0.5, 1], // RGBA (0-1)
metallicFactor: 0.5,
roughnessFactor: 0.5,
}
]
}- Refresh the page - your device will appear in the dropdown!
- Open browser console (F12)
- Select your device
- Switch to 3D view
- Look for "Available materials in model" log
- Use those exact names in
bodyMaterials
Colors use normalized RGB: [r, g, b, a] where values are 0-1
Examples:
- Black:
[0, 0, 0, 1] - White:
[1, 1, 1, 1] - Space Grey:
[0.22, 0.22, 0.23, 1] - Silver:
[0.85, 0.85, 0.86, 1]
Convert from Hex:
#4d567d → RGB(77, 86, 125)
→ [77/255, 86/255, 125/255, 1]
→ [0.302, 0.337, 0.490, 1]
-
metallicFactor (0-1): How metallic the surface appears
- 0 = Non-metallic (plastic, rubber)
- 1 = Fully metallic (polished metal)
-
roughnessFactor (0-1): Surface smoothness
- 0 = Mirror-smooth (glossy)
- 1 = Very rough (matte)
- HTML:
index.html(minimal, just structure) - CSS: Modular in
css/folder (base, layout, components) - JavaScript: ES6 modules in
js/folder - Assets: Device files in
devices/folder
Check Console for:
- "Available materials in model" - Lists all GLB materials
- "Applying tint to material X" - Confirms material found
- "Material X not found" - Material name mismatch
- "Found screen material: X" - Screen detection
Common Issues:
- Material not found → Check exact spelling/case in GLB
- Screen not updating → Check screenMaterialName matches
- Colors wrong → Verify RGB values are 0-1, not 0-255
- Modern browser with ES6 module support
- Chrome 90+, Firefox 88+, Safari 14+, Edge 90+
- 3D Viewer: Google Model Viewer
- 2D Rendering: HTML5 Canvas API
- Styling: Modern CSS (Grid, Flexbox, Custom Properties)
- JavaScript: ES6 Modules, async/await
This project is released under the MIT License.
You are free to use, modify, and distribute it for any purpose.
"Iphone 17 pro" (https://skfb.ly/pzYOR) by Ibrahim.Bhl is licensed under Creative Commons Attribution (http://creativecommons.org/licenses/by/4.0/).
"macbook pro M3 16 inch 2024" (https://skfb.ly/oQJZu) by jackbaeten is licensed under Creative Commons Attribution (http://creativecommons.org/licenses/by/4.0/).
"iMac 2021" (https://skfb.ly/o6poS) by DatSketch is licensed under Creative Commons Attribution (http://creativecommons.org/licenses/by/4.0/).

