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>
<meta charset="UTF-8" />
<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">
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-9675905177363247" crossorigin="anonymous"></script>
@ -20,5 +20,6 @@
</head>
<body>
<script src="./src/bootloader.ts" type="module"></script>
<script src="./src/background.js" type="module"></script>
</body>
</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%;
overflow: hidden;
margin: 10px;
window {
resize: both;
max-width: 100%;

View file

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

View file

@ -1,7 +1,9 @@
import HTML from '../HTML'
import { Process } from '../types'
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 = {
config: {
name: 'Desktop',
@ -17,7 +19,7 @@ const BootLoader: Process = {
const wm = await process.loadLibrary('lib/WindowManager')
const launcher = await process.loadLibrary('lib/Launcher')
const { Input } = await process.loadLibrary('lib/Components')
const windowArea = document.querySelector('window-area')
const input = Input.new().attr({
type: 'text',
placeholder: 'Search'
@ -93,7 +95,12 @@ const BootLoader: Process = {
})
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 launcher.element.appendTo(document.body)
await wm.windowArea.appendTo(document.body)

View file

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