Skip to content

Commit

Permalink
Merge pull request #68 from Flow-Works/dev
Browse files Browse the repository at this point in the history
🔖 tags: v1.0.8-beta
  • Loading branch information
ThinLiquid authored Jul 26, 2023
2 parents 03d2437 + 88bc618 commit fbe2ab0
Show file tree
Hide file tree
Showing 14 changed files with 3,131 additions and 3,356 deletions.
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "flow-os",
"version": "1.0.7-beta",
"version": "1.0.8-beta",
"description": "The customizable webOS.",
"keywords": [
"tomp",
Expand All @@ -22,7 +22,6 @@
"@fastify/express": "^2.3.0",
"@fastify/static": "^6.10.2",
"@proudparrot2/uv": "^2.0.0",
"@sysce/stomp": "^2.0.0",
"@tomphttp/bare-server-node": "^2.0.1",
"dotenv": "^16.3.1",
"express": "^4.18.2",
Expand Down
6 changes: 3 additions & 3 deletions public/builtin/apps/scripts/app-wizard.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Object.values(config.customApps.get()).forEach((data) => {
delete obj[data.APP_ID];
config.customApps.set(obj);
window.location.reload();
parent.document.querySelector('.app-switcher .apps').innerHTML = '';
parent.document.querySelector('.spotlight .apps').innerHTML = '';
parent.Flow.apps.register();
};

Expand Down Expand Up @@ -72,7 +72,7 @@ document.querySelector('.url').onsubmit = async () => {
obj[data.APP_ID] = data;
config.customApps.set(obj);
window.location.reload();
parent.document.querySelector('.app-switcher .apps').innerHTML = '';
parent.document.querySelector('.spotlight .apps').innerHTML = '';
parent.Flow.apps.register();
};

Expand All @@ -84,6 +84,6 @@ document.querySelector('.json').onsubmit = () => {
obj[data.APP_ID] = data;
config.customApps.set(obj);
window.location.reload();
parent.document.querySelector('.app-switcher .apps').innerHTML = '';
parent.document.querySelector('.spotlight .apps').innerHTML = '';
parent.Flow.apps.register();
};
2 changes: 1 addition & 1 deletion public/builtin/apps/scripts/apps.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ import('https://flow-works.github.io/appstore/apps.js').then((appStore) => {
}
config.apps.set(obj);
window.location.reload();
parent.document.querySelector('.app-switcher .apps').innerHTML = '';
parent.document.querySelector('.spotlight .apps').innerHTML = '';
parent.Flow.apps.register();
};

Expand Down
31 changes: 13 additions & 18 deletions public/builtin/apps/scripts/browser.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/* eslint-env browser */

import { config } from '../../../scripts/managers.js';
import '/stomp/bootstrapper.js';

const input = document.querySelector('input');

Expand Down Expand Up @@ -146,28 +145,24 @@ const handleTab = (tab, titleBtn, img) => {
injectJS(tab, url, false, () => {});
});

if (proxyConfig.proxyName !== 'stomp') {
injectJS(tab, 'https://cdn.jsdelivr.net/npm/eruda', true, () => {
injectJS(tab, 'https://cdn.jsdelivr.net/npm/eruda-code', true, () => {
tab.contentWindow.eruda.add(tab.contentWindow.erudaCode);
});
injectJS(tab, 'https://cdn.jsdelivr.net/npm/eruda', true, () => {
injectJS(tab, 'https://cdn.jsdelivr.net/npm/eruda-code', true, () => {
tab.contentWindow.eruda.add(tab.contentWindow.erudaCode);
});

tab.contentWindow.eruda.init({ tool: ['console', 'elements', 'code', 'sources'] });
tab.contentWindow.eruda._entryBtn.hide();
tab.contentWindow.eruda.init({ tool: ['console', 'elements', 'code', 'sources'] });
tab.contentWindow.eruda._entryBtn.hide();

document.querySelector('.eruda').onclick = () => {
if (open == false) {
document.querySelector('.eruda').onclick = () => {
if (open == false) {
tab.contentWindow.eruda.show();
} else {
} else {
tab.contentWindow.eruda.hide();
}
}

open = !open;
};
});
} else {
document.querySelector('.eruda').style.display = 'none';
}
open = !open;
};
});

document.querySelector('.block').onclick = () => {
blockElement(tab);
Expand Down
13 changes: 0 additions & 13 deletions public/builtin/modules/spotlight.js

This file was deleted.

20 changes: 8 additions & 12 deletions public/flow.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import apps from './constants/apps.js';
import { WindowManager, WindowInstance } from './wm.js';

export default class FlowInstance {
version = 'v1.0.7-beta';
version = 'v1.0.8-beta';
wm = new WindowManager();

#init = false;
Expand All @@ -36,8 +36,6 @@ export default class FlowInstance {
if (user) {
this.apps.register();
this.hotkeys.register();
const spotlight = await import('./builtin/modules/spotlight.js');
await this.bar.add(spotlight.default);

for (let i = 0; i < config.settings.get('modules').urls.length; i++) {
const url = config.settings.get('modules').urls[i];
Expand Down Expand Up @@ -69,25 +67,23 @@ export default class FlowInstance {

spotlight = {
add: (app) => {
document.querySelector('.app-switcher .apps').append(app);
document.querySelector('.spotlight .apps').append(app);
},

toggle: async () => {
switch (this.spotlight.state) {
case true:
document.querySelector('.app-switcher').style.opacity = 1;
this.bar.items.spotlight.setText('🔎');
document.querySelector('.app-switcher').style.opacity = 0;
document.querySelector('.spotlight').style.opacity = 1;
document.querySelector('.spotlight').style.opacity = 0;
await sleep(200);
document.querySelector('.app-switcher').style.display = 'none';
document.querySelector('.spotlight').style.display = 'none';
this.spotlight.state = false;
break;
case false:
this.bar.items.spotlight.setText('❌');
document.querySelector('.app-switcher').style.opacity = 0;
document.querySelector('.app-switcher').style.display = 'flex';
document.querySelector('.spotlight').style.opacity = 0;
document.querySelector('.spotlight').style.display = 'flex';
await sleep(200);
document.querySelector('.app-switcher').style.opacity = 1;
document.querySelector('.spotlight').style.opacity = 1;
this.spotlight.state = true;
break;
}
Expand Down
7 changes: 1 addition & 6 deletions public/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-env browser */
/* global __uv$config __stomp$config */
/* global __uv$config */

import Logger from './scripts/logger.js';
import { registerSettings, useCustomCSS, sleep } from './scripts/utilities.js';
Expand All @@ -8,8 +8,6 @@ import { config } from './scripts/managers.js';
import FlowInstance from './flow.js';

import './uv/uv.config.js';
import './stomp/bootstrapper.js';
import './stmp/stomp.js';

window.immortalize = async () => {
console.log('Loading 3MB Tailwind Package...');
Expand All @@ -28,9 +26,6 @@ self.logger = new Logger();
window.onload = () => {
registerSettings();
switch (config.settings.get('search').proxy) {
case 'STomp':
self.currentProxy = __stomp$config;
break;
case 'Ultraviolet':
self.currentProxy = __uv$config;
break;
Expand Down
15 changes: 6 additions & 9 deletions public/os.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,18 +48,15 @@

<div class="bar"></div>

<div class="app-switcher">
<div class="spotlight">
<input class="searchbar" placeholder="Search apps..."/>
<ul class="apps"></ul>
</div>
<!--
<script src="https://cdn.jsdelivr.net/npm/winbox/dist/winbox.bundle.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/hotkeys-js/dist/hotkeys.min.js"></script>
<script src="/scripts/handler.js" defer></script>
<script src="/scripts/classes.js" defer></script>
<script src="/scripts/utils.js" defer></script>
<script src="/uv/uv.config.js" defer></script>
-->

<div class="taskbar">
<img src="/assets/logo.svg" height="25px" onclick="Flow.spotlight.toggle();">
</div>

<script>
;(function () {
var src = '//cdn.jsdelivr.net/npm/eruda';
Expand Down
2 changes: 1 addition & 1 deletion public/scripts/utilities.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export const registerSettings = () => {
new SettingsCategory('search', 'Browser', [
new SettingsInput('url', 'Search Engine URL', 'https://duckduckgo.com', 'https://duckduckgo.com'),
new SettingsTextarea('urls', 'Extension URLs', 'https://mysite.to/script1.js\nhttps://mysite.to/script2.js\nhttps://mysite.to/script3.js', ''),
new SettingsDropdown('proxy', 'Proxy', 'Ultraviolet', ['Ultraviolet', 'STomp'])
new SettingsDropdown('proxy', 'Proxy', 'Ultraviolet', ['Ultraviolet'])
]);

new SettingsCategory('theme', 'Theme', [
Expand Down
28 changes: 0 additions & 28 deletions public/stmp/stomp.js

This file was deleted.

70 changes: 61 additions & 9 deletions public/styles/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@
--boot-bg: black;
}

*, *::before, *::after {
box-sizing: border-box;
}
*, *:before, *:after {
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
}

*, .wb-title {
color: var(--text-color);
Expand All @@ -26,7 +28,7 @@ body {
margin: 0;
}

.app-switcher {
.spotlight {
display: none;
position: absolute;

Expand All @@ -53,15 +55,15 @@ body {
border-radius: 10px;
}

.app-switcher input {
.spotlight input {
padding: 10px;
width: 100%;
border-radius: 10px;
background: var(--desktop-bg);
color: var(--text-color);
}

.app-switcher ul {
.spotlight ul {
display: grid;
grid-template-columns: 1fr 1fr 1fr;
flex-grow: 1;
Expand All @@ -71,7 +73,7 @@ body {
padding: 2px;
}

.app-switcher li {
.spotlight li {
list-style: none;
display: flex;
min-width: 0;
Expand All @@ -83,14 +85,14 @@ body {
outline: 2px solid transparent;
}

.app-switcher li p {
.spotlight li p {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
margin: 0;
}

.app-switcher li:hover {
.spotlight li:hover {
outline: 2px solid var(--primary);
}

Expand Down Expand Up @@ -217,4 +219,54 @@ body {

.winbox iframe {
background: transparent;
}

.taskbar {
height: 50px;
position: absolute;
bottom: 0;
left: 0;
width: 100%;
background: var(--window-bg);
display: flex;
gap: 10px;
padding: 10px;
flex-direction: row;
align-items: center;
}

.taskbar-item {
border-radius: 10px;
display: flex;
align-items: center;
flex: 1;
padding: 10px;
background: var(--surface-bg);
transition: all .4s cubic-bezier(1, 0, 1, 0);
gap: 10px;
text-overflow: ellipsis;
overflow: hidden;
}

.taskbar-item.new-item {
flex: .00001;
animation: flexGrow .4s ease forwards;
}

.taskbar-item.remove-item {
flex: 1;
animation: flexShrink .4s ease forwards;
}

@keyframes flexShrink {
to {
flex: .01;
flex: .00001;
}
}

@keyframes flexGrow {
to {
flex: 1;
}
}
Loading

0 comments on commit fbe2ab0

Please sign in to comment.