Closed
Description
When I change the theme to dark, the cmatrix
behavior is not working as expected. The matrix is not displayed correctly with the dark theme.
Html
<canvas id="matrix"></canvas>
Javascript
import matrix from "cmatrix/dist/matrix";
var canvas = document.getElementById("matrix");
var someFunction = function (event) {
//clear canvas before drawing
canvas.getContext("2d").clearRect(0, 0, canvas.width, canvas.height);
matrix(canvas, {
chars: ["0", "1"],
color: localStorage.getItem("theme") === "dark" ? "#0F0" : "#000",
background:
localStorage.getItem("theme") === "dark"
? "rgba(51, 65, 84, 0.09)"
: "rgba(255,255,255, 0.05)",
exit: true,
font_size: 20,
});
};
window.addEventListener("theme", someFunction, false);
Untitled3.1.mp4
Metadata
Assignees
Labels
No labels