npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

rain-char

v1.4.0

Published

A lightweight JavaScript library that creates a 'Matrix-style' falling character effect with depth. Customize the font, colors, character range, and animation speed for dynamic visual effects on your webpage.

Downloads

827

Readme

RainChar - Customizable Matrix-Style Rain Effect

A dark background with flowing streams of Japanese characters in and yellow cascading downwards.

RainChar is an animation effect written in JavaScript to create a Matrix-Style effect with full control over customizability.

Usage

Use CDN:


<script src="https://cdn.jsdelivr.net/npm/rain-char"></script>

Create an instance of the effect (all options are optional)

const rain = new RainChar({
    id: 'rain',
    font: 'Consolas',
    charSize: [10, 30]
});

To start the effect call the start method

rain.start();

Demo

m-sarabi.ir/rain-char A matrix-style image generator interface with options for font, character size, character range, background, foreground, speed, density factor, and resizing the effect screen.

Customization

You can customize the effect however you like with the options provided, and you can add an id to each effect individually to style them with CSS.

Most options (except for id and parentId) can be adjusted seamlessly at any time.

Options

| Name | Description | Type | Default value | |-------------------|--------------------------------------------------------------|--------------------------------------------|------------------| | font | The font used for Rain Characters | string | "monospace" | | charSize | The lower and upper limit for the font size | [number, number] | [10, 40] | | charRange | The range of Unicode character, or a list of such ranges | [number, number] or [number, number][] | [0x0021, 0x007e] | | bg | Background color of the canvas | string | "#222" | | fg | Color of the characters | string | "yellow" | | id | The id to be assigned to the canvas element | string | | | fps | Maximum fps (higher means faster rainfall) | number | 30 | | densityFactor | How dense the rainfall is (Lower means denser) | number | 10 | | trailMultiplier | Defines the length of the trail. Higher means shorter trail | number | 1 | | charSpacing | Defines the space between characters (1 means one character) | number | 1 | | charChangeFreq | Defines the probability of characters changing (0% - 100%) | number | 1 | | parentId | id of the element which canvas is appended to | string | body element |

Methods

| Name | Description | |---------|--------------------------------------------------------------| | start | Fresh starts the effect animation. It also acts as a restart | | stop | Stops the effect and clears the canvas. | | pause | Pause/Play the animation. |

By playing with the options above, you can create a variety of effects.

An example snow effect:

Changelog

Changelog

©️ Licence

This project is licensed under the MIT License

Copyright 2024 Mohammad Sarabi