From 46f3b3d5cb327abcbed3f5ad8b34ee006c98dfad Mon Sep 17 00:00:00 2001 From: echo <91651232+exhq@users.noreply.github.com> Date: Sat, 27 Aug 2022 18:03:26 +0430 Subject: funny --- console/src/jsMain/kotlin/main.kt | 31 ++++++++++++++++++----------- console/src/jsMain/resources/index.html | 3 ++- console/src/jsMain/resources/weebshit1.jpg | Bin 0 -> 884231 bytes 3 files changed, 21 insertions(+), 13 deletions(-) create mode 100644 console/src/jsMain/resources/weebshit1.jpg (limited to 'console/src/jsMain') 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 @@ + - Document + 💯best console 100% fax no print diff --git a/console/src/jsMain/resources/weebshit1.jpg b/console/src/jsMain/resources/weebshit1.jpg new file mode 100644 index 0000000..4e85973 Binary files /dev/null and b/console/src/jsMain/resources/weebshit1.jpg differ -- cgit