Jump to content

Figma Embed Mobile Proportions & Responsive

Go to solution Solved by MichGlad,

Recommended Posts

Posted

Hi :)

How can I resize the embedded Figma block to have the proportions of a mobile phone?

I would like to add a Figma prototype for a mobile application to my Squarespace website. I tried adding it, but it has the wrong proportions - it is too short and too broad.

This is how it looks:

332646369_Screenshot2021-06-25132538.thumb.jpg.a49240625f451ac3b96ae5bcaa280049.jpg

I would like the Figma prototype to look more like this and to be responsive for mobile view:

 

200981001_Screenshot2021-06-25133835.thumb.jpg.82f62bf9b64af509ac75b9b28a19cc0b.jpg

I used this code to create it:

<html>
  <head>
    <style>
      #content {
        width: 800px;
        margin: auto;
        height: 100%;
        display: flex;
        align-items: center;
      }
    </style>
  </head>
  <body>
    <div id="content">
      <iframe style="border: 1px solid rgba(0, 0, 0, 0.1);" width="800" height="450" src="https://www.figma.com/embed?embed_host=share&url=https%3A%2F%2Fwww.figma.com%2Fproto%2FqfvtLv9FQgLOek1VqmI9OM%2FPhoneScreenTestSqurespace%3Fnode-id%3D1%253A32%26scaling%3Dmin-zoom%26page-id%3D0%253A1" allowfullscreen></iframe>
    </div>
  </body>
</html>

I found the code here: https://www.figma.com/developers/embed

Here the link to the prototype again: https://www.figma.com/proto/qfvtLv9FQgLOek1VqmI9OM/PhoneScreenTestSqurespace?node-id=1%3A32&scaling=min-zoom&page-id=0%3A1

 

I would be very grateful if you could help me :)
Thank you in advance!

 

  • 1 month later...
  • Solution
Posted (edited)

Thank you @tuanphan :)

I found a solution to my problem

HTML code block:

<div class="iframeContentCenter">
  <iframe style="border: 1px solid rgba(0, 0, 0, 0);" width="414" height="882" src="https://www.figma.com/embed?embed_host=share&url=https%3A%2F%2Fwww.figma.com%2Fproto%2FqfvtLv9FQgLOek1VqmI9OM%2FPhoneScreenTestSqurespace%3Fnode-id%3D1%253A32%26scaling%3Dmin-zoom%26page-id%3D0%253A1" allowfullscreen></iframe>
</div>

Custom CSS:

/*iframe position*/
.iframeContentCenter{
  width: 414px;
  margin: auto;
  border-style: none;
  height: 100%;
  display: block;
}
Edited by MichGlad
  • 2 weeks later...
Posted

And if you don't want that white figma footer at the bottom of your iframe you can add %26hide-ui=1 to the end of your src url.
Otherwise just add 48px to your height so the footer does not overlap.

  • 2 months later...
Posted

I have a couple questions about this too! I don't code at all, so know, I don't understand how to write CSS 😀

  1. Is there a way to put the embed code into one of the sqsp image blocks (eg. the collage image block)?
  2. is there a way to make the figma embed code responsive?
  3. is there a way to make the figma embed code responsive, but constrained to aspect ratio? 
  4. I tried adding "%26hide-ui=1" to the end of the source URL but it did not work? I must not be understanding where the end of the url actually is? (I put it right after the ID% number)

 

This is what I have now. as you can see its centered on desktop but not on tablet or mobile. its not responding to device at all. 

 

<center>
<iframe style="border: 0px solid rgba(0, 0, 0, 0.1);" width="800" height="1024
" src="https://www.figma.com/embed?embed_host=share&url=https%3A%2F%2Fwww.figma.com%2Fproto%2FcD5e93lWwLEbGNhSQte9Iv%2FPlenity_06_portfolio%3Fpage-id%3D2422%253A73083%26node-id%3D2422%253A73083%26viewport%3D241%252C48%252C0.5%26scaling%3Dmin-zoom%26starting-point-node-id%3D2422%253A74946" allowfullscreen></iframe>
<center>

 

Screen Shot 2021-10-22 at 2.34.47 PM.png

Screen Shot 2021-10-22 at 2.34.59 PM.png

Screen Shot 2021-10-22 at 2.35.08 PM.png

Posted
On 10/23/2021 at 1:36 AM, finooks said:

I have a couple questions about this too! I don't code at all, so know, I don't understand how to write CSS 😀

  1. Is there a way to put the embed code into one of the sqsp image blocks (eg. the collage image block)?
  2. is there a way to make the figma embed code responsive?
  3. is there a way to make the figma embed code responsive, but constrained to aspect ratio? 
  4. I tried adding "%26hide-ui=1" to the end of the source URL but it did not work? I must not be understanding where the end of the url actually is? (I put it right after the ID% number)

 

This is what I have now. as you can see its centered on desktop but not on tablet or mobile. its not responding to device at all. 

 

