Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

165
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda