Skip to content

Commit

Permalink
Migrate to ComposeViewport
Browse files Browse the repository at this point in the history
  • Loading branch information
egorikftp committed Oct 14, 2024
1 parent eef18f4 commit 63d257d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ import androidx.compose.ui.graphics.Color
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import androidx.compose.ui.window.CanvasBasedWindow
import androidx.compose.ui.window.ComposeViewport
import composegears.tiamat.sample.koin.KoinLib

external fun onLoadFinished()

@OptIn(ExperimentalComposeUiApi::class)
fun main() {
KoinLib.start()
CanvasBasedWindow(canvasElementId = "TiamatTarget") {
ComposeViewport(viewportContainerId = "TiamatTarget") {
LaunchedEffect(Unit) {
onLoadFinished()
}
Expand All @@ -32,7 +32,7 @@ fun main() {
color = Color.White,
fontSize = 20.sp,
fontWeight = FontWeight.Bold,
text = "Pre Alpha (Wasm)",
text = "Wasm Alpha",
)
}
}
Expand Down
2 changes: 1 addition & 1 deletion example/app/composeApp/src/wasmJsMain/resources/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ <h3>Your browser doesn't support Wasm 🌝</h3>
<h5>For more information, see <a href="https://kotl.in/wasm-help" style="color: #375fad">https://kotl.in/wasm-help</a>.
</h5>
</div>
<canvas id="TiamatTarget"></canvas>
<div id="TiamatTarget"></div>
</div>
</body>
</html>
1 change: 1 addition & 0 deletions example/app/composeApp/src/wasmJsMain/resources/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ body {
display: flex;
justify-content: center;
align-items: center;
overflow: hidden;
}

#warning {
Expand Down

0 comments on commit 63d257d

Please sign in to comment.