GithubHelp home page GithubHelp logo

sterroso / textparticles Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 16 KB

JavaScript text particles animation and physics emulation.

License: MIT License

JavaScript 88.70% CSS 2.40% Pug 3.37% HTML 5.53%

textparticles's Introduction

TextParticles


Simulates text composed by mobile particles repelled by the mouse pointer.

It starts by creating an HTML Canvas where a small text is written and the scanned to transform each pixel into a filled circle (particle), each sith its own behaviour to drift away from the mouse pointer when it gets near, and go back to its initial position when it goes away.

Uses a custom class to store the Particle's properties and behaviours.

A mouse object stores the mouse pointer's position and captures its movement events.

Attached a resize event handler to the window to adjust the canvas dimensions (width and height).


Credits

This was made thanks to Frank's laboratory free tutorial on YouTube.

You might learn a lot about the <canvas> HTML element, game programming and particles animation in his YouTube Channel and TikTok profile.

Visit his CodePen portfolio to find out more code like this.

Thank you very much!


TODO:

  • Add an entry point from the index.html page.
  • Accept input from the user to change the text shown.
  • Accept input from the user to customize other properties as:
    • Font family.
    • Background color.
    • Foreground color(s).
    • Support for gradients in Background and Foreground.
    • Particle radius (size).
    • Mouse repel radius.
    • Support for images in addition to text.
  • Estimate the least possible area to scan into getImageData to optimize memory and cpu usage.
  • Find general optimization opportunities.

textparticles's People

Contributors

sterroso avatar

Watchers

 avatar

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.