Download index 41.html from Studytime171/lucky: direct link, hf CLI and curl.
- Browser
- Download file 7.18 kB
-
https://huggingface.co/Studytime171/lucky/resolve/main/index%2041.html
- Command line
-
hf download 'hf://Studytime171/lucky/index 41.html'
-
curl -L -o 'index 41.html' https://huggingface.co/Studytime171/lucky/resolve/main/index%2041.html
7.18 kB
| <html> | |
| <head> | |
| <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"> | |
| <title>GBA.js - Mobile Controller</title> | |
| <link rel="stylesheet" href="resources/main.css"> | |
| <style> | |
| /* Base Layout */ | |
| body, html { | |
| margin: 0; | |
| padding: 0; | |
| width: 100%; | |
| height: 100%; | |
| background-color: #000; | |
| overflow: hidden; | |
| display: flex; | |
| flex-direction: column; | |
| font-family: sans-serif; | |
| touch-action: none; /* Prevents accidental zooming/scrolling */ | |
| } | |
| /* Game Screen Area */ | |
| #screen-container { | |
| width: 100%; | |
| flex: 0 0 auto; | |
| display: flex; | |
| flex-direction: column; | |
| align-items: center; | |
| background: #000; | |
| padding-top: 5px; | |
| } | |
| #screen { | |
| width: 100vw; | |
| height: auto; | |
| max-height: 40vh; /* Limits height to save room for big buttons */ | |
| aspect-ratio: 3 / 2; | |
| image-rendering: pixelated; | |
| background: #000; | |
| } | |
| /* Status Bar */ | |
| #controls { | |
| width: 100%; | |
| background: #111; | |
| padding: 10px 0; | |
| text-align: center; | |
| border-bottom: 1px solid #333; | |
| } | |
| #ingame button, #preload button { | |
| background: #333; | |
| color: #0f0; | |
| border: 1px solid #444; | |
| padding: 8px 15px; | |
| margin: 0 5px; | |
| font-family: monospace; | |
| border-radius: 4px; | |
| text-transform: uppercase; | |
| } | |
| /* Responsive Touch Controls */ | |
| #touchControls { | |
| flex: 1; | |
| display: none; /* Shown via JS */ | |
| position: relative; | |
| width: 100%; | |
| box-sizing: border-box; | |
| user-select: none; | |
| -webkit-user-select: none; | |
| } | |
| .ctrl-btn { | |
| position: absolute; | |
| background: #555; | |
| border: none; | |
| color: #eee; | |
| font-weight: bold; | |
| display: flex; | |
| align-items: center; | |
| justify-content: center; | |
| pointer-events: auto; | |
| box-shadow: 0 5px #222; | |
| touch-action: manipulation; | |
| } | |
| .ctrl-btn:active { | |
| background: #777; | |
| box-shadow: 0 2px #111; | |
| transform: translateY(3px); | |
| } | |
| /* BIG D-PAD */ | |
| #dpad { | |
| position: absolute; | |
| bottom: 12%; | |
| left: 4vw; | |
| width: 42vw; | |
| max-width: 240px; | |
| aspect-ratio: 1 / 1; | |
| } | |
| #up { top: 0; left: 33%; width: 34%; height: 38%; border-radius: 10px 10px 0 0; } | |
| #down { bottom: 0; left: 33%; width: 34%; height: 38%; border-radius: 0 0 10px 10px; } | |
| #left { top: 33%; left: 0; width: 38%; height: 34%; border-radius: 10px 0 0 10px; } | |
| #right { top: 33%; right: 0; width: 38%; height: 34%; border-radius: 0 10px 10px 0; } | |
| #center-block { position: absolute; top: 33%; left: 33%; width: 34%; height: 34%; background: #555; } | |
| /* BIG ACTION CLUSTER */ | |
| #action-cluster { | |
| position: absolute; | |
| bottom: 12%; | |
| right: 4vw; | |
| width: 45vw; | |
| max-width: 260px; | |
| height: 35vw; | |
| max-height: 200px; | |
| } | |
| .round-btn { | |
| width: 20vw; | |
| height: 20vw; | |
| max-width: 100px; | |
| max-height: 100px; | |
| border-radius: 50%; | |
| font-size: 24px; | |
| } | |
| #a { top: 0; right: 0; background: #a22; } /* Red for A */ | |
| #b { bottom: 0; left: 0; background: #aa2; } /* Yellow-ish for B */ | |
| /* Shoulders */ | |
| #l { top: 10px; left: 4vw; width: 22vw; height: 45px; border-radius: 8px; max-width: 120px; } | |
| #r { top: 10px; right: 4vw; width: 22vw; height: 45px; border-radius: 8px; max-width: 120px; } | |
| /* Select/Start Pill Buttons */ | |
| .pill-btn { | |
| bottom: 20px; | |
| width: 24vw; | |
| height: 35px; | |
| max-width: 110px; | |
| border-radius: 20px; | |
| font-size: 12px; | |
| background: #333; | |
| } | |
| #select { left: 24vw; } | |
| #start { right: 24vw; } | |
| /* Landscape Tweaks */ | |
| @media (orientation: landscape) { | |
| #screen { max-height: 55vh; width: auto; } | |
| #dpad { bottom: 5%; width: 25vw; } | |
| #action-cluster { bottom: 5%; width: 30vw; } | |
| } | |
| .hidden { display: none ; } | |
| </style> | |
| <script src="js/util.js"></script> | |
| <script src="js/core.js"></script> | |
| <script src="js/arm.js"></script> | |
| <script src="js/thumb.js"></script> | |
| <script src="js/mmu.js"></script> | |
| <script src="js/io.js"></script> | |
| <script src="js/audio.js"></script> | |
| <script src="js/video.js"></script> | |
| <script src="js/video/proxy.js"></script> | |
| <script src="js/video/software.js"></script> | |
| <script src="js/irq.js"></script> | |
| <script src="js/keypad.js"></script> | |
| <script src="js/sio.js"></script> | |
| <script src="js/savedata.js"></script> | |
| <script src="js/gpio.js"></script> | |
| <script src="js/gba.js"></script> | |
| <script src="resources/xhr.js"></script> | |
| <script> | |
| var gba; | |
| try { | |
| gba = new GameBoyAdvance(); | |
| gba.keypad.eatInput = true; | |
| } catch (exception) { gba = null; } | |
| window.onload = function() { | |
| if (gba) { | |
| var canvas = document.getElementById('screen'); | |
| gba.setCanvas(canvas); | |
| loadRom('resources/bios.bin', function(bios) { gba.setBios(bios); }); | |
| // Ensure touch controls show on mobile/tablets | |
| if ('ontouchstart' in window || navigator.maxTouchPoints > 0) { | |
| document.getElementById('touchControls').style.display = 'block'; | |
| } | |
| setupTouchControls(); | |
| } | |
| } | |
| function run(file) { | |
| gba.loadRomFromFile(file, function(result) { | |
| if (result) { | |
| document.getElementById('preload').classList.add('hidden'); | |
| document.getElementById('ingame').classList.remove('hidden'); | |
| gba.runStable(); | |
| } | |
| }); | |
| } | |
| function setupTouchControls() { | |
| function press(c) { window.dispatchEvent(new KeyboardEvent('keydown', {keyCode: c})); } | |
| function release(c) { window.dispatchEvent(new KeyboardEvent('keyup', {keyCode: c})); } | |
| const map = { | |
| 'up': 38, 'down': 40, 'left': 37, 'right': 39, | |
| 'a': 88, 'b': 90, 'l': 65, 'r': 83, | |
| 'start': 13, 'select': 16 | |
| }; | |
| Object.keys(map).forEach(id => { | |
| const el = document.getElementById(id); | |
| if(el) { | |
| el.addEventListener('touchstart', (e) => { e.preventDefault(); press(map[id]); }, {passive: false}); | |
| el.addEventListener('touchend', (e) => { e.preventDefault(); release(map[id]); }, {passive: false}); | |
| } | |
| }); | |
| } | |
| </script> | |
| </head> | |
| <body> | |
| <div id="screen-container"> | |
| <div style="color:#0f0; font-family:monospace; margin-bottom:5px; font-size: 12px;">GBA.js MOBILE</div> | |
| <canvas id="screen" width="480" height="320"></canvas> | |
| </div> | |
| <section id="controls"> | |
| <div id="preload"> | |
| <button onclick="document.getElementById('loader').click()">Select ROM</button> | |
| <input id="loader" type="file" accept=".gba" onchange="run(this.files[0]);" style="display:none"> | |
| </div> | |
| <div id="ingame" class="hidden"> | |
| <button onclick="gba.pause()">Pause</button> | |
| <button onclick="gba.reset()">Reset</button> | |
| </div> | |
| </section> | |
| <div id="touchControls"> | |
| <div id="dpad"> | |
| <button id="up" class="ctrl-btn">↑</button> | |
| <button id="left" class="ctrl-btn">←</button> | |
| <div id="center-block"></div> | |
| <button id="right" class="ctrl-btn">→</button> | |
| <button id="down" class="ctrl-btn">↓</button> | |
| </div> | |
| <div id="action-cluster"> | |
| <button id="b" class="ctrl-btn round-btn">B</button> | |
| <button id="a" class="ctrl-btn round-btn">A</button> | |
| </div> | |
| <button id="l" class="ctrl-btn">L</button> | |
| <button id="r" class="ctrl-btn">R</button> | |
| <button id="select" class="ctrl-btn pill-btn">SELECT</button> | |
| <button id="start" class="ctrl-btn pill-btn">START</button> | |
| </div> | |
| </body> | |
| </html> | |