diff options
author | Joffrey Bion <joffrey.bion@gmail.com> | 2019-07-30 01:31:20 +0200 |
---|---|---|
committer | Joffrey Bion <joffrey.bion@gmail.com> | 2019-08-03 17:25:11 +0200 |
commit | 846276ed6530c9c634b24c34a49e4269907db7dc (patch) | |
tree | eec7da6e0245a2cff5677ea51ade763f1d239a21 /sw-ui-kt/src/main/kotlin | |
parent | First attempt at routing (diff) | |
download | seven-wonders-846276ed6530c9c634b24c34a49e4269907db7dc.tar.gz seven-wonders-846276ed6530c9c634b24c34a49e4269907db7dc.tar.bz2 seven-wonders-846276ed6530c9c634b24c34a49e4269907db7dc.zip |
Use kotlin-styled for Home component CSS
Diffstat (limited to 'sw-ui-kt/src/main/kotlin')
-rw-r--r-- | sw-ui-kt/src/main/kotlin/org/luxons/sevenwonders/ui/components/home/Home.kt | 15 | ||||
-rw-r--r-- | sw-ui-kt/src/main/kotlin/org/luxons/sevenwonders/ui/components/home/HomeStyles.kt | 28 |
2 files changed, 40 insertions, 3 deletions
diff --git a/sw-ui-kt/src/main/kotlin/org/luxons/sevenwonders/ui/components/home/Home.kt b/sw-ui-kt/src/main/kotlin/org/luxons/sevenwonders/ui/components/home/Home.kt index e9af82be..abbd84a9 100644 --- a/sw-ui-kt/src/main/kotlin/org/luxons/sevenwonders/ui/components/home/Home.kt +++ b/sw-ui-kt/src/main/kotlin/org/luxons/sevenwonders/ui/components/home/Home.kt @@ -2,11 +2,20 @@ package org.luxons.sevenwonders.ui.components.home import react.RBuilder import react.dom.* +import styled.css +import styled.styledDiv -fun RBuilder.home() = div { - h1 { - +"Seven Wonders" +private const val LOGO = "images/logo-7-wonders.png" + +fun RBuilder.home() = styledDiv { + css { + +HomeStyles.fullscreen + +HomeStyles.center + +HomeStyles.homeRoot } + + img(src = LOGO, alt = "Seven Wonders") {} + p { +"Great app!" } diff --git a/sw-ui-kt/src/main/kotlin/org/luxons/sevenwonders/ui/components/home/HomeStyles.kt b/sw-ui-kt/src/main/kotlin/org/luxons/sevenwonders/ui/components/home/HomeStyles.kt new file mode 100644 index 00000000..34699f5b --- /dev/null +++ b/sw-ui-kt/src/main/kotlin/org/luxons/sevenwonders/ui/components/home/HomeStyles.kt @@ -0,0 +1,28 @@ +package org.luxons.sevenwonders.ui.components.home + +import kotlinx.css.* +import styled.StyleSheet + +object HomeStyles : StyleSheet("HomeStyles", isStatic = true) { + + val homeRoot by css { + background = "url('images/background-zeus-temple.jpg') center no-repeat" + backgroundSize = "cover" + } + + val center by css { + display = Display.flex + flexDirection = FlexDirection.column + alignItems = Align.center + justifyContent = JustifyContent.center + } + + val fullscreen by css { + position = Position.fixed + top = LinearDimension("0") + left = LinearDimension("0") + bottom = LinearDimension("0") + right = LinearDimension("0") + overflow = Overflow.hidden + } +} |