]> git.ardis.lu - zip-page/commitdiff
Don't show original UI if there's any hash
authorArdis Lu <ardisglu@gmail.com>
Sat, 30 Sep 2023 04:30:45 +0000 (21:30 -0700)
committerArdis Lu <ardisglu@gmail.com>
Sat, 30 Sep 2023 04:30:45 +0000 (21:30 -0700)
index.html

index 9c6855b91d1464878161be31603d10c3ac4015ae..cc2faeff4613b6f0b73d84ea88d997e998a97fa0 100644 (file)
   </style>
 </head>
 
-<body>
+<body style="display: none">
   <header>
     <h1>zip-page</h1>
   </header>
       const url = `${location.origin}/#${b64}`;
       e.target.elements['url'].innerHTML = `<a href="${url}">${url.substring(0, 60)}${url.length > 60 ? '...' : ''}</a>`;
     });
+
+    // Blocks flash of original UI before document.write in the header script executes
+    if (location.hash === '') {
+      document.querySelector('body').style.setProperty('display', '');
+    }
   </script>
 </body>
 
This page took 0.031577 seconds and 4 git commands to generate.