From 6567455281b384a470c3ffbc8c3432543a2fc284 Mon Sep 17 00:00:00 2001 From: numex-admin Date: Thu, 10 Sep 2026 09:22:30 +0000 Subject: [PATCH] =?UTF-8?q?Numex=20yay=C4=B1n:=20public/game.js?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/game.js | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 public/game.js diff --git a/public/game.js b/public/game.js new file mode 100644 index 0000000..e5ca260 --- /dev/null +++ b/public/game.js @@ -0,0 +1,62 @@ +/* Neon sinir ışıkları evren gibi hareket ediyor */ +const canvas = document.getElementById('neon-canvas'); +const ctx = canvas.getContext('2d'); + +let stars = []; +for (let i = 0; i < 200; i++) { + stars.push({ + x: Math.random() * canvas.width, + y: Math.random() * canvas.height, + size: Math.random() * 2 + 1, + speed: Math.random() * 0.5 + 0.2 + }); +} + +function animate() { + ctx.fillStyle = 'rgba(0, 0, 0, 0.1)'; + ctx.fillRect(0, 0, canvas.width, canvas.height); + + stars.forEach(star => { + ctx.fillStyle = `hsl(${Math.random() * 360}, 100%, 50%)`; + ctx.beginPath(); + ctx.arc(star.x, star.y, star.size, 0, Math.PI * 2); + ctx.fill(); + + star.y += star.speed; + if (star.y > canvas.height) { + star.y = -star.size; + star.x = Math.random() * canvas.width; + } + }); + + requestAnimationFrame(animate); +} + +// Neon sinir efektleri +function drawNeonLines() { + ctx.strokeStyle = 'hsl(200, 100%, 80%)'; + ctx.lineWidth = 1.5; + ctx.beginPath(); + + let x = Math.random() * canvas.width; + let y = Math.random() * canvas.height; + + for (let i = 0; i < 10; i++) { + ctx.moveTo(x, y); + x += Math.random() * 20 - 10; + y += Math.random() * 20 - 10; + ctx.lineTo(x, y); + } + + ctx.stroke(); + + requestAnimationFrame(drawNeonLines); +} + +animate(); +requestAnimationFrame(drawNeonLines); + +// Neon pulsing effect +setInterval(() => { + canvas.style.filter = `contrast(${Math.random() * 0.3 + 0.7}) brightness(${Math.random() * 0.2 + 0.8})`; +}, 100);