Create device mockups in one click
Prerequisites:
Now, in your terminal:
> npm install
> npm run dev
# omitted
🚀 astro v2.8.3 started in 106ms
┃ Local http://127.0.0.1:3000/
┃ Network use --host to expose
# Visit http://127.0.0.1:3000/ and have fun!
pip install Pillow
pip install opencv-python
{device_id}-portrait.png
and {device_id}-landscape.png
in public/Images/mockup_templates/
make create-mask-image
to create mask image to public/Images/mockup_mask_templates/
make add-new-device
, and input device info, this script will let user use {device_id}-portrait.png
in public/Images/mockup_mask_templates/
to get the frame of the image
src/scripts/device_info.json
, or press enter in the image window to generate device_info and auto add it to src/scripts/device_info.json
{
"credits": '<p><a href="http://facebook.design/devices" target="blank">Facebook - Design Resources</a></p>',
"desc": "{device_color}",
"meta_title": "{device_name} {device_color} Mock Up",
"meta_description": "1 click to generate your {device_name} {device_color} mockup! You can wrap screenshots in {device_name} {device_color} for prototypes.",
"display_resolution": [width, height],
"device_type": f"{device_type}",
"device_id": f"{device_id}",
"name": f"{device_name}",
"orientations": [
{
"alt": "",
"coords": [
[top-left-point],
[top-right-point],
[bottom-right-point],
[bottom-left-point]
],
"name": "portrait",
},
{
"alt": "",
"coords": [
[top-right-point],
[bottom-right-point],
[bottom-left-point],
[top-left-point]
],
"name": "landscape",
},
],
"view_desc": "Portrait<br/>Landscape",
}
credits
and alt
in orientations
credits
, desc
, name
, view_desc
will display in https://mockuphone.com/device_listmake add-new-device
Input device_id(ex: samsung-galaxys20ultra-cosmicgrey): samsung-galaxys20ultra-cosmicgrey
Input device_color(ex: Pink): Pink
Input device_name(ex: Samsung Galaxy S20): Samsung Galaxy S20
Input device_type(Android/iOS/TV/Laptops/Macbook): Android
src/scripts/device_info.json
{
"credits": "<p><a href=\"http://facebook.design/devices\" target=\"blank\">Facebook - Design Resources</a></p>",
"desc": "Pink",
"meta_title": "Samsung Galaxy S20 Pink Mock Up",
"meta_description": "1 click to generate your Samsung Galaxy S20 Pink mockup! You can wrap screenshots in Samsung Galaxy S20 Pink for prototypes.",
"display_resolution": [1440, 3200],
"device_type": "Android",
"device_id": "samsung-galaxys20ultra-cosmicgrey",
"name": "Samsung Galaxy S20",
"orientations": [
{
"alt": "",
"coords": [
[200, 200],
[1640, 200],
[1640, 3400],
[200, 3400]
],
"name": "portrait"
},
{
"alt": "",
"coords": [
[3400, 200],
[3400, 1640],
[200, 1640],
[200, 200]
],
"name": "landscape"
}
],
"view_desc": "Portrait<br/>Landscape"
}
src/scripts/device_info.json
, add the device_id
to the device_cat
it belongs tonpx prettier src/scripts/device_info.json --write
to format src/scripts/device_info.json