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

What is Framer? Join the Community
Return to index
Johannes Eckert
Posted Mar 21 - Read on Facebook

Custom Device Bug

when adding a custom device, according to the snippet I should be able to set a custom device image (presumably in images/) but framer studio will always look into it's own resources according to the device name.

when sharing, this happens: http://share.framerjs.com/5z5u36vgewvr/

I guess I should be able to add my own image and have that one uploaded, right?

12 Comments

Johannes Eckert

so I added a surface.jp2 into the resources folder, but it still doesn't work with sharing.

here's my fix to overwrite the device's backgroundImage:
Framer.Device.phone.style.backgroundImage = "url(images/surface.png)"

http://share.framerjs.com/53zvkokp2dvu/

Sander Värv

I can't get it to work even with this fix, althought the code looks identical to yours. Error says: No device named Nexus-4. Did you add "surface" as a device to some other file?

Johannes Eckert

do you compare to the code I have in my comment above?
make sure to add your nexus-4 as a new item in array Framer.DeviceView.Devices[] before referencing. Then you should get an asset not found error that you can overwride

Sander Värv

Yes, with a different image and device name.

Johannes Eckert

care to share your code?

Sander Värv

Sure, I can do it later. Not behind my computer atm.

Sander Värv

Here it is, nothing visible though. http://share.framerjs.com/f8q2awq45onl/

Johannes Eckert

This is easy to fix. don't know why (probably safe name restrictions for object names), "nexus4" works, but "Nexus-4" does not

Sander Värv

Thanks! Feeling stupid now! I thought I tried that combination too..

Johannes Eckert

these things happen to me all the time.

Koen Bok

Hmm yep there is a bug here. I do smart stuff to figure out wether to serve the image locally or from the server and in which format. That seems to have a bug. I'll fix this.

Read the entire post on Facebook