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

171
Visualizações
Rotation effect with background-positon

I need to create a rotating paste effect. For this I downloaded animejs. I placed the points where I need to stop for the rotation effect.

I also set up the scope, when the user sees the block, then the rotation occurs.

The problem is that I can't adjust the smoothness, I need to create a rotation effect, but because of the background-positon, the movement effect is obtained.

I can only use this image and this property, how can I do that?

CodeSandbox

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

0

I'm not sure how to use anime.js here and why, but it can be done with pure CSS/JS easily:

const el = document.getElementById("App");

const observer = new window.IntersectionObserver(
  ([entry]) => el.classList.toggle('spin', entry.isIntersecting),
  {root: null, threshold: .2}
);

observer.observe(el);
#App {
  height: 90vh;
  width: 40.67vh;
  margin: 23em auto;
  background: url("https://i.imgur.com/EI2qVf1.jpeg") no-repeat 0 0 / 5500% 100%;
}

.spin {
  animation: spin 2s steps(54) infinite;
}

@keyframes spin {
  to {background-position: 100%}
}
Scroll down
<div id="App"></div>

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