SuperXpace
AI agents, automation, and smart digital solutions come alive to grow your ideas, your business, and your world. We build next-gen platforms powered by intelligence and creativity, helping you automate, innovate, and lead.
Whether you’re launching your dream project or scaling your vision, SuperXpace is your partner in the intelligent digital age.
// --- Space Pixels Animation Script ---
const canvas = document.getElementById('space-background');
const ctx = canvas.getContext('2d');
let particles = [];
const particleCount = 400; // Number of particles on screen
// Set canvas to full screen and handle resizing
function resizeCanvas() {
canvas.width = window.innerWidth;
canvas.height = window.innerHeight;
// Re-initialize particles on resize to ensure they are distributed across the new screen size
init();
}
window.addEventListener('resize', resizeCanvas);
// Particle class to define individual pixels
class Particle {
constructor() {
this.x = Math.random() * canvas.width;
this.y = Math.random() * canvas.height;
this.size = Math.random() * 1.5 + 0.5; // Size of the particle
this.speedY = Math.random() * 1 + 0.2; // Speed of vertical movement
this.opacity = Math.random() * 0.5 + 0.2; // Particle opacity
}
// Update particle position
update() {
this.y += this.speedY;
// Reset particle to the top when it goes off screen
if (this.y > canvas.height) {
this.y = 0 - this.size;
this.x = Math.random() * canvas.width;
}
}
// Draw particle on the canvas
draw() {
ctx.beginPath();
ctx.fillStyle = `rgba(0, 217, 255, ${this.opacity})`;
ctx.arc(this.x, this.y, this.size, 0, Math.PI * 2);
ctx.fill();
}
}
// Initialize all particles
function init() {
particles = [];
for (let i = 0; i < particleCount; i++) { particles.push(new Particle()); } } // Animation loop function animate() { ctx.clearRect(0, 0, canvas.width, canvas.height); for (let i = 0; i < particles.length; i++) { particles[i].update(); particles[i].draw(); } requestAnimationFrame(animate); } // Start the animation resizeCanvas(); // Set initial canvas size and create particles animate();
change background to fast moving and it interact with hover with user