Skip to content

Tag: javascript

Javascript Donut Animation

Couple of days ago I watched a Youtube video about donut animation by Lex Fridman. So I decided to copy-pasted his code and made a Javascript’s requestAnimationFrame( ) version of it. Since I didn’t make any delay for the animation, I was surprised how the browser can keep the frame rate around 60fps in my laptop. 🙂 Original donut article made by Andy Sloane at https://www.a1k0n.net/2011/07/20/donut-math.html. Andy made a great explanation about the algorithm, and even made an optimized version of it (without math sin/cos library) here: https://www.a1k0n.net/2021/01/13/optimizing-donut.html. Live version: https://web.tealtadpole.me/tt-javascript-donut/ Github code: https://github.com/tealtadpole/tt-javascript-donut – tt-

Leave a Comment

Javascript Bezier Curve Animation Library

I wrote a Javascript bezier curve animation library. I can’t seem to find any javascript bezier animation library that can handle multiple degree, so I made one myself. You can download it from the github here: https://github.com/tealtadpole/tt-javascript-bezier-animation Live example You  can see the live example here: https://web.tealtadpole.me/tt-javascript-bezier-animation/ You can download the live example html file (or clone it from the github repository), then dissect the content inside. The usage is pretty simple, and I think it should cover most custom animation cases. I use requestAnimationFrame( ) method for a better performance (it will be paused when the tab is inactive…

Leave a Comment

Naive String and Boyer Moore Javascript Implementation

Github link: https://github.com/tealtadpole/tt-boyer-moore-js https://github.com/tealtadpole/tt-naive-search-js I need a string search algorithm in one of my frontend project. String.protoype.indexOf( ) is of course good. It also accept start index as a second parameter. I made a simple function with indexOf( ) that return array of indexes. While googling about this topic, I found some interesting algorithms, which naive string search and boyer moore. So, I decided to try implementing both out of curiosity. Naive String Search Being the simplest string matching algorithm, I can’t find any research paper who developed the algorithm. Probably this method is the default method every freshmen at…

Leave a Comment