Up-in-the-Air – commitdiff

You can use Git to clone the repository via the web URL. Download snapshot (zip)
Functioning keyboard rebinding reset and feather selection
authorJulian Fietkau <git@fietkau.software>
Thu, 26 Sep 2024 00:04:24 +0000 (02:04 +0200)
committerJulian Fietkau <git@fietkau.software>
Thu, 26 Sep 2024 00:04:24 +0000 (02:04 +0200)
12 files changed:
index.html
main.js
textures/feather-black.png [new file with mode: 0644]
textures/feather-blue.png [new file with mode: 0644]
textures/feather-brown.png [new file with mode: 0644]
textures/feather-ghost.png [new file with mode: 0644]
textures/feather-golden.png [new file with mode: 0644]
textures/feather-green.png [new file with mode: 0644]
textures/feather-orange.png [new file with mode: 0644]
textures/feather-purple.png [new file with mode: 0644]
textures/feather-red.png [new file with mode: 0644]
textures/feather.png [deleted file]

index a95f7ea685e4d34903af91387307bdc09a3bd37e..7c1b1a0d543c1dd11eb18802e88dfd6ae18241b0 100644 (file)
     width: 6em;
     margin: -1em 0;
     transition: 150ms transform;
-  }
-  .ui-page.options .feather img {
-    transform: translateX(-1em);
+    transform: scaleY(-1) translateX(-1em);
   }
   .ui-page.options .feather input:checked + img {
-    transform: translateX(1em);
+    transform: scaleY(-1) translateX(1em);
   }
   .ui-page.options .feather label:hover img, .ui-page.options .feather label:focus-within img {
     filter: 
   .ui-page.options .feather label:nth-child(8) { z-index: 43; }
   .ui-page.options .feather label:nth-child(9) { z-index: 42; }
   .ui-page.options .feather label:nth-child(10) { z-index: 41; }
+  .ui-page.options .feather label:nth-child(11) { z-index: 40; }
+  .ui-page.options .feather label:nth-child(12) { z-index: 39; }
+  .ui-page.options .feather label:nth-child(13) { z-index: 38; }
+  .ui-page.options .feather label:nth-child(14) { z-index: 37; }
+  .ui-page.options .feather label:nth-child(15) { z-index: 36; }
   .ui-page.loading {
     display: flex;
     flex-direction: column;
 <h3>Feather Customization</h3>
 <p>You can change the feather’s visual appearance. This is an aesthetic choice with no impact on the game mechanics.</p>
 <div class="feather">
-<label><input type="radio" name="upInTheAirGame-feather" value="blue"><img src="textures/feather.png" alt="Blue feather"></label>
-<label><input type="radio" name="upInTheAirGame-feather" value="red"><img src="textures/feather.png" alt="Red feather"></label>
-<label><input type="radio" name="upInTheAirGame-feather" value="green"><img src="textures/feather.png" alt="Green feather"></label>
-<label><input type="radio" name="upInTheAirGame-feather" value="black"><img src="textures/feather.png" alt="Black feather"></label>
-<label><input type="radio" name="upInTheAirGame-feather" value="brown"><img src="textures/feather.png" alt="Brown feather"></label>
+<label><input type="radio" name="upInTheAirGame-feather" value="blue"><img src="textures/feather-blue.png" alt="Blue feather"></label>
+<label><input type="radio" name="upInTheAirGame-feather" value="red"><img src="textures/feather-red.png" alt="Red feather"></label>
+<label><input type="radio" name="upInTheAirGame-feather" value="green"><img src="textures/feather-green.png" alt="Green feather"></label>
+<label><input type="radio" name="upInTheAirGame-feather" value="black"><img src="textures/feather-black.png" alt="Black feather"></label>
+<label><input type="radio" name="upInTheAirGame-feather" value="brown"><img src="textures/feather-brown.png" alt="Brown feather"></label>
+<label><input type="radio" name="upInTheAirGame-feather" value="brown"><img src="textures/feather-orange.png" alt="Orange feather"></label>
+<label><input type="radio" name="upInTheAirGame-feather" value="brown"><img src="textures/feather-purple.png" alt="Purple feather"></label>
 </div>
 </div>
 </div>
diff --git a/main.js b/main.js
index ec9d9493b97bbfc54e56b4c20ddb64a0256c1628..aafcd25de81912044fd48efffdb0b7814ad496e7 100644 (file)
--- a/main.js
+++ b/main.js
@@ -71,7 +71,15 @@ function loadAllAssets(game, renderProgressCallback) {
       'textures/cloud5a.png': 2066,
       'textures/cloud5b.png': 2065,
       'textures/cloud5c.png': 2066,
-      'textures/feather.png': 9196,
+      'textures/feather-black.png': 1026,
+      'textures/feather-blue.png': 1026,
+      'textures/feather-brown.png': 1027,
+      'textures/feather-ghost.png': 1023,
+      'textures/feather-golden.png': 1027,
+      'textures/feather-green.png': 1028,
+      'textures/feather-orange.png': 1028,
+      'textures/feather-purple.png': 1028,
+      'textures/feather-red.png': 1024,
       'textures/highcontrast-backdrop.png': 500,
       'textures/logo.png': 5174,
       'textures/pinwheel.png': 904,
@@ -1175,7 +1183,15 @@ game.ui.root.querySelectorAll('.options .keyboard label button').forEach((btn) =
     game.ui.root.appendChild(keyboardModal);
   });
 });
