From dc8b85e3dac265275c79effa570507d1b27be8c6 Mon Sep 17 00:00:00 2001 From: jay-tux Date: Sun, 4 May 2025 11:05:19 +0200 Subject: [PATCH] Attempting to reduce code size --- .../kotlin/com/jaytux/simd/frontend/main.kt | 1 + .../composeApp/src/wasmJsMain/resources/index.html | 1 + .../composeApp/src/wasmJsMain/resources/styles.css | 11 +++++++++++ frontend/package.sh | 8 ++++---- 4 files changed, 17 insertions(+), 4 deletions(-) diff --git a/frontend/composeApp/src/wasmJsMain/kotlin/com/jaytux/simd/frontend/main.kt b/frontend/composeApp/src/wasmJsMain/kotlin/com/jaytux/simd/frontend/main.kt index 47588c2..870807d 100644 --- a/frontend/composeApp/src/wasmJsMain/kotlin/com/jaytux/simd/frontend/main.kt +++ b/frontend/composeApp/src/wasmJsMain/kotlin/com/jaytux/simd/frontend/main.kt @@ -6,6 +6,7 @@ import kotlinx.browser.document @OptIn(ExperimentalComposeUiApi::class) fun main() { + document.getElementById("loading")?.remove() ComposeViewport(document.body!!) { App() } diff --git a/frontend/composeApp/src/wasmJsMain/resources/index.html b/frontend/composeApp/src/wasmJsMain/resources/index.html index 414682d..55cebdc 100644 --- a/frontend/composeApp/src/wasmJsMain/resources/index.html +++ b/frontend/composeApp/src/wasmJsMain/resources/index.html @@ -8,5 +8,6 @@ +
⏳ UI Loading...
\ No newline at end of file diff --git a/frontend/composeApp/src/wasmJsMain/resources/styles.css b/frontend/composeApp/src/wasmJsMain/resources/styles.css index 0549b10..7327f8e 100644 --- a/frontend/composeApp/src/wasmJsMain/resources/styles.css +++ b/frontend/composeApp/src/wasmJsMain/resources/styles.css @@ -4,4 +4,15 @@ html, body { margin: 0; padding: 0; overflow: hidden; +} + +#loading { + /* perfectly center this div */ + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + font-size: 2em; + color: #000; + text-align: center; } \ No newline at end of file diff --git a/frontend/package.sh b/frontend/package.sh index f06a71b..dbc4dd2 100755 --- a/frontend/package.sh +++ b/frontend/package.sh @@ -15,11 +15,11 @@ echo "" ./gradlew packageAppImage echo "" -echo "+-------------------------------------+" -echo "| ./gradlew wasmJsBrowserDistribution |" -echo "+-------------------------------------+" +echo "+------------------------------------------+" +echo "| ./gradlew wasmJsBrowserProductionWebpack |" +echo "+------------------------------------------+" echo "" -./gradlew wasmJsBrowserDistribution +./gradlew wasmJsBrowserProductionWebpack echo "" echo "+-------------------------------------------------------------------------------------------------------------+"