]> git.ardis.lu - minimal-routing/commitdiff
Simplify pages element
authorArdis Lu <ardisglu@gmail.com>
Thu, 28 Nov 2024 06:07:07 +0000 (22:07 -0800)
committerArdis Lu <ardisglu@gmail.com>
Thu, 28 Nov 2024 06:07:07 +0000 (22:07 -0800)
Converting to array is not necessary

index.html

index ff63154e701bae0d9baa8de2ce8645004af2d293..d7af3babf575ceca7d6d5e0956b9732d9151e0e7 100644 (file)
@@ -91,7 +91,7 @@
 
     @media (max-width: 800px) {
       main {
-        grid-template: 
+        grid-template:
           "nav"
           "content";
       }
   <script>
     const routers = document.querySelectorAll('[data-router]');
     const content = document.querySelector('section');
-    const pages = Array.from(document.querySelectorAll('[data-page]')); // Must convert to array to preserve elements
+    const pages = document.querySelectorAll('[data-page]');
 
     // Display the appropriate page based on the URL path (does NOT modify browser history)
     function showPage(path) {
   </script>
 </body>
 
-</html>
+</html>
\ No newline at end of file
This page took 0.032498 seconds and 4 git commands to generate.