Skip to content

Commit 25ef6d8

Browse files
committed
Improve README documentation
1 parent 7deb5cf commit 25ef6d8

1 file changed

Lines changed: 108 additions & 38 deletions

File tree

‎README.md‎

Lines changed: 108 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,8 @@
22

33
The matrixfall effect in the terminal.
44

5-
![demo](https://raw.githubusercontent.com/Shresht7/matrixfall/main/showcase/demo.gif)
5+
![Animated terminal demo of matrixfall](https://raw.githubusercontent.com/Shresht7/matrixfall/main/showcase/demo.gif)
66

7-
> [!NOTE]
8-
>
9-
> Just a simple program I made while learning Rust!
107

118
## 🌟 Features
129

@@ -20,11 +17,19 @@ The matrixfall effect in the terminal.
2017

2118
## 🛠️ Installation
2219

20+
Install a prebuilt binary from the [latest GitHub release](https://github.com/Shresht7/matrixfall/releases/latest).
21+
2322
> [!NOTE]
2423
>
2524
> To install and run matrixfall, you will need to have Rust and Cargo installed on your system. You can install Rust and Cargo by following the instructions at [https://www.rust-lang.org/tools/install](https://www.rust-lang.org/tools/install).
2625
27-
You can clone the repository and build the project:
26+
You can install matrixfall from [crates.io](https://crates.io/crates/matrixfall) using Cargo. To do this, run the following command in your terminal:
27+
28+
```sh
29+
cargo install matrixfall
30+
```
31+
32+
Alternatively, you can clone the repository and build the project from source:
2833

2934
```sh
3035
git clone https://github.com/Shresht7/matrixfall.git
@@ -38,17 +43,15 @@ To run the project, use the following command:
3843
cargo run --release
3944
```
4045

41-
Or **alternatively**, you can also install `matrixfall` using `cargo install` and add it to your `$PATH` variable for easy access:
46+
To install the checked-out version into Cargo's bin directory:
4247

4348
```sh
4449
cargo install --path . --name matrixfall
4550
```
4651

47-
After installation, you can run matrixfall from anywhere by adding the Cargo bin directory to your `$PATH` variable.
48-
4952
---
5053

51-
## 📖 Usage Instructions
54+
## 📖 Usage
5255

5356
To use matrixfall, you can run the project with the following command:
5457

@@ -77,51 +80,118 @@ Here are some examples of how to use the different configuration options:
7780
>
7881
> You can combine multiple options to customize the matrixfall effect to your liking.
7982
83+
### Controls
84+
85+
- `q`, `Esc`, or `Ctrl+C`: exit matrixfall.
86+
8087
### Configuration Options
8188

82-
The different configuration options available in this project are:
89+
| Flag | Default | Description |
90+
| -------------------------------- | ------------- | -------------------------------------------------------------------------------- |
91+
| `--mode` | `Original` | Character symbol set. Use a built-in mode or any non-empty custom character set. |
92+
| `--stream-color` | `0,255,70` | Stream color. Accepts `R,G,B`, `#RRGGBB`, or a named color such as `green`. |
93+
| `--stream-color-gradient-factor` | `0.33` | Multiplier controlling how much the stream color fades toward its tail. |
94+
| `--leading-entity-color` | `200,255,200` | Color of the leading character in each stream. |
95+
| `--leave-trail` | off | Retains characters after streams pass. |
96+
| `--fps` | `60` | Target frames per second. |
97+
| `--direction` | `down` | Direction in which streams move. |
98+
| `--stream-min-count` | `5` | Minimum number of characters in a stream. |
99+
| `--stream-max-count` | `25` | Maximum number of characters in a stream. |
100+
| `--stream-spacing` | `2` | Number of terminal columns or rows between streams, depending on direction. |
101+
| `--switch-interval` | `1` | Maximum number of seconds before a character changes randomly. |
102+
103+
### Colors
83104

84-
* `mode`: The character symbol set to use. Valid options include "Original", "Binary", "Decimal", "Math", "ASCII", "Braille", "Emoji", and custom sets like "abc123".
85-
* `stream_color`: The color of the streaming entities (e.g., `"0,255,70"`, `"#00FF00"`, or `"green"`).
86-
* `stream_color_gradient_factor`: The multiplier that describes the extent of the gradient in the stream color.
87-
* `leading_entity_color`: The color of the leading entity in a stream (e.g., `"200,255,200"`, `"#C8FFC8"`, or `"white"`).
88-
* `leave_trail`: A boolean option to leave the trail intact as the streams pass by.
89-
* `fps`: The frame rate to run at, specified as the number of frames per second.
90-
* `direction`: The direction of motion for the stream particles (e.g., `"down"`, `"up"`, `"left"`, `"right"`, `"diagonal-right"`, etc.).
91-
* `stream_min_count`: The minimum number of entities per stream.
92-
* `stream_max_count`: The maximum number of entities per stream.
93-
* `stream_spacing`: The spacing between the streams, specified as the number of columns between each stream.
94-
* `switch_interval`: The maximum number of seconds within which an entity randomly switches its symbol.
105+
`--stream-color` and `--leading-entity-color` accept:
106+
107+
- RGB: `0,255,70`
108+
- Hex: `#00FF00`
109+
- Named colors: `black`, `red`, `green`, `yellow`, `blue`, `magenta`, `cyan`, or `white`
110+
111+
For example:
112+
113+
```sh
114+
matrixfall --stream-color "#00FF00" --leading-entity-color white
115+
```
95116

96117
### Modes
97118

98-
The different modes available for the `mode` option are:
119+
| Mode | Aliases | Symbols |
120+
| ---------- | ---------------------- | ------------------------------------------------ |
121+
| `original` | `normal`, `katakana` | Katakana characters, e.g. ア, カ, サ, ナ |
122+
| `binary` | `bin` | `0`, `1` |
123+
| `decimal` | `numbers`, `digits` | `0` through `9` |
124+
| `math` | `maths`, `mathematics` | Mathematical symbols, e.g. ∐, ∑, ≠, → |
125+
| `ascii` | `text`, `english` | Printable ASCII characters, from `!` through `~` |
126+
| `braille` | `dots` | Braille patterns, e.g. ⠇, ⠾, ⣿ |
127+
| `emoji` | `cursed` | Emoji characters |
128+
129+
Any other value is treated as a custom symbol set.
130+
131+
### Custom Symbol Sets
132+
133+
Any value for `--mode` that is not a built-in mode is used as a custom set of characters. Matrixfall randomly selects from that set as streams render.
134+
135+
```sh
136+
matrixfall --mode "abc123"
137+
```
138+
139+
The command above renders only a, b, c, 1, 2, and 3.
140+
141+
### Directions
142+
143+
| Value | Aliases | Movement |
144+
| ------------------------ | -------------------- | ----------------------- |
145+
| `down` | `vertical` | Top to bottom |
146+
| `up` | `vertical-reverse` | Bottom to top |
147+
| `left` | `horizontal` | Right to left |
148+
| `right` | `horizontal-reverse` | Left to right |
149+
| `diagonal-left` | `bottom-left` | Toward the bottom-left |
150+
| `diagonal-left-reverse` | `top-right` | Toward the top-right |
151+
| `diagonal-right` | `bottom-right` | Toward the bottom-right |
152+
| `diagonal-right-reverse` | `top-left` | Toward the top-left |
153+
154+
### Examples
155+
156+
Use binary symbols with a green gradient:
157+
158+
```sh
159+
matrixfall --mode binary --stream-color 0,255,70 --stream-color-gradient-factor 0.5
160+
```
161+
162+
Run ASCII streams faster and retain their trail:
99163

100-
* "Original" | "Normal" | "Katakana": Original Katakana Symbols (e.g., ア, カ, サ, ナ)
101-
* "Binary" | "Bin": 0s and 1s
102-
* "Decimal" | "Numbers" | "Digits": Decimal numbers from 0 to 9
103-
* "Math" | "Maths" | "Mathematics": Mathematical Symbols (e.g., ∐, ∑, ≠, →)
104-
* "ASCII" | "Text" | "English": ASCII Characters (from '!' to '~', including A-Z, a-z, 0-9, etc.)
105-
* "Braille" | "Dots": Braille patterns (e.g., ⠇, ⠾, ⣿)
106-
* "Emoji" | "Cursed": Emojis
107-
* Custom sets like "abc123": User-defined symbol set
164+
```sh
165+
matrixfall --mode ascii --fps 120 --leave-trail
166+
```
167+
168+
Move streams diagonally toward the bottom-right:
108169

109-
### Customizing the Symbol Set
170+
```sh
171+
matrixfall --direction diagonal-right
172+
```
110173

111-
To specify custom character sets for the `mode` option, you can use the `Custom` variant of the `Symbols` enum.
174+
Use a custom character set:
175+
```sh
176+
matrixfall --mode "abc123"
177+
```
112178

113-
Use the `--mode` option followed by your custom character set. For example, to use the custom character set "abc123", you would run the command:
179+
Use a blue color scheme with a white leading character:
114180
```sh
115-
cargo run --release -- --mode abc123
181+
matrixfall --stream-color "#008CFF" --leading-entity-color white
116182
```
117183

118-
The custom character set can be any string of characters you want to use. The program will randomly select characters from this set for the matrix rain effect.
184+
---
185+
186+
## Terminal Compatibility
187+
188+
matrixfall works best in a terminal with ANSI true-color support and a Unicode-capable font.
119189

120-
The custom character set is defined in the `src/config.rs` file and is handled by the `Symbols::Custom` variant in the `src/symbols.rs` file.
190+
Some symbol sets, especially `emoji`, may have different widths or appearances depending on your terminal and font.
121191

122192
---
123193

124-
## Contributing
194+
## 📑 Contributing
125195

126196
Contributions are welcome! If you would like to contribute to this project, please follow these guidelines:
127197

@@ -130,6 +200,6 @@ Contributions are welcome! If you would like to contribute to this project, plea
130200
3. Ensure that all tests pass and the code is properly formatted.
131201
4. Submit a pull request with a clear description of your changes.
132202

133-
## License
203+
## 📝 License
134204

135205
This project is licensed under the [MIT License](./LICENSE). See the [`LICENSE`](./LICENSE) file for more information.

0 commit comments

Comments
 (0)