cmatrix

CMatrix - Matrix effect in JavaScript

npm version LICENSE MIT jsDelivr CDN download counter

Matrix animation effect in JavaScript using Canvas

Screenshot of a browser window with Matrix rain effect, green letters that look like Japanese on black background

Installation

npm install cmatrix

Demos

Usage

You can use CDN:

<script src="https://cdn.jsdelivr.net/npm/cmatrix"></script>

and intialize the effect.

matrix(canvasElement, {
  chars: ['0', '1'],
  font_size: 16
}).
matrix(canvasElement, {
  chars: matrix.range(0x30A1, 0x30F6).concat(matrix.range(0x0030, 0x0039)),
  font_size: 16
}).

The matrix function return a Promise that is resolved when exit. By default, q and ESC exit from the effect. Use exit: false to disable ending of the animation.

Repo Link

Options

Matrix instance methods

Static methods

Changelog

0.5.0

0.4.0

0.3.1

0.3.0

0.2.0

0.1.1 / 0.1.0

Acknowledge

License

Copyright (C) 2021-2023 Jakub T. Jankiewicz
Released under MIT License