« get me outta code hell

collapse sidebar on small screens - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
diff options
context:
space:
mode:
authorFlorrie <towerofnix@gmail.com>2020-06-04 15:24:52 -0300
committerFlorrie <towerofnix@gmail.com>2020-06-04 15:24:52 -0300
commit4556e821d96d8849692d077493f5576fd4478f78 (patch)
treeafd21f6aabe402101eb6e8decf24d7d9c06e610f
parent875bab24546ede8781e03557e51481e2405162a9 (diff)
collapse sidebar on small screens
the site is fully accessible through the header navbar so we can hide
the sidebar when it takes up more screen than its worth now!
-rw-r--r--site.css6
-rw-r--r--upd8.js9
2 files changed, 14 insertions, 1 deletions
diff --git a/site.css b/site.css
index addc859..5beed49 100644
--- a/site.css
+++ b/site.css
@@ -77,6 +77,12 @@ a:hover {
     white-space: nowrap;
 }
 
+@media (max-width: 780px) {
+    #sidebar {
+        display: none;
+    }
+}
+
 #sidebar, #content, #header {
     background-color: rgba(var(--bg-shade), var(--bg-shade), var(--bg-shade), 0.6);
     border: 1px dotted var(--fg-color);
diff --git a/upd8.js b/upd8.js
index 87f89b7..a590423 100644
--- a/upd8.js
+++ b/upd8.js
@@ -1383,7 +1383,8 @@ function writeListingPages() {
                     </div>
                     <div id="content">
                         <h1>Listings</h1>
-                        <p>Feel free to explore any of the listings linked in the sidebar!</p>
+                        <p>Feel free to explore any of the listings linked below and in the sidebar!</p>
+                        ${generateLinkIndexForListings(listingDescriptors)}
                     </div>
                 </div>
             </body>
@@ -1525,6 +1526,12 @@ function generateHeaderForListings(listingDescriptors, currentDirectoryParts) {
 function generateSidebarForListings(listingDescriptors, currentDirectoryParts) {
     return fixWS`
         <h1><a href="${C.LISTING_DIRECTORY}/index.html">Listings</a></h1>
+        ${generateLinkIndexForListings(listingDescriptors, currentDirectoryParts)}
+    `;
+}
+
+function generateLinkIndexForListings(listingDescriptors, currentDirectoryParts) {
+    return fixWS`
         <ul>
             ${listingDescriptors.map(([ ldDirectoryParts, ldTitle ]) => fixWS`
                 <li class="${currentDirectoryParts === ldDirectoryParts && 'current'}">