diff options
author | nea <romangraef@gmail.com> | 2022-08-26 15:29:41 +0200 |
---|---|---|
committer | nea <romangraef@gmail.com> | 2022-08-26 15:29:41 +0200 |
commit | ed5889d825e6ac63973692700ea5cbdaae6500f8 (patch) | |
tree | 4c74e4ace4069be493d304a382fefceefbee050a /console/src/jsMain/kotlin | |
parent | 60608b4bb1759bb58d28923b3e222d8e11eaeafa (diff) | |
download | exhq.github.io-ed5889d825e6ac63973692700ea5cbdaae6500f8.tar.gz exhq.github.io-ed5889d825e6ac63973692700ea5cbdaae6500f8.tar.bz2 exhq.github.io-ed5889d825e6ac63973692700ea5cbdaae6500f8.zip |
moveshitaround
Diffstat (limited to 'console/src/jsMain/kotlin')
-rw-r--r-- | console/src/jsMain/kotlin/main.kt | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/console/src/jsMain/kotlin/main.kt b/console/src/jsMain/kotlin/main.kt new file mode 100644 index 0000000..c0a4f38 --- /dev/null +++ b/console/src/jsMain/kotlin/main.kt @@ -0,0 +1,41 @@ +import kotlinx.browser.document +import kotlinx.css.minHeight +import kotlinx.css.vh +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 styled.injectGlobal + + +val defaultFileSystem = fileSystem { + "etc" { + "passwd" text "hunter2" + } + "home/nea" { + "todo" text """ + | - git gud + | - finish this website + | - convince the general public that comic sans is a viable font + """.trimMargin() + } + "flag" text "CTF{12345abcdefghijklmonp3.1.4.1.5.9.2.8}" +} + +fun main() { + injectGlobal { + ".${Styles.consoleClass}" { + minHeight = 100.vh + } + } + + val root = document.body!!.append.div() + val console = KConsole.createFor(root, fileSystem = defaultFileSystem) + console.addLine("Starting stfff") + console.PS1 = { "echowebsite > " } + console.rerender() + console.registerCommand(defaultLsCommand("ls")) + +}
\ No newline at end of file |