dev-resources.site
for different kinds of informations.
Matrix (and perlish) background effect in Javascript :)
Published at
3/3/2021
Categories
perl
javascript
effect
Author
thibaultduponchelle
Author
19 person written this
thibaultduponchelle
open
Today I have something useless-but-cool to show.
My Matrix-perlish background! π π π
Check out my github page to see a live preview π
It's only a couple of lines of javascript derivated from the work that you can find here or here so I deserve absolutely zero credit but I simply modified it to make it appear more perlish! π
(or p@r]i$% if you prefer π)
Below the full code:
<html>
<head>
</head>
<body>
<!-- background animations -->
<div class="div_bg">
<canvas id="c"></canvas>
</div>
<script>
var c = document.getElementById("c");
var ctx = c.getContext("2d");
c.height = window.innerHeight;
c.width = window.innerWidth;
var txts = "~!@#$%^&*)(_-=+;:{}[]|\/<>,.";
txts = txts.split("");
var font_size = 12;
var columns = c.width / font_size;
var drops = [];
for (var x = 0; x < columns; x++) drops[x] = 1;
function draw() {
ctx.fillStyle = "rgba(255, 255, 255, 0.05)";
ctx.fillRect(0, 0, c.width, c.height);
ctx.fillStyle = "#000";
ctx.font = font_size + "px arial";
for (var i = 0; i < drops.length; i++) {
var text = txts[Math.floor(Math.random() * txts.length)];
ctx.fillText(text, i * font_size, drops[i] * font_size);
if (drops[i] * font_size > c.height || Math.random() > 0.98) drops[i] = 0;
drops[i]++;
}
}
setInterval(draw, 20);
</script>
</body>
</html>
effect Article's
30 articles in total
Wrapping up 2024
read article
This Week in Effect - 2024-12-27
read article
Effect 3.12 (Release)
read article
Effect 3.11 (Release)
read article
Cause & Effect Podcast #1
read article
Mapping Operations in Effect-TS Optionals
read article
Using do Notation in Effect-TS Optionals
read article
Exploring Option Getters in Effect-TS
read article
Exploring Option Conversions in Effect-TS
read article
Using match with Option in Effect
read article
Using match with Option in Effect
read article
Effect in React
read article
Understanding Type Guards in Effect-TS: Ensuring Safe Option Handling
read article
Exploring Option Constructors in Effect-TS
read article
Introduction to Options in Effect
read article
Effects in Ember
read article
How we migrated our codebase from fp-ts toΒ Effect
read article
Synthetic Turf Benefits: Cost-Effective Solutions for Public Spaces
read article
The Effect Tax
read article
Effect 3.0
read article
Effect Days conference on Feb 23, 2024 in Vienna
read article
Link: OCAML 5 is Out + Effects Tutorial
read article
How To Fade In And Out In Premiere Pro
read article
React - Don't update parent state in the rendering phase of the child
read article
Encoding HKTs in TypeScript (Once Again)
read article
Developing A Wrapper Around Node.Js FS
read article
Contentlayer & EffectβββArchitectural Patterns And Decisions.
read article
JavaScript photo efffect fun project
read article
Matrix (and perlish) background effect in Javascript :)
currently reading
Social Media Buttons with HTML and CSS ( blur effect ).
read article
Featured ones: