-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshubham-page.html
175 lines (148 loc) · 5.26 KB
/
shubham-page.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
<html><head>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/less.js/2.7.2/less.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery.terminal/1.4.3/js/jquery.terminal.js"></script>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>
Upcoming Page</title>
<!-- Google Tag Manager -->
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-N8N7QXQ');</script>
<!-- End Google Tag Manager -->
</head>
<body>
<style>
body {
background-color:#222;
font-family: 'consolas';
text-align: center;
color:#fff;
padding-top:1em;
}
* { color:#fff; text-decoration:none;}
</style>
<canvas id="canvas">
<style>
#canvas{background:#222;}
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</style>
<script>
window.requestAnimFrame = function()
{
return (
window.requestAnimationFrame ||
window.webkitRequestAnimationFrame ||
window.mozRequestAnimationFrame ||
window.oRequestAnimationFrame ||
window.msRequestAnimationFrame ||
function(/* function */ callback){
window.setTimeout(callback, 1000 / 60);
}
);
}();
var canvas = document.getElementById('canvas');
var context = canvas.getContext('2d');
var W = window.innerWidth, H = window.innerHeight;
canvas.width = W;
canvas.height = H/2;
var particle_count = 60,
particles = [],
couleurs = ["#2ecc71", "#3498db", "#f1c40f","#e74c3c", "#ff5733"," #f9ff33"," #99ff33"," #33ff39"," #33ffd1"];
function Particle()
{
this.radius = Math.round((Math.random()*5)+5);
this.x = Math.floor((Math.random() * canvas.width)+ this.radius);
this.y = Math.floor((Math.random() * canvas.height) + this.radius);
this.color = couleurs[Math.round(Math.random()*couleurs.length)];
this.speedx = Math.round((Math.random()*201)+0)/100;
this.speedy = Math.round((Math.random()*201)+0)/100;
switch (Math.round(Math.random()*couleurs.length))
{
case 1:
this.speedx *= 1;
this.speedy *= 1;
break;
case 2:
this.speedx *= -1;
this.speedy *= 1;
break;
case 3:
this.speedx *= 1;
this.speedy *= -1;
break;
case 4:
this.speedx *= -1;
this.speedy *= -1;
break;
}
this.move = function()
{
context.beginPath();
context.globalCompositeOperation = 'source-over';
context.fillStyle = this.color;
context.globalAlpha = 1;
context.arc(this.x, this.y, this.radius, 0, Math.PI*2, false);
context.fill();
context.closePath();
this.x = this.x + this.speedx;
this.y = this.y + this.speedy;
if(this.x <= 0+this.radius)
{
this.speedx *= -1;
}
if(this.x >= canvas.width-this.radius)
{
this.speedx *= -1;
}
if(this.y <= 0+this.radius)
{
this.speedy *= -1;
}
if(this.y >= canvas.height-this.radius)
{
this.speedy *= -1;
}
for (var j = 0; j < particle_count; j++)
{
var particleActuelle = particles[j],
yd = particleActuelle.y - this.y,
xd = particleActuelle.x - this.x,
d = Math.sqrt(xd * xd + yd * yd);
if ( d < 200 )
{
context.beginPath();
context.globalAlpha = (200 - d) / (200 - 0);
context.globalCompositeOperation = 'destination-over';
context.lineWidth = 1;
context.moveTo(this.x, this.y);
context.lineTo(particleActuelle.x, particleActuelle.y);
context.strokeStyle = this.color;
context.lineCap = "round";
context.stroke();
context.closePath();
}
}
};
};
for (var i = 0; i < particle_count; i++)
{
var particle = new Particle();
particles.push(particle);
}
function animate()
{
context.clearRect(0, 0, canvas.width, canvas.height);
for (var i = 0; i < particle_count; i++)
{
particles[i].move();
}
requestAnimFrame(animate);
}
animate();
</script>
</canvas>
</body>
</html>