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

159
Views
Animación CSS que funciona en la computadora pero no en mi teléfono

así que encontré esta animación y la estaba probando, funciona perfectamente en mi computadora, pero una vez que cambio a mi teléfono, la animación se congela en un cuadro. No veo por qué está haciendo esto... Por cierto, estoy usando React, no creo que importe, pero nunca se sabe.

CSS:

 .loader { max-width: 15rem; width: 100%; height: auto; stroke-linecap: round; } circle { fill: none; stroke-width: 3.5; animation-name: preloader; animation-duration: 3s; animation-iteration-count: infinite; animation-timing-function: ease-in-out; transform-origin: 170px 170px; will-change: transform; } circle:nth-of-type(1) { stroke-dasharray: 550px; } circle:nth-of-type(2) { stroke-dasharray: 500px; } circle:nth-of-type(3) { stroke-dasharray: 450px; } circle:nth-of-type(4) { stroke-dasharray: 300px; } circle:nth-of-type(1) { animation-delay: -0.15s; } circle:nth-of-type(2) { animation-delay: -0.3s; } circle:nth-of-type(3) { animation-delay: -0.45s; } circle:nth-of-type(4) { animation-delay: -0.6s; } @keyframes preloader { 50% { transform: rotate(360deg); } }

html:

 import React from 'react' function Animation() { return ( <div> <svg class="loader" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 340 340"> <circle cx="170" cy="170" r="160" stroke="#0000FF"/> <circle cx="170" cy="170" r="135" stroke="#404041"/> <circle cx="170" cy="170" r="110" stroke="#0000FF"/> <circle cx="170" cy="170" r="85" stroke="#404041"/> </svg> </div> ) } export default Animation

Editar: Entonces, después de probar en el teléfono de mi hermano, funciona, no sé por qué está haciendo eso en mi teléfono, pero funciona en otros...

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Creo que esto sucede porque usas class en lugar de className. En React.JS usamos className y la única razón detrás del hecho de que usa className sobre class es que la clase es una palabra clave reservada en JavaScript y dado que usamos JSX en React, que en sí mismo es la extensión de JavaScript, entonces tenemos que usar className en lugar del atributo de clase.

 import React from 'react'; function Animation() { return ( <div> <svg className="loader" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 340 340"> <circle cx="170" cy="170" r="160" stroke="#0000FF"/> <circle cx="170" cy="170" r="135" stroke="#404041"/> <circle cx="170" cy="170" r="110" stroke="#0000FF"/> <circle cx="170" cy="170" r="85" stroke="#404041"/> </svg> </div> ) } export default Animation
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!