Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

172
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!