This commit is contained in:
Neptune6866 2024-07-23 22:41:57 +00:00 committed by GitHub
commit 1276653ad8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 29 additions and 15 deletions

2
.vscode/settings.json vendored Normal file
View file

@ -0,0 +1,2 @@
{
}

View file

@ -3,7 +3,7 @@
<head> <head>
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>FlowOS</title> <title>FlowOS Neo</title>
<link rel="shortcut icon" href="./src/assets/flow.png" type="image/png"> <link rel="shortcut icon" href="./src/assets/flow.png" type="image/png">
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-9675905177363247" crossorigin="anonymous"></script> <script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-9675905177363247" crossorigin="anonymous"></script>
@ -20,5 +20,6 @@
</head> </head>
<body> <body>
<script src="./src/bootloader.ts" type="module"></script> <script src="./src/bootloader.ts" type="module"></script>
<script src="./src/background.js" type="module"></script>
</body> </body>
</html> </html>

BIN
src/assets/background.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

View file

@ -121,7 +121,7 @@ window-area {
height: 100%; height: 100%;
overflow: hidden; overflow: hidden;
margin: 10px; margin: 10px;
window { window {
resize: both; resize: both;
max-width: 100%; max-width: 100%;

View file

@ -43,7 +43,7 @@ boot.appendMany(
src: logo, src: logo,
height: '40px' height: '40px'
}), }),
new HTML('h1').text('FlowOS').styleJs({ new HTML('h1').text('FlowOS Neo').styleJs({
color: 'white' color: 'white'
}) })
), ),
@ -116,16 +116,16 @@ window.console.group = (...args: any) => {
try { try {
const args = new URLSearchParams(window.location.search) const args = new URLSearchParams(window.location.search)
const kernel = new Kernel() const kernel = new Kernel()
writeln('/-----------------------------------------------\\') writeln('/-----------------------------------------------------------------------------------\\')
writeln('| FlowOS is now discontinued. Starting in 10s...|') writeln('| FlowOS Neo is a planned project by Neptune6866 to continue what FlowOS meant to do|')
writeln('\\-----------------------------------------------/') writeln('\\-----------------------------------------------------------------------------------/')
setTimeout(() => { setTimeout(() => {
kernel.boot(boot, progress, args).catch(e => console.error(e)) kernel.boot(boot, progress, args).catch(e => console.error(e))
}, 10000) }, 5000)
} catch (e) { } catch (e) {
writeln() writeln()
writeln('An error occured while booting FlowOS.') writeln('An error occured while booting FlowOS.')
writeln('Please report this error to Flow Works.') writeln('Please report this error to Neptune6866.')
writeln() writeln()
console.error(e.stack) console.error(e.stack)
writeln() writeln()

View file

@ -1,7 +1,9 @@
import HTML from '../HTML' import HTML from '../HTML'
import { Process } from '../types' import { Process } from '../types'
import nullIcon from '../assets/icons/application-default-icon.svg' import nullIcon from '../assets/icons/application-default-icon.svg'
import VirtualFS from '../system/VirtualFS'
import { config } from 'process'
import { parse } from 'js-ini'
const BootLoader: Process = { const BootLoader: Process = {
config: { config: {
name: 'Desktop', name: 'Desktop',
@ -17,7 +19,7 @@ const BootLoader: Process = {
const wm = await process.loadLibrary('lib/WindowManager') const wm = await process.loadLibrary('lib/WindowManager')
const launcher = await process.loadLibrary('lib/Launcher') const launcher = await process.loadLibrary('lib/Launcher')
const { Input } = await process.loadLibrary('lib/Components') const { Input } = await process.loadLibrary('lib/Components')
const windowArea = document.querySelector('window-area')
const input = Input.new().attr({ const input = Input.new().attr({
type: 'text', type: 'text',
placeholder: 'Search' placeholder: 'Search'
@ -93,7 +95,12 @@ const BootLoader: Process = {
}) })
document.body.style.flexDirection = 'column-reverse' document.body.style.flexDirection = 'column-reverse'
await fs.readFile('/etc/flow').then(async (data: Uint8Array) => {
const dataString = Buffer.from(data).toString()
const config = parse(dataString)
document.body.style.backgroundImage = "url(" + config.BACKGROUND.toString() + ")"})
document.body.style.backgroundSize = "cover"
await statusBar.element.appendTo(document.body) await statusBar.element.appendTo(document.body)
await launcher.element.appendTo(document.body) await launcher.element.appendTo(document.body)
await wm.windowArea.appendTo(document.body) await wm.windowArea.appendTo(document.body)

View file

@ -374,10 +374,11 @@ export const defaultFS: { root: Directory } = {
deleteable: false, deleteable: false,
permission: Permission.ELEVATED, permission: Permission.ELEVATED,
content: Buffer.from([ content: Buffer.from([
'SERVER=https://server.flow-works.me', 'SERVER=http://localhost:3000/',
'24_HOUR=false', '24_HOUR=false',
'THEME=Mocha', 'THEME=Mocha',
'THEME_PRIMARY=blue' 'THEME_PRIMARY=blue',
'BACKGROUND=/src/assets/background.png'
].join('\n')) ].join('\n'))
}, },
hostname: { hostname: {
@ -434,7 +435,7 @@ class VirtualFS {
const config = parse(dataString) const config = parse(dataString)
if (config.SERVER == null) { if (config.SERVER == null) {
config.SERVER = 'https://server.flow-works.me' config.SERVER = 'http://localhost:3000/'
await this.writeFile('/etc/flow', stringify(config)) await this.writeFile('/etc/flow', stringify(config))
} }
if (config['24_HOUR'] == null) { if (config['24_HOUR'] == null) {
@ -449,6 +450,10 @@ class VirtualFS {
config.THEME_PRIMARY = 'blue' config.THEME_PRIMARY = 'blue'
await this.writeFile('/etc/flow', stringify(config)) await this.writeFile('/etc/flow', stringify(config))
} }
if (config.BACKGROUND == null) {
config.BACKGROUND = '/src/assets/background.png'
await this.writeFile('/etc/flow', stringify(config))
}
}) })
} }

View file

@ -1,7 +1,6 @@
import { Process } from '../../types' import { Process } from '../../types'
import icon from '../../assets/icons/preferences-system.svg' import icon from '../../assets/icons/preferences-system.svg'
import { stringify } from 'js-ini' import { stringify } from 'js-ini'
const Settings: Process = { const Settings: Process = {
config: { config: {
name: 'Settings', name: 'Settings',