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

260
Views
¿Por qué esta función no funciona en JavaScript?

Estoy trabajando en un pequeño proyecto. Se supone que la página pasa de estar borrosa a una imagen clara. El problema es que la imagen nunca se aclara. Se mantiene en el mismo nivel de desenfoque (30Px). Todo lo demás ahora funciona correctamente.

No estoy seguro de qué más agregar a la pregunta.

 CSS: @import url('https://fonts.googleapis.com/css?family=Ubuntu'); * { box-sizing: border-box; } body { font-family: "Ubuntu", sans-serif; display: flex; align-items: center; justify-content: center; height: 100vh; overflow: hidden; margin: 0; } .bg { background: url("4.jpg") no-repeat center center/cover; position: absolute; top: -300px; left: -30px; width: calc(100vw + 50px); height: calc(100vw + 30px); z-index: -1; filter: blur(30px); } #text { font-size: 50px; color: #fff; } JS: loadText = document.getElementById('text'); const bg = document.querySelector('.bg'); let load = 0; const int = setInterval(blurring, 100); function blurring() { load++ console.log(load) if (load > 99) { clearInterval(int) } loadText.innerText = `${load}%` loadText.style.opacity = scale(load, 0, 100, 1, 0) } function scale (number, inMin, inMax, outMin, outMax) { return (number - inMin) * (outMax - outMin) / (inMax - inMin) + outMin; } blurring() The image starts blurred, but never becomes clear. This count from 0% to 100% functions properly. The opacity fade is working properly as well. The only thing not functioning is the image becoming clear.
about 4 years ago · Juan Pablo Isaza
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!