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

230
Views
Código JS, no puedo ver los cambios en mi navegador, pero se mostrarán en otro navegador

Tengo estos scripts JS que definen un const TEXTS, la primera vez que lo subí a mi sitio web tenía algo de texto en español. Lo abrí con Chrome y Safari en mi iPhone. Hice cambios en Visual Studio, todo estuvo bien (ver cambios con el servidor en vivo), luego, cuando subí archivos actualizados y abrí mi sitio web en Chrome, todavía vería los textos antiguos, lo mismo para mi iPhone ... ya borré el historial de caché datos y todo, todavía muestra texto antiguo... cuando abro la página en Microsoft Edge, muestra el texto actualizado.

Aquí está el código

 const elts = { text1: document.getElementById("text1"), text2: document.getElementById("text2") }; // The strings to morph between. You can change these to anything you want! var texts = [ "REALITY", "currently under", "SIMULATION" ]; // Controls the speed of morphing. const morphTime = 1.5; const cooldownTime = 0.5; let textIndex = texts.length - 1; let time = new Date(); let morph = 0; let cooldown = cooldownTime; elts.text1.textContent = texts[textIndex % texts.length]; elts.text2.textContent = texts[(textIndex + 1) % texts.length]; function doMorph() { morph -= cooldown; cooldown = 0; let fraction = morph / morphTime; if (fraction > 1) { cooldown = cooldownTime; fraction = 1; } setMorph(fraction); } // A lot of the magic happens here, this is what applies the blur filter to the text. function setMorph(fraction) { // fraction = Math.cos(fraction * Math.PI) / -2 + .5; elts.text2.style.filter = `blur(${Math.min(8 / fraction - 8, 100)}px)`; elts.text2.style.opacity = `${Math.pow(fraction, 0.4) * 100}%`; fraction = 1 - fraction; elts.text1.style.filter = `blur(${Math.min(8 / fraction - 8, 100)}px)`; elts.text1.style.opacity = `${Math.pow(fraction, 0.4) * 100}%`; elts.text1.textContent = texts[textIndex % texts.length]; elts.text2.textContent = texts[(textIndex + 1) % texts.length]; } function doCooldown() { morph = 0; elts.text2.style.filter = ""; elts.text2.style.opacity = "100%"; elts.text1.style.filter = ""; elts.text1.style.opacity = "0%"; } // Animation loop, which is called every frame. function animate() { requestAnimationFrame(animate); let newTime = new Date(); let shouldIncrementIndex = cooldown > 0; let dt = (newTime - time) / 1000; time = newTime; cooldown -= dt; if (cooldown <= 0) { if (shouldIncrementIndex) { textIndex++; } doMorph(); } else { doCooldown(); } } // Start the animation. animate();
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!