-game.ui.root.querySelector('.options .keyboard button[value="reset"]').addEventListener('click', applySettings(game));
+game.ui.root.querySelector('.options .keyboard button[value="reset"]').addEventListener('click', (e) => {
+  const container = e.target.parentNode;
+  container.querySelector('button.up').value = 'ArrowUp|w';
+  container.querySelector('button.right').value = 'ArrowRight|d';
+  container.querySelector('button.down').value = 'ArrowDown|s';
+  container.querySelector('button.left').value = 'ArrowLeft|a';
+  applySettings(game);
+  loadSettings(game);
+});
 game.ui.root.querySelectorAll('.ui-page .areatabs button').forEach((btn) => {
   btn.addEventListener('click', (e) => {
     btn.parentNode.querySelectorAll('button').forEach((otherBtn) => {
diff --git a/textures/feather-black.png b/textures/feather-black.png
new file mode 100644 (file)
index 0000000..921f77f
Binary files /dev/null and b/textures/feather-black.png differ
diff --git a/textures/feather-blue.png b/textures/feather-blue.png
new file mode 100644 (file)
index 0000000..7af4971
Binary files /dev/null and b/textures/feather-blue.png differ
diff --git a/textures/feather-brown.png b/textures/feather-brown.png
new file mode 100644 (file)
index 0000000..382e0a0
Binary files /dev/null and b/textures/feather-brown.png differ
diff --git a/textures/feather-ghost.png b/textures/feather-ghost.png
new file mode 100644 (file)
index 0000000..406abe7
Binary files /dev/null and b/textures/feather-ghost.png differ
diff --git a/textures/feather-golden.png b/textures/feather-golden.png
new file mode 100644 (file)
index 0000000..c95c0da
Binary files /dev/null and b/textures/feather-golden.png differ
diff --git a/textures/feather-green.png b/textures/feather-green.png
new file mode 100644 (file)
index 0000000..e679e78
Binary files /dev/null and b/textures/feather-green.png differ
diff --git a/textures/feather-orange.png b/textures/feather-orange.png
new file mode 100644 (file)
index 0000000..91fcd92
Binary files /dev/null and b/textures/feather-orange.png differ
diff --git a/textures/feather-purple.png b/textures/feather-purple.png
new file mode 100644 (file)
index 0000000..bb1c504
Binary files /dev/null and b/textures/feather-purple.png differ
diff --git a/textures/feather-red.png b/textures/feather-red.png
new file mode 100644 (file)
index 0000000..3aa2245
Binary files /dev/null and b/textures/feather-red.png differ
diff --git a/textures/feather.png b/textures/feather.png
deleted file mode 100644 (file)
index 18dad6b..0000000
Binary files a/textures/feather.png and /dev/null differ