Up-in-the-Air – commitdiff

You can use Git to clone the repository via the web URL. Download snapshot (zip)
Automatically scroll to top of credits when they are opened
authorJulian Fietkau <git@fietkau.software>
Sun, 29 Sep 2024 03:10:39 +0000 (05:10 +0200)
committerJulian Fietkau <git@fietkau.software>
Sun, 29 Sep 2024 03:10:39 +0000 (05:10 +0200)
main.js

diff --git a/main.js b/main.js
index af7ae9ddb288b819212dc6084c8979159fa7f2ba..198d3dfec2863944d379a5934990b2b96d73e0cc 100644 (file)
--- a/main.js
+++ b/main.js
@@ -1080,7 +1080,7 @@ function loadSettings(game) {
     'audio': {
       'music': 0.5,
       'sounds': 0.5,
-      'theme': 'classical',
+      'theme': null, // actual default value determined after asset loading
     },
     'feather': 'blue',
     'unlocks': [],
@@ -1786,6 +1786,9 @@ function moveToPage(game, target, skipFade = false) {
     targetElem.style.display = 'flex';
     setTimeout((targetElem) => {
       targetElem.style.opacity = '1';
+      if(target == 'credits') {
+        targetElem.querySelector('.area').scrollTop = 0;
+      }
     }, fadeDuration, targetElem);
   }
   if(target != 'pause' && game.ui.currentPage != 'pause') {