Browse Source

update web-landing content according to new version (1.0.0-rc12) (#1523)

Co-authored-by: Oleksandr Karpovich <oleksandr.karpovich@jetbrains.com>
feature/accessebility-win
Oleksandr Karpovich 3 years ago committed by GitHub
parent
commit
a9156f5787
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 49
      examples/web-landing/src/jsMain/kotlin/com/sample/content/AboutComposeWebLibsSection.kt
  2. 4
      examples/web-landing/src/jsMain/kotlin/com/sample/content/CodeSnippets.kt
  3. 10
      examples/web-landing/src/jsMain/kotlin/com/sample/content/IntroSection.kt
  4. 4
      examples/web-landing/src/jsMain/kotlin/com/sample/content/JoinUs.kt
  5. 6
      examples/web-landing/src/jsMain/kotlin/com/sample/style/WtOffest.kt
  6. 18
      examples/web-landing/src/jsMain/kotlin/com/sample/style/WtText.kt
  7. 15
      examples/web-landing/src/jsMain/resources/compose_bullet.svg

49
examples/web-landing/src/jsMain/kotlin/com/sample/content/AboutComposeWebLibsSection.kt

@ -8,6 +8,8 @@ import com.sample.components.Card
import com.sample.components.ContainerInSection
import com.sample.components.LinkOnCard
import com.sample.style.*
import org.jetbrains.compose.web.attributes.ATarget
import org.jetbrains.compose.web.attributes.target
import org.jetbrains.compose.web.css.paddingTop
data class CardWithListPresentation(
@ -37,6 +39,30 @@ private fun createAboutComposeWebCards(): List<CardWithListPresentation> {
)
}
private fun createFeaturesList(): List<String> {
return listOf(
"Same reactive engine that is used on Android/Desktop allows using a common codebase.",
"Framework for rich UI creation for Kotlin/JS.",
"Convenient Kotlin DOM DSL that covers all common frontend development scenarios.",
"Comprehensive CSS-in-Kotlin/JS API."
)
}
@Composable
private fun FeatureDescriptionBlock(description: String) {
Div(attrs = {
classes(WtCols.wtCol3, WtCols.wtColMd6, WtCols.wtColSm12, WtOffsets.wtTopOffset48)
}) {
Img(src = "compose_bullet.svg")
P(attrs = {
classes(WtTexts.wtText1, WtTexts.wtText1HardnessHard, WtOffsets.wtTopOffset12)
}) {
Text(description)
}
}
}
@Composable
fun ComposeWebLibraries() {
ContainerInSection(WtSections.wtSectionBgGrayLight) {
@ -56,22 +82,21 @@ fun ComposeWebLibraries() {
Text("Compose for Web allows you to build reactive user interfaces for the web in Kotlin, using the concepts and APIs of Jetpack Compose to express the state, behavior, and logic of your application.")
}
}
Div(attrs = {
classes(WtCols.wtCol6, WtCols.wtColMd6, WtCols.wtColSm12, WtOffsets.wtTopOffset24)
}) {
P(attrs = {
classes(WtTexts.wtText1)
}) {
Text("Compose for Web provides multiple ways of declaring user interfaces in Kotlin code, allowing you to have full control over your website layout with a declarative DOM API, or use versions of the widgets you already know from Jetpack Compose for Desktop and Android.\n")
}
}
}
Div(attrs = {
classes(WtRows.wtRow, WtRows.wtRowSizeM, WtOffsets.wtTopOffset48)
classes(WtRows.wtRow, WtRows.wtRowSizeM, WtOffsets.wtTopOffset24)
}) {
createAboutComposeWebCards().forEach { CardWithList(it) }
createFeaturesList().forEach {
FeatureDescriptionBlock(it)
}
}
A(attrs = {
classes(WtTexts.wtButton, WtTexts.wtButtonThemeLight, WtOffsets.wtTopOffset48, WtOffsets.wtTopOffsetSm24)
target(ATarget.Blank)
}, href = "https://github.com/JetBrains/compose-jb/blob/master/FEATURES.md#features-currently-available-in-compose-for-web") {
Text("See all features")
}
}
}

4
examples/web-landing/src/jsMain/kotlin/com/sample/content/CodeSnippets.kt

