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

179
Visualizações
Is there a JS animation library that provides predetermined coordinates for elements to be animated

Please excuse the question title but I don't really know how sum the question up.

I'm working on an Electron project where we use Animejs to create an animated presentation. It's mainly just text that is brought onto the screen by fading, translateY, translateX etc. And then after a few seconds the text is animated out and new text is animated in.

The main purpose of the application is that the user can save the presentation as a video. So we are using Electrons on paint event to capture each rendered frame. And this works OK. But I don't think it is the correct way since the browser framerate is not constant and also it only fires the "paint" event when there is movement so we have had to figure out a way to use the last written frame to fill in the gaps where there are missing frames. This also works ok but it is not perfect and a little buggy.

I think the optimal solution would be to have an array of objects that contains the predetermined coordinates of each element for each frame. Then I can loop through the array/frames and use js to position each element correctly and then write that frame to disk as a bitmap. So no more missing frames.

As an example, animating two lines of text from left to right might look something like this (only two frames for brevity):

 const frames = [
{
  coordinates: [
    {
      elId: "text-1",
      left: 50, // px
      top: 150, // px
    },
    {
      elId: "text-2",
      left: 50, // px
      top: 180, // px
    },
  ],
},
{
  coordinates: [
    {
      elId: "text-1",
      left: 51, // px
      top: 150, // px
    },
    {
      elId: "text-2",
      left: 51, // px
      top: 180, // px
    },
  ],
},

];

So my question is, does anyone know of an animation library that will allow us to write the animations in js like Animejs or Greensock does but instead of running the animations in real time the library spits out an array of objects similar to the above example?

about 4 years ago · Juan Pablo Isaza
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