From a6ad45816bbbdfd40b830e16452e3fac04a6f5e4 Mon Sep 17 00:00:00 2001 From: RodrigoDornelles Date: Sun, 5 Nov 2023 21:23:39 -0300 Subject: [PATCH] feat: install gamepadzilla --- fake_npm_install.sh | 2 ++ res/index.html | 41 ++++++++++++++++++++++++++++++----------- res/pwa.js | 1 + 3 files changed, 33 insertions(+), 11 deletions(-) diff --git a/fake_npm_install.sh b/fake_npm_install.sh index 7541d2c..071fa6f 100755 --- a/fake_npm_install.sh +++ b/fake_npm_install.sh @@ -1,6 +1,8 @@ #!/usr/bin/sh mkdir -p html +URL_GAMEPAD=https://rodrigodornelles.github.io/npm-gamepadzilla/gamepadzilla.js URL_FCEUX_JS=https://cdn.jsdelivr.net/npm/em-fceux@2.2.0/dist/fceux.min.js URL_FCEUX_WASM=https://cdn.jsdelivr.net/npm/em-fceux@2.2.0/dist/fceux.wasm +(curl -fsSL $URL_GAMEPAD || wget -qO- $URL_GAMEPAD) > html/gamepadzilla.js (curl -fsSL $URL_FCEUX_JS || wget -qO- $URL_FCEUX_JS) > html/fceux.js (curl -fsSL $URL_FCEUX_WASM || wget -qO- $URL_FCEUX_WASM) > html/fceux.wasm diff --git a/res/index.html b/res/index.html index 44cfe3d..b888c76 100644 --- a/res/index.html +++ b/res/index.html @@ -24,13 +24,14 @@ text-align: center; background-color: black; } - canvas { + #gameCanvas { width: 100vmin; + } + canvas { padding-left: 0; padding-right: 0; margin-left: auto; margin-right: auto; - display: block; image-rendering: pixelated; image-rendering: crisp-edges; } @@ -44,29 +45,42 @@ margin: 15vh 20%; background-color: white; } - .btn:hover { opacity: 0.9; cursor: pointer; } + .gpz-btn, .gpz-joy { + width: 25vw; + } - +
loading...
+
+ + +
- + + diff --git a/res/pwa.js b/res/pwa.js index 34fb352..f2ffbe1 100644 --- a/res/pwa.js +++ b/res/pwa.js @@ -4,6 +4,7 @@ const urlsToCache = [ 'index.html', 'favicon.ico', 'fceux.js', + 'gamepadzilla.js', 'fceux.wasm', 'cocobattleroyale.nes', 'galinharoyale.nes',