diff --git a/assets/Nunito-VariableFont_wght.ttf b/assets/Nunito-VariableFont_wght.ttf new file mode 100644 index 0000000..edc20b8 Binary files /dev/null and b/assets/Nunito-VariableFont_wght.ttf differ diff --git a/index.html b/index.html index b9105fd..8141761 100644 --- a/index.html +++ b/index.html @@ -7,6 +7,7 @@ + FileKade @@ -33,6 +34,35 @@ +
+
+
+

New Folder

+
+
+
+
+
+

Sort by: Name

+
+
+

Order: Ascending

+
+
+
+
+
+

Reload

+
+
+

Refresh

+
+
+

Options

+
+
+
+ diff --git a/main.js b/main.js index 8f7bfd5..95775c6 100644 --- a/main.js +++ b/main.js @@ -17,7 +17,7 @@ async function createWindow () { }, titleBarStyle: "hidden", //titleBarOverlay: true, - }) + }); // and load the index.html of the app. mainWindow.maximize(); diff --git a/scripts/contextmenu/createcontext.js b/scripts/contextmenu/createcontext.js new file mode 100644 index 0000000..fab7b20 --- /dev/null +++ b/scripts/contextmenu/createcontext.js @@ -0,0 +1,7 @@ +module.exports = (e, target, window) => { + window.kade.context = true; + let ctx = document.getElementById('ctx'); + ctx.style.left = `${e.pageX}px`; + ctx.style.top = `${e.pageY}px`; + ctx.style.display = 'block'; +}; \ No newline at end of file diff --git a/scripts/contextmenu/hidecontext.js b/scripts/contextmenu/hidecontext.js new file mode 100644 index 0000000..6d677e0 --- /dev/null +++ b/scripts/contextmenu/hidecontext.js @@ -0,0 +1,4 @@ +module.exports = (window) => { + document.getElementById('ctx').style.display = 'none'; + window.kade.context = false; +}; \ No newline at end of file diff --git a/scripts/fileview/load/render.js b/scripts/fileview/load/render.js index 22aaa5c..2123310 100644 --- a/scripts/fileview/load/render.js +++ b/scripts/fileview/load/render.js @@ -1,6 +1,7 @@ const loadHierarchy = require("../hierarchy"); const isOverflowing = require('../../dep/overflowing'); +const refresh = require("../refresh"); module.exports = (dir) => { const refresh = require("../refresh"); @@ -20,6 +21,12 @@ module.exports = (dir) => { if (window.kade.cl) {window.kade.cl.classList.remove('file-active');} window.kade.cl = cfc; }; + cfc.oncontextmenu = function () { + window.kade.elc = true; + if (!cfc.classList.contains('file-active')) {cfc.classList.add('file-active');} + if (window.kade.cl) {window.kade.cl.classList.remove('file-active');} + window.kade.cl = cfc; + }; cfc.style = `animation-delay: ${num * .03}s`; cfc.onanimationend = () => { cfc.style = ''; diff --git a/scripts/startup/preload.js b/scripts/startup/preload.js index 1bac7e7..4f7b889 100644 --- a/scripts/startup/preload.js +++ b/scripts/startup/preload.js @@ -1,6 +1,7 @@ const os = require('os'); const setButtons = require('./setbuttons'); +const hideContext = require('../contextmenu/hidecontext'); window.addEventListener('DOMContentLoaded', () => { window.kade = {}; @@ -9,6 +10,7 @@ window.addEventListener('DOMContentLoaded', () => { window.kade.cpath = ''; window.kade.sort = 'Name'; window.kade.ascend = true; + window.kade.context = false; const startDir = `${os.homedir}\\Desktop`; @@ -20,12 +22,19 @@ window.addEventListener('DOMContentLoaded', () => { if (window.kade.elc) {window.kade.elc = false; return;} if (window.kade.cl) {window.kade.cl.classList.remove('file-active');} }, 100); + if (window.kade.context) {hideContext(window);} } + document.getElementById('ctx').style.display = 'none'; + require('../keybinds/handleKey')(); }); window.addEventListener('contextmenu', e => { e.preventDefault(); - + require('../contextmenu/createcontext')(e, e.target, window); + setTimeout(function () { + if (window.kade.elc) {window.kade.elc = false; return;} + if (window.kade.cl) {window.kade.cl.classList.remove('file-active');} + }, 100); }); \ No newline at end of file diff --git a/styles/context.css b/styles/context.css new file mode 100644 index 0000000..cd800fb --- /dev/null +++ b/styles/context.css @@ -0,0 +1,35 @@ +#ctx { + font-family: 'Nunito', sans-serif; + font-size: 16px; + color: #d4d4d4; + border-radius: 7px 7px; + position: absolute; + background-color: #101010df; + padding: 7px 5px; + border: 1px solid #af2188a4; +} + +#ctx hr { + margin: 4px 5px; + border-color: #f3f3f3ca; +} + +.ctx-item p {margin: 0 0; padding: 0 0;} + +.ctx-item { + cursor: pointer; + border-radius: 3px; + transition: background-color .1s ease-in; + margin: 0 0; + padding: 4px; +} +.ctx-item:hover {background-color: #90909049;} + +.ctx-group { + display: flex; + flex-direction: column; + justify-content: space-between; + align-items: stretch; + align-content: stretch; + row-gap: 2px; +} \ No newline at end of file diff --git a/styles/styles.css b/styles/styles.css index edf1c61..3532bc9 100644 --- a/styles/styles.css +++ b/styles/styles.css @@ -54,6 +54,7 @@ body { overflow: hidden; background-color: #0000006d; z-index: 1; + -webkit-app-region: drag; } .nosel {-webkit-user-select: none;} \ No newline at end of file