* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
overflow: hidden;
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
#canvas {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: linear-gradient(135deg, #0f2027 0%, #203a43 50%, #2c5364 100%);
}
.content {
position: relative;
z-index: 10;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
min-height: 100vh;
color: #cfd8dc;
text-align: center;
padding: 20px;
}
h1 {
font-size: 48px;
font-weight: 300;
letter-spacing: 3px;
margin-bottom: 20px;
text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
color: #e3f2fd;
}
p {
font-size: 18px;
max-width: 600px;
line-height: 1.8;
color: #b0bec5;
}
.card {
background: rgba(255, 255, 255, 0.05);
backdrop-filter: blur(15px);
padding: 40px 60px;
border-radius: 20px;
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
margin-top: 30px;
border: 1px solid rgba(255, 255, 255, 0.1);
}
.btn {
margin-top: 30px;
padding: 15px 40px;
background: linear-gradient(135deg, #1e3c72, #2a5298);
border: none;
border-radius: 30px;
color: #fff;
font-size: 16px;
font-weight: 600;
cursor: pointer;
transition: all 0.3s ease;
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}
.btn:hover {
background: linear-gradient(135deg, #2a5298, #1e3c72);
transform: translateY(-2px);
box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}
const canvas = document.getElementById('canvas');
const ctx = canvas.getContext('2d');
canvas.width = window.innerWidth;
canvas.height = window.innerHeight;
class Particle {
constructor() {
this.x = Math.random() * canvas.width;
this.y = Math.random() * canvas.height;
this.size = Math.random() * 3 + 1;
this.speedX = Math.random() * 0.5 - 0.25;
this.speedY = Math.random() * 0.5 - 0.25;
this.opacity = Math.random() * 0.5 + 0.2;
}
update() {
this.x += this.speedX;
this.y += this.speedY;
if (this.x > canvas.width) this.x = 0;
if (this.x < 0) this.x = canvas.width;
if (this.y > canvas.height) this.y = 0;
if (this.y < 0) this.y = canvas.height;
}
draw() {
ctx.fillStyle = `rgba(100, 181, 246, ${this.opacity})`; // light blue particles
ctx.beginPath();
ctx.arc(this.x, this.y, this.size, 0, Math.PI * 2);
ctx.fill();
}
}
const particlesArray = [];
const numberOfParticles = 80;
function init() {
particlesArray.length = 0;
for (let i = 0; i < numberOfParticles; i++) {
particlesArray.push(new Particle());
}
}
function connectParticles() {
for (let a = 0; a < particlesArray.length; a++) {
for (let b = a + 1; b < particlesArray.length; b++) {
const dx = particlesArray[a].x - particlesArray[b].x;
const dy = particlesArray[a].y - particlesArray[b].y;
const distance = Math.sqrt(dx * dx + dy * dy);
if (distance < 120) {
const opacity = (1 - distance / 120) * 0.3;
ctx.strokeStyle = `rgba(33, 150, 243, ${opacity})`; // blue connection lines
ctx.lineWidth = 1;
ctx.beginPath();
ctx.moveTo(particlesArray[a].x, particlesArray[a].y);
ctx.lineTo(particlesArray[b].x, particlesArray[b].y);
ctx.stroke();
}
}
}
}
function animate() {
ctx.clearRect(0, 0, canvas.width, canvas.height);
particlesArray.forEach(particle => {
particle.update();
particle.draw();
});
connectParticles();
requestAnimationFrame(animate);
}
init();
animate();
window.addEventListener('resize', () => {
canvas.width = window.innerWidth;
canvas.height = window.innerHeight;
init();
});
// Mouse interaction
let mouse = { x: null, y: null, radius: 100 };
window.addEventListener('mousemove', (e) => {
mouse.x = e.x;
mouse.y = e.y;
particlesArray.forEach(particle => {
const dx = mouse.x - particle.x;
const dy = mouse.y - particle.y;
const distance = Math.sqrt(dx * dx + dy * dy);
if (distance < mouse.radius) {
particle.x -= dx / 50;
particle.y -= dy / 50;
}
});
});
window.addEventListener('mouseout', () => {
mouse.x = null;
mouse.y = null;
});
No comments yet. Be the first!