diff --git a/assets/css/butter-dir-listing.css b/assets/css/butter-dir-listing.css
index fcd0ccb..e258684 100644
--- a/assets/css/butter-dir-listing.css
+++ b/assets/css/butter-dir-listing.css
@@ -1,9 +1,12 @@
/* Based on the default lighttpd styles, this butters up the UI */
-
-
body {
font-family: "Poppins", sans-serif;
+ margin: 0;
+}
+
+a {
+ text-decoration: none;
}
body>h2 {
@@ -21,6 +24,25 @@ div.foot {
display: none;
}
+.breadcrumbs {
+ display: flex;
+ align-items: center;
+ margin: 10px;
+ height: 34px;
+ .path-next {
+ margin: 0 5px;
+ height: 12px;
+ }
+}
+
+.crumb {
+ align-items: center;
+ color: black;
+ display: flex;
+ font-family: "Poppins", sans-serif;
+ font-size: 14px;
+}
+
h2 {
font-size: 18px;
font-weight: 500;
@@ -33,6 +55,10 @@ hr {
margin: 20px 10px;
}
+hr.full-width {
+ margin: 0;
+}
+
.container {
display: flex;
align-items: center;
@@ -41,7 +67,6 @@ hr {
margin: 10px;
box-sizing: border-box;
font-family: "Poppins", sans-serif;
- text-decoration: none;
}
.logo-container {
diff --git a/assets/images/home.svg b/assets/images/home.svg
new file mode 100644
index 0000000..494c316
--- /dev/null
+++ b/assets/images/home.svg
@@ -0,0 +1,4 @@
+
+
\ No newline at end of file
diff --git a/assets/images/next.svg b/assets/images/next.svg
new file mode 100644
index 0000000..c04632d
--- /dev/null
+++ b/assets/images/next.svg
@@ -0,0 +1,4 @@
+
+
\ No newline at end of file
diff --git a/assets/js/butter-dir-listing.js b/assets/js/butter-dir-listing.js
index d90823c..819628d 100644
--- a/assets/js/butter-dir-listing.js
+++ b/assets/js/butter-dir-listing.js
@@ -96,8 +96,39 @@ window.onload = function () {
const { files, folders } = extractDirectoryListing();
console.log('Files:', files);
console.log('Folders:', folders);
+ const listDiv = document.querySelector('div.list');
- // insert a new div before div.list
+ // Header with breadcrumbs
+ const usbRoot = "/usb-butter/";
+ const h2Path = document.querySelector('h2').textContent;
+ console.log("H2 Path:", h2Path);
+ const path = h2Path.replace('Index of ', '').replace(usbRoot, '');
+ console.log("Path:", path);
+
+ const breadcrumbs = document.createElement("div");
+ breadcrumbs.classList.add('breadcrumbs');
+ let breadcrumbHTML = `
+
+
Explore
+ `;
+ pathSteps = path.split('/');
+ let pathToHere = usbRoot;
+ pathSteps.forEach((step, index) => {
+ pathToHere += step + '/';
+ if (step !== "") {
+ breadcrumbHTML += `
+
${step}`;
+ }
+ });
+ breadcrumbs.innerHTML = breadcrumbHTML;
+ listDiv.parentNode.insertBefore(breadcrumbs, listDiv);
+
+ // hr
+ const fullWithHR = document.createElement('hr');
+ fullWithHR.classList.add('full-width');
+ listDiv.parentNode.insertBefore(fullWithHR, listDiv);
+
+ // Create a folder listing
const folderListing = document.createElement("div");
folderListing.classList.add('folder-list');
folderListing.innerHTML = '
| Name | Last Modified | Size | Type |
|---|---|---|---|
| ../ | - | Directory | |
| johns_subfolder1/ | 2024-Apr-30 17:11:52 | - | Directory |
| johns_subfolder2/ | 2024-Apr-30 17:11:54 | - | Directory |
| lub.zip | 2024-May-01 15:38:22 | 30.3M | application/zip |
| test.txt | 2024-Mar-07 14:55:59 | 0.0K | text/plain;charset=utf-8 |