@ -72,7 +72,7 @@ private val DeclareAndUseStylesheet = CodeSnippetData(
private val DeclareAndUseCssVariable = CodeSnippetData(
title = "Declare and use CSS variables",
source = """
object MyVariables : CSSVariables {
object MyVariables {
val contentBackgroundColor by variable<Color>() /* declare a variable */
}
@ -190,7 +190,7 @@ private val allSnippets = arrayOf(
DeclareAndUseCssVariable,
HoverSelectorAndMedia,
DefineCssClassInComponent,
LayoutsSample
//LayoutsSample
)
private var currentCodeSnippet: CodeSnippetData by mutableStateOf(allSnippets[0])

10
examples/web-landing/src/jsMain/kotlin/com/sample/content/IntroSection.kt

@ -45,9 +45,9 @@ fun Intro() {
}) {
Text("Web")
Span(attrs = { classes(AppStylesheet.composeTitleTag) }) {
Text("Technology preview")
}
// Span(attrs = { classes(AppStylesheet.composeTitleTag) }) {
// Text("Technology preview")
// }
}
}
Div({
@ -95,11 +95,11 @@ private fun IntroAboutComposeWeb() {
Text(
"Compose for Web simplifies and accelerates UI development for web applications, " +
"and aims to enable UI code sharing between web, desktop, and Android applications " +
"in the future. Currently in technology preview."
"in the future."
)
}
ComposeWebStatusMessage()
//ComposeWebStatusMessage()
IntroCodeSample()

4
examples/web-landing/src/jsMain/kotlin/com/sample/content/JoinUs.kt

@ -29,7 +29,7 @@ fun JoinUs() {
classes(WtTexts.wtLink)
target(ATarget.Blank)
}) {
Text("Compose for Desktop")
Text("Compose Multiplatform")
}
}
}
@ -69,4 +69,4 @@ private fun LinkToSlack(url: String, text: String) {
}) {
Text(text)
}
}
}

6
examples/web-landing/src/jsMain/kotlin/com/sample/style/WtOffest.kt

@ -23,6 +23,12 @@ object WtOffsets : StyleSheet(AppStylesheet) {
marginTop(48.px)
}
val wtTopOffset12 by style {
self style {
marginTop(12.px)
}
}
val wtTopOffsetSm12 by style {
media(mediaMaxWidth(640.px)) {
self style {

18
examples/web-landing/src/jsMain/kotlin/com/sample/style/WtText.kt

@ -61,6 +61,10 @@ object WtTexts : StyleSheet(AppStylesheet) {
)
}
val wtText1HardnessHard by style {
color(rgb(15, 16, 17))
}
val wtText1ThemeDark by style {
color(rgba(255, 255, 255, 0.6))
}
@ -198,6 +202,20 @@ object WtTexts : StyleSheet(AppStylesheet) {
}
}
val wtButtonThemeLight by style {
color(Color("#27282c"))
backgroundColor(Color("transparent"))
border {
style(LineStyle.Solid)
width(1.px)
color(Color("#27282c"))
}
hover(self) style {
backgroundColor(rgba(39,40,44,.05))
}
}
val wtSocialButtonItem by style {
marginRight(16.px)
marginLeft(16.px)

15
examples/web-landing/src/jsMain/resources/compose_bullet.svg

@ -0,0 +1,15 @@
<svg fill="none" height="27" viewBox="0 0 24 27" width="24" xmlns="http://www.w3.org/2000/svg">
<g fill="#000">
<path d="m12.075 21.585h-.029c-.29 0-.58-.07-.841-.215l-5.91-3.336c-.349-.198-.563-.564-.563-.96v-6.788c0-.29.052-.57.174-.814l-4.621-2.598c-.192.407-.29.866-.285 1.349v11.212c.006.657.36 1.261.935 1.586l9.747 5.51c.43.245.912.361 1.388.361v-.006c.011-.703.005-3.522.005-5.3z"
opacity=".1"/>
<path d="m4.9 9.466c.128-.267.326-.488.593-.65l5.561-3.285c.517-.308 1.155-.313 1.684-.017l5.62 3.18c.249.139.47.342.632.58l4.546-2.714c-.267-.39-.627-.72-1.04-.953l-9.282-5.249c-.865-.488-1.922-.476-2.775.03l-9.179 5.416c-.44.261-.766.633-.975 1.07l4.615 2.591z"
opacity=".6"/>
<path d="m23.53 6.56-4.547 2.715c.175.255.28.558.285.866v6.463c.006.605-.308 1.163-.824 1.465l-5.562 3.284c-.25.145-.528.227-.807.232.006 1.773.006 4.592-.006 5.296v.005c.482-.005.958-.133 1.388-.383l9.178-5.423c.853-.506 1.376-1.424 1.364-2.418v-10.666c-.005-.517-.18-1.011-.47-1.436z"
opacity=".3"/>
<path d="m12.07 18.9h-.041c-.192 0-.39-.046-.563-.145l-3.96-2.238c-.058-.035-.11-.07-.156-.116-.047-.047-.087-.099-.116-.151-.047-.082-.082-.175-.1-.274-.005-.034-.005-.063-.005-.098v-4.552c0-.046 0-.098.006-.145.012-.122.04-.244.087-.354l-1.068-.657-1.254-.703c-.116.244-.174.523-.174.813v6.79c.005.394.22.76.563.958l5.904 3.342c.261.146.551.221.842.215h.029c0-.866-.006-1.482-.006-1.482l.011-1.203z"
opacity=".5"/>
<path d="m18.351 8.693-5.62-3.18c-.522-.295-1.16-.29-1.683.018l-5.561 3.284c-.267.157-.465.384-.592.651l1.26.704 1.067.656.018-.052c.011-.023.023-.046.035-.064.023-.04.052-.081.081-.122.075-.099.168-.18.279-.25l3.727-2.203c.081-.046.162-.081.25-.11.01-.006.022-.006.034-.012.064-.017.128-.029.197-.035.03 0 .053-.005.082-.005h.075c.099.005.192.023.29.052.07.023.14.052.204.093l3.768 2.133c.127.07.237.163.336.273.03.035.058.076.087.117l.035.052.964-.645 1.306-.785c-.168-.227-.383-.43-.639-.57z"/>
<path d="m16.715 10.704.046.082.035.07c.017.046.035.098.046.145.018.075.03.15.03.232v4.33c0 .123-.018.239-.053.35-.006.011-.006.023-.011.034-.012.035-.024.064-.041.099-.012.03-.03.058-.04.087-.024.04-.053.081-.082.122-.046.058-.093.11-.151.163-.035.035-.076.064-.116.093-.023.012-.04.029-.064.04l-3.727 2.204c-.163.093-.342.145-.522.157v1.203s0 .616.005 1.482c.279-.006.558-.082.807-.233l5.562-3.284c.517-.308.83-.866.824-1.464v-6.464c-.006-.314-.11-.61-.284-.866l-1.306.785z"
opacity=".7"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.5 KiB

Loading…
Cancel
Save