Напиши на js качественный эффект как в матрице, только используй эмодзи 15 штук. Сделай так, чтобы эффект было видно только в круге по центру. В одном index.html файле.
Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Matrix Effect с эмодзи</title>
<style>
body {
margin: 0;
padding: 0;
background: #000;
overflow: hidden;
font-family: monospace;
}
canvas {
display: block;
background: #000;
}
</style>
</head>
<body>
<canvas id="matrix"></canvas>
<script>
const canvas = document.getElementById('matrix');
const ctx = canvas.getContext('2d');
// Устанавливаем размер canvas
canvas.width = window.innerWidth;
canvas.height = window.innerHeight;
// Эмодзи для эффекта
const emojis = ['🔥', '⚡', '💎', '🌟', '🚀', '💫', '🎯', '🔮', '⭐', '💥', '🌈', '🎪', '🎭', '🎨', '🎵'];
// Параметры эффекта
const fontSize = 20;
const columns = Math.floor(canvas.width / fontSize);
const drops = new Array(columns).fill(0);
// Центр экрана и радиус круга
const centerX = canvas.width / 2;
const centerY = canvas.height / 2;
const radius = Math.min(canvas.width, canvas.height) * 0.3;
function draw() {
// Затемняем фон
ctx.fillStyle = 'rgba(0, 0, 0, 0.05)';
ctx.fillRect(0, 0, canvas.width, canvas.height);
// Создаем маску круга
ctx.save();
ctx.beginPath();
ctx.arc(centerX, centerY, radius, 0, Math.PI * 2);
ctx.clip();
// Рисуем эмодзи
ctx.font = fontSize + 'px monospace';
for (let i = 0; i < drops.length; i++) {
// Случайный эмодзи
const emoji = emojis[Math.floor(Math.random() * emojis.length)];
// Позиция символа
const x = i * fontSize;
const y = drops[i] * fontSize;
// Проверяем, находится ли символ в круге
const distance = Math.sqrt((x - centerX) ** 2 + (y - centerY) ** 2);
if (distance <= radius) {
// Градиент цвета от зеленого к белому
const intensity = Math.max(0, 1 - distance / radius);
const green = Math.floor(100 + intensity * 155);
const alpha = 0.3 + intensity * 0.7;
ctx.fillStyle = `rgba(0, ${green}, 0, ${alpha})`;
ctx.fillText(emoji, x, y);
// Добавляем свечение для символов ближе к центру
if (intensity > 0.7) {
ctx.shadowColor = '#00ff00';
ctx.shadowBlur = 10;
ctx.fillStyle = `rgba(255, 255, 255, ${intensity * 0.5})`;
ctx.fillText(emoji, x, y);
ctx.shadowBlur = 0;
}
}
// Сбрасываем каплю, если она вышла за экран
if (y > canvas.height && Math.random() > 0.975) {
drops[i] = 0;
}
// Двигаем каплю вниз
drops[i]++;
}
ctx.restore();
// Рисуем границу круга
ctx.strokeStyle = 'rgba(0, 255, 0, 0.3)';
ctx.lineWidth = 2;
ctx.beginPath();
ctx.arc(centerX, centerY, radius, 0, Math.PI * 2);
ctx.stroke();
}
// Запускаем анимацию
setInterval(draw, 50);
// Обработка изменения размера окна
window.addEventListener('resize', () => {
canvas.width = window.innerWidth;
canvas.height = window.innerHeight;
// Пересчитываем параметры
const newColumns = Math.floor(canvas.width / fontSize);
drops.length = newColumns;
drops.fill(0);
});
</script>
</body>
</html>
Этот код создает эффект "Матрицы" с использованием 15 различных эмодзи, которые падают сверху вниз. Эффект ограничен кругом в центре экрана с зеленым свечением и градиентом интенсивности от центра к краям. Символы ближе к центру светятся ярче, а граница круга подсвечена зеленым цветом.