Player1444 commited on
Commit
42ebf4d
·
verified ·
1 Parent(s): 135dc50

Delete index.html

Browse files
Files changed (1) hide show
  1. index.html +0 -392
index.html DELETED
@@ -1,392 +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
- :root {
12
- --btn-size: 70px;
13
- --btn-font: 24px;
14
- --btn-opacity: 0.3;
15
- }
16
-
17
- * {
18
- padding: 0; margin: 0; box-sizing: border-box;
19
- user-select: none; -webkit-user-select: none;
20
- }
21
- html, body {
22
- width: 100%; height: 100%; overflow: hidden; background: #000; font-family: "Segoe UI", sans-serif;
23
- }
24
- #window {
25
- display: flex; flex-direction: column; width: 100%; height: 100%;
26
- border: 2px solid #adadad; background: transparent;
27
- }
28
- #titlebar {
29
- height: 32px; background: #f0f0f0; display: flex; align-items: center;
30
- justify-content: space-between; flex-shrink: 0; border-bottom: 1px solid #adadad;
31
- }
32
- #titlebar-left { display: flex; align-items: center; padding-left: 10px; }
33
- #titlebar-text { font-size: 12px; color: #333; font-weight: 600; }
34
- #titlebar-buttons { display: flex; height: 100%; }
35
- .titlebar-btn {
36
- width: 46px; height: 100%; border: none; background: transparent; font-size: 16px;
37
- display: flex; align-items: center; justify-content: center; color: #333; cursor: pointer;
38
- }
39
- .titlebar-btn:hover { background: rgba(0, 0, 0, 0.1); }
40
- #btn-close:hover { background: #e81123; color: white; }
41
-
42
- #game-container {
43
- display: flex; justify-content: center; align-items: center;
44
- background: #000; flex: 1;
45
- }
46
-
47
- canvas {
48
- width: min(100vw, calc(100vh * 4 / 3));
49
- height: min(100vh, calc(100vw * 3 / 4));
50
- image-rendering: pixelated;
51
- object-fit: contain;
52
- touch-action: none;
53
- }
54
-
55
- body.fullscreen #window { border: none; }
56
- body.fullscreen #titlebar { display: none; }
57
-
58
- .touch-zone { position: fixed; z-index: 99999; touch-action: none; }
59
-
60
-
61
- .touch-btn {
62
- width: var(--btn-size);
63
- height: var(--btn-size);
64
- background: rgba(255, 255, 255, var(--btn-opacity));
65
- border: 3px solid rgba(0, 0, 0, 0.4);
66
- border-radius: 50%;
67
- display: flex; align-items: center; justify-content: center;
68
- font-weight: bold; font-size: var(--btn-font); color: rgba(0, 0, 0, 0.6);
69
- box-shadow: 0 4px 6px rgba(0,0,0,0.2);
70
- }
71
-
72
- #edit-toggle {
73
- position: fixed; top: 45px; right: 15px; padding: 8px 16px;
74
- background: rgba(0, 0, 0, 0.6); color: white; border: 2px solid white;
75
- border-radius: 5px; font-size: 14px; z-index: 100000; cursor: pointer;
76
- }
77
- #edit-toggle.editing { background: #e81123; }
78
-
79
-
80
- #edit-panel {
81
- display: none;
82
- position: fixed; top: 90px; right: 15px;
83
- background: rgba(0, 0, 0, 0.8);
84
- padding: 15px; border-radius: 8px; border: 2px solid white;
85
- color: white; z-index: 100001; font-family: Arial, sans-serif;
86
- width: 200px;
87
- }
88
- .edit-row {
89
- display: flex; flex-direction: column; margin-bottom: 15px;
90
- }
91
- .edit-row label { font-size: 13px; margin-bottom: 5px; }
92
- .edit-row input { touch-action: auto; /* Чтобы ползунки работали на телефоне */ }
93
-
94
- .editing-mode .touch-btn {
95
- background: rgba(232, 17, 35, var(--btn-opacity)) !important;
96
- border: 3px dashed #fff !important; color: #fff !important;
97
- }
98
- </style>
99
- </head>
100
- <body>
101
-
102
- <div id="window">
103
- <div id="titlebar">
104
- <div id="titlebar-left"><div id="titlebar-text">Super Mario Bros. unofficial android port by Player1444(Web)</div></div>
105
- <div id="titlebar-buttons">
106
- <button class="titlebar-btn" id="btn-minimize">—</button>
107
- <button class="titlebar-btn" id="btn-maximize">▢</button>
108
- <button class="titlebar-btn" id="btn-close">✕</button>
109
- </div>
110
- </div>
111
- <div id="game-container">
112
- <canvas id="c2canvas" width="256" height="240"></canvas>
113
- </div>
114
- </div>
115
-
116
- <button id="edit-toggle">Edit</button>
117
-
118
-
119
- <div id="edit-panel">
120
- <div class="edit-row">
121
- <label>Размер кнопок:</label>
122
- <input type="range" id="edit-size" min="40" max="130" value="70">
123
- </div>
124
- <div class="edit-row">
125
- <label>Прозрачность:</label>
126
- <input type="range" id="edit-opacity" min="5" max="100" value="30">
127
- </div>
128
- <div style="font-size:11px; color:#aaa; text-align:center;">Двигайте кнопки по экрану, чтобы изменить их позицию</div>
129
- </div>
130
-
131
-
132
- <div id="zone-left" class="touch-zone" style="bottom: 40px; left: 20px;"><div class="touch-btn">←</div></div>
133
- <div id="zone-right" class="touch-zone" style="bottom: 40px; left: 160px;"><div class="touch-btn">→</div></div>
134
- <div id="zone-up" class="touch-zone" style="bottom: 110px; left: 90px;"><div class="touch-btn">↑</div></div>
135
- <div id="zone-down" class="touch-zone" style="bottom: 20px; left: 90px;"><div class="touch-btn">↓</div></div>
136
-
137
-
138
- <div id="zone-enter" class="touch-zone" style="bottom: 120px; right: 30px;">
139
- <div class="touch-btn" style="font-size: calc(var(--btn-font) * 0.65);">ENTER</div>
140
- </div>
141
- <div id="zone-shift" class="touch-zone" style="bottom: 120px; right: 110px;">
142
- <div class="touch-btn" style="font-size: calc(var(--btn-font) * 0.65);">SHIFT</div>
143
- </div>
144
- <div id="zone-run" class="touch-zone" style="bottom: 40px; right: 110px;"><div class="touch-btn">X</div></div>
145
- <div id="zone-jump" class="touch-zone" style="bottom: 40px; right: 30px;"><div class="touch-btn">Z</div></div>
146
-
147
- <input style="display:none;" id="c2nwOpenFileDialog" type="file" />
148
- <input style="display:none;" id="c2nwChooseFolderDialog" type="file" nwdirectory />
149
- <input style="display:none;" id="c2nwSaveDialog" type="file" nwsaveas />
150
-
151
- <script src="jquery-3.4.1.min.js"></script>
152
-
153
- <script>
154
- window["c2nodewebkit"] = false;
155
-
156
- function createSuperMock() {
157
- const noop = function() {};
158
- const proxy = new Proxy(noop, {
159
- get: function(target, prop) {
160
- if (prop === Symbol.toPrimitive) return () => "";
161
- if (prop === 'toString') return () => "";
162
- if (prop === 'valueOf') return () => 0;
163
- if (prop === 'then') return undefined;
164
- if (prop === 'platform') return 'win32';
165
- if (prop === 'filename') return 'index.html';
166
- if (prop === 'manifest') return { window: { icon: "" } };
167
- if (prop === 'sep') return '/';
168
- return proxy;
169
- },
170
- apply: function() { return proxy; },
171
- construct: function() { return proxy; }
172
- });
173
- return proxy;
174
- }
175
-
176
- if (typeof window.require === "undefined") {
177
- window.require = function(moduleName) {
178
-
179
-
180
- if (moduleName === "path") {
181
- return new Proxy({
182
- join: function() { return Array.from(arguments).join("/").replace(/\/\//g, "/"); },
183
- dirname: function() { return "/"; },
184
- sep: "/"
185
- }, { get: (t, p) => t[p] || createSuperMock() });
186
- }
187
-
188
-
189
- if (moduleName === "fs") {
190
- return new Proxy({
191
- existsSync: function(path) {
192
- return localStorage.getItem("vfs_" + path) !== null;
193
- },
194
- readFileSync: function(path, encoding) {
195
- return localStorage.getItem("vfs_" + path) || "";
196
- },
197
- writeFileSync: function(path, data) {
198
- localStorage.setItem("vfs_" + path, data);
199
- },
200
- appendFileSync: function(path, data) {
201
- let old = localStorage.getItem("vfs_" + path) || "";
202
- localStorage.setItem("vfs_" + path, old + data);
203
- },
204
- unlinkSync: function(path) {
205
- localStorage.removeItem("vfs_" + path);
206
- },
207
- statSync: function() { return { isDirectory: () => false }; }
208
- }, { get: (t, p) => t[p] || createSuperMock() });
209
- }
210
-
211
- return createSuperMock();
212
- };
213
- }
214
-
215
- window.process = createSuperMock();
216
- window.nw = createSuperMock();
217
- </script>
218
-
219
- <script src="c2runtime.js"></script>
220
-
221
- <script>
222
- jQuery(document).ready(function () {
223
- cr_createRuntime("c2canvas");
224
- loadSettingsAndPositions();
225
- });
226
-
227
- document.addEventListener("visibilitychange", function() {
228
- if (typeof cr_setSuspended !== "undefined") cr_setSuspended(!!document.hidden);
229
- });
230
-
231
- document.getElementById("btn-minimize").onclick = () => alert("Окно нельзя свернуть в браузере.");
232
- document.getElementById("btn-close").onclick = () => {
233
- document.getElementById("window").style.display = "none";
234
- if (typeof cr_setSuspended !== "undefined") cr_setSuspended(true);
235
- };
236
-
237
- var btnMaximize = document.getElementById("btn-maximize");
238
- btnMaximize.onclick = () => {
239
- var elem = document.documentElement;
240
- if (!document.fullscreenElement) {
241
- if (elem.requestFullscreen) elem.requestFullscreen();
242
- else if (elem.webkitRequestFullscreen) elem.webkitRequestFullscreen();
243
- } else {
244
- if (document.exitFullscreen) document.exitFullscreen();
245
- else if (document.webkitExitFullscreen) document.webkitExitFullscreen();
246
- }
247
- };
248
-
249
- document.addEventListener("fullscreenchange", () => {
250
- if (document.fullscreenElement) document.body.classList.add("fullscreen");
251
- else document.body.classList.remove("fullscreen");
252
- });
253
-
254
-
255
- var isEditing = false;
256
- var isRunLocked = false;
257
-
258
- var keyMap = {
259
- 'zone-left': [37], 'zone-right': [39], 'zone-up': [38], 'zone-down': [40],
260
- 'zone-jump': [90, 32], 'zone-run': [88], 'zone-shift': [16], 'zone-enter': [13]
261
- };
262
-
263
- function simulateKeyboardEvent(keyCodes, type) {
264
- if (!keyCodes) return;
265
- keyCodes.forEach(code => {
266
- var e = new KeyboardEvent(type, { keyCode: code, which: code, bubbles: true });
267
- document.dispatchEvent(e); window.dispatchEvent(e);
268
- var canvas = document.getElementById("c2canvas");
269
- if (canvas) canvas.dispatchEvent(e);
270
- });
271
- }
272
-
273
- var editToggle = document.getElementById('edit-toggle');
274
- var editPanel = document.getElementById('edit-panel');
275
-
276
- editToggle.addEventListener('click', function() {
277
- isEditing = !isEditing;
278
- if (isEditing) {
279
- this.classList.add('editing'); this.innerText = 'Save';
280
- document.body.classList.add('editing-mode');
281
- editPanel.style.display = 'block';
282
- } else {
283
- this.classList.remove('editing'); this.innerText = 'Edit';
284
- document.body.classList.remove('editing-mode');
285
- editPanel.style.display = 'none';
286
- saveSettingsAndPositions();
287
- }
288
- });
289
-
290
-
291
- document.getElementById('edit-size').addEventListener('input', function(e) {
292
- var size = e.target.value;
293
- document.documentElement.style.setProperty('--btn-size', size + 'px');
294
- document.documentElement.style.setProperty('--btn-font', (size / 2.8) + 'px');
295
- });
296
-
297
- document.getElementById('edit-opacity').addEventListener('input', function(e) {
298
- var opacity = e.target.value / 100;
299
- document.documentElement.style.setProperty('--btn-opacity', opacity);
300
- });
301
-
302
- var zones = document.querySelectorAll('.touch-zone');
303
-
304
- zones.forEach(function(zone) {
305
- var dragX = 0, dragY = 0;
306
-
307
- zone.addEventListener('touchstart', function(e) {
308
- if (isEditing) {
309
- var touch = e.touches[0];
310
- var rect = zone.getBoundingClientRect();
311
- dragX = touch.clientX - rect.left;
312
- dragY = touch.clientY - rect.top;
313
- } else {
314
- if (zone.id === 'zone-run') {
315
- isRunLocked = !isRunLocked;
316
- if (isRunLocked) {
317
- simulateKeyboardEvent(keyMap['zone-run'], 'keydown');
318
- zone.querySelector('.touch-btn').style.background = 'rgba(0, 255, 0, 0.6)';
319
- zone.querySelector('.touch-btn').style.borderColor = '#00ff00';
320
- } else {
321
- simulateKeyboardEvent(keyMap['zone-run'], 'keyup');
322
- zone.querySelector('.touch-btn').style.background = ''; // Возврат к CSS
323
- zone.querySelector('.touch-btn').style.borderColor = 'rgba(0, 0, 0, 0.4)';
324
- }
325
- } else {
326
- zone.querySelector('.touch-btn').style.background = 'rgba(255, 255, 255, 0.6)';
327
- simulateKeyboardEvent(keyMap[zone.id], 'keydown');
328
- }
329
- }
330
- }, { passive: false });
331
-
332
- zone.addEventListener('touchmove', function(e) {
333
- if (isEditing) {
334
- e.preventDefault();
335
- var touch = e.touches[0];
336
- var left = touch.clientX - dragX;
337
- var top = touch.clientY - dragY;
338
- left = Math.max(0, Math.min(window.innerWidth - zone.offsetWidth, left));
339
- top = Math.max(0, Math.min(window.innerHeight - zone.offsetHeight, top));
340
- zone.style.left = left + 'px';
341
- zone.style.top = top + 'px';
342
- zone.style.bottom = 'auto';
343
- }
344
- }, { passive: false });
345
-
346
- zone.addEventListener('touchend', function(e) {
347
- if (!isEditing) {
348
- if (zone.id === 'zone-run') {
349
- if (isRunLocked) zone.querySelector('.touch-btn').style.background = 'rgba(0, 255, 0, 0.6)';
350
- } else {
351
- zone.querySelector('.touch-btn').style.background = ''; // Возврат к CSS
352
- simulateKeyboardEvent(keyMap[zone.id], 'keyup');
353
- }
354
- }
355
- }, { passive: false });
356
- });
357
-
358
- function saveSettingsAndPositions() {
359
- var data = {
360
- size: document.getElementById('edit-size').value,
361
- opacity: document.getElementById('edit-opacity').value,
362
- positions: {}
363
- };
364
- zones.forEach(z => data.positions[z.id] = { left: z.style.left, top: z.style.top, bottom: z.style.bottom });
365
- localStorage.setItem('mario_data_v3', JSON.stringify(data));
366
- }
367
-
368
- function loadSettingsAndPositions() {
369
- var saved = JSON.parse(localStorage.getItem('mario_data_v3') || "{}");
370
-
371
-
372
- if (saved.size) {
373
- document.getElementById('edit-size').value = saved.size;
374
- document.documentElement.style.setProperty('--btn-size', saved.size + 'px');
375
- document.documentElement.style.setProperty('--btn-font', (saved.size / 2.8) + 'px');
376
- }
377
- if (saved.opacity) {
378
- document.getElementById('edit-opacity').value = saved.opacity;
379
- document.documentElement.style.setProperty('--btn-opacity', saved.opacity / 100);
380
- }
381
-
382
-
383
- if (saved.positions) {
384
- for (var id in saved.positions) {
385
- var z = document.getElementById(id);
386
- if (z) { z.style.left = saved.positions[id].left; z.style.top = saved.positions[id].top; z.style.bottom = saved.positions[id].bottom; }
387
- }
388
- }
389
- }
390
- </script>
391
- </body>
392
- </html>