From 110f695a1ff0ebfdc7aa92332c604c4006b19d36 Mon Sep 17 00:00:00 2001 From: WubzyGD Date: Fri, 21 Jan 2022 18:04:40 -0700 Subject: [PATCH 1/8] Add a readme finally --- README.md | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..1eac1c0 --- /dev/null +++ b/README.md @@ -0,0 +1,46 @@ +# FileKade + +**Welcome to FileKade's official repository!** + +This project is mainly just me learning the ropes of electron, but I'm fairly well-versed in HTML/CSS/JS, and things are coming along quite well! + +> For **downloads**, have a look at [releases](https://github.com/WubzyGD/FileKade/releases). ([git.wubzy.xyz](https://git.wubzy.xyz/Wubzy/FileKade/releases)), or build from source. Just `git clone`, `npm i` and `npm i -g electron`, then `npm start` + +## Features + +FileKade has *loads* of fun features that most file explorers don't have. Well, it will, at least. + +### Current + +- The basics. You can explore files :p +- Sports a highly aesthetic background and theme +- Fun, clean animations and moving gradients +- Intuitive and speedy keybinds +- Clean code that works with you and your changes both in and out of the app + +_yeah listen it's not super powerful yet \*cough* we **are** in alpha_ + +### Planned + +- A sidebar to quickly access your most-used folders + - Possibly folders to really organize your favorite places? + - Maybe some user-set icons, too +- Loads of settings + - Custom backgrounds + - Custom colors +- In-app file-viewers and maybe even editors +- Integration with apps like Windows terminal and Visual Studio Code + +## Contribution + +Want to contribute to FileKade? **Awesome!** + +Fork and make a PR. I'm not going to burst a blood vessel over formatters or anything like that; just a hobbyist making something fun, so if you have something you want to add, don't be shy at all to add it! + +## Acknowledgements/Other + +*Notice*: FileKade is a project currently in its **Alpha** state. Everything is temporary and nothing is bug-free (theoretically). Certainly don't rely on this file explorer as your main driver or anything. Linux support is currently minimal at best, and MacOS is entirely untested and likely to break. + +This project was heavily inspired by [Xplorer](https://github.com/kimlimjustin/xplorer). Its current file icons were taken from that app, because again, this project is not intended to be public at the current moment. In other words, you're free to use FileKade, but don't shoot me for the icons :3 + +I'd also like to thank [JetBrains](https://jetbrains.com) for their open source license. I use [WebStorm](https://www.jetbrains.com/webstorm) religiously, and it's been an immense help and a wonderful IDE that I'm happy to call my main JS/HTML IDE. \ No newline at end of file From 0e7414d8cce8e9b5aa004d825950db9c041224c0 Mon Sep 17 00:00:00 2001 From: WubzyGD Date: Fri, 21 Jan 2022 18:18:02 -0700 Subject: [PATCH 2/8] lots of new keybinds --- json/shortcuts.json | 8 ++++++-- scripts/contextmenu/refresh.js | 1 + scripts/keybinds/renderer/changeascend.js | 1 + scripts/keybinds/renderer/changesort.js | 1 + scripts/keybinds/renderer/refresh.js | 1 + 5 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 scripts/keybinds/renderer/changeascend.js create mode 100644 scripts/keybinds/renderer/changesort.js create mode 100644 scripts/keybinds/renderer/refresh.js diff --git a/json/shortcuts.json b/json/shortcuts.json index c626df6..f665da2 100755 --- a/json/shortcuts.json +++ b/json/shortcuts.json @@ -1,10 +1,14 @@ { "process": { - "ctrl+r": "reload", + "ctrl+shift+r": "reload", "command+r": "reload", "ctrl+shift+i": "devtool" }, "renderer": { - "ctrl+n": "newfolder" + "ctrl+n": "newfolder", + "ctrl+r": "refresh", + "alt+a": "changeascend", + "alt+s": "changesort", + "alt+t": "changesort" } } \ No newline at end of file diff --git a/scripts/contextmenu/refresh.js b/scripts/contextmenu/refresh.js index fcffe9e..4f38815 100755 --- a/scripts/contextmenu/refresh.js +++ b/scripts/contextmenu/refresh.js @@ -1,3 +1,4 @@ module.exports = () => { + require('../toast/createtoast')("Refresh", "View refreshed!"); require('../fileview/lightrefresh')(window.kade.cpath); }; \ No newline at end of file diff --git a/scripts/keybinds/renderer/changeascend.js b/scripts/keybinds/renderer/changeascend.js new file mode 100644 index 0000000..06e2846 --- /dev/null +++ b/scripts/keybinds/renderer/changeascend.js @@ -0,0 +1 @@ +module.exports = () => {require('../../buttons/changeascend')();}; \ No newline at end of file diff --git a/scripts/keybinds/renderer/changesort.js b/scripts/keybinds/renderer/changesort.js new file mode 100644 index 0000000..87b6b7b --- /dev/null +++ b/scripts/keybinds/renderer/changesort.js @@ -0,0 +1 @@ +module.exports = () => {require('../../buttons/changesort')();}; \ No newline at end of file diff --git a/scripts/keybinds/renderer/refresh.js b/scripts/keybinds/renderer/refresh.js new file mode 100644 index 0000000..94b16f0 --- /dev/null +++ b/scripts/keybinds/renderer/refresh.js @@ -0,0 +1 @@ +module.exports = () => {require('../../contextmenu/refresh')();}; \ No newline at end of file From bc65dd35bcc10dbfca3f7f01e280df6a2bc5560c Mon Sep 17 00:00:00 2001 From: WubzyGD Date: Fri, 21 Jan 2022 18:20:17 -0700 Subject: [PATCH 3/8] 1.4.3 -> New keybinds --- json/changelogs/1.4.3.json | 1 + package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) create mode 100644 json/changelogs/1.4.3.json diff --git a/json/changelogs/1.4.3.json b/json/changelogs/1.4.3.json new file mode 100644 index 0000000..9fead2c --- /dev/null +++ b/json/changelogs/1.4.3.json @@ -0,0 +1 @@ +{"log":{"Keybinds":["Ctrl+R: Now does a refresh instead of reload","Ctrl+Shift+R: Does a hard reload instead","Alt+A: Switches between ascending and descending","Alt+S or Alt+T: Changes sorting type"]},"version":{"name":"Alpha","semver":"1.4.3"}} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index a6c8687..bf89c9e 100755 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "filekade", - "version": "1.4.2", + "version": "1.4.3", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "filekade", - "version": "1.4.2", + "version": "1.4.3", "license": "ISC", "dependencies": { "chalk": "^4.1.2", diff --git a/package.json b/package.json index 6c5ce74..4b9dd6b 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "filekade", - "version": "1.4.2", + "version": "1.4.3", "description": "A file explorer (primarily a learning experience for me)", "main": "main.js", "scripts": { From 2d20c2a479608179df15c402f8bf622c49e305a7 Mon Sep 17 00:00:00 2001 From: WubzyGD Date: Fri, 21 Jan 2022 18:42:53 -0700 Subject: [PATCH 4/8] toast has timers so it doesn't burn :D --- scripts/toast/createtoast.js | 18 ++++++++++++++---- scripts/toast/removetoast.js | 2 +- styles/toast.css | 21 ++++++++++++++++++++- 3 files changed, 35 insertions(+), 6 deletions(-) diff --git a/scripts/toast/createtoast.js b/scripts/toast/createtoast.js index 29e5073..19d0a41 100755 --- a/scripts/toast/createtoast.js +++ b/scripts/toast/createtoast.js @@ -1,6 +1,6 @@ const removeToast = require('./removetoast'); -module.exports = (name, text, bg = '#a172a6', persistOnClick = false, time = 5, onclick = () => {}, selectable = false) => { +module.exports = (name, text, bg = '#a172a6', persistOnClick = false, time = 5, onclick = () => {}, selectable = false, timerColor='#ddddddb2') => { if (!name || !text) {return;} if (!Array.isArray(text)) {text = [text];} let toast = document.createElement('div'); @@ -10,6 +10,8 @@ module.exports = (name, text, bg = '#a172a6', persistOnClick = false, time = 5, toast.classList.add('toast-entering'); toast.onmouseenter = () => {toast.style.backgroundColor = bg;}; toast.onmouseleave = () => {toast.style.backgroundColor = `${bg}c2`;}; + let toastWrap = document.createElement('div'); + toastWrap.className = 'toast-wrapper'; let continueTimeout = true; toast.onclick = () => { if (!persistOnClick) { @@ -19,18 +21,26 @@ module.exports = (name, text, bg = '#a172a6', persistOnClick = false, time = 5, onclick(); }; document.getElementById('toast-container').appendChild(toast); + toast.appendChild(toastWrap); let h2 = document.createElement('h2'); h2.innerHTML = name; if (!selectable) {h2.className = 'nosel';} - toast.appendChild(h2); + toastWrap.appendChild(h2); for (let i = 0; i < text.length; i++) { if (text[i].length) { let p = document.createElement('p'); p.innerHTML = text[i]; if (!selectable) {p.className = 'nosel';} - toast.appendChild(p); + toastWrap.appendChild(p); } - else {toast.appendChild(document.createElement('br'));} + else {toastWrap.appendChild(document.createElement('br'));} } + let timer = document.createElement('div'); + timer.className = 'toast-timer'; + timer.style.backgroundColor = timerColor; + timer.style.animation = `toast-timer ${time}s linear`; + toastWrap.appendChild(timer); + //toast.onmouseenter = () => {timer.style.animationPlayState = 'paused';}; + //toast.onmouseleave = () => {timer.style.animationPlayState = 'normal';}; setTimeout(() => {if (continueTimeout) {removeToast(toast);}}, time * 1000); }; \ No newline at end of file diff --git a/scripts/toast/removetoast.js b/scripts/toast/removetoast.js index 46fe48e..422c6ae 100755 --- a/scripts/toast/removetoast.js +++ b/scripts/toast/removetoast.js @@ -1,5 +1,5 @@ module.exports = (toast) => { toast.classList.remove('toast-entering'); toast.classList.add('toast-leaving'); - toast.onanimationend = () => {toast.remove();}; + setTimeout(() => {toast.onanimationend = () => {toast.remove();};}, 100); }; \ No newline at end of file diff --git a/styles/toast.css b/styles/toast.css index 16500d4..c024673 100755 --- a/styles/toast.css +++ b/styles/toast.css @@ -19,6 +19,11 @@ } } +@keyframes toast-timer { + to {width: 100%;} + from {width: 0;} +} + #toast-container { position: fixed; top: 34px; @@ -38,7 +43,7 @@ color: white; animation: enter-toast .25s ease-out 1; animation-fill-mode: both; - padding: 4px 6px; + padding: 0 0; border-color: #a172a6c2; border-style: solid; border-width: 1px; @@ -68,4 +73,18 @@ font-size: 20px; font-family: 'Nunito', sans-serif; margin: 6px 0 2px 8px; +} + +.toast-timer { + height: 5px; + position: absolute; + bottom: 0; + left: 0; +} + +.toast-wrapper { + padding: 4px 6px; + position: relative; + max-height: inherit; + height: inherit; } \ No newline at end of file From 8ee91f9acb5aab33d5dc8761c137e00ef276c648 Mon Sep 17 00:00:00 2001 From: WubzyGD Date: Fri, 21 Jan 2022 19:18:57 -0700 Subject: [PATCH 5/8] 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 From 9c3d43513e0985b17c912398af190f5ed5b08a95 Mon Sep 17 00:00:00 2001 From: WubzyGD Date: Fri, 21 Jan 2022 19:20:03 -0700 Subject: [PATCH 6/8] 1.4.4 -> Toast timers --- json/changelogs/1.4.4.json | 1 + package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) create mode 100644 json/changelogs/1.4.4.json diff --git a/json/changelogs/1.4.4.json b/json/changelogs/1.4.4.json new file mode 100644 index 0000000..d825ae8 --- /dev/null +++ b/json/changelogs/1.4.4.json @@ -0,0 +1 @@ +{"log":{"Toasts":["Toasts now have moving timers","They'll soon pause on hover. (Soon:tm:)"]},"version":{"name":"Alpha","semver":"1.4.4"}} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index bf89c9e..b6a2f65 100755 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "filekade", - "version": "1.4.3", + "version": "1.4.4", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "filekade", - "version": "1.4.3", + "version": "1.4.4", "license": "ISC", "dependencies": { "chalk": "^4.1.2", diff --git a/package.json b/package.json index 4b9dd6b..0b1f718 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "filekade", - "version": "1.4.3", + "version": "1.4.4", "description": "A file explorer (primarily a learning experience for me)", "main": "main.js", "scripts": { From c9ae623c084a29fc3c3275d6150abc335cadaab9 Mon Sep 17 00:00:00 2001 From: WubzyGD Date: Fri, 21 Jan 2022 19:23:25 -0700 Subject: [PATCH 7/8] 1.5.0 -> Bring sidebar into prod --- json/changelogs/1.5.0.json | 1 + package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) create mode 100644 json/changelogs/1.5.0.json diff --git a/json/changelogs/1.5.0.json b/json/changelogs/1.5.0.json new file mode 100644 index 0000000..30da064 --- /dev/null +++ b/json/changelogs/1.5.0.json @@ -0,0 +1 @@ +{"log":{"Sidebar":["There's now a sidebar! :D","The sidebar properly flows with other elements. Have to add this as a changelog cause it took some love","There are some default quick access buttons for Windows","The quick access buttons do in fact work"]},"version":{"name":"Alpha","semver":"1.5.0"}} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index b6a2f65..2783343 100755 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "filekade", - "version": "1.4.4", + "version": "1.5.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "filekade", - "version": "1.4.4", + "version": "1.5.0", "license": "ISC", "dependencies": { "chalk": "^4.1.2", diff --git a/package.json b/package.json index 0b1f718..b2ffed8 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "filekade", - "version": "1.4.4", + "version": "1.5.0", "description": "A file explorer (primarily a learning experience for me)", "main": "main.js", "scripts": { From 0a21a13b17da805c9e3010eb938c04b6ab180794 Mon Sep 17 00:00:00 2001 From: WubzyGD Date: Fri, 21 Jan 2022 19:43:00 -0700 Subject: [PATCH 8/8] 1.5.1 -> Fix changelogs in prod --- json/changelogs/1.5.1.json | 1 + package-lock.json | 4 ++-- package.json | 2 +- scripts/startup/changelog.js | 3 ++- 4 files changed, 6 insertions(+), 4 deletions(-) create mode 100644 json/changelogs/1.5.1.json diff --git a/json/changelogs/1.5.1.json b/json/changelogs/1.5.1.json new file mode 100644 index 0000000..0115736 --- /dev/null +++ b/json/changelogs/1.5.1.json @@ -0,0 +1 @@ +{"log":{"Bugs":["Changelogs work in production","My brain is quite small yes yes","Hope this doesn't break anything else *shrug*"]},"version":{"name":"Alpha","semver":"1.5.1"}} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 2783343..7d7c1f1 100755 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "filekade", - "version": "1.5.0", + "version": "1.5.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "filekade", - "version": "1.5.0", + "version": "1.5.1", "license": "ISC", "dependencies": { "chalk": "^4.1.2", diff --git a/package.json b/package.json index b2ffed8..7cbb3c8 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "filekade", - "version": "1.5.0", + "version": "1.5.1", "description": "A file explorer (primarily a learning experience for me)", "main": "main.js", "scripts": { diff --git a/scripts/startup/changelog.js b/scripts/startup/changelog.js index 22f9b7e..36a80a0 100755 --- a/scripts/startup/changelog.js +++ b/scripts/startup/changelog.js @@ -1,10 +1,11 @@ const fs = require('fs'); const Mousetrap = require('../dep/mousetrap'); +const path = require('path'); const preModal = require('../modal/pre'); const postModal = require('../modal/post'); -const changelogs = fs.readdirSync('./json/changelogs').filter(file => file.endsWith('.json')); +const changelogs = fs.readdirSync(path.join(__dirname, '../../', '/json/changelogs')).filter(file => file.endsWith('.json')); module.exports = () => { if (window.kade.modal) {return;}