Player1444 commited on
Commit
08ebbd0
·
verified ·
1 Parent(s): ab1bd8d

Delete index.html

Browse files
Files changed (1) hide show
  1. index.html +0 -316
index.html DELETED
@@ -1,316 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <meta charset="UTF-8" />
5
- <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
6
- <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
7
- <title>Super Mario Bros.</title>
8
-
9
- <style>
10
- * {
11
- padding: 0; margin: 0; box-sizing: border-box;
12
- user-select: none; -webkit-user-select: none; touch-action: none;
13
- }
14
- html, body {
15
- width: 100%; height: 100%; overflow: hidden; background: #000; font-family: "Segoe UI", sans-serif;
16
- }
17
- #window {
18
- display: flex; flex-direction: column; width: 100%; height: 100%;
19
- border: 2px solid #adadad; background: transparent;
20
- }
21
- #titlebar {
22
- height: 32px; background: #f0f0f0; display: flex; align-items: center;
23
- justify-content: space-between; flex-shrink: 0; border-bottom: 1px solid #adadad;
24
- }
25
- #titlebar-left { display: flex; align-items: center; padding-left: 10px; }
26
- #titlebar-text { font-size: 12px; color: #333; font-weight: 600; }
27
- #titlebar-buttons { display: flex; height: 100%; }
28
- .titlebar-btn {
29
- width: 46px; height: 100%; border: none; background: transparent; font-size: 16px;
30
- display: flex; align-items: center; justify-content: center; color: #333; cursor: pointer;
31
- }
32
- .titlebar-btn:hover { background: rgba(0, 0, 0, 0.1); }
33
- #btn-close:hover { background: #e81123; color: white; }
34
- #game-container {
35
- display:flex;
36
- justify-content:center;
37
- align-items:center;
38
- background:#000;
39
- }
40
-
41
- canvas{
42
- width:min(100vw, calc(100vh * 4 / 3));
43
- height:min(100vh, calc(100vw * 3 / 4));
44
- image-rendering:pixelated;
45
- }
46
- body.fullscreen #window { border: none; }
47
- body.fullscreen #titlebar { display: none; }
48
-
49
- .touch-zone { position: fixed; z-index: 99999; }
50
- .touch-btn {
51
- width: 70px; height: 70px; background: rgba(255, 255, 255, 0.25);
52
- border: 3px solid rgba(0, 0, 0, 0.4); border-radius: 50%;
53
- display: flex; align-items: center; justify-content: center;
54
- font-weight: bold; font-size: 24px; color: rgba(0, 0, 0, 0.6);
55
- }
56
- .joystick-base {
57
- width: 180px; height: 180px; background: rgba(255, 255, 255, 0.15);
58
- border: 3px solid rgba(0, 0, 0, 0.4); border-radius: 50%; position: relative;
59
- }
60
- .joystick-stick {
61
- width: 80px; height: 80px; background: rgba(0, 0, 0, 0.4); border-radius: 50%;
62
- position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
63
- }
64
- #edit-toggle {
65
- position: fixed; top: 45px; right: 15px; padding: 8px 16px;
66
- background: rgba(0, 0, 0, 0.6); color: white; border: 2px solid white;
67
- border-radius: 5px; font-size: 14px; z-index: 100000; cursor: pointer;
68
- }
69
- #edit-toggle.editing { background: #e81123; }
70
- .editing-mode .touch-btn, .editing-mode .joystick-base {
71
- background: rgba(232, 17, 35, 0.4) !important; border: 3px dashed #fff !important; color: #fff !important;
72
- }
73
- </style>
74
- </head>
75
- <body>
76
-
77
- <div id="window">
78
- <div id="titlebar">
79
- <div id="titlebar-left"><div id="titlebar-text">Super Mario Bros. unofficial android port by Player1444(Web)</div></div>
80
- <div id="titlebar-buttons">
81
- <button class="titlebar-btn" id="btn-minimize">—</button>
82
- <button class="titlebar-btn" id="btn-maximize">▢</button>
83
- <button class="titlebar-btn" id="btn-close">✕</button>
84
- </div>
85
- </div>
86
- <div id="game-container">
87
- <canvas id="c2canvas" width="256" height="240"></canvas>
88
- </div>
89
- </div>
90
-
91
- <button id="edit-toggle">Edit</button>
92
-
93
- <div id="zone-joystick" class="touch-zone" style="bottom: 40px; left: 40px;">
94
- <div class="joystick-base"><div class="joystick-stick" id="joystick-stick"></div></div>
95
- </div>
96
- <div id="zone-enter" class="touch-zone" style="bottom: 120px; right: 30px;">
97
- <div class="touch-btn" style="font-size: 16px;">Enter</div>
98
- </div>
99
- <div id="zone-shift" class="touch-zone" style="bottom: 120px; right: 110px;">
100
- <div class="touch-btn" style="font-size: 16px;">Shift</div>
101
- </div>
102
- <div id="zone-run" class="touch-zone" style="bottom: 40px; right: 110px;">
103
- <div class="touch-btn">X</div>
104
- </div>
105
- <div id="zone-jump" class="touch-zone" style="bottom: 40px; right: 30px;">
106
- <div class="touch-btn">Z</div>
107
- </div>
108
-
109
- <input style="display:none;" id="c2nwOpenFileDialog" type="file" />
110
- <input style="display:none;" id="c2nwChooseFolderDialog" type="file" nwdirectory />
111
- <input style="display:none;" id="c2nwSaveDialog" type="file" nwsaveas />
112
-
113
- <script src="jquery-3.4.1.min.js"></script>
114
-
115
- <!-- ======================================================================= -->
116
- <!-- АБСОЛЮТНАЯ СУПЕР-ЗАГЛУШКА NW.JS (Не дает игре выдать ни одной ошибки) -->
117
- <!-- ======================================================================= -->
118
- <script>
119
- window["c2nodewebkit"] = false;
120
-
121
- // Этот магический прокси-объект может притворяться чем угодно.
122
- // Если игра вызовет require("fs").existsSync("file")()().path.anything...
123
- // Прокси ��росто ответит "всё хорошо" и не сломает код.
124
- function createSuperMock() {
125
- const noop = function() {};
126
- const proxy = new Proxy(noop, {
127
- get: function(target, prop) {
128
- if (prop === Symbol.toPrimitive) return () => "";
129
- if (prop === 'toString') return () => "";
130
- if (prop === 'valueOf') return () => 0;
131
- if (prop === 'then') return undefined; // Защита от поломки Promise-ов
132
-
133
- // Специфичные константы, которые игра жестко проверяет:
134
- if (prop === 'platform') return 'win32';
135
- if (prop === 'filename') return 'index.html';
136
- if (prop === 'manifest') return { window: { icon: "" } };
137
- if (prop === 'existsSync') return () => false;
138
- if (prop === 'readFileSync') return () => "";
139
- if (prop === 'sep') return '/';
140
- if (prop === 'join' || prop === 'dirname') return () => "";
141
-
142
- return proxy; // Возвращает сам себя для бесконечной вложенности
143
- },
144
- apply: function(target, thisArg, args) {
145
- return proxy; // Если вызвали как функцию — не падаем
146
- },
147
- construct: function(target, args) {
148
- return proxy; // Если вызвали через new — не падаем
149
- }
150
- });
151
- return proxy;
152
- }
153
-
154
- // Подменяем все ПК-функции на нашу черную дыру
155
- if (typeof window.require === "undefined") {
156
- window.require = function() { return createSuperMock(); };
157
- }
158
-
159
- window.process = createSuperMock();
160
- window.nw = createSuperMock();
161
- </script>
162
-
163
- <script src="c2runtime.js"></script>
164
-
165
- <script>
166
- jQuery(document).ready(function () {
167
- cr_createRuntime("c2canvas");
168
- loadButtonPositions();
169
- });
170
-
171
- document.addEventListener("visibilitychange", function() {
172
- if (typeof cr_setSuspended !== "undefined") cr_setSuspended(!!document.hidden);
173
- });
174
-
175
- document.getElementById("btn-minimize").onclick = () => alert("Окно нельзя свернуть в браузере.");
176
- document.getElementById("btn-close").onclick = () => {
177
- document.getElementById("window").style.display = "none";
178
- if (typeof cr_setSuspended !== "undefined") cr_setSuspended(true);
179
- };
180
-
181
- var btnMaximize = document.getElementById("btn-maximize");
182
- btnMaximize.onclick = () => {
183
- var elem = document.documentElement;
184
- if (!document.fullscreenElement) {
185
- if (elem.requestFullscreen) elem.requestFullscreen();
186
- else if (elem.webkitRequestFullscreen) elem.webkitRequestFullscreen();
187
- } else {
188
- if (document.exitFullscreen) document.exitFullscreen();
189
- else if (document.webkitExitFullscreen) document.webkitExitFullscreen();
190
- }
191
- };
192
-
193
- document.addEventListener("fullscreenchange", () => {
194
- if (document.fullscreenElement) document.body.classList.add("fullscreen");
195
- else document.body.classList.remove("fullscreen");
196
- });
197
-
198
- var isEditing = false;
199
- var keyMap = { 'zone-jump': [90, 32, 38], 'zone-run': [88], 'zone-shift': [16], 'zone-enter': [13] };
200
-
201
- function simulateKeyboardEvent(keyCodes, type) {
202
- if (!keyCodes) return;
203
- keyCodes.forEach(code => {
204
- var e = new KeyboardEvent(type, { keyCode: code, which: code, bubbles: true });
205
- document.dispatchEvent(e); window.dispatchEvent(e);
206
- var canvas = document.getElementById("c2canvas");
207
- if (canvas) canvas.dispatchEvent(e);
208
- });
209
- }
210
-
211
- var editToggle = document.getElementById('edit-toggle');
212
- editToggle.addEventListener('click', function() {
213
- isEditing = !isEditing;
214
- if (isEditing) {
215
- this.classList.add('editing'); this.innerText = 'Save'; document.body.classList.add('editing-mode');
216
- } else {
217
- this.classList.remove('editing'); this.innerText = 'Edit'; document.body.classList.remove('editing-mode');
218
- saveButtonPositions();
219
- }
220
- });
221
-
222
- var activeJoystickKeys = new Set();
223
- function handleJoystick(e, zone) {
224
- var touch = e.touches[0];
225
- var rect = zone.getBoundingClientRect();
226
- var centerX = rect.left + rect.width / 2;
227
- var centerY = rect.top + rect.height / 2;
228
- var dx = touch.clientX - centerX;
229
- var dy = touch.clientY - centerY;
230
- var distance = Math.sqrt(dx * dx + dy * dy);
231
- var angle = Math.atan2(dy, dx);
232
-
233
- var maxVisualDist = 65;
234
- var visualDist = Math.min(distance, maxVisualDist);
235
- var stickX = Math.cos(angle) * visualDist;
236
- var stickY = Math.sin(angle) * visualDist;
237
- zone.querySelector('.joystick-stick').style.transform = `translate(calc(-50% + ${stickX}px), calc(-50% + ${stickY}px))`;
238
-
239
- var deadZone = 30;
240
- var newKeys = new Set();
241
- if (distance > deadZone) {
242
- if (dx > deadZone) newKeys.add(39);
243
- if (dx < -deadZone) newKeys.add(37);
244
- if (dy > deadZone) newKeys.add(40);
245
- if (dy < -deadZone) newKeys.add(38);
246
- }
247
-
248
- activeJoystickKeys.forEach(key => { if (!newKeys.has(key)) simulateKeyboardEvent([key], 'keyup'); });
249
- newKeys.forEach(key => { if (!activeJoystickKeys.has(key)) simulateKeyboardEvent([key], 'keydown'); });
250
- activeJoystickKeys = newKeys;
251
- }
252
-
253
- function resetJoystick(zone) {
254
- zone.querySelector('.joystick-stick').style.transform = 'translate(-50%, -50%)';
255
- activeJoystickKeys.forEach(key => simulateKeyboardEvent([key], 'keyup'));
256
- activeJoystickKeys.clear();
257
- }
258
-
259
- var zones = document.querySelectorAll('.touch-zone');
260
- zones.forEach(zone => {
261
- var dragX = 0, dragY = 0;
262
- zone.addEventListener('touchstart', e => {
263
- if (isEditing) {
264
- dragX = e.touches[0].clientX - zone.getBoundingClientRect().left;
265
- dragY = e.touches[0].clientY - zone.getBoundingClientRect().top;
266
- } else {
267
- if (zone.id === 'zone-joystick') {
268
- zone.querySelector('.joystick-stick').style.background = 'rgba(0, 0, 0, 0.6)';
269
- handleJoystick(e, zone);
270
- } else {
271
- zone.querySelector('.touch-btn').style.background = 'rgba(255, 255, 255, 0.6)';
272
- simulateKeyboardEvent(keyMap[zone.id], 'keydown');
273
- }
274
- }
275
- }, { passive: false });
276
-
277
- zone.addEventListener('touchmove', e => {
278
- e.preventDefault();
279
- if (isEditing) {
280
- var left = e.touches[0].clientX - dragX;
281
- var top = e.touches[0].clientY - dragY;
282
- zone.style.left = Math.max(0, Math.min(window.innerWidth - zone.offsetWidth, left)) + 'px';
283
- zone.style.top = Math.max(0, Math.min(window.innerHeight - zone.offsetHeight, top)) + 'px';
284
- zone.style.bottom = 'auto';
285
- } else if (zone.id === 'zone-joystick') handleJoystick(e, zone);
286
- }, { passive: false });
287
-
288
- zone.addEventListener('touchend', e => {
289
- if (!isEditing) {
290
- if (zone.id === 'zone-joystick') {
291
- zone.querySelector('.joystick-stick').style.background = 'rgba(0, 0, 0, 0.4)';
292
- resetJoystick(zone);
293
- } else {
294
- zone.querySelector('.touch-btn').style.background = 'rgba(255, 255, 255, 0.25)';
295
- simulateKeyboardEvent(keyMap[zone.id], 'keyup');
296
- }
297
- }
298
- }, { passive: false });
299
- });
300
-
301
- function saveButtonPositions() {
302
- var pos = {};
303
- zones.forEach(z => pos[z.id] = { left: z.style.left, top: z.style.top, bottom: z.style.bottom });
304
- localStorage.setItem('mario_pos', JSON.stringify(pos));
305
- }
306
-
307
- function loadButtonPositions() {
308
- var saved = JSON.parse(localStorage.getItem('mario_pos') || "{}");
309
- for (var id in saved) {
310
- var z = document.getElementById(id);
311
- if (z) { z.style.left = saved[id].left; z.style.top = saved[id].top; z.style.bottom = saved[id].bottom; }
312
- }
313
- }
314
- </script>
315
- </body>
316
- </html>