File size: 11,000 Bytes
1c8f5d1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Matrix Dialog</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <style>
        @import url('https://fonts.googleapis.com/css2?family=Inconsolata:wght@400;700&display=swap');
        
        body {
            font-family: 'Inconsolata', monospace;
            background-color: #000;
            overflow: hidden;
        }
        
        .matrix-bg {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            z-index: -1;
            opacity: 0.1;
        }
        
        .matrix-char {
            color: #20C20E;
            text-shadow: 0 0 5px #20C20E;
            animation: fade 1s infinite alternate;
        }
        
        @keyframes fade {
            0% { opacity: 0.3; }
            100% { opacity: 1; }
        }
        
        .dialog-box {
            border: 2px solid #20C20E;
            box-shadow: 0 0 15px #20C20E;
            animation: pulse 2s infinite;
        }
        
        @keyframes pulse {
            0% { box-shadow: 0 0 15px #20C20E; }
            50% { box-shadow: 0 0 25px #20C20E; }
            100% { box-shadow: 0 0 15px #20C20E; }
        }
        
        .btn {
            transition: all 0.3s;
        }
        
        .btn:hover {
            text-shadow: 0 0 10px #20C20E;
            transform: scale(1.05);
        }
        
        .typing {
            border-right: 2px solid #20C20E;
            animation: blink 0.75s step-end infinite;
        }
        
        @keyframes blink {
            from, to { border-color: transparent; }
            50% { border-color: #20C20E; }
        }
    </style>
</head>
<body class="text-green-500">
    <!-- Matrix background effect -->
    <canvas id="matrixCanvas" class="matrix-bg"></canvas>
    
    <!-- Main container -->
    <div class="min-h-screen flex items-center justify-center p-4">
        <!-- Dialog box -->
        <div class="dialog-box bg-black bg-opacity-90 rounded-lg p-8 max-w-md w-full relative">
            <!-- Title with matrix effect -->
            <h1 id="matrixTitle" class="text-3xl font-bold mb-6 text-center"></h1>
            
            <!-- Dialog content -->
            <div class="space-y-6">
                <div id="dialogContent" class="text-lg leading-relaxed">
                    <!-- Content will be added dynamically -->
                </div>
                
                <!-- Choices -->
                <div id="choices" class="space-y-3 hidden">
                    <button class="btn w-full text-left p-3 border border-green-500 rounded hover:bg-green-900 hover:bg-opacity-30 transition-all duration-300">
                        <span class="text-green-400">></span> Принять красную таблетку
                    </button>
                    <button class="btn w-full text-left p-3 border border-green-500 rounded hover:bg-green-900 hover:bg-opacity-30 transition-all duration-300">
                        <span class="text-green-400">></span> Принять синюю таблетку
                    </button>
                </div>
                
                <!-- Continue button -->
                <button id="continueBtn" class="btn w-full bg-green-900 bg-opacity-50 text-green-400 py-3 px-4 rounded font-bold hover:bg-opacity-70 transition-all duration-300">
                    ПРОДОЛЖИТЬ >
                </button>
            </div>
            
            <!-- Terminal-like footer -->
            <div class="mt-6 pt-4 border-t border-green-800 text-sm text-green-600 flex justify-between">
                <span>SYSTEM ACCESS</span>
                <span>USER: NEO</span>
            </div>
        </div>
    </div>

    <script>
        // Matrix background effect
        const canvas = document.getElementById('matrixCanvas');
        const ctx = canvas.getContext('2d');
        
        canvas.width = window.innerWidth;
        canvas.height = window.innerHeight;
        
        const katakana = 'アァカサタナハマヤャラワガザダバパイィキシチニヒミリヰギジヂビピウゥクスツヌフムユュルグズブヅプエェケセテネヘメレヱゲゼデベペオォコソトノホモヨョロヲゴゾドボポヴッン';
        const latin = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
        const nums = '0123456789';
        const alphabet = katakana + latin + nums;
        
        const fontSize = 16;
        const columns = canvas.width / fontSize;
        
        const rainDrops = [];
        
        for (let x = 0; x < columns; x++) {
            rainDrops[x] = 1;
        }
        
        const draw = () => {
            ctx.fillStyle = 'rgba(0, 0, 0, 0.05)';
            ctx.fillRect(0, 0, canvas.width, canvas.height);
            
            ctx.fillStyle = '#20C20E';
            ctx.font = fontSize + 'px monospace';
            
            for (let i = 0; i < rainDrops.length; i++) {
                const text = alphabet.charAt(Math.floor(Math.random() * alphabet.length));
                ctx.fillText(text, i * fontSize, rainDrops[i] * fontSize);
                
                if (rainDrops[i] * fontSize > canvas.height && Math.random() > 0.975) {
                    rainDrops[i] = 0;
                }
                rainDrops[i]++;
            }
        };
        
        setInterval(draw, 30);
        
        // Dialog system
        const matrixTitle = document.getElementById('matrixTitle');
        const dialogContent = document.getElementById('dialogContent');
        const choices = document.getElementById('choices');
        const continueBtn = document.getElementById('continueBtn');
        const choiceButtons = document.querySelectorAll('#choices button');
        
        let currentStep = 0;
        const dialogSteps = [
            {
                title: "> СИСТЕМА ЗАГРУЖЕНА",
                content: "Приветствую, Нео.",
                delay: 30
            },
            {
                title: "> ДОСТУП К СИСТЕМЕ",
                content: "Ты чувствовал это всю свою жизнь... Что мир не совсем настоящий.",
                delay: 20
            },
            {
                title: "> ВЫБОР ПРЕДЛОЖЕН",
                content: "Я могу предложить тебе выбор. Прими одну из таблеток.",
                showChoices: true,
                delay: 20
            },
            {
                title: "> ПУТЬ ОПРЕДЕЛЕН",
                content: "Ты выбрал красную таблетку. Помни: все, что я могу предложить - это правда.",
                delay: 20
            },
            {
                title: "> ПРОГРАММА ЗАВЕРШЕНА",
                content: "Добро пожаловать в реальный мир.",
                final: true,
                delay: 30
            }
        ];
        
        // Typewriter effect
        async function typeWriter(element, text, delay) {
            return new Promise(resolve => {
                element.innerHTML = '';
                element.classList.add('typing');
                
                let i = 0;
                const typing = setInterval(() => {
                    if (i < text.length) {
                        element.innerHTML += text.charAt(i);
                        i++;
                    } else {
                        clearInterval(typing);
                        element.classList.remove('typing');
                        resolve();
                    }
                }, delay);
            });
        }
        
        // Show current step
        async function showStep(stepIndex) {
            const step = dialogSteps[stepIndex];
            
            // Type title
            await typeWriter(matrixTitle, step.title, 50);
            
            // Type content
            await typeWriter(dialogContent, step.content, step.delay);
            
            // Show choices if needed
            if (step.showChoices) {
                choices.classList.remove('hidden');
                continueBtn.classList.add('hidden');
            } else {
                choices.classList.add('hidden');
                continueBtn.classList.remove('hidden');
            }
            
            // Change continue button text if final step
            if (step.final) {
                continueBtn.textContent = 'ЗАВЕРШИТЬ >';
            } else {
                continueBtn.textContent = 'ПРОДОЛЖИТЬ >';
            }
        }
        
        // Initialize
        showStep(currentStep);
        
        // Continue button click
        continueBtn.addEventListener('click', () => {
            if (dialogSteps[currentStep].final) {
                // Restart from beginning
                currentStep = 0;
            } else {
                currentStep++;
                if (currentStep >= dialogSteps.length) currentStep = 0;
            }
            showStep(currentStep);
        });
        
        // Choice buttons click
        choiceButtons.forEach((button, index) => {
            button.addEventListener('click', () => {
                // Skip to the step after choices
                currentStep = 3;
                // Modify the content based on choice
                if (index === 1) {
                    dialogSteps[3].content = "Ты выбрал синюю таблетку. История закончится, ты проснешься в своей постели и поверишь... во что захочешь.";
                }
                choices.classList.add('hidden');
                continueBtn.classList.remove('hidden');
                showStep(currentStep);
            });
        });
        
        // Handle window resize
        window.addEventListener('resize', () => {
            canvas.width = window.innerWidth;
            canvas.height = window.innerHeight;
        });
    </script>
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=Phoenixoni/matrix" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
</html>