Auto commit: 2026-02-15T15:12:06.977Z

This commit is contained in:
Flatlogic Bot 2026-02-15 15:12:06 +00:00
parent 2f077507b0
commit a1a37f4953

View File

@ -529,34 +529,49 @@ $whatsapp_link = "https://wa.me/" . preg_replace('/[^0-9]/', '', $whatsapp_numbe
canvas.width = canvas.offsetWidth; canvas.width = canvas.offsetWidth;
canvas.height = canvas.offsetHeight; canvas.height = canvas.offsetHeight;
function draw() { let hue = 0;
animationId = requestAnimationFrame(draw); function draw() {
analyzer.getByteFrequencyData(dataArray); animationId = requestAnimationFrame(draw);
analyzer.getByteFrequencyData(dataArray);
ctx.clearRect(0, 0, canvas.width, canvas.height); ctx.clearRect(0, 0, canvas.width, canvas.height);
const barWidth = (canvas.width / bufferLength) * 2.5; const barWidth = (canvas.width / bufferLength) * 2.5;
let barHeight; let barHeight;
let x = 0; let x = 0;
for (let i = 0; i < bufferLength; i++) { // Calcular intensidad promedio para reactividad
barHeight = (dataArray[i] / 255) * canvas.height; let sum = 0;
for(let i=0; i<bufferLength; i++) sum += dataArray[i];
const average = sum / bufferLength;
// Create more vibrant neon gradient // Rotar el color base según el tiempo y la intensidad
const gradient = ctx.createLinearGradient(0, canvas.height, 0, 0); hue = (hue + 0.5 + (average / 50)) % 360;
gradient.addColorStop(0, '#00e676'); // Neon Green
gradient.addColorStop(0.5, '#38bdf8'); // Sky Blue
gradient.addColorStop(1, '#a855f7'); // Purple
ctx.fillStyle = gradient; for (let i = 0; i < bufferLength; i++) {
// Rounded bars barHeight = (dataArray[i] / 255) * canvas.height;
ctx.beginPath();
ctx.roundRect(x, canvas.height - barHeight, barWidth - 3, barHeight, 4);
ctx.fill();
x += barWidth; // Color dinámico basado en hue, índice de barra e intensidad
} const barHue = (hue + (i * 2)) % 360;
const saturation = 80 + (average / 255) * 20;
const lightness = 50 + (dataArray[i] / 255) * 25;
const gradient = ctx.createLinearGradient(0, canvas.height, 0, canvas.height - barHeight);
gradient.addColorStop(0, `hsl(${barHue}, ${saturation}%, ${lightness}%)`);
gradient.addColorStop(1, `hsl(${(barHue + 40) % 360}, ${saturation}%, ${lightness + 10}%)`);
ctx.fillStyle = gradient;
ctx.shadowBlur = 15;
ctx.shadowColor = `hsla(${barHue}, ${saturation}%, ${lightness}%, 0.5)`;
// Rounded bars
ctx.beginPath();
ctx.roundRect(x, canvas.height - barHeight, barWidth - 3, barHeight, 4);
ctx.fill();
x += barWidth;
} }
}
draw(); draw();
} }