-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2badd3c
commit fe04979
Showing
9 changed files
with
218 additions
and
104 deletions.
There are no files selected for viewing
14 changes: 6 additions & 8 deletions
14
web/src/jsMain/kotlin/com/jamshedalamqaderi/portfolio/Main.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
web/src/jsMain/kotlin/com/jamshedalamqaderi/portfolio/presentation/PortfolioScaffold.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package com.jamshedalamqaderi.portfolio.presentation | ||
|
||
import androidx.compose.foundation.layout.Box | ||
import androidx.compose.foundation.layout.fillMaxSize | ||
import androidx.compose.material3.CircularProgressIndicator | ||
import androidx.compose.material3.ExperimentalMaterial3Api | ||
import androidx.compose.material3.Scaffold | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.runtime.LaunchedEffect | ||
import androidx.compose.runtime.mutableStateOf | ||
import androidx.compose.runtime.remember | ||
import androidx.compose.ui.Alignment | ||
import androidx.compose.ui.Modifier | ||
import com.jamshedalamqaderi.portfolio.domain.utils.FontLoader | ||
import com.jamshedalamqaderi.portfolio.presentation.ui.theme.PortfolioTheme | ||
|
||
@OptIn(ExperimentalMaterial3Api::class) | ||
@Composable | ||
fun PortfolioScaffold(modifier: Modifier = Modifier, content: @Composable () -> Unit) { | ||
val loaded = remember { mutableStateOf(false) } | ||
LaunchedEffect(Unit) { | ||
FontLoader.loadPoppins() | ||
loaded.value = true | ||
} | ||
if (loaded.value) { | ||
PortfolioTheme { | ||
Scaffold(modifier) { | ||
content.invoke() | ||
} | ||
} | ||
} else { | ||
Box(Modifier.fillMaxSize(), contentAlignment = Alignment.Center) { | ||
CircularProgressIndicator() | ||
} | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
...sMain/kotlin/com/jamshedalamqaderi/portfolio/presentation/components/landing/Expertise.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package com.jamshedalamqaderi.portfolio.presentation.components.landing | ||
|
||
import androidx.compose.foundation.layout.Arrangement | ||
import androidx.compose.foundation.layout.Column | ||
import androidx.compose.foundation.layout.fillMaxSize | ||
import androidx.compose.material3.Text | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Alignment | ||
import androidx.compose.ui.Modifier | ||
|
||
@Composable | ||
fun Expertise() { | ||
Column( | ||
modifier = Modifier.fillMaxSize(), | ||
horizontalAlignment = Alignment.CenterHorizontally, | ||
verticalArrangement = Arrangement.Center | ||
) { | ||
Text("Kotlin Multiplatform") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
.../kotlin/com/jamshedalamqaderi/portfolio/presentation/components/landing/PortfolioImage.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package com.jamshedalamqaderi.portfolio.presentation.components.landing | ||
|
||
import androidx.compose.foundation.Image | ||
import androidx.compose.foundation.background | ||
import androidx.compose.foundation.border | ||
import androidx.compose.foundation.layout.Box | ||
import androidx.compose.foundation.layout.padding | ||
import androidx.compose.foundation.layout.size | ||
import androidx.compose.foundation.shape.RoundedCornerShape | ||
import androidx.compose.material3.MaterialTheme | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.draw.shadow | ||
import androidx.compose.ui.graphics.Color | ||
import androidx.compose.ui.graphics.ImageBitmap | ||
import androidx.compose.ui.unit.dp | ||
|
||
internal val RoundedPortfolioPictureShape = RoundedCornerShape( | ||
topStartPercent = 50, | ||
topEndPercent = 50, | ||
bottomStartPercent = 5, | ||
bottomEndPercent = 5, | ||
) | ||
|
||
@Composable | ||
fun PortfolioImage(picture: ImageBitmap) { | ||
Box( | ||
modifier = Modifier | ||
.shadow(5.dp, shape = RoundedPortfolioPictureShape) | ||
.background( | ||
Color(0xFF60C7AE), | ||
shape = RoundedPortfolioPictureShape | ||
) | ||
.border( | ||
10.dp, | ||
color = MaterialTheme.colorScheme.primary, | ||
shape = RoundedPortfolioPictureShape | ||
) | ||
.padding(top = 50.dp), | ||
) { | ||
Image( | ||
picture, | ||
contentDescription = "Landing Intro Profile Image", | ||
modifier = Modifier.size(500.dp) | ||
) | ||
} | ||
} |
31 changes: 28 additions & 3 deletions
31
web/src/jsMain/kotlin/com/jamshedalamqaderi/portfolio/presentation/pages/Landing.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,41 @@ | ||
package com.jamshedalamqaderi.portfolio.presentation.pages | ||
|
||
import androidx.compose.foundation.ExperimentalFoundationApi | ||
import androidx.compose.foundation.layout.fillMaxSize | ||
import androidx.compose.foundation.pager.PagerDefaults | ||
import androidx.compose.foundation.pager.PagerSnapDistance | ||
import androidx.compose.foundation.pager.VerticalPager | ||
import androidx.compose.foundation.pager.rememberPagerState | ||
import androidx.compose.material3.ExperimentalMaterial3Api | ||
import androidx.compose.material3.Scaffold | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Modifier | ||
import com.jamshedalamqaderi.portfolio.presentation.PortfolioScaffold | ||
import com.jamshedalamqaderi.portfolio.presentation.components.landing.Expertise | ||
import com.jamshedalamqaderi.portfolio.presentation.components.landing.LandingIntro | ||
|
||
@OptIn(ExperimentalMaterial3Api::class) | ||
@OptIn(ExperimentalMaterial3Api::class, ExperimentalFoundationApi::class) | ||
@Composable | ||
fun Landing() { | ||
Scaffold(modifier = Modifier.fillMaxSize()) { | ||
LandingIntro() | ||
val pagerState = rememberPagerState() | ||
|
||
val fling = PagerDefaults.flingBehavior( | ||
state = pagerState, | ||
pagerSnapDistance = PagerSnapDistance.atMost(2) | ||
) | ||
|
||
PortfolioScaffold (modifier = Modifier.fillMaxSize()) { | ||
VerticalPager( | ||
pageCount = 2, | ||
state = pagerState, | ||
flingBehavior = fling, | ||
pageContent = { index -> | ||
when (index) { | ||
0 -> LandingIntro() | ||
1 -> Expertise() | ||
} | ||
} | ||
) | ||
|
||
} | ||
} |
Oops, something went wrong.