From 362c1060bd99186a1d372fa89a6b7a470f387d34 Mon Sep 17 00:00:00 2001 From: jbion Date: Thu, 23 May 2019 18:06:48 +0200 Subject: Attempt at Kotlin frontend plugin --- .../org/luxons/sevenwonders/ui/SevenWondersUi.kt | 23 ++++++++++++++++++++++ sw-ui-kt/src/main/web/index.html | 3 ++- 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 sw-ui-kt/src/main/kotlin/org/luxons/sevenwonders/ui/SevenWondersUi.kt (limited to 'sw-ui-kt/src/main') diff --git a/sw-ui-kt/src/main/kotlin/org/luxons/sevenwonders/ui/SevenWondersUi.kt b/sw-ui-kt/src/main/kotlin/org/luxons/sevenwonders/ui/SevenWondersUi.kt new file mode 100644 index 00000000..5d9d9be6 --- /dev/null +++ b/sw-ui-kt/src/main/kotlin/org/luxons/sevenwonders/ui/SevenWondersUi.kt @@ -0,0 +1,23 @@ +package org.luxons.sevenwonders.ui + +import react.RBuilder +import react.dom.* +import kotlin.browser.document +import kotlin.browser.window + +fun main() { + window.onload = { + render(document.getElementById("root")!!) { + app() + } + } +} + +fun RBuilder.app() = div { + h1 { + +"Seven Wonders" + } + p { + +"Great app!" + } +} diff --git a/sw-ui-kt/src/main/web/index.html b/sw-ui-kt/src/main/web/index.html index 32b449cb..74cac462 100644 --- a/sw-ui-kt/src/main/web/index.html +++ b/sw-ui-kt/src/main/web/index.html @@ -3,7 +3,7 @@ - + + -- cgit