|
|
@ -14,19 +14,20 @@ import org.w3c.dom.HTMLElement |
|
|
|
@Composable |
|
|
|
@Composable |
|
|
|
fun Intro() { |
|
|
|
fun Intro() { |
|
|
|
ContainerInSection { |
|
|
|
ContainerInSection { |
|
|
|
Div(attrs = { |
|
|
|
Div({ |
|
|
|
classes(WtRows.wtRow, WtRows.wtRowSizeM, WtRows.wtRowSmAlignItemsCenter) |
|
|
|
classes(WtRows.wtRow, WtRows.wtRowSizeM, WtRows.wtRowSmAlignItemsCenter) |
|
|
|
}) { |
|
|
|
}) { |
|
|
|
|
|
|
|
|
|
|
|
Div(attrs = { |
|
|
|
Div({ |
|
|
|
classes(WtCols.wtCol2, WtCols.wtColMd3) |
|
|
|
classes(WtCols.wtCol2, WtCols.wtColMd3) |
|
|
|
}, style = { |
|
|
|
style { |
|
|
|
alignSelf(AlignSelf.Start) |
|
|
|
alignSelf(AlignSelf.Start) |
|
|
|
|
|
|
|
} |
|
|
|
}) { |
|
|
|
}) { |
|
|
|
Img(src = "i1.svg", attrs = { classes(AppStylesheet.composeLogo) }) {} |
|
|
|
Img(src = "i1.svg", attrs = { classes(AppStylesheet.composeLogo) }) {} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Div(attrs = { |
|
|
|
Div({ |
|
|
|
classes( |
|
|
|
classes( |
|
|
|
WtCols.wtCol10, |
|
|
|
WtCols.wtCol10, |
|
|
|
WtCols.wtColMd8, |
|
|
|
WtCols.wtColMd8, |
|
|
@ -36,10 +37,13 @@ fun Intro() { |
|
|
|
}) { |
|
|
|
}) { |
|
|
|
H1(attrs = { classes(WtTexts.wtHero) }) { |
|
|
|
H1(attrs = { classes(WtTexts.wtHero) }) { |
|
|
|
Text("Compose for ") |
|
|
|
Text("Compose for ") |
|
|
|
Span(style = { |
|
|
|
Span({ |
|
|
|
display(DisplayStyle.InlineBlock) |
|
|
|
classes(WtTexts.wtHero) |
|
|
|
property("white-space", value("nowrap")) |
|
|
|
style { |
|
|
|
}, attrs = { classes(WtTexts.wtHero) }) { |
|
|
|
display(DisplayStyle.InlineBlock) |
|
|
|
|
|
|
|
property("white-space", value("nowrap")) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}) { |
|
|
|
Text("Web") |
|
|
|
Text("Web") |
|
|
|
|
|
|
|
|
|
|
|
Span(attrs = { classes(AppStylesheet.composeTitleTag) }) { |
|
|
|
Span(attrs = { classes(AppStylesheet.composeTitleTag) }) { |
|
|
@ -47,7 +51,7 @@ fun Intro() { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
Div(attrs = { |
|
|
|
Div({ |
|
|
|
classes(WtDisplay.wtDisplayMdNone) |
|
|
|
classes(WtDisplay.wtDisplayMdNone) |
|
|
|
}) { |
|
|
|
}) { |
|
|
|
IntroAboutComposeWeb() |
|
|
|
IntroAboutComposeWeb() |
|
|
@ -66,14 +70,14 @@ fun Intro() { |
|
|
|
|
|
|
|
|
|
|
|
@Composable |
|
|
|
@Composable |
|
|
|
private fun IntroAboutComposeWeb() { |
|
|
|
private fun IntroAboutComposeWeb() { |
|
|
|
Div(attrs = { |
|
|
|
Div({ |
|
|
|
classes(WtRows.wtRow, WtRows.wtRowSizeM) |
|
|
|
classes(WtRows.wtRow, WtRows.wtRowSizeM) |
|
|
|
}) { |
|
|
|
}) { |
|
|
|
|
|
|
|
|
|
|
|
Div(attrs = { |
|
|
|
Div({ |
|
|
|
classes(WtCols.wtCol9, WtCols.wtColMd9, WtCols.wtColSm12) |
|
|
|
classes(WtCols.wtCol9, WtCols.wtColMd9, WtCols.wtColSm12) |
|
|
|
}) { |
|
|
|
}) { |
|
|
|
P(attrs = { classes(WtTexts.wtSubtitle2, WtOffsets.wtTopOffset24) }) { |
|
|
|
P({ classes(WtTexts.wtSubtitle2, WtOffsets.wtTopOffset24) }) { |
|
|
|
Text("Reactive web UIs for Kotlin, based on Google's ") |
|
|
|
Text("Reactive web UIs for Kotlin, based on Google's ") |
|
|
|
|
|
|
|
|
|
|
|
A(href = "https://developer.android.com/jetpack/compose", attrs = { |
|
|
|
A(href = "https://developer.android.com/jetpack/compose", attrs = { |
|
|
@ -86,15 +90,15 @@ private fun IntroAboutComposeWeb() { |
|
|
|
Text(" and brought to you by JetBrains") |
|
|
|
Text(" and brought to you by JetBrains") |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
P(attrs = { |
|
|
|
P({ |
|
|
|
classes(WtTexts.wtText1, WtOffsets.wtTopOffset24) |
|
|
|
classes(WtTexts.wtText1, WtOffsets.wtTopOffset24) |
|
|
|
}) { |
|
|
|
}) { |
|
|
|
Text( |
|
|
|
Text( |
|
|
|
"Compose for Web simplifies and accelerates UI development for web applications, " + |
|
|
|
"Compose for Web simplifies and accelerates UI development for web applications, " + |
|
|
|
"and aims to enable UI code sharing between web, desktop, and Android applications " + |
|
|
|
"and aims to enable UI code sharing between web, desktop, and Android applications " + |
|
|
|
"in the future. Currently in technology preview." |
|
|
|
"in the future. Currently in technology preview." |
|
|
|
) |
|
|
|
) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
ComposeWebStatusMessage() |
|
|
|
ComposeWebStatusMessage() |
|
|
|
|
|
|
|
|
|
|
@ -115,14 +119,18 @@ private fun IntroAboutComposeWeb() { |
|
|
|
|
|
|
|
|
|
|
|
@Composable |
|
|
|
@Composable |
|
|
|
private fun IntroCodeSample() { |
|
|
|
private fun IntroCodeSample() { |
|
|
|
Div(style = { |
|
|
|
Div({ |
|
|
|
marginTop(24.px) |
|
|
|
style { |
|
|
|
backgroundColor(Color.RGBA(39, 40, 44, 0.05)) |
|
|
|
marginTop(24.px) |
|
|
|
borderRadius(8.px) |
|
|
|
backgroundColor(Color.RGBA(39, 40, 44, 0.05)) |
|
|
|
property("font-family", value("'JetBrains Mono', monospace")) |
|
|
|
borderRadius(8.px) |
|
|
|
|
|
|
|
property("font-family", value("'JetBrains Mono', monospace")) |
|
|
|
|
|
|
|
} |
|
|
|
}) { |
|
|
|
}) { |
|
|
|
Div(style = { |
|
|
|
Div({ |
|
|
|
property("padding", value("12px 16px")) |
|
|
|
style { |
|
|
|
|
|
|
|
property("padding", value("12px 16px")) |
|
|
|
|
|
|
|
} |
|
|
|
}) { |
|
|
|
}) { |
|
|
|
FormattedCodeSnippet( |
|
|
|
FormattedCodeSnippet( |
|
|
|
code = """ |
|
|
|
code = """ |
|
|
@ -138,10 +146,12 @@ private fun IntroCodeSample() { |
|
|
|
) |
|
|
|
) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Hr(style = { |
|
|
|
Hr({ |
|
|
|
height(1.px) |
|
|
|
style { |
|
|
|
border(width = 0.px) |
|
|
|
height(1.px) |
|
|
|
backgroundColor(Color.RGBA(39, 40, 44, 0.15)) |
|
|
|
border(width = 0.px) |
|
|
|
|
|
|
|
backgroundColor(Color.RGBA(39, 40, 44, 0.15)) |
|
|
|
|
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
IntroCodeSampleResult() |
|
|
|
IntroCodeSampleResult() |
|
|
@ -150,24 +160,26 @@ private fun IntroCodeSample() { |
|
|
|
|
|
|
|
|
|
|
|
@Composable |
|
|
|
@Composable |
|
|
|
private fun IntroCodeSampleResult() { |
|
|
|
private fun IntroCodeSampleResult() { |
|
|
|
Div(style = { |
|
|
|
Div({ |
|
|
|
property("padding", value("12px 16px")) |
|
|
|
style { |
|
|
|
display(DisplayStyle.Flex) |
|
|
|
property("padding", value("12px 16px")) |
|
|
|
flexDirection(FlexDirection.Row) |
|
|
|
display(DisplayStyle.Flex) |
|
|
|
alignItems(AlignItems.Center) |
|
|
|
flexDirection(FlexDirection.Row) |
|
|
|
|
|
|
|
alignItems(AlignItems.Center) |
|
|
|
|
|
|
|
} |
|
|
|
}) { |
|
|
|
}) { |
|
|
|
Span( |
|
|
|
Span({ |
|
|
|
attrs = { classes(WtTexts.wtText2) }, |
|
|
|
classes(WtTexts.wtText2) |
|
|
|
style = { |
|
|
|
style { |
|
|
|
property("margin-right", value(8.px)) |
|
|
|
property("margin-right", value(8.px)) |
|
|
|
} |
|
|
|
} |
|
|
|
) { |
|
|
|
}) { |
|
|
|
Text("Result:") |
|
|
|
Text("Result:") |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
fun greet() = listOf("Hello", "Hallo", "Hola", "Servus").random() |
|
|
|
fun greet() = listOf("Hello", "Hallo", "Hola", "Servus").random() |
|
|
|
|
|
|
|
|
|
|
|
Div(attrs = { |
|
|
|
Div({ |
|
|
|
id("greetingContainer") |
|
|
|
id("greetingContainer") |
|
|
|
}) { |
|
|
|
}) { |
|
|
|
var greeting by remember { mutableStateOf(greet()) } |
|
|
|
var greeting by remember { mutableStateOf(greet()) } |
|
|
@ -180,22 +192,24 @@ private fun IntroCodeSampleResult() { |
|
|
|
|
|
|
|
|
|
|
|
@Composable |
|
|
|
@Composable |
|
|
|
private fun ComposeWebStatusMessage() { |
|
|
|
private fun ComposeWebStatusMessage() { |
|
|
|
Div(attrs = { |
|
|
|
Div({ |
|
|
|
classes(WtRows.wtRow, WtRows.wtRowSizeXs, WtOffsets.wtTopOffset24) |
|
|
|
classes(WtRows.wtRow, WtRows.wtRowSizeXs, WtOffsets.wtTopOffset24) |
|
|
|
}) { |
|
|
|
}) { |
|
|
|
Div(attrs = { |
|
|
|
Div({ |
|
|
|
classes(WtCols.wtColInline) |
|
|
|
classes(WtCols.wtColInline) |
|
|
|
}) { |
|
|
|
}) { |
|
|
|
Img(src = "ic_info.svg", style = { |
|
|
|
Img(src = "ic_info.svg", attrs = { |
|
|
|
width(24.px) |
|
|
|
style { |
|
|
|
height(24.px) |
|
|
|
width(24.px) |
|
|
|
|
|
|
|
height(24.px) |
|
|
|
|
|
|
|
} |
|
|
|
}) {} |
|
|
|
}) {} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Div(attrs = { |
|
|
|
Div({ |
|
|
|
classes(WtCols.wtColAutoFill) |
|
|
|
classes(WtCols.wtColAutoFill) |
|
|
|
}) { |
|
|
|
}) { |
|
|
|
P(attrs = { |
|
|
|
P({ |
|
|
|
classes(WtTexts.wtText3) |
|
|
|
classes(WtTexts.wtText3) |
|
|
|
}) { |
|
|
|
}) { |
|
|
|
Text( |
|
|
|
Text( |
|
|
@ -211,13 +225,11 @@ private fun ComposeWebStatusMessage() { |
|
|
|
|
|
|
|
|
|
|
|
@Composable |
|
|
|
@Composable |
|
|
|
inline fun Hr( |
|
|
|
inline fun Hr( |
|
|
|
crossinline attrs: (AttrsBuilder<Tag.Div>.() -> Unit) = {}, |
|
|
|
crossinline attrs: (AttrsBuilder<Tag.Div>.() -> Unit) = {} |
|
|
|
crossinline style: (StyleBuilder.() -> Unit) = {}, |
|
|
|
|
|
|
|
) { |
|
|
|
) { |
|
|
|
TagElement<Tag.Div, HTMLElement>( |
|
|
|
TagElement<Tag.Div, HTMLElement>( |
|
|
|
tagName = "hr", |
|
|
|
tagName = "hr", |
|
|
|
applyAttrs = attrs, |
|
|
|
applyAttrs = attrs, |
|
|
|
applyStyle = style, |
|
|
|
|
|
|
|
content = { } |
|
|
|
content = { } |
|
|
|
) |
|
|
|
) |
|
|
|
} |
|
|
|
} |