Skip to content

Marqui-13/dynamic-particle-text-animation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dynamic Particle Text Animation

Overview

Discover the enchanting realm of our 2D Dynamic Particle Text Animation web app, where your text transforms into a mesmerizing spectacle of animated particles. Crafted with HTML5 canvas and JavaScript, this application turns user input into a dynamic array of colored particles that react to your cursor's movements, creating an interactive visual feast.

Each particle, derived from the pixels of the rendered text, dances on the screen, responding to interactions with lifelike motion. Enter any text and watch as it dynamically updates, each dot a part of a larger, interactive display. As you move your cursor, the particles sway, creating a fluid and captivating experience that blends art with technology.

Designed for accessibility and ease of use, the app invites users from all backgrounds to engage in digital creativity. It's a testament to the imaginative potential of coding, offering a digital canvas for both expression and exploration. Experience the magic of your words brought to life in a stunning display of dynamic particle animation, a true intersection of code and creativity.

Features

  • Dynamic Text Input: Transform any text into a vivid display of animated particles.
  • Cursor Interaction: Particles react to cursor movements, creating an immersive experience.
  • Responsive Design: Fullscreen canvas that adjusts to window size for optimal viewing on any device.
  • Customizable Settings: Easily modify particle size, color, and other properties through the code.

Technologies Used

  • HTML5
  • CSS3
  • JavaScript

Getting Started

To get a local copy up and running, follow these simple steps.

Prerequisites

No prerequisites are needed, just a modern web browser capable of running HTML5 and JavaScript.

Installation

  1. Clone the repo

    git clone https://www.github.com/Marqui-13/dynamic-particle-text-animation.git

  2. Open index.html in your web browser.

Usage

  • View Animation: Simply open the web app to start the animation.
  • Interact with Animation: Move your cursor/finger/stylus across the canvas to interact with the particles.
  • Change Text: Enter any text in the input box at the top left corner to see it transform into particles.

Contributing

Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Credits

License

Distributed under the MIT License. See LICENSE for more information.

Acknowledgments

  • Font Awesome for icons

Converting JavaScript to TypeScript: Introduction

This project initially uses JavaScript for its implementation. To leverage TypeScript’s type safety and modern features, you may want to convert the JavaScript code to TypeScript. This guide will walk you through the steps required to perform this conversion.

Prerequisites

•	Node.js and npm installed on your system
•	Basic knowledge of JavaScript and TypeScript

Step 1: Install TypeScript

First, you need to install TypeScript globally on your machine. Open your terminal and run:

npm install -g typescript

Step 2: Initialize a TypeScript Project

Navigate to your project’s root directory and initialize a TypeScript project. This will create a tsconfig.json file with default settings.

tsc --init

Adjust the tsconfig.json as necessary for your project. For converting existing JavaScript to TypeScript while targeting modern JavaScript environments, consider setting "target": "es6" in your tsconfig.json.

Step 3: Rename Your JavaScript Files

Rename your .js files to .ts. For example, if you have a file named app.js, rename it to app.ts.

Step 4: Convert Your Code

Modify your code to include TypeScript syntax. This includes:

•	Adding type annotations to variables and function parameters.
•	Defining interfaces or types for your objects.
•	Resolving any TypeScript errors that arise during compilation.

Step 5: Compile TypeScript to JavaScript

Compile your TypeScript files back into JavaScript using the TypeScript compiler. Run:

tsc

This command will compile all .ts files in your project to .js files according to the options set in tsconfig.json.

Step 6: Include the Generated JavaScript in Your Project

Update your project to use the compiled JavaScript files. If you’re working on a web project, make sure your HTML files reference the newly generated .js files.

Additional Tips

•	TypeScript Tooling: Consider using TypeScript-enabled IDEs or editors like Visual Studio Code for better development experience, including real-time error checking and auto-completion.
•	Watch Mode: Use tsc --watch to automatically compile your TypeScript files whenever changes are made.
•	Advanced Configuration: Explore other tsconfig.json options to fine-tune the compiler to your needs. This includes configuring module resolution, enabling strict mode, and more.

Conclusion

Converting JavaScript to TypeScript can significantly improve your project’s maintainability and catch errors early in the development process. By following these steps, you can smoothly transition your project to TypeScript and take advantage of its powerful features.

Feel free to adjust the wording, steps, and details based on the specific needs and structure of your project!

Releases

No releases published

Packages

No packages published