aboutsummaryrefslogtreecommitdiff
path: root/console/src/jsMain/kotlin/main.kt
diff options
context:
space:
mode:
authorecho <91651232+exhq@users.noreply.github.com>2022-08-27 18:03:26 +0430
committerecho <91651232+exhq@users.noreply.github.com>2022-08-27 18:03:26 +0430
commit46f3b3d5cb327abcbed3f5ad8b34ee006c98dfad (patch)
treeb5ad08c9df9af0d95484bdb8cbb5964c37f2e275 /console/src/jsMain/kotlin/main.kt
parent547f5955f1cca47750bfa18e31f1ee56f1b7b2f3 (diff)
downloadexhq.github.io-46f3b3d5cb327abcbed3f5ad8b34ee006c98dfad.tar.gz
exhq.github.io-46f3b3d5cb327abcbed3f5ad8b34ee006c98dfad.tar.bz2
exhq.github.io-46f3b3d5cb327abcbed3f5ad8b34ee006c98dfad.zip
funny
Diffstat (limited to 'console/src/jsMain/kotlin/main.kt')
-rw-r--r--console/src/jsMain/kotlin/main.kt31
1 files changed, 19 insertions, 12 deletions
diff --git a/console/src/jsMain/kotlin/main.kt b/console/src/jsMain/kotlin/main.kt
index c0a4f38..a607e69 100644
--- a/console/src/jsMain/kotlin/main.kt
+++ b/console/src/jsMain/kotlin/main.kt
@@ -1,20 +1,17 @@
import kotlinx.browser.document
-import kotlinx.css.minHeight
-import kotlinx.css.vh
+import kotlinx.css.*
import kotlinx.html.dom.append
import kotlinx.html.js.div
-import moe.nea89.website.KConsole
-import moe.nea89.website.Styles
-import moe.nea89.website.defaultLsCommand
-import moe.nea89.website.fileSystem
+import moe.nea89.website.*
import styled.injectGlobal
+import kotlin.time.Duration.Companion.milliseconds
val defaultFileSystem = fileSystem {
"etc" {
"passwd" text "hunter2"
}
- "home/nea" {
+ "home/exhq" {
"todo" text """
| - git gud
| - finish this website
@@ -25,17 +22,27 @@ val defaultFileSystem = fileSystem {
}
fun main() {
+
+ val root = document.body!!.append.div()
+ val console = KConsole.createFor(root, fileSystem = defaultFileSystem)
injectGlobal {
".${Styles.consoleClass}" {
minHeight = 100.vh
+ backgroundColor = Color("#282a39C6")
+ }
+ body {
+ backgroundImage = Image("url(weebshit1.jpg)")
+ backgroundSize = "cover"
}
- }
- val root = document.body!!.append.div()
- val console = KConsole.createFor(root, fileSystem = defaultFileSystem)
+ }
console.addLine("Starting stfff")
- console.PS1 = { "echowebsite > " }
+ console.PS1 = { "${console.fileAccessor!!.currentDir.joinToString("/", "/")} > " }
+ console.fileAccessor!!.cd("/home/exhq")
console.rerender()
- console.registerCommand(defaultLsCommand("ls"))
+ console.registerCommand(defaultLsCommand("ls", delayBetweenLines = 0.milliseconds))
+ console.registerCommand(defaultCdCommand("cd"))
+ console.registerCommand(defaultCatCommand("cat"))
+ console.registerCommand(defaultCwdCommand("cwd", "pwd"))
} \ No newline at end of file