Browse Source

Div/Span instead of Table

with_mpp_example
Shagen Ogandzhanian 3 years ago
parent
commit
603fddd6e3
  1. 24
      examples/web-skia/src/jsMain/kotlin/com/sample/Main.kt

24
examples/web-skia/src/jsMain/kotlin/com/sample/Main.kt

@ -12,16 +12,11 @@ import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier
import androidx.compose.ui.geometry.Offset
import androidx.compose.ui.geometry.Size
import androidx.compose.ui.graphics.BlendMode.Companion.Color
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.drawscope.Stroke
import androidx.compose.ui.unit.dp
import org.jetbrains.compose.web.dom.Canvas
import org.jetbrains.compose.web.dom.Table
import org.jetbrains.compose.web.dom.Td
import org.jetbrains.compose.web.dom.Tr
import org.jetbrains.compose.web.dom.Div
import org.jetbrains.compose.web.dom.Span
import org.jetbrains.compose.web.renderComposable
import org.jetbrains.compose.web.skiko.skiko
import org.jetbrains.skiko.wasm.onWasmReady
@ -41,7 +36,10 @@ fun SomeCanvas() {
LaunchedEffect(radius) {
radius.animateTo(
targetValue = 100f,
animationSpec = infiniteRepeatable(tween(durationMillis = 1000, easing = LinearEasing), repeatMode = RepeatMode.Reverse)
animationSpec = infiniteRepeatable(
tween(durationMillis = 1000, easing = LinearEasing),
repeatMode = RepeatMode.Reverse
)
)
}
@ -62,20 +60,18 @@ fun SomeCanvas() {
@Composable
fun App() {
Table {
Tr {
Td {
Div {
Span {
SomeCanvas()
}
Td {
Span {
SomeCanvas()
}
Td {
Span {
SomeCanvas()
}
}
}
}
fun main() {
onWasmReady {

Loading…
Cancel
Save