This is a read-only archive of the Framer Community on Facebook.

What is Framer? Join the Community
Return to index
Mike Hughes
Posted Feb 15 - Read on Facebook

New to Framer but working on Custom Device frames. Code Snippet is as follows:

# deviceType can be either "phone" or "desktop"
Framer.DeviceView.Devices["custom"] =
"deviceType": "phone"
"screenWidth": 720
"screenHeight": 1000
"deviceImage": "http://f.cl.ly/items/001L0v3c1f120t0p2z24/custom.png"
"deviceImageWidth": 800
"deviceImageHeight": 1203

# Set custom device
Framer.Device.deviceType = "custom"

But when playing around with creating Custom Device frames, how do I re-position the Screen, as it may not align to the Device Image, if the Device Image is a few pixels left/right or up/down.

Are there other properties I can add to Framer.DeviceView.Devices["custom"] to offset say 10 left and 5 down relative to the Device Image ? Or should I just always ensure the screen part of device images are pixel perfect centred on x and y axis ?

1 Comments

Floris Verloop

Framer makes sure the device is always centred, so the way to fix this is to make sure the mockup you're using has it's screen perfectly centred.

Read the entire post on Facebook