Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

199
Visualizações
How can I able to render a .gif file into jpeg mobile frame to my Gatsby site

I want to render .gif file to a mobile.png to my gatsby site but not able identify a proper resource for it. could any have an idea how's that possible to render a .gif file to .png mobile frame for Gatsby site

Here's the frame enter image description here

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

You have a Working with GIFs guide. You just need to import the .gif asset as any other asset to allow webpack to get the source of that file and display it in a <img> tag:

import * as React from 'react'
import Layout from '../components/layout'
import otterGIF from '../gifs/otter.gif'
const AboutPage = () => (
    return (
        <Layout>
            <div class="yourLayout">
              <img src={otterGIF} alt="Otter dancing with a fish" />
            </div>
        </Layout>
    )
)
export default AboutPage;

The key part is to set the mobile frame as a background of the yourLayout div so it can wrap the GIF inside:

.yourLayout {
   position: relative;
   background: url('../path/to/asset.png') no-repeat center center / 100% 100%;
   width: 500px; //define a constraints if necessary 
   height: 800px;  //define a constraints if necessary 
}

.yourLayout img {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: contain; // work with this property to adjust it if needed
}

Basically, you are setting yourLayout div as a frame while the image inside (the GIF) will take all the available space because of the position absolute.

There's a lack of details in your question so, depending on your structure, you may not need to use the constraints.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda