Skip to content

K4GE366/K4GE366

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
Blackhole 2d just simple and experimental <html> <head> <title>Page Title</title> </head> <body> </body> </html><!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <title>Black Hole Animation</title> <style> html, body { margin: 0; overflow: hidden; background: radial-gradient(ellipse at center, #000 0%, #0a0a0a 100%); } canvas { display: block; } </style> </head> <body> <canvas id="blackhole"></canvas> <script> const canvas = document.getElementById('blackhole'); const ctx = canvas.getContext('2d'); canvas.width = window.innerWidth; canvas.height = window.innerHeight; const center = { x: canvas.width / 2, y: canvas.height / 2 }; const particles = []; function random(min, max) { return Math.random() * (max - min) + min; } class Star { constructor() { this.reset(); } reset() { const angle = random(0, Math.PI * 2); const radius = random(canvas.width / 2, canvas.width); this.x = center.x + radius * Math.cos(angle); this.y = center.y + radius * Math.sin(angle); this.angle = angle; this.radius = radius; this.speed = random(0.5, 1.5); this.size = random(1, 3); this.color = `hsl(${random(200, 280)}, 100%, 80%)`; } update() { this.radius -= this.speed; this.x = center.x + this.radius * Math.cos(this.angle); this.y = center.y + this.radius * Math.sin(this.angle + this.radius / 200); if (this.radius < 10) { this.reset(); } } draw() { ctx.beginPath(); ctx.fillStyle = this.color; ctx.arc(this.x, this.y, this.size, 0, Math.PI * 2); ctx.fill(); } } for (let i = 0; i < 600; i++) { particles.push(new Star()); } function drawBlackHole() { const gradient = ctx.createRadialGradient(center.x, center.y, 0, center.x, center.y, 40); gradient.addColorStop(0, '#000'); gradient.addColorStop(0.7, '#222'); gradient.addColorStop(1, 'rgba(0, 0, 0, 0)'); ctx.fillStyle = gradient; ctx.beginPath(); ctx.arc(center.x, center.y, 40, 0, Math.PI * 2); ctx.fill(); } function animate() { ctx.fillStyle = 'rgba(0, 0, 0, 0.25)'; ctx.fillRect(0, 0, canvas.width, canvas.height); particles.forEach(p => { p.update(); p.draw(); }); drawBlackHole(); requestAnimationFrame(animate); } animate(); window.addEventListener('resize', () => { canvas.width = window.innerWidth; canvas.height = window.innerHeight; center.x = canvas.width / 2; center.y = canvas.height / 2; }); </script> </body> <
Blackhole 2d just simple and experimental <html> <head> <title>Page Title</title> </head> <body> </body> </html><!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <title>Black Hole Animation</title> <style> html, body { margin: 0; overflow: hidden; background: radial-gradient(ellipse at center, #000 0%, #0a0a0a 100%); } canvas { display: block; } </style> </head> <body> <canvas id="blackhole"></canvas> <script> const canvas = document.getElementById('blackhole'); const ctx = canvas.getContext('2d'); canvas.width = window.innerWidth; canvas.height = window.innerHeight; const center = { x: canvas.width / 2, y: canvas.height / 2 }; const particles = []; function random(min, max) { return Math.random() * (max - min) + min; } class Star { constructor() { this.reset(); } reset() { const angle = random(0, Math.PI * 2); const radius = random(canvas.width / 2, canvas.width); this.x = center.x + radius * Math.cos(angle); this.y = center.y + radius * Math.sin(angle); this.angle = angle; this.radius = radius; this.speed = random(0.5, 1.5); this.size = random(1, 3); this.color = `hsl(${random(200, 280)}, 100%, 80%)`; } update() { this.radius -= this.speed; this.x = center.x + this.radius * Math.cos(this.angle); this.y = center.y + this.radius * Math.sin(this.angle + this.radius / 200); if (this.radius < 10) { this.reset(); } } draw() { ctx.beginPath(); ctx.fillStyle = this.color; ctx.arc(this.x, this.y, this.size, 0, Math.PI * 2); ctx.fill(); } } for (let i = 0; i < 600; i++) { particles.push(new Star()); } function drawBlackHole() { const gradient = ctx.createRadialGradient(center.x, center.y, 0, center.x, center.y, 40); gradient.addColorStop(0, '#000'); gradient.addColorStop(0.7, '#222'); gradient.addColorStop(1, 'rgba(0, 0, 0, 0)'); ctx.fillStyle = gradient; ctx.beginPath(); ctx.arc(center.x, center.y, 40, 0, Math.PI * 2); ctx.fill(); } function animate() { ctx.fillStyle = 'rgba(0, 0, 0, 0.25)'; ctx.fillRect(0, 0, canvas.width, canvas.height); particles.forEach(p => { p.update(); p.draw(); }); drawBlackHole(); requestAnimationFrame(animate); } animate(); window.addEventListener('resize', () => { canvas.width = window.innerWidth; canvas.height = window.innerHeight; center.x = canvas.width / 2; center.y = canvas.height / 2; }); </script> </body> <
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

👋 Hi! I'm Michael

I'm a Grade 11 STEM student passionate about Computer Science and creativity. I love building things—from fun games and websites to meaningful digital projects that show my growth and ideas.

Right now, I'm exploring HTML, CSS, JavaScript, and Python, and working on interactive projects like a dreamy starry night animation, 12 dimesion in HTML/WEB, flowers and a heartfelt birthday surprise site.

Every click, bug, and breakthrough is part of my journey. Thanks for stopping by—check out my projects below!

I did projects like 12 dimension of a box (Theoretical Physics, simple calculator, simple animations with code, love/Bd letters, 3d Blackhole, hacker kind of vibes like matrix in html/web language like it was a terminal. and still learning) I have a account in Mimo and Sololearn same username. and github but now I no longer publish my codes, because I sell it, and don't wanna to anyone to copy paste the code on their notes or server/digital box you can visit those accounts and run my codes, you can't run it here right? too much hassle.

after a month i take interest in cybersecurity.

About

Just a g11 student

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published