Skip to content

Commit 48af829

Browse files
committed
trying a different way to get the matrix code to show on live
1 parent ebe7cde commit 48af829

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
lines changed

index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
</style>
77
</head>
88
<body>
9-
<canvas class="matrix-bg" id="matrixCanvas"></canvas>
9+
<canvas id="matrixCanvas"></canvas>
1010

1111
<section class="hero">
1212
<div class="logo">ai16z</div>

script.js

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
document.addEventListener('DOMContentLoaded', () => {
22
const canvas = document.getElementById('matrixCanvas');
3-
console.log('Canvas element:', canvas);
43
if (!canvas) {
54
console.error('Matrix canvas element not found');
65
return;
76
}
87
const ctx = canvas.getContext('2d');
9-
console.log('Canvas context:', ctx);
108

119
canvas.width = window.innerWidth;
1210
canvas.height = window.innerHeight;
@@ -26,10 +24,10 @@ document.addEventListener('DOMContentLoaded', () => {
2624
}
2725

2826
function draw() {
29-
ctx.fillStyle = 'rgba(10, 10, 10, 0.05)';
27+
ctx.fillStyle = 'rgba(10, 10, 10, 0.1)';
3028
ctx.fillRect(0, 0, canvas.width, canvas.height);
3129

32-
ctx.fillStyle = '#0F0';
30+
ctx.fillStyle = 'rgba(0, 255, 0, 0.15)';
3331
ctx.font = fontSize + 'px monospace';
3432

3533
for(let i = 0; i < rainDrops.length; i++) {

style.css

+10
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ body {
6363
align-items: center;
6464
padding: 2rem;
6565
text-align: center;
66+
background: transparent;
6667
}
6768

6869
.logo {
@@ -269,4 +270,13 @@ footer img {
269270
padding: 1rem;
270271
gap: 0.8rem;
271272
}
273+
}
274+
275+
#matrixCanvas {
276+
position: fixed;
277+
top: 0;
278+
left: 0;
279+
width: 100%;
280+
height: 100%;
281+
z-index: -1;
272282
}

0 commit comments

Comments
 (0)