-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2bd90a9
commit 3935a3c
Showing
5 changed files
with
86 additions
and
4 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "terminaltools", | ||
"version": "1.8.5", | ||
"version": "1.9.0", | ||
"description": "terminaltools allows you to do tricks in the terminal like play videos, show images and more.", | ||
"main": "tools.js", | ||
"scripts": { | ||
|
@@ -44,7 +44,9 @@ | |
"client", | ||
"ascii star wars", | ||
"towel.blinkenlights.nl", | ||
"A lot of keywords" | ||
"A lot of keywords", | ||
"Snow", | ||
"Matrix" | ||
], | ||
"author": "RedYetiDev <[email protected]> (https://RedYetiDev.github.io)", | ||
"license": "MIT", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
const delay = (ms) => { | ||
return new Promise(resolve => { | ||
setTimeout(resolve, ms) | ||
} | ||
) | ||
} | ||
var domatrix; | ||
async function start() { | ||
domatrix = true | ||
var lines = process.stdout.rows | ||
var columns = process.stdout.columns | ||
console.log("\033[1;40m") | ||
process.stdout.write("\033[2J") | ||
var cols = []; | ||
while (domatrix == true) { | ||
var line = 0 | ||
await delay(100) | ||
var random_col = Math.floor(Math.random() * columns) | ||
var letter= Math.floor(Math.random() * 2) | ||
cols[random_col] = 0; | ||
for (col in cols) { | ||
var rnum = Math.floor(Math.random() * 20); | ||
if (cols[col] < 0) { | ||
line =- cols[col]; | ||
cols[col] = cols[col] - 1; | ||
var subline = -cols[col] + 1 | ||
process.stdout.write("\033[" + line + ";" + col + "H ") | ||
process.stdout.write("\033[\n;" + col + "H \033[0;0H") | ||
if (subline >= lines) { | ||
cols[col] = 0; | ||
} else if (rnum < 1) { | ||
cols[col] = 0 | ||
} | ||
} else { | ||
line = cols[col]; | ||
cols[col] = cols[col]+1; | ||
if (rnum < 3) { | ||
process.stdout.write("\033[" + line + ";" + col + "H\033[1;32m" + letter + "\033[0m") | ||
} else { | ||
process.stdout.write("\033[" + line + ";" + col + "H\033[2;32m" + letter + "\033[0m") | ||
} | ||
process.stdout.write("\033[" + cols[col] + ";" + col + "H\033[37m" + letter + "\033[0;0H\033[0m") | ||
if (cols[col] >= lines) { | ||
if (rnum < 2) { | ||
cols[col] = 0 | ||
} else { | ||
cols[col] = -1; | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
module.exports.start = start | ||
module.exports.stop = () => {domatrix = false} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
var C = process.stdout.columns | ||
var a = []; | ||
const delay = (ms) => {return new Promise(resolve => setTimeout(resolve, ms))} | ||
var snow; | ||
async function start() { | ||
snow = true | ||
process.stdout.write("\033[2J") | ||
while (snow == true) { | ||
a[Math.floor(Math.random() * C)] = 0; | ||
a.forEach(function(o, x) { | ||
if (o != undefined) { | ||
a[x]++; | ||
process.stdout.write("\033[" + o + ";" + x + "H \033[" + a[x] + ";" + x + "H❃ \033[0;0H") | ||
} | ||
}); | ||
await delay(100) | ||
} | ||
} | ||
module.exports.start = start | ||
module.exports.stop = () => {snow = false} |