<center>
<iframe style="border: 0px solid rgba(0, 0, 0, 0.1);" width="800" height="1024
" src="https://www.figma.com/embed?embed_host=share&url=https%3A%2F%2Fwww.figma.com%2Fproto%2FcD5e93lWwLEbGNhSQte9Iv%2FPlenity_06_portfolio%3Fpage-id%3D2422%253A73083%26node-id%3D2422%253A73083%26viewport%3D241%252C48%252C0.5%26scaling%3Dmin-zoom%26starting-point-node-id%3D2422%253A74946" allowfullscreen></iframe>
<center>

 

Screen Shot 2021-10-22 at 2.34.47 PM.png

Screen Shot 2021-10-22 at 2.34.59 PM.png

Screen Shot 2021-10-22 at 2.35.08 PM.png

#1. Use script code to move embed block into collage block

#2. #3. #1. Can you share link to page where you added figma? We can check easier

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

  • 11 months later...
Posted
On 8/5/2021 at 2:08 PM, MichGlad said:

Thank you @tuanphan 🙂

I found a solution to my problem

HTML code block:

<div class="iframeContentCenter">
  <iframe style="border: 1px solid rgba(0, 0, 0, 0);" width="414" height="882" src="https://www.figma.com/embed?embed_host=share&url=https%3A%2F%2Fwww.figma.com%2Fproto%2FqfvtLv9FQgLOek1VqmI9OM%2FPhoneScreenTestSqurespace%3Fnode-id%3D1%253A32%26scaling%3Dmin-zoom%26page-id%3D0%253A1" allowfullscreen></iframe>
</div>

Custom CSS:

/*iframe position*/
.iframeContentCenter{
  width: 414px;
  margin: auto;
  border-style: none;
  height: 100%;
  display: block;
}

Hi! I'm having the exact same problem. I know nothing about HTML, CSS... 

where can I paste this code?

thank you in advance!

  • 6 months later...
Posted
On 10/24/2021 at 11:31 PM, tuanphan said:

#1. Use script code to move embed block into collage block

#2. #3. #1. Can you share link to page where you added figma? We can check easier

Hey Tuan, what script code would you use to move an embeded block into a collage? Trying to embed my Figma site in a way that it'll be responsive on mobile.

 

BTW, just wanted to say that you're awesome. Almost every time I come to one of these forums I see you answering. Thank you so much for all you do, and all the help you've given me personally!

  • 2 months later...
Posted

I'm also having the same issue. Although I think mine is a scaling issue vs. a dimension issue? I want the PT to fill as much of the viewport as possible, but it's either too big or too small. I've messed around with a number of code options as well as the PT setting within Figma, no dice. The device frame itself isn't showing up either. I wonder if it has to do with the overall height. I set it that way so it would at least scale up to a viewable size.

Any takers on advice?

Screenshot 2023-07-10 at 00.24.14.png

Screenshot 2023-07-10 at 00.24.47.png

IMG_3031.PNG

Posted
On 7/10/2023 at 2:36 PM, jakecakewalk said:

I'm also having the same issue. Although I think mine is a scaling issue vs. a dimension issue? I want the PT to fill as much of the viewport as possible, but it's either too big or too small. I've messed around with a number of code options as well as the PT setting within Figma, no dice. The device frame itself isn't showing up either. I wonder if it has to do with the overall height. I set it that way so it would at least scale up to a viewable size.

Any takers on advice?

Screenshot 2023-07-10 at 00.24.14.png

Screenshot 2023-07-10 at 00.24.47.png

IMG_3031.PNG

Can you share link to this page? We can check easier

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

  • 1 year later...
Posted
On 8/5/2021 at 9:08 PM, MichGlad said:

Thank you @tuanphan 🙂

I found a solution to my problem

HTML code block:

<div class="iframeContentCenter">
  <iframe style="border: 1px solid rgba(0, 0, 0, 0);" width="414" height="882" src="https://www.figma.com/embed?embed_host=share&url=https%3A%2F%2Fwww.figma.com%2Fproto%2FqfvtLv9FQgLOek1VqmI9OM%2FPhoneScreenTestSqurespace%3Fnode-id%3D1%253A32%26scaling%3Dmin-zoom%26page-id%3D0%253A1" allowfullscreen></iframe>
</div>

Custom CSS:

/*iframe position*/
.iframeContentCenter{
  width: 414px;
  margin: auto;
  border-style: none;
  height: 100%;
  display: block;
}

I'm using this exact same code and pasted the custom CSS, but the prototype frame still appears cut-off, not full screen 😞
Does the code above still working today? anyone could help?

Thanks

Posted
On 10/5/2024 at 11:52 PM, dee88 said:

I'm using this exact same code and pasted the custom CSS, but the prototype frame still appears cut-off, not full screen 😞
Does the code above still working today? anyone could help?

Thanks

Can you share link to page where you added prototype frame? We can check easier

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.