From 4b2724d2f928549e59a9be9f8ac896115dbe07e5 Mon Sep 17 00:00:00 2001 From: Parrot Date: Tue, 17 Oct 2023 13:35:55 +0000 Subject: [PATCH 01/10] =?UTF-8?q?[=F0=9F=92=84]=20Add=20battery=20emoji=20?= =?UTF-8?q?to=20battery=20module?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/battery.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/battery.ts b/src/modules/battery.ts index dce3252..3909381 100644 --- a/src/modules/battery.ts +++ b/src/modules/battery.ts @@ -9,5 +9,5 @@ export const run = (element: HTMLDivElement): void => { element.style.alignItems = 'center' element.style.paddingLeft = '15px' element.style.paddingRight = '15px' - element.innerHTML = '100%' + element.innerHTML = '๐Ÿ”‹ 100%' } From 86d2958a824fe1869412175b27b7eeef713f281f Mon Sep 17 00:00:00 2001 From: Parrot Date: Tue, 17 Oct 2023 13:36:45 +0000 Subject: [PATCH 02/10] =?UTF-8?q?[=F0=9F=92=84]=20Add=20gradient=20to=20la?= =?UTF-8?q?uncher=20button?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/style.less | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/src/style.less b/src/style.less index 6e19dd6..73be354 100644 --- a/src/style.less +++ b/src/style.less @@ -11,7 +11,12 @@ --crust: #11111b; } -body, html { +.bx-category { + color: #181926; +} + +body, +html { background-color: var(--crust); width: 100vw; @@ -25,7 +30,6 @@ body, html { overflow: hidden; } - *::-webkit-scrollbar { display: none; } @@ -34,7 +38,7 @@ body, html { -ms-overflow-style: none; scrollbar-width: none; - font-family: 'Satoshi', sans-serif; + font-family: "Satoshi", sans-serif; font-weight: 600; color: var(--text); @@ -50,12 +54,17 @@ toolbar { margin: 0 0 0 0; justify-content: center; + div[data-toolbar-id="appview"] { + background: rgb(150, 181, 246); + background: linear-gradient(45deg, rgba(150, 181, 246, 1) 0%, rgba(150, 181, 246, 1) 12%, rgba(77, 129, 236, 1) 100%); + color: black; + } & > div { background: var(--base); padding: 5px; border-radius: 5px; box-shadow: 0 10px 10px rgba(0, 0, 0, 0.1), 0 0px 10px rgba(0, 0, 0, 0.1); - height: 40px!important; + height: 40px !important; display: flex; app { @@ -80,7 +89,6 @@ window-area { margin-bottom: 20px; height: 100%; overflow: hidden; - window { background: var(--base); @@ -91,8 +99,8 @@ window-area { overflow: hidden; border: 1px solid rgba(255, 255, 255, 0.2); background: var(--crust); - transition: .2s opacity, .2s width, .2s height; - + transition: 0.2s opacity, 0.2s width, 0.2s height; + window-header { height: 20px; padding: 7.5px; @@ -106,7 +114,7 @@ window-area { border-radius: 40%; } } - + window-content { height: 100%; border-radius: 10px 10px 0 0; @@ -132,7 +140,7 @@ launcher { width: 100vw; height: calc(100vh + 20px); gap: 20px; - transition: .2s opacity, .2s backdrop-filter; + transition: 0.2s opacity, 0.2s backdrop-filter; apps { max-height: 70vh; @@ -167,11 +175,11 @@ launcher { width: 300px; max-width: 100vw; text-align: center; - transition: border .2s; + transition: border 0.2s; &:focus { outline: none; border: 2px solid var(--text); } } -} \ No newline at end of file +} From f46558038800977a6f9818ee5f9e13aa3cd51463 Mon Sep 17 00:00:00 2001 From: Parrot Date: Tue, 17 Oct 2023 13:39:10 +0000 Subject: [PATCH 03/10] =?UTF-8?q?[=F0=9F=90=9B]=20Fixed=20weird=20margin?= =?UTF-8?q?=20in=20the=20launcher?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/style.less | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/style.less b/src/style.less index 73be354..9efce8c 100644 --- a/src/style.less +++ b/src/style.less @@ -137,10 +137,12 @@ launcher { top: 0; background: rgba(0, 0, 0, 0.5); z-index: 99999999999999999999999; - width: 100vw; + width: calc(100vw + 20px); height: calc(100vh + 20px); gap: 20px; transition: 0.2s opacity, 0.2s backdrop-filter; + margin: 0; + left: 0; apps { max-height: 70vh; From 86cc529c24c153263a0ef0e0f956d4bdd9606a69 Mon Sep 17 00:00:00 2001 From: Parrot Date: Tue, 17 Oct 2023 13:52:09 +0000 Subject: [PATCH 04/10] =?UTF-8?q?[=E2=9C=A8]=20Added=20eruda=20debug=20(?= =?UTF-8?q?=3Fdebug=3Dtrue)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package-lock.json | 6 ++++++ package.json | 1 + src/index.ts | 13 +++++++++++-- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index bbfd532..2667fe3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,6 +10,7 @@ "license": "MIT", "dependencies": { "@ptkdev/logger": "^1.8.0", + "eruda": "^3.0.1", "filer": "^1.4.1", "prism-code-editor": "^1.2.2", "prismjs": "^1.29.0", @@ -1846,6 +1847,11 @@ "is-arrayish": "^0.2.1" } }, + "node_modules/eruda": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/eruda/-/eruda-3.0.1.tgz", + "integrity": "sha512-6q1Xdwga4JTr1mKSW4mzuWSSbmXgqpm/8Wa1QGFGfCWRjC0bCQjbS4u06M1te1moucIS3hBLlbSTPWYH2W0qbQ==" + }, "node_modules/es-abstract": { "version": "1.22.2", "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.22.2.tgz", diff --git a/package.json b/package.json index d91f9ff..2283b5d 100644 --- a/package.json +++ b/package.json @@ -21,6 +21,7 @@ }, "dependencies": { "@ptkdev/logger": "^1.8.0", + "eruda": "^3.0.1", "filer": "^1.4.1", "prism-code-editor": "^1.2.2", "prismjs": "^1.29.0", diff --git a/src/index.ts b/src/index.ts index ea1346d..a6201d0 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,7 +1,7 @@ import './style.less' -import StatusBar from './statusbar.ts' -import WM from './wm.ts' +import StatusBar from './statusbar' +import WM from './wm' import * as fs from 'fs' @@ -16,3 +16,12 @@ declare global { window.statusBar = new StatusBar() window.wm = new WM() window.fs = new (window as any).Filer.FileSystem() + +const params = new URLSearchParams(window.location.search) + +async function enableDebug() { + const { default: eruda } = await import("eruda") + eruda.init() +} + +if (params.get("debug")) enableDebug() \ No newline at end of file From 356e18abd280a558e637a879d766a78f8b500a03 Mon Sep 17 00:00:00 2001 From: Parrot Date: Tue, 17 Oct 2023 13:57:15 +0000 Subject: [PATCH 05/10] =?UTF-8?q?[=E2=9A=A1]=20Favicon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.html | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/index.html b/index.html index 6360138..734e681 100644 --- a/index.html +++ b/index.html @@ -1,12 +1,13 @@ - - - - Flow OS - - - - - - \ No newline at end of file + + + + Flow OS + + + + + + + From cd7af324271600080cc1fb42ae8aa6841502c258 Mon Sep 17 00:00:00 2001 From: Parrot Date: Tue, 17 Oct 2023 14:15:26 +0000 Subject: [PATCH 06/10] =?UTF-8?q?[=E2=9A=A1]=20Add=20preview=20script?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 2283b5d..494ea71 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "test": "ts-standard", "dev": "vite", "build": "vite build", - "serve": "vite serve" + "preview": "vite preview" }, "keywords": [], "author": "", From e8521d654615a408d6e3f243b97ab372ce43493b Mon Sep 17 00:00:00 2001 From: ThinLiquid Date: Tue, 17 Oct 2023 22:17:43 +0100 Subject: [PATCH 07/10] =?UTF-8?q?[=F0=9F=94=A8]=20Refactor=20multiple=20fi?= =?UTF-8?q?les?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/apps/editor.ts | 26 +++++++++++--------------- src/apps/files.ts | 8 ++++---- src/statusbar.ts | 17 +++++++++-------- src/wm.ts | 6 +----- 4 files changed, 25 insertions(+), 32 deletions(-) diff --git a/src/apps/editor.ts b/src/apps/editor.ts index 5d3a846..f3643f4 100644 --- a/src/apps/editor.ts +++ b/src/apps/editor.ts @@ -34,7 +34,7 @@ export default class EditorApp implements App { }) if (data != null) { - win.setTitle('Editor - ' + data.path) + win.setTitle(`Editor - ${data.path}`) win.content.style.display = 'flex' win.content.style.flexDirection = 'column' @@ -99,33 +99,29 @@ export default class EditorApp implements App { const fileBtn = win.content.querySelector('#file-open') const editBtn = win.content.querySelector('#edit-open') - const toggleDropdown = function (id: string): void { + const toggleDropdown = (id: string): void => { const el = win.content.querySelector(`#${id}`) el?.classList.toggle('show') } - fileBtn?.addEventListener('click', function (e) { + fileBtn?.addEventListener('click', (e) => { e.stopPropagation() toggleDropdown('file') }) - editBtn?.addEventListener('click', function (e) { + editBtn?.addEventListener('click', (e) => { e.stopPropagation() toggleDropdown('edit') }) - win.content.addEventListener('click', function () { - const file = win.content.querySelector('#file') - const edit = win.content.querySelector('#edit') - if (file !== null) { - if (file.classList.contains('show')) { - toggleDropdown('file') - } + win.content.addEventListener('click', () => { + const file = (win.content.querySelector('#file') as HTMLElement) + const edit = (win.content.querySelector('#edit') as HTMLElement) + if (file.classList.contains('show')) { + toggleDropdown('file') } - if (edit !== null) { - if (edit.classList.contains('show')) { - toggleDropdown('edit') - } + if (edit.classList.contains('show')) { + toggleDropdown('edit') } }) diff --git a/src/apps/files.ts b/src/apps/files.ts index 69ba2ff..91d5b4e 100644 --- a/src/apps/files.ts +++ b/src/apps/files.ts @@ -39,22 +39,22 @@ export default class FilesApp implements App { if (back !== '') { (win.content.querySelector('.back') as HTMLElement).onclick = async () => { if (dir.split('/')[1] === dir.replace('/', '')) { - await setDir('/' + dir.split('/')[0]) + await setDir(`/${dir.split('/')[0]}`) } else { - await setDir('/' + dir.split('/')[1]) + await setDir(`/${dir.split('/')[1]}`) } } } (win.content.querySelector('.file') as HTMLElement).onclick = async () => { const title: string = prompt('Enter file name') ?? 'new-file.txt' - await window.fs.promises.open(dir + '/' + title, 'w') + await window.fs.promises.open(`${dir}/${title}`, 'w') await setDir(dir) } (win.content.querySelector('.folder') as HTMLElement).onclick = async () => { const title: string = prompt('Enter folder name') ?? 'new-folder' - await window.fs.promises.mkdir(dir + '/' + title) + await window.fs.promises.mkdir(`${dir}/${title}`) await setDir(dir) } diff --git a/src/statusbar.ts b/src/statusbar.ts index 3ff1b7c..5111cfc 100644 --- a/src/statusbar.ts +++ b/src/statusbar.ts @@ -27,15 +27,16 @@ class StatusBar { add (item: StatusItem): void { if (this.items.some(x => x.meta.id === item.meta.id)) { console.error(`Unable to register tool; ${item.meta.id} is already registered.`) - } else { - const element = document.createElement('div') - element.setAttribute('data-toolbar-id', item.meta.id) - - this.items.push(item) - this.element.appendChild(element) - - item.run(element) + return } + + const element = document.createElement('div') + element.setAttribute('data-toolbar-id', item.meta.id) + + this.items.push(item) + this.element.appendChild(element) + + item.run(element) } } diff --git a/src/wm.ts b/src/wm.ts index 4e97706..d7da6a4 100644 --- a/src/wm.ts +++ b/src/wm.ts @@ -185,11 +185,7 @@ class WM { const max = Math.max(...indexes) - if (max === -Infinity) { - return 0 - } else { - return max - } + return max === -Infinity ? 0 : max } createWindow (config: FlowWindowConfig): FlowWindow { From b1386e4720813994a60d738cc043ced71fb2d071 Mon Sep 17 00:00:00 2001 From: ThinLiquid Date: Tue, 17 Oct 2023 22:27:01 +0100 Subject: [PATCH 08/10] =?UTF-8?q?[=F0=9F=93=9A]=20Fix=20spelling=20of=20Fl?= =?UTF-8?q?owOS?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index d02afa0..b39f3be 100644 --- a/README.md +++ b/README.md @@ -13,20 +13,20 @@ [![build](https://github.com/Flow-Works/FlowOS-2.0/actions/workflows/build.yml/badge.svg)](https://github.com/Flow-Works/FlowOS-2.0/actions/workflows/build.yml)
- The future of Flow OS + The future of FlowOS
Read the docs ยป
-## What is Flow OS? +## What is FlowOS? -Flow OS is a web OS proxy made for the Titanium Network 2023 Proxathon. It's extremly customizable with an API to make your own apps, themes, and modules. +FlowOS is a web OS proxy made for the Titanium Network 2023 Proxathon. It's extremly customizable with an API to make your own apps, themes, and modules. ## Getting Started -To run Flow OS on your local machine, you need Node.js 16 or above. +To run FlowOS on your local machine, you need Node.js 16 or above. 1. Clone the repository ```bash @@ -44,7 +44,7 @@ npm run serve ## Made with -Flow OS is made with the following software: +FlowOS is made with the following software: * [Filer](https://github.com/filerjs/filer) * [Prism Code Editor](https://github.com/FIameCaster/prism-code-editor) * [Vite](https://vitejs.dev) From 971253a9e1213c060bdf8b50d74478db20d498a1 Mon Sep 17 00:00:00 2001 From: ThinLiquid Date: Tue, 17 Oct 2023 23:01:05 +0100 Subject: [PATCH 09/10] =?UTF-8?q?[=F0=9F=93=87]=20Create=20FUNDING.yml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/FUNDING.yml | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .github/FUNDING.yml diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..6d42574 --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,2 @@ +# These are supported funding model platforms +ko_fi: flowworks From 73530afebd531ab03426591272fa53c37dcff02c Mon Sep 17 00:00:00 2001 From: Parrot Date: Tue, 17 Oct 2023 22:33:46 +0000 Subject: [PATCH 10/10] =?UTF-8?q?[=F0=9F=94=A8]=20Fixing=20ts-standard=20e?= =?UTF-8?q?rrors=20I=20made=20earlier?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/index.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/index.ts b/src/index.ts index a6201d0..24f0676 100644 --- a/src/index.ts +++ b/src/index.ts @@ -19,9 +19,12 @@ window.fs = new (window as any).Filer.FileSystem() const params = new URLSearchParams(window.location.search) -async function enableDebug() { - const { default: eruda } = await import("eruda") +async function enableDebug (): Promise { + const { default: eruda } = await import('eruda') eruda.init() + return await Promise.resolve() } -if (params.get("debug")) enableDebug() \ No newline at end of file +if (params.get('debug') !== null && params.get('debug') !== undefined) { + enableDebug().catch(e => console.error(e)) +}