Giter VIP home page Giter VIP logo

Comments (8)

tameemsafi avatar tameemsafi commented on July 1, 2024

It should be fixed now, below is an example which will log the time it takes to finish the loop. It may differ slightly but it will be generally the same for every loop.

Example:
https://jsfiddle.net/v5uzLrpb/

from typewriterjs.

haggen avatar haggen commented on July 1, 2024

@tameemsafi It seems to be happening again, even on the example you provided. With each loop the time between loops increases a bit.

from typewriterjs.

tameemsafi avatar tameemsafi commented on July 1, 2024

@haggen I have taken a look and I don't see the problem in the example above. Yes it does increase/decrease slightly but that is expected due to using window.requestAnimationFrame. However, it does not exponentially increase so there does not seem to be any issues. If you are experiencing an issue then please provide a way for me to reproduce the error so that I can fix it.

image

from typewriterjs.

haggen avatar haggen commented on July 1, 2024

Click (tested on Chrome 75) and open your console. https://h9ht9.csb.app/

To see the source: https://codesandbox.io/s/typewriter-effect-loop-delay-bug-h9ht9

from typewriterjs.

tameemsafi avatar tameemsafi commented on July 1, 2024

@haggen Thank you but it seems you are using the console.time function incorrectly. You need to run the console.time("typewriter loop") when it starts and then run console.timeEnd("typewriter loop") when it has completed. Please can you try that? It seems to work fine for me.

from typewriterjs.

haggen avatar haggen commented on July 1, 2024

@tameemsafi Thank you for your quick response! :)

I'm not using it incorrectly. I'm using it to measure exactly what I want to measure, which is the time between loops--as opposed to timing the whole procedure. That's what increases with each loop.

Just look at the result and you'll notice it rather easily. It:

  1. Clears, writes Banana and pauses for 1 second
  2. Clears, writes Apple and pauses for 1 second
  3. Clears, writes Grape and pauses for 1 second
  4. Starts over, but every time this step is reached it adds an additional pause that is increasingly longer each time

from typewriterjs.

tameemsafi avatar tameemsafi commented on July 1, 2024

@haggen I have now published v2.10.0 please let me know if you are still seeing the issue.

from typewriterjs.

haggen avatar haggen commented on July 1, 2024

That was fast, @tameemsafi 😄 Thank you! It looks fixed now!

from typewriterjs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.