aboutsummaryrefslogtreecommitdiff
path: root/console/src/jsMain
diff options
context:
space:
mode:
Diffstat (limited to 'console/src/jsMain')
-rw-r--r--console/src/jsMain/kotlin/main.kt31
-rw-r--r--console/src/jsMain/resources/index.html3
-rw-r--r--console/src/jsMain/resources/weebshit1.jpgbin0 -> 884231 bytes
3 files changed, 21 insertions, 13 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
diff --git a/console/src/jsMain/resources/index.html b/console/src/jsMain/resources/index.html
index dfa64ec..48937ec 100644
--- a/console/src/jsMain/resources/index.html
+++ b/console/src/jsMain/resources/index.html
@@ -4,8 +4,9 @@
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
+ <link rel="shortcut icon" href="favicon.png" type="image/png">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
- <title>Document</title>
+ <title>💯best console 100% fax no print</title>
</head>
<body>
<script src="exhqwebsitebeta.js"></script>
diff --git a/console/src/jsMain/resources/weebshit1.jpg b/console/src/jsMain/resources/weebshit1.jpg
new file mode 100644
index 0000000..4e85973
--- /dev/null
+++ b/console/src/jsMain/resources/weebshit1.jpg
Binary files differ