]> git.sesse.net Git - remoteglot/commitdiff
Do not show the board before we have an initial load.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Sat, 22 Oct 2022 11:07:37 +0000 (13:07 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Sat, 22 Oct 2022 11:07:37 +0000 (13:07 +0200)
www/index.html
www/js/remoteglot.js

index 45bab22a10165c445a4168b29442b4f6c5e9923c..d2a4d4923ccbe4daf9413ecd3ddaedcc00c238bf 100644 (file)
@@ -24,7 +24,7 @@
   <script type="text/javascript" src="js/remoteglot.min.js"></script>
   -->
 </head>
-<body>
+<body style="opacity: 0">  <!-- Avoid layout shift on initial load. -->
 <audio id="ding" preload="none">
   <source src="ding.opus" type="audio/ogg; codecs=opus" />
   <source src="ding.mp3" type="audio/mp3" />
index 3a95204e20bc7692a38d2fb3fdc36ed5b7e61eab..d102ad027e351c10c417ce237615eebaa1a7ac4e 100644 (file)
@@ -302,6 +302,7 @@ var request_update = function() {
                        current_analysis_request_timer = setTimeout(function() { request_update(); }, timeout);
                }
        }).fail(function(jqXHR, textStatus, errorThrown) {
+               document.body.style.opacity = null;
                if (textStatus === "abort") {
                        // Aborted because we are switching backends. Abandon and don't retry,
                        // because another one is already started for us.
@@ -1028,6 +1029,8 @@ var patch_move = function(move) {
 /** Update all the HTML on the page, based on current global state.
  */
 var update_board = function() {
+       document.body.style.opacity = null;
+
        var data = displayed_analysis_data || current_analysis_data;
        var current_data = current_analysis_data;  // Convenience alias.