Skip to content

Commit b5bf45c

Browse files
Add files
1 parent b5e27af commit b5bf45c

File tree

23 files changed

+3735
-0
lines changed

23 files changed

+3735
-0
lines changed

EXTRAS.txt

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
EXTRAS
2+
3+
PARTICLES-CSS---------------------------------------------
4+
#particles-js {
5+
background: black;
6+
height: 100vh;
7+
width: 100%;
8+
}
9+
10+
HTML PART--- IN HEADER TAG
11+
<div id="particles-js"></div>
12+
13+
JS PART
14+
<script src="./js/particles.js"></script>
15+
<script src="./js/app.js"></script>
16+
17+
18+
STARS CSS--------------------------------------------------
19+
section {
20+
position: absolute;
21+
width: 100%;
22+
height: 100vh;
23+
overflow: hidden;
24+
background: #000200;
25+
display: flex;
26+
z-index: -1;
27+
.stars {
28+
position: absolute;
29+
top: 10%;
30+
left: 0;
31+
width: 100%;
32+
height: 100%;
33+
pointer-events: none;
34+
animation: animate 8s ease-in-out infinite,
35+
backgroundmove 16s linear infinite;
36+
}
37+
.s1 {
38+
animation-delay: -0s;
39+
background: url(./stars/star1.png);
40+
}
41+
.s2 {
42+
animation-delay: -1s;
43+
background: url(./stars/star2.png);
44+
}
45+
.s1 {
46+
animation-delay: -2s;
47+
background: url(./stars/star1.png);
48+
}
49+
.s3 {
50+
animation-delay: -3s;
51+
background: url(./stars/star3.png);
52+
}
53+
.s4 {
54+
animation-delay: -4s;
55+
background: url(./stars/star4.png);
56+
}
57+
.s5 {
58+
animation-delay: -5s;
59+
background: url(./stars/star5.png);
60+
}
61+
.s6 {
62+
animation-delay: -6s;
63+
background: url(./stars/star6.png);
64+
}
65+
.s7 {
66+
animation-delay: -7s;
67+
background: url(./stars/star7.png);
68+
}
69+
.s8 {
70+
animation-delay: -8s;
71+
background: url(./stars/star8.png);
72+
}
73+
}
74+
75+
@keyframes animate {
76+
0%,
77+
20%,
78+
40%,
79+
60%,
80+
80%,
81+
100% {
82+
opacity: 0;
83+
}
84+
10%,
85+
30%,
86+
50%,
87+
70%,
88+
90% {
89+
opacity: 1;
90+
}
91+
}
92+
@keyframes backgroundmove {
93+
0% {
94+
transform: scale(1);
95+
}
96+
100% {
97+
transform: scale(2);
98+
}
99+
}

Matrix Background.html

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
<!--Made By Boujjou Achraf-->
2+
<html>
3+
<head>
4+
<style>
5+
6+
/*basic reset */
7+
8+
*{
9+
margin: 0;
10+
padding: 0;
11+
}
12+
13+
body {background: black;}
14+
canvas {display:block;}
15+
16+
</style>
17+
</head>
18+
<body>
19+
20+
<canvas id="c"></canvas>
21+
22+
<script>
23+
// geting canvas by id c
24+
var c = document.getElementById("c");
25+
var ctx = c.getContext("2d");
26+
27+
//making the canvas full screen
28+
c.height = window.innerHeight;
29+
c.width = window.innerWidth;
30+
31+
//chinese characters - taken from the unicode charset
32+
var matrix = "ABCDEFGHIJKLMNOPQRSTUVWXYZ123456789@#$%^&*()*&^%";
33+
//converting the string into an array of single characters
34+
matrix = matrix.split("");
35+
36+
var font_size = 10;
37+
var columns = c.width/font_size; //number of columns for the rain
38+
//an array of drops - one per column
39+
var drops = [];
40+
//x below is the x coordinate
41+
//1 = y co-ordinate of the drop(same for every drop initially)
42+
for(var x = 0; x < columns; x++)
43+
drops[x] = 1;
44+
45+
//drawing the characters
46+
function draw()
47+
{
48+
//Black BG for the canvas
49+
//translucent BG to show trail
50+
ctx.fillStyle = "rgba(0, 0, 0, 0.04)";
51+
ctx.fillRect(0, 0, c.width, c.height);
52+
53+
ctx.fillStyle = "#0F0"; //green text
54+
ctx.font = font_size + "px arial";
55+
//looping over drops
56+
for(var i = 0; i < drops.length; i++)
57+
{
58+
//a random chinese character to print
59+
var text = matrix[Math.floor(Math.random()*matrix.length)];
60+
//x = i*font_size, y = value of drops[i]*font_size
61+
ctx.fillText(text, i*font_size, drops[i]*font_size);
62+
63+
//sending the drop back to the top randomly after it has crossed the screen
64+
//adding a randomness to the reset to make the drops scattered on the Y axis
65+
if(drops[i]*font_size > c.height && Math.random() > 0.975)
66+
drops[i] = 0;
67+
68+
//incrementing Y coordinate
69+
drops[i]++;
70+
}
71+
}
72+
73+
setInterval(draw, 35);
74+
75+
76+
</script>
77+
</body>
78+
</html>

0 commit comments

Comments
 (0)