From 397cd73dacb658a69865274a852d66d52d07052c Mon Sep 17 00:00:00 2001 From: ThinLiquid Date: Wed, 26 Jul 2023 23:59:24 +0100 Subject: [PATCH 1/3] :sparkles: feature: switch to git versioning --- public/builtin/apps/about.html | 6 +++--- public/builtin/apps/scripts/about.js | 2 +- public/flow.js | 14 +++++++++++--- public/index.js | 25 +++++++++++-------------- src/index.js | 13 +++++++++++++ 5 files changed, 39 insertions(+), 21 deletions(-) diff --git a/public/builtin/apps/about.html b/public/builtin/apps/about.html index 802f8b8e..1065b519 100644 --- a/public/builtin/apps/about.html +++ b/public/builtin/apps/about.html @@ -20,9 +20,9 @@

About FlowOS

-
Version:
-
Designed By: thinliquid
-
Developed By: thinliquid, 1nspird, proudparrot2
+
+

+
Created by thinliquid, 1nspird, proudparrot2


diff --git a/public/builtin/apps/scripts/about.js b/public/builtin/apps/scripts/about.js index 73e7d230..31028884 100644 --- a/public/builtin/apps/scripts/about.js +++ b/public/builtin/apps/scripts/about.js @@ -1,5 +1,5 @@ /* eslint-env browser */ window.onload = () => { - document.querySelector('v').innerText = parent.Flow.version; + document.querySelector('v').innerHTML = `${parent.Flow.version.substring(0, 8)} (${parent.Flow.branch})`; }; \ No newline at end of file diff --git a/public/flow.js b/public/flow.js index 7e673fa1..b597636d 100644 --- a/public/flow.js +++ b/public/flow.js @@ -9,7 +9,7 @@ import apps from './constants/apps.js'; import { WindowManager, WindowInstance } from './wm.js'; export default class FlowInstance { - version = 'v1.0.8-beta'; + version; branch; url; wm = new WindowManager(); #init = false; @@ -17,8 +17,17 @@ export default class FlowInstance { constructor() { registerSW(); + this.setVersion(); } + setVersion = async () => { + const res = await fetch('/ver'); + const data = await res.json(); + this.version = data.hash; + this.branch = data.branch; + this.url = data.url; + }; + boot = async () => { document.querySelector('.boot').style.opacity = 0; setTimeout(() => { @@ -37,8 +46,7 @@ export default class FlowInstance { this.apps.register(); this.hotkeys.register(); - for (let i = 0; i < config.settings.get('modules').urls.length; i++) { - const url = config.settings.get('modules').urls[i]; + for (const url of config.settings.get('modules').urls) { const module = await import(url); await this.bar.add(module.default); } diff --git a/public/index.js b/public/index.js index 1069983e..2feb5e03 100644 --- a/public/index.js +++ b/public/index.js @@ -25,10 +25,8 @@ self.logger = new Logger(); window.onload = () => { registerSettings(); - switch (config.settings.get('search').proxy) { - case 'Ultraviolet': - self.currentProxy = __uv$config; - break; + if (config.settings.get('search').proxy === 'Ultraviolet') { + self.currentProxy = __uv$config; } useCustomCSS(); @@ -36,15 +34,14 @@ window.onload = () => { window.Flow.boot(); }; -document.querySelector('.searchbar').onkeyup = () => { - const input = document.querySelector('.searchbar').value.toLowerCase(); - let x = Array.from(document.querySelector('ul.apps').children); +const searchBar = document.querySelector('.searchbar'); +const appsList = document.querySelector('ul.apps'); - x.forEach((item) => { - if (!item.innerText.toLowerCase().includes(input)) { - item.style.display = 'none'; - } else { - item.style.display = 'flex'; - } +searchBar.addEventListener('keyup', () => { + const input = searchBar.value.toLowerCase(); + const apps = Array.from(appsList.children); + + apps.forEach((item) => { + item.style.display = item.innerText.toLowerCase().includes(input) ? 'flex' : 'none'; }); -}; +}); \ No newline at end of file diff --git a/src/index.js b/src/index.js index 08ce4551..c5cad35a 100644 --- a/src/index.js +++ b/src/index.js @@ -9,6 +9,9 @@ import { uvPath } from '@proudparrot2/uv'; import { createServer } from 'http'; import fs from 'fs'; +import Module from 'node:module'; +const require = Module.createRequire(import.meta.url); + import ai from './ai.js'; const port = process.env.PORT || 3000; @@ -72,6 +75,16 @@ app.get('/uv/uv.config.js', (req, res) => { res.type('text/javascript').send(fs.readFileSync(`${publicPath}/uv/uv.config.js`)); }); +app.get('/ver', (req, res) => { + require('child_process').exec('git rev-parse HEAD', (err1, hash) => { + require('child_process').exec('git branch --show-current', (err2, branch) => { + require('child_process').exec('git ls-remote --get-url', (err3, url) => { + res.type('application/json').send({ hash: hash.replace(/\n/g, ''), branch: branch.replace(/\n/g, ''), url: url.replace(/\n/g, '') }); + }); + }); + }); +}); + process.on('SIGINT', shutdown); process.on('SIGTERM', shutdown); From 546d68d2760b5f480c62c09abc9cada2532a44be Mon Sep 17 00:00:00 2001 From: ThinLiquid Date: Wed, 26 Jul 2023 23:59:56 +0100 Subject: [PATCH 2/3] :adhesive_bandage: fix: fullscreen animation --- public/styles/style.css | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/public/styles/style.css b/public/styles/style.css index 48c53d43..f8e7f2e6 100644 --- a/public/styles/style.css +++ b/public/styles/style.css @@ -196,7 +196,7 @@ body { background: transparent; border-radius: 10px; outline: 2px solid transparent; - transition: outline 1s cubic-bezier(0, 0, 0, 1); + transition: width .3s, height .3s, left .3s, top .3s, outline 1s cubic-bezier(0, 0, 0, 1); } .winbox.focus { @@ -209,12 +209,18 @@ body { .wb-header { border-radius: 10px 10px 0 0; + transition: border-radius .3s; +} + +.max .wb-header, .max .wb-body { + border-radius: 0; } .wb-body { backdrop-filter: blur(20px); border-radius: 0 0 10px 10px; background: transparent; + transition: border-radius .3s; } .winbox iframe { @@ -233,6 +239,7 @@ body { padding: 10px; flex-direction: row; align-items: center; + z-index: 1000; } .taskbar-item { From 591b4d1a1d8389f862ae8908c242d36bd0e44c5e Mon Sep 17 00:00:00 2001 From: ThinLiquid Date: Thu, 27 Jul 2023 00:02:45 +0100 Subject: [PATCH 3/3] :bookmark: tags: v1.0.9-beta --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c1d4d02e..5a6138bf 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "flow-os", - "version": "1.0.8-beta", + "version": "1.0.9-beta", "description": "The customizable webOS.", "keywords": [ "tomp",