File size: 2,863 Bytes
fb2810b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
cd457da
fb2810b
cd457da
fb2810b
 
 
 
cd457da
 
fb2810b
 
 
 
cd457da
 
fb2810b
cd457da
 
 
 
fb2810b
 
 
 
 
 
cd457da
 
 
 
 
 
 
 
fb2810b
cd457da
 
 
 
fb2810b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
// Частицы на Canvas
const canvas = document.getElementById('particle-canvas');
const ctx = canvas.getContext('2d');
canvas.width = window.innerWidth;
canvas.height = window.innerHeight;

const particles = [];
for (let i = 0; i < 100; i++) {
    particles.push({
        x: Math.random() * canvas.width,
        y: Math.random() * canvas.height,
        radius: Math.random() * 2 + 1,
        speed: Math.random() * 1 + 0.5,
        color: `hsl(${Math.random() * 360}, 100%, 50%)`
    });
}

function animateParticles() {
    ctx.clearRect(0, 0, canvas.width, canvas.height);
    particles.forEach(p => {
        ctx.beginPath();
        ctx.arc(p.x, p.y, p.radius, 0, Math.PI * 2);
        ctx.fillStyle = p.color;
        ctx.fill();
        p.y -= p.speed;
        if (p.y < 0) p.y = canvas.height;
    });
    requestAnimationFrame(animateParticles);
}
animateParticles();

// Нейро-анимация продукта
document.addEventListener('mousemove', (e) => {
    const product = document.getElementById('ar-product');
    const xAxis = (window.innerWidth / 2 - e.pageX) / 20;
    const yAxis = (window.innerHeight / 2 - e.pageY) / 20;
    product.style.transform = `perspective(1500px) rotateY(${xAxis}deg) rotateX(${yAxis}deg)`;
});

// Голосовое управление и заказ
function orderNow() {
    const msg = new SpeechSynthesisUtterance("Revolut активирован. Чистота начинается сейчас.");
    window.speechSynthesis.speak(msg);
    document.body.style.background = "radial-gradient(circle, #00ffcc, #000)";
    setTimeout(() => {
        document.body.style.background = "#000";
    }, 1000);
}

// Эффекты для подов
function podEffect(element) {
    element.style.transform = "translateY(-20px) scale(1.1)";
    element.style.boxShadow = "0 0 30px rgba(0, 255, 204, 0.7)";
}

function podReset(element) {
    element.style.transform = "translateY(0) scale(1)";
    element.style.boxShadow = "none";
}

// Нейро-приветствие
window.addEventListener('load', () => {
    if ('speechSynthesis' in window) {
        const msg = new SpeechSynthesisUtterance("Добро пожаловать в 2070. Активируй Revolut голосом: скажи 'Начать'.");
        window.speechSynthesis.speak(msg);
    }
});

if ('SpeechRecognition' in window || 'webkitSpeechRecognition' in window) {
    const recognition = new (window.SpeechRecognition || window.webkitSpeechRecognition)();
    recognition.lang = 'ru-RU';
    recognition.continuous = true;
    recognition.onresult = (event) => {
        const command = event.results[event.results.length - 1][0].transcript.toLowerCase();
        if (command.includes('начать') || command.includes('активировать')) {
            orderNow();
        }
    };
    recognition.start();
}