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

80
Views
Animación con componentes de estilo en reaccionar

Quiero ejecutar la animación en los últimos diez segundos de un temporizador. Primero, probé con fotogramas clave y fue como quería, pero esta vez, si no actualizo la página, la animación no funcionó. Lo comenté y probé de otra manera que está a continuación:

 useEffect(() => { if (time <= 30 && disabled === false && time !== 0) { setTimeout(() => setTime(time - 1), 1000); } else if (disabled) { setTime(30); setAnimated(null); } else if (time === 0) { setDisabled(!disabled); setInputValue("Time is over"); } if (time <= 10 && animated !== null && disabled === false && time !== 0) { setAnimated("animation 1s infinite"); } }, [time, disabled]);

Componente de cuenta regresiva:

 const CountDown = () => { const { time, animated } = useContext(WordContext); return ( <Time> <Counting style={{ animation: animated !== null ? animated : "" }}> 00:00:{time} </Counting> </Time> ); };

CSS:

 export const Counting = styled.p` margin: auto; font-size: 40px; line-height: 1; animation: ${animation}; // animation-fill-mode: backwards; // animation-delay: 23s; // animation-iteration-count: 10; `;

¿Tienes alguna sugerencia o corrección?. Gracias por adelantado.

about 4 years ago · Santiago Trujillo
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!