From 310fdd728c36fb86fa6fab364d8551f91cf06103 Mon Sep 17 00:00:00 2001 From: WubzyGD Date: Fri, 21 Jan 2022 16:57:08 -0700 Subject: [PATCH 1/4] reorganize html for sidebar --- index.html | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/index.html b/index.html index 97302be..12b264d 100755 --- a/index.html +++ b/index.html @@ -20,18 +20,21 @@ -
-
-
-
-
-
-
-

-

Name

-

Type

-

Last Modified

-

Size

+
+ +
+
+
+
+
+
+
+

+

Name

+

Type

+

Last Modified

+

Size

+
From be92c82f4f1fd9af12b21ea9d14ddbe1f41d1cd3 Mon Sep 17 00:00:00 2001 From: WubzyGD Date: Fri, 21 Jan 2022 17:13:21 -0700 Subject: [PATCH 2/4] base sidebar css --- index.html | 1 + styles/files.css | 2 +- styles/sidebar.css | 17 +++++++++++++++++ 3 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 styles/sidebar.css diff --git a/index.html b/index.html index 12b264d..0d6f588 100755 --- a/index.html +++ b/index.html @@ -10,6 +10,7 @@ + FileKade diff --git a/styles/files.css b/styles/files.css index 8ad5053..5145d9a 100755 --- a/styles/files.css +++ b/styles/files.css @@ -10,7 +10,7 @@ } .files { - margin: 0 15px 12px 15px; + margin: 0 15px 12px 7px; display: flex; flex-direction: column; justify-content: space-between; diff --git a/styles/sidebar.css b/styles/sidebar.css new file mode 100644 index 0000000..dd46960 --- /dev/null +++ b/styles/sidebar.css @@ -0,0 +1,17 @@ +#sidebar { + width: 10%; + border-right: 1px solid #5d60caaf; + margin: 0 0; + padding: 12px 14px; +} + +#container { + flex-basis: 90%; +} + +#master { + display: flex; + align-items: stretch; + align-content: flex-start; + justify-content: stretch; +} \ No newline at end of file From bcde3903c422815ead74c2a6289a5d2cffad5527 Mon Sep 17 00:00:00 2001 From: WubzyGD Date: Fri, 21 Jan 2022 17:39:27 -0700 Subject: [PATCH 3/4] fixed sidebar; reflow z css and main container --- index.html | 8 +++++++- styles/context.css | 1 + styles/modal.css | 4 ++-- styles/sidebar.css | 24 +++++++++++------------- styles/styles.css | 5 ++--- 5 files changed, 23 insertions(+), 19 deletions(-) diff --git a/index.html b/index.html index 0d6f588..52ab5b1 100755 --- a/index.html +++ b/index.html @@ -22,7 +22,13 @@
- +
diff --git a/styles/context.css b/styles/context.css index 502b0ba..c92ac43 100755 --- a/styles/context.css +++ b/styles/context.css @@ -7,6 +7,7 @@ position: absolute; background-color: #101010df; padding: 7px 5px; + z-index: 2; } #ctx hr { diff --git a/styles/modal.css b/styles/modal.css index 0bdb6c6..b580c66 100755 --- a/styles/modal.css +++ b/styles/modal.css @@ -9,7 +9,7 @@ border: 1px solid #af2188a4; background-color: #171717da; padding: 6px 8px; - z-index: 3; + z-index: 4; max-width: 50%; } @@ -65,7 +65,7 @@ top: 0; left: 0; background-color: #1717176d; - z-index: 2; + z-index: 3; } .error-modal {max-width: 45%;} diff --git a/styles/sidebar.css b/styles/sidebar.css index dd46960..180b5b6 100644 --- a/styles/sidebar.css +++ b/styles/sidebar.css @@ -1,17 +1,15 @@ #sidebar { - width: 10%; + width: 180px; border-right: 1px solid #5d60caaf; - margin: 0 0; - padding: 12px 14px; + margin: 26px 0 0 0; + padding: 0 14px 12px 14px; + position: fixed; + z-index: 1; + overflow-x: hidden; + top: 0; + left: 0; + background-color: #0000006d; + height: 100%; } -#container { - flex-basis: 90%; -} - -#master { - display: flex; - align-items: stretch; - align-content: flex-start; - justify-content: stretch; -} \ No newline at end of file +#container {margin-left: 200px;} \ No newline at end of file diff --git a/styles/styles.css b/styles/styles.css index 8e3d08a..b7e9a01 100755 --- a/styles/styles.css +++ b/styles/styles.css @@ -11,7 +11,6 @@ body { color: #d3d3d3; font-family: 'Montserrat', sans-serif; overflow-y: overlay; - width: calc(100vw) - 10px; } .rise { @@ -32,7 +31,7 @@ body { #title { font-family: 'Nunito', sans-serif; margin: 0 0; - z-index: 1; + z-index: 2; animation: shine 5s linear infinite; background: linear-gradient(to right, #5d60ca 20%, #171717 35%, #171717 35%, #5d60ca 50%, #5d60ca 50%, #af2188 75%, #5d60ca 90%); background-size: 200% auto; @@ -55,7 +54,7 @@ body { width: 100vw; overflow: hidden; background-color: #0000006d; - z-index: 1; + z-index: 2; -webkit-app-region: drag; } From 8ee91f9acb5aab33d5dc8761c137e00ef276c648 Mon Sep 17 00:00:00 2001 From: WubzyGD Date: Fri, 21 Jan 2022 19:18:57 -0700 Subject: [PATCH 4/4] sidebar quick access --- index.html | 1 + json/qa.json | 23 +++++++++++++++++++++++ scripts/startup/initsidebar.js | 27 +++++++++++++++++++++++++++ scripts/startup/preload.js | 1 + styles/sidebar.css | 25 ++++++++++++++++++++++++- 5 files changed, 76 insertions(+), 1 deletion(-) create mode 100644 json/qa.json create mode 100644 scripts/startup/initsidebar.js diff --git a/index.html b/index.html index 52ab5b1..4e5a77f 100755 --- a/index.html +++ b/index.html @@ -27,6 +27,7 @@

Quick Access

+
diff --git a/json/qa.json b/json/qa.json new file mode 100644 index 0000000..1682ad4 --- /dev/null +++ b/json/qa.json @@ -0,0 +1,23 @@ +{ + "default": [ + { + "name": "Desktop", + "win32": "{r}\\Desktop" + }, { + "name": "Documents", + "win32": "{r}\\Documents" + }, { + "name": "Pictures", + "win32": "{r}\\Pictures" + }, { + "name": "Videos", + "win32": "{r}\\Videos" + }, { + "name": "Music", + "win32": "{r}\\Music" + }, { + "name": "Downloads", + "win32": "{r}\\Downloads" + } + ] +} \ No newline at end of file diff --git a/scripts/startup/initsidebar.js b/scripts/startup/initsidebar.js new file mode 100644 index 0000000..4437c8c --- /dev/null +++ b/scripts/startup/initsidebar.js @@ -0,0 +1,27 @@ +const refresh = require('../fileview/refresh'); + +const qa = require('../../json/qa.json'); +const os = require("os"); + +module.exports = () => { + let root + switch (window.kade.platform) { + case 'win32': + root = `${os.homedir()}`; + break; + case 'linux': + root = `~/home`; + break; + } + + let quickAccess = document.getElementById('favorites-container'); + + qa.default.forEach(i => { + let quick = document.createElement('div'); + quick.innerHTML = i.name; + quick.onclick = () => {refresh(i[window.kade.platform].replace('{r}', root));}; + quick.className = 'favorites-button'; + quick.classList.add('nosel'); + quickAccess.appendChild(quick); + }); +}; \ No newline at end of file diff --git a/scripts/startup/preload.js b/scripts/startup/preload.js index f934d20..388e211 100755 --- a/scripts/startup/preload.js +++ b/scripts/startup/preload.js @@ -40,6 +40,7 @@ window.addEventListener('DOMContentLoaded', () => { } require('./initcontext')(); + require('./initsidebar')(); require('../fileview/refresh')(startDir); setButtons(); diff --git a/styles/sidebar.css b/styles/sidebar.css index 180b5b6..6b9a258 100644 --- a/styles/sidebar.css +++ b/styles/sidebar.css @@ -12,4 +12,27 @@ height: 100%; } -#container {margin-left: 200px;} \ No newline at end of file +#container {margin-left: 200px;} + +#favorites-container { + display: flex; + flex-direction: column; + align-items: stretch; + align-content: flex-start; + justify-content: flex-start; + row-gap: 6px; +} + +.favorites-button { + padding: 4px 6px; + color: #afafaf; + border-radius: 3px 3px; + cursor: pointer; + transition: padding-left .05s linear; +} + +.favorites-button:hover { + background-color: #a172a65f; + padding-left: 10px; + color: white; +} \ No newline at